mersenneforum.org  

Go Back   mersenneforum.org > Factoring Projects > YAFU

Reply
 
Thread Tools
Old 2018-04-27, 12:49   #12
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

1101011101012 Posts
Default

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.
EdH is offline   Reply With Quote
Old 2018-04-27, 13:11   #13
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

5×13×53 Posts
Default

Quote:
Originally Posted by bsquared View Post
...
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.
EdH is offline   Reply With Quote
Old 2018-04-27, 16:12   #14
jcrombie
 
jcrombie's Avatar
 
"Jonathan"
Jul 2010
In a tangled web...

D616 Posts
Default

Quote:
Originally Posted by jasonp View Post
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;
}
jcrombie is offline   Reply With Quote
Old 2018-04-27, 16:48   #15
jcrombie
 
jcrombie's Avatar
 
"Jonathan"
Jul 2010
In a tangled web...

D616 Posts
Default

Quote:
Originally Posted by EdH View Post
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.
jcrombie is offline   Reply With Quote
Old 2018-04-27, 16:57   #16
GeoffreyY
 
"Geoffrey Yeung"
Feb 2017
London

2×32 Posts
Default

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
GeoffreyY is offline   Reply With Quote
Old 2018-04-27, 20:16   #17
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

1101011101012 Posts
Default

Quote:
Originally Posted by jcrombie View Post
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!!
EdH is offline   Reply With Quote
Old 2018-04-27, 20:28   #18
Dubslow
Basketry That Evening!
 
Dubslow's Avatar
 
"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88

3·2,399 Posts
Default

As to the "why", this is a very old known problem dating back several years; the workaround worked ~well enough that no one bothered to patch it until jrcrombie here, though even with the patch, the archaic version control and decline of SourceForge have limited usefulness of patches anyways. Basically, "inertia is a bitch".
Dubslow is offline   Reply With Quote
Old 2018-05-18, 13:44   #19
jasonp
Tribal Bullet
 
jasonp's Avatar
 
Oct 2004

3×1,163 Posts
Default

Patch committed to SVN trunk.
jasonp is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Aouessare-El Haddouchi-Essaaidi "test": "if Mp has no factor, it is prime!" wildrabbitt Miscellaneous Math 11 2015-03-06 08:17
Feature request @ "too few cycles" after filtering Andi47 Msieve 2 2010-01-11 08:50
Error: "matrix must have more columns than rows" mdettweiler Msieve 10 2009-03-17 02:38
Would Minimizing "iterations between results file" may reveal "is not prime" earlier? nitai1999 Software 7 2004-08-26 18:12

All times are UTC. The time now is 13:11.

Tue Nov 24 13:11:59 UTC 2020 up 75 days, 10:22, 4 users, load averages: 0.94, 1.51, 1.81

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.