View Single Post
Old 2012-10-25, 18:58   #3
Basketry That Evening!
Dubslow's Avatar
"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88

11100001101012 Posts

It looks like the multiple-precision code written for Msieve (and now mostly replaced by GMP) is failing.

You should note that a) that code was written to work for an "average" NFS number, which is many more than a few digits; b) Msieve refuses to run NFS of any sort on a number small than 60-80 digits or so, even if the scratch-MP code didn't crash.

My hunch is that since the MP code was "ad hoc", it's not anywhere near as bug-free as GMP, meaning it probably assumes an input of at least 32 bits or some such. (jasonp can comment on this, since it's his code )

Try using a number above the NFS limit. (Even an 85 digit job should be less than an hour on most computers.)

PS Use the [code] tag for your code.

PPS There might be some element of your msieve_obj that's uninitialized, since you didn't use msieve_obj_new().
msieve_obj * msieve_obj_new(char *input_integer, uint32 flags,
	                            char *savefile_name, char *logfile_name,
	                            char *nfs_fbfile_name,
	                            uint32 seed1, uint32 seed2, uint32 max_relations,
	                            enum cpu_type cpu,
	                            uint32 cache_size1, uint32 cache_size2,
	                            uint32 num_threads, uint32 which_gpu, 
	                            const char *nfs_args) {
	        msieve_obj *obj = (msieve_obj *)xcalloc((size_t)1, sizeof(msieve_obj));
	        obj->input = input_integer;
	        obj->flags = flags;
	        obj->seed1 = seed1;
	        obj->seed2 = seed2;
	        obj->max_relations = max_relations;
	        obj->cpu = cpu;
	        obj->cache_size1 = cache_size1;
	        obj->cache_size2 = cache_size2;
	        obj->num_threads = num_threads;
	        obj->which_gpu = which_gpu;
	        obj->logfile_name = MSIEVE_DEFAULT_LOGFILE;
	        obj->nfs_args = nfs_args;
	        if (logfile_name)
	                obj->logfile_name = logfile_name;
	        obj->nfs_fbfile_name = MSIEVE_DEFAULT_NFS_FBFILE;
	        if (nfs_fbfile_name)
	                obj->nfs_fbfile_name = nfs_fbfile_name;
	        obj->mp_sprintf_buf = (char *)xmalloc(32 * MAX_MP_WORDS + 1);
	        savefile_init(&obj->savefile, savefile_name);
	        return obj;
In particular, some important things that need to be initialized are `mp_sprintf_buf`, `num_threads`, `logfile_name`, and `nfs_fbfile_name`. I'd recommend you just call this function instead of doing the initialization yourself.

Last fiddled with by Dubslow on 2012-10-25 at 19:09
Dubslow is offline   Reply With Quote