mersenneforum.org Factoring projects algorithms - What is Aliqueit ?
 Register FAQ Search Today's Posts Mark Forums Read

2016-08-09, 12:42   #34
bsquared

"Ben"
Feb 2007

7×13×41 Posts

Quote:
 Originally Posted by Romuald Yes. But where do I modify this parameter? I didn't find neither in the yafu.ini nor in the makefile before compilation. However it's written in the docfile to add '-thread ' such as Code: ./yafu 'factor(2^127-1) -threads 1' , (note that number is not what I especially want to factorize, it's completely arbitrary as an example, don't tell me "To factorize $2^{127}-1$ rather use this or that, you don't need yafu...") returns Code: unrecognized token: threads1 This is boring, I follow exactly what it's expected me to do, no way to run YAFU properly.

Code:
./yafu "factor(2^127-1)" -threads 1
Quotes, single quotes, and their position are important on the command line... why invent them and then complain when things don't work as expected?

Quote:
 Originally Posted by Romuald I note that this problem only occurs when I precisely use GMP & msieve at compiling time, and then I use GMP-ECM & ggnfs binaries added in the yafu.ini file. I mean when I compile YAFU with simply Code: make x86_64 [NFS=1] [PROFILE=1] [TIMING=1] [USE_SSE41=1] as said in README file, I get no problem.
GMP is always used, and specifying NFS=1 during make brings in msieve's NFS routines, so I'm not understanding what the problem is.

BTW, in case you didn't read the README fully, neither PROFILE=1 or TIMING=1 are necessary and will slightly slow down the program.

2016-08-09, 13:01   #35
Romuald

Oct 2015
France

778 Posts

Quote:
 Originally Posted by bsquared Code: ./yafu "factor(2^127-1)" -threads 1 Quotes, single quotes, and their position are important on the command line... why invent them and then complain when things don't work as expected? GMP is always used, and specifying NFS=1 during make brings in msieve's NFS routines, so I'm not understanding what the problem is. BTW, in case you didn't read the README fully, neither PROFILE=1 or TIMING=1 are necessary and will slightly slow down the program.

I'm not a newbie on linux, so I don't invent anything.

I simply thought that
Code:
./yafu 'sth'
meant "Open the called 'YAFU' program and type in there what's between the inverted commas".
Obviously, according what you are telling me, it actually means
"Open the called 'YAFU' program and type in there all what's after './yafu'.
Otherwise the '-threads x' would not be considered. And that's weird because when opening yafu by double-click, don't need to put ' and '.

About the compiling command, that is in the docs. I read the docs. Nevertheless I'll be willing to try without these options if you wish.

Last fiddled with by Romuald on 2016-08-09 at 13:03

 2016-08-09, 13:33 #36 bsquared     "Ben" Feb 2007 7·13·41 Posts The quotes are only necessary because the main input to yafu is a mathematical expression and the linux command line parser will balk at unquoted parenthesis and other symbols. The other options function as normal in linux (i.e. preceded by dashes) except I didn't use the typical single letter syntax for most of them. Note that the current release version requires that you enter the math expression as the first non-optional argument to the program followed by any options (e.g., yafu "factor(2^127-1)" -threads 1) but the head SVN code allows the expression to be anywhere on the command line with the standard option syntax using the -e option (./yafu -threads 1 -e "factor(2^127-1)", which is maybe more clear.
 2016-08-09, 15:19 #37 LaurV Romulan Interpreter     "name field" Jun 2011 Thailand 2·11·467 Posts note that you can give the number of threads in the ini file, along with many other things, and note that in windoze you have to double the ^ sign (even if you use quotes or not) in command line, or quadruple it (when calling in a batch); the quotes are necessary because what is between them may contain spaces, special signs, etc, which will not be parsed properly, but some stuff (like the ^ sign) is parsed even if in quotes. Example of my yafu ini in the current computer (windoze): Code: B1pm1=100000 B1pp1=20000 B1ecm=11000 rhomax=1000 threads=4 %threads=8 %plan=light %plan=deep plan=custom %pretest_ratio=0.3334 pretest_ratio=0.29 R=1 %v=1 ggnfs_dir=..\ggnfs\ ecm_path=..\gmp_ecm\ecm.exe tune_info= Intel(R) Core(TM) i7-blahblahblah please also note that the % to comment out lines, and note the case-sensitivity, for example -R and -r are two different options. Also note the external dirs for both ecm and ggnfs (not inside yafu folder);
 2016-08-09, 16:44 #38 Romuald     Oct 2015 France 32·7 Posts Ok & Thank you bsquared, now it seems to work & thx LaurV for your tip. Indeed, the line threads=1 is present in the yafu.ini, yet I still get this error: Code: ./yafu "factor(3316294578130624781632962198467832354647635629298847312456767341851)" -threads 1 fac: factoring 3316294578130624781632962198467832354647635629298847312456767341851 fac: using pretesting plan: normal fac: no tune info: using qs/gnfs crossover of 95 digits div: primes less than 10000 rho: x^2 + 3, starting 1000 iterations on C63 rho: x^2 + 2, starting 1000 iterations on C63 rho: x^2 + 2, starting 1000 iterations on C59 rho: x^2 + 1, starting 1000 iterations on C59 pm1: starting B1 = 150K, B2 = gmp-ecm default on C59 Erreur de segmentation (core dumped) what should mean Segmentation Fault (core dumped) I googled, it's an error that occurs in C++... :( Last fiddled with by Romuald on 2016-08-09 at 16:48
2016-08-09, 16:53   #39
bsquared

"Ben"
Feb 2007

7·13·41 Posts

Quote:
 Originally Posted by Romuald what should mean Segmentation Fault (core dumped) I googled, it's an error that occurs in C++... :(
It looks like that is happening when it tries to do ecm. I would verify that your ecm build is working by trying the factorization directly using your ecm binary.

 2016-08-09, 18:18 #40 Romuald     Oct 2015 France 32×7 Posts Absolutely. What am I supposed to type? Currently, the only time when I used GMP was one year ago when I was implementing RSA in C++ on windows. I never used it in command-line. Last fiddled with by Romuald on 2016-08-09 at 18:21
2016-08-09, 19:03   #41
VBCurtis

"Curtis"
Feb 2005
Riverside, CA

2×5×563 Posts

Quote:
 Originally Posted by Romuald Absolutely. What am I supposed to type?

If your composite is the sole content of, say, input.txt, ecm can be tested as follows:
ecm 1e6 <input.txt

That will run a single curve with B1 bound 1 million (a reasonable choice to find factors in the mid-30 digit range). It might take something like a minute to run; if you just want to test the ecm binary, use 1e4 instead for a runtime of a second or so.

2016-08-09, 21:50   #42
Dubslow

"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88

3·29·83 Posts

Quote:
 Originally Posted by bsquared It looks like that is happening when it tries to do ecm. I would verify that your ecm build is working by trying the factorization directly using your ecm binary.
It's internal ecm that's failing, and I've had the same bug for years. The work around is to set the internal to external crossover to 1 or something similar (I forget what the precise option is).

Last fiddled with by Dubslow on 2016-08-09 at 21:51

2016-08-10, 04:36   #43
Dubslow

"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88

1C3516 Posts

Quote:
 Originally Posted by Romuald Ok & Thank you bsquared, now it seems to work & thx LaurV for your tip. Indeed, the line threads=1 is present in the yafu.ini, yet I still get this error: Code: ./yafu "factor(3316294578130624781632962198467832354647635629298847312456767341851)" -threads 1 fac: factoring 3316294578130624781632962198467832354647635629298847312456767341851 fac: using pretesting plan: normal fac: no tune info: using qs/gnfs crossover of 95 digits div: primes less than 10000 rho: x^2 + 3, starting 1000 iterations on C63 rho: x^2 + 2, starting 1000 iterations on C63 rho: x^2 + 2, starting 1000 iterations on C59 rho: x^2 + 1, starting 1000 iterations on C59 pm1: starting B1 = 150K, B2 = gmp-ecm default on C59 Erreur de segmentation (core dumped) what should mean Segmentation Fault (core dumped) I googled, it's an error that occurs in C++... :(
Seg faults are the bane of C (and C++) programmers anywhere.

At any rate, the workaround for this bug is to put the following line in yafu.ini: ext_ecm=5. Should work fine after that.
Quote:
 Originally Posted by Romuald I'm not a newbie on linux, so I don't invent anything.
Frankly, what you say after that makes this a highly dubious statement IMO.

Unless you mean you are are familiar with graphical environments on Linux, which is possible I suppose. At any rate you demonstrate ignorance of the command line.
Quote:
 Originally Posted by Romuald I simply thought that Code: ./yafu 'sth' meant "Open the called 'YAFU' program and type in there what's between the inverted commas".
Inverted commas? Are you serious? Avez-vous déjà entendu parler de guillemets?
Quote:
 Originally Posted by Romuald Obviously, according what you are telling me, it actually means "Open the called 'YAFU' program and type in there all what's after './yafu'. Otherwise the '-threads x' would not be considered. And that's weird because when opening yafu by double-click, don't need to put ' and '.
Since you seem to not know about how the command line works, allow me to elaborate on what B^2 said.

The first thing you type is the program to be executed. ls, cat and ./yafu are all examples of a program name that is about to be executed.

Whatever text follows the program name are called arguments to the program. Each space separated string is passed into the program's top level function (called main in C/C++) to be used in whatever way. It is extremely traditional for most arguments to be in the form of -a or --argument or --argument value or --argument=value or in Yafu's case -argument value (a non-traditional yet somewhat widespread variation). The other way to pass arguments is without a hyphen, as in ls /home/bill or ./yafu "factor(2^127-1)".

As mentioned, the command line (default is bash but there are others like sh or ksh or csh etc) treats certain characters as having special meaning, such as ( ) $# & > < [ ] ;, and in order to use parentheses as required for Yafu's expressions, such expressions need to be in guillemets (well, guillemets anglais) for the command line to ignore the special meaning and pass the characters straight to the program verbatim. This is the very basics of how to use a command line, and is (very reasonably) assumed by the documentation. Quote:  Originally Posted by Romuald About the compiling command, that is in the docs. I read the docs. Nevertheless I'll be willing to try without these options if you wish. To continue, the common way for documentation to record what its command line arguments are is to put optional arguments in brackets [ ]. So something like ls [-R] file|directory means that the -R argument is optional, and that the final argument is not optional but may be either a file name or directory name. Thus, make x86_64 [NFS=1] [PROFILE=1] [TIMING=1] [USE_SSE41=1] means that all but the first two words are mandatory but the rest are optional, and the documentation very clearly states what their optional use is, and in particular it states that the PROFILE and TIMING options add extra work, and are probably best skipped for production use. Please re-read the documentation since you claimed to have read it already, but did not properly comprehend it (or so it seems to us). 2016-08-10, 08:24 #44 Romuald Oct 2015 France 32×7 Posts Dubslow, I really don't want this thread to get into a conflict, but since you seem to insist I'm gonna respond you. By the way, I regret to inform you that the ext_ecm=5 line does not alter the seg fault which still occurs. Quote:  Originally Posted by Dubslow Frankly, what you say after that makes this a highly dubious statement IMO. Unless you mean you are are familiar with graphical environments on Linux, which is possible I suppose. At any rate you demonstrate ignorance of the command line. No. Garbled reasoning. I am indeed familiar with GUI & CLI Linux environments. Sorry for not using every day specific tools with specific syntax. Quote:  Originally Posted by Dubslow Inverted commas? Are you serious? Avez-vous déjà entendu parler de guillemets? Excellente démonstration. Bravo. Vraiment. Si tu veux parler en français avec moi, je veux bien, mais tu vas très vite te heurter à plus dur puisque tu ne le parles pas. Just for the record, 'inverted commas' is the exact translation of my dictionnary for "guillemets". I appreciate the fact tou worry about my mastery of french, mais oui j'ai déjà entendu parler de guillemets, si c'est ça qui semble te déranger. Quote:  Originally Posted by Dubslow The first thing you type is the program to be executed. ls, cat and ./yafu are all examples of a program name that is about to be executed. Whatever text follows the program name are called arguments to the program. Each space separated string is passed into the program's top level function (called main in C/C++) to be used in whatever way. It is extremely traditional for most arguments to be in the form of -a or --argument or --argument value or --argument=value or in Yafu's case -argument value (a non-traditional yet somewhat widespread variation). The other way to pass arguments is without a hyphen, as in ls /home/bill or ./yafu "factor(2^127-1)". As mentioned, the command line (default is bash but there are others like sh or ksh or csh etc) treats certain characters as having special meaning, such as ( )$ # & > < [ ] ;, and in order to use parentheses as required for Yafu's expressions, such expressions need to be in guillemets (well, guillemets anglais) for the command line to ignore the special meaning and pass the characters straight to the program verbatim. This is the very basics of how to use a command line, and is (very reasonably) assumed by the documentation.
Thank you so much for this reminer. Except that, as you might not have noticed, I programmed by the passed a kind of RSA generator (that generates RSA key pairs). Which means that anyway I know how generally works a programming language, such as C, C++, python, javascript, etc, what is an algorithm, what are variables and loops, what is a function, bref, basic rules and concepts. Just to prove that notions you suppose me not to know such as the main function in C++, the arguments you mentionned, the --opt.... are familiar to me, given the fact I've already been confronted to them. Nevertheless I don't claim to be an expert in any programming language, it would be rudely pretentious.
I also code in $\LaTeX$, python, and sagemath (which is quite python), in fact.

My precise lacune (well, the english for lacune) consists in string & file manipulations, and different shells you mentionned, e.g. sh, ksh, csh, if I'm not mistaken, but I don't think I am.

But don't get me wrong, we have tutorials also in Francophone web.

And, since you laugh about my designation of guillements, would you be willing to tell me how you say that word in english to please you? Considering that according to the language (UK or US), the guillements sorts (i.e. `, ', "), it can be different. Yeah, I know what is unicode and encoding params, in the case you would be sceptical (should I say skeptical?) about that too.

Last fiddled with by Romuald on 2016-08-10 at 09:01

 Similar Threads Thread Thread Starter Forum Replies Last Post rogue Factoring 20 2014-11-19 01:08 Raman Hobbies 45 2009-05-11 05:11 ThiloHarich Factoring 0 2007-09-02 20:32 koders333 Factoring 14 2006-01-25 14:08 koders333 Factoring 1 2006-01-19 20:04

All times are UTC. The time now is 20:18.

Mon Jan 30 20:18:52 UTC 2023 up 165 days, 17:47, 0 users, load averages: 1.00, 0.85, 0.84