mersenneforum.org > YAFU "too few cycles, matrix probably cannot build"
 Register FAQ Search Today's Posts Mark Forums Read

 2018-04-27, 12:49 #12 EdH     "Ed Hall" Dec 2009 Adirondack Mtns 2×11×167 Posts I guess I'm not the only one experiencing this, then. I had wondered. Why did no one else bring this up and instead chose to work around it? As mentioned earlier, I'm running instances of yafu.pl, a perl script designed to grab composites from the db, factor them via YAFU and move on. If it doesn't find a factor from YAFU, it drops the composite and gets another. The trouble is, that composite is available to run and error again under the normal workings of yafu.pl. I have somewhat minimized this by running a list of those composites worked that is checked before factoring, but once a large number of these problem composites have accumulated, the script just keeps hitting and skipping them continuously at a higher rate than gathering new ones. I have modified yafu.pl and could probably do so some more, but, although growing, my perl knowledge is quite limited. And, although it is mostly doing what I want, much of my modification is probably not nearly correctly coded. Since I'm currently working with C100s and smaller, for my work around, is there a way I can modify my tune info to increase the SIQS/NFS crossover from 98 to 101?: Code: tune_info= Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz,LINUX64,1.17024e-05,0.204308,0.300965,0.101681,98.9503,3392.26 Would it be as simple as changing the 98.9503 above, or is something needed with the other values? Sorry to be such a pain with my oddities. Thanks for all the help.
2018-04-27, 13:11   #13
EdH

"Ed Hall"
Dec 2009

2×11×167 Posts

Quote:
 Originally Posted by bsquared ... The command line bit is something I'm working on where the yafu shell in linux will recognize backspaces to delete text, and up arrows and down arrows for command browsing. But, if yafu exits abnormally (ctrl-c, or exit()), then you get the effect you observed. The temporary fix (I hope, this is untested) would be to: 1) edit line 121 to : #if 0 //defined(__unix__) 2) edit line 355 to: #if 1 //!defined(__unix__) 3) edit line 337 to: #if 0 //defined(__unix__) Sorry! Thanks for the feedback!
Sorry for my ignorance, but I couldn't figure out where to make these edits.

2018-04-27, 16:12   #14
jcrombie

"Jonathan"
Jul 2010
In a tangled web...

2·107 Posts

Quote:
 Originally Posted by jasonp The calls to exit() were a holdover from when the library was only used in one application and not the complete factoring frameworks we have now. Getting rid of them is easy but they need to be replaced with actual return paths that e.g. close any open files and propagate error information up. Not having this makes embedding libmsieve within application much harder.
If you're willing to mess with the code a bit, this should work. (I noticed msieve is now at version 1019, but all the modified files seem to be untouched since ver 1015).

Quote:
 jcrombie@dads-pc:~/msieve/latest_for_yafu$svn diff Index: common/filter/filter.c =================================================================== --- common/filter/filter.c (revision 1015) +++ common/filter/filter.c (working copy) @@ -59,11 +59,11 @@ } /*--------------------------------------------------------------------*/ -void filter_make_relsets(msieve_obj *obj, filter_t *filter, +int filter_make_relsets(msieve_obj *obj, filter_t *filter, merge_t *merge, uint32 min_cycles) { filter_purge_cliques(obj, filter); filter_merge_init(obj, filter); filter_merge_2way(obj, filter, merge); - filter_merge_full(obj, merge, min_cycles); + return filter_merge_full(obj, merge, min_cycles); } Index: common/filter/filter.h =================================================================== --- common/filter/filter.h (revision 1015) +++ common/filter/filter.h (working copy) @@ -139,7 +139,7 @@ of relations. min_cycles is the absolute minimum number of relation sets that are required */ -void filter_make_relsets(msieve_obj *obj, filter_t *filter, +int filter_make_relsets(msieve_obj *obj, filter_t *filter, merge_t *merge, uint32 min_cycles); /* perform post-processing optimizations on the collection of cycles Index: common/filter/filter_priv.h =================================================================== --- common/filter/filter_priv.h (revision 1015) +++ common/filter/filter_priv.h (working copy) @@ -91,7 +91,7 @@ built (the actual matrix is expected to be much larger than this). */ -void filter_merge_full(msieve_obj *obj, merge_t *merge, uint32 min_cycles); +int filter_merge_full(msieve_obj *obj, merge_t *merge, uint32 min_cycles); #ifdef __cplusplus } Index: common/filter/merge.c =================================================================== --- common/filter/merge.c (revision 1015) +++ common/filter/merge.c (working copy) @@ -331,7 +331,7 @@ /*--------------------------------------------------------------------*/ #define NUM_CYCLE_BINS 9 -void filter_merge_full(msieve_obj *obj, merge_t *merge, uint32 min_cycles) { +int filter_merge_full(msieve_obj *obj, merge_t *merge, uint32 min_cycles) { /* The core of the NFS merge phase; this routine starts with a collection of relation sets, each containing entries @@ -621,7 +621,13 @@ if (num_cycles < 0.8 * target_cycles) { logprintf(obj, "too few cycles, matrix probably " "cannot build\n"); - exit(0); /* a non-zero exit code aborts factMsieve.pl */ + matrix_weight_free(&mat_weight); + heap_free(&active_heap); + heap_free(&inactive_heap); + ideal_list_free(&ideal_list); + free(aux); + return 1; +/* exit(0); *//* a non-zero exit code aborts factMsieve.pl */ } qsort(relset_array, (size_t)num_cycles, @@ -675,4 +681,5 @@ heap_free(&inactive_heap); ideal_list_free(&ideal_list); free(aux); + return 0; } Index: gnfs/filter/filter.c =================================================================== --- gnfs/filter/filter.c (revision 1015) +++ gnfs/filter/filter.c (working copy) @@ -184,7 +184,9 @@ if (target_density != 0) merge->target_density = target_density; - filter_make_relsets(obj, filter, merge, extra_needed); + if ( filter_make_relsets(obj, filter, merge, extra_needed) != 0 ) + return 1000000; + return 0; } 2018-04-27, 16:48 #15 jcrombie "Jonathan" Jul 2010 In a tangled web... 110101102 Posts Quote:  Originally Posted by EdH Sorry for my ignorance, but I couldn't figure out where to make these edits. That would be in top/driver.c Checking my own code, I just commented out line 126: Quote:  jcrombie@dads-pc:~/yafu/latest/top$ diff driver.c_orig driver.c 126c126 < tcsetattr(0, TCSANOW, &newtio); --- > /* tcsetattr(0, TCSANOW, &newtio);*/
Cheers.

 2018-04-27, 16:57 #16 GeoffreyY   "Geoffrey Yeung" Feb 2017 London 2·32 Posts Hi, I'm also having similar problems. The lines (121, 337, 355) doesn't exist on revision 366 or the newest github version. I do have an older version where the lines do exist, however I'm having trouble compiling that. (edit: I don't recall what specific version is that, CHANGES says v 1.35 (beta)) Last fiddled with by GeoffreyY on 2018-04-27 at 16:59
2018-04-27, 20:16   #17
EdH

"Ed Hall"
Dec 2009

E5A16 Posts

Quote:
 Originally Posted by jcrombie If you're willing to mess with the code a bit, this should work. (I noticed msieve is now at version 1019, but all the modified files seem to be untouched since ver 1015).
This appears to have done the trick! I tested with two of the composites in the OP and both flew through fine.

Thanks much everyone!!

 2018-04-27, 20:28 #18 Dubslow Basketry That Evening!     "Bunslow the Bold" Jun 2011 40
 2018-05-18, 13:44 #19 jasonp Tribal Bullet     Oct 2004 67208 Posts Patch committed to SVN trunk.

 Similar Threads Thread Thread Starter Forum Replies Last Post wildrabbitt Miscellaneous Math 11 2015-03-06 08:17 Andi47 Msieve 2 2010-01-11 08:50 mdettweiler Msieve 10 2009-03-17 02:38 nitai1999 Software 7 2004-08-26 18:12

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

Sun Apr 11 12:20:00 UTC 2021 up 3 days, 7 hrs, 1 user, load averages: 0.95, 1.19, 1.30