1Instructions on how to use CADO-NFS with msieve
2===============================================
3
4Summary:
5
6I) Using CADO-NFS with relations computed with msieve (or ggnfs)
7II) Using msieve filtering and linear algebra with relations in CADO format
8III) Using msieve linear algebra after CADO-NFS filtering
9
10==============================================================================
11
12I) Using CADO-NFS with relations computed with msieve (or ggnfs)
13
14The format of relations used by CADO-NFS is the same as the one used by ggnfs
15or msieve.
16
17IMPORTANT NOTE: free relations should not be included. To remove them,
18first do: $ egrep -v '^[0-9]+,0$' relations > relations_fixed
19
200) You need to work with a git checkout of CADO-NFS, as it contains
21   utility code that is not present in tarballs (see main README for the
22   git clone command line).
23
241) First, convert the polynomial from Msieve format to CADO format using:
25   $ make convert_poly
26   $ build/<hostname>/misc/convert_poly -if msieve < input.poly > output.poly
27
282) Since ggnfs doesn't print prime factors under 10000, and CADO-NFS requires
29   all prime factors, you will need to complete all relations files that are in
30   ggnfs or msieve format using:
31
32   $ build/<hostname>/misc/check_rels -complete rels.out.gz -poly <polyfile> file0 file1 ... filen
33        or
34   $ build/<hostname>/misc/check_rels -complete rels.out.gz -poly <polyfile> -filelsit <filelist>
35        where <filelist> is a name of a file containing the list of all
36        relations files
37
38    See check_rels -h for others options.
39
403) Create a parameter file for the Python script: in the scripts/cadofactor
41directory, see the files 'parameters' and 'README'. In the README file, read
42thoroughly the section on importing polynomial file and importing relations.
43You can also look in the 'params' directory for examples of parameter files
44depending on the size of the input.
45
464) run the cado-nfs.py script (where $CADO is the CADO-NFS directory):
47
48   $ $CADO/cado-nfs.py <parameterfile>
49
50If the parameter file is correctly configured, the script will skip the
51polyselect step and the sieving. It will run all the remaining step of the
52factorization until the factors are found.
53
54NB: If you only want to do the filtering step, add the following command-line
55arguments:
56
57   $ $CADO/cado-nfs.py <parameterfile> 'tasks.linalg.run = false' 'tasks.sqrt.run = false'
58
59==============================================================================
60
61II) Using msieve filtering and linear algebra with relations in CADO format
62
631) Create a file msieve.fb, which contains:
64
65      N <number to be factored>
66      R0  <coeff of x^0, rational side>
67      R1  <coeff of x^1, rational side>
68      A0  <coeff of x^0, algebraic side>
69      A1  <etc>
70      A2  <etc>
71      A3  <etc>
72      A4  <etc>
73      A5  <etc>
74
75   This can be done with:
76
77      $ ./convert_poly -of msieve < cxxx.poly > msieve.fb
78
792) create a file msieve.dat, which contains:
80
81      N <number to be factored>
82      <all the relations in GGNFS/CADO format>
83
84   (Do not include free relations, since the CADO-NFS format is not
85    recognized by msieve, and msieve includes them in the filtering.)
86
873) then run "msieve -nc -v <number to be factored>"
88   The msieve output goes into msieve.log.
89   You can add the "-t 4" option to use 4 threads.
90
91==============================================================================
92
93III) Using msieve linear algebra after CADO-NFS filtering
94
95[should work with CADO-NFS revision aca5658]
96
97up from msieve (svn) revision 891, msieve can read a cycle file produced by
98CADO-NFS. To use it, you will have to:
99
100- use CADO-NFS for the filtering. In what follows, let 'prefix' be
101  the prefix used for all the CADO filenames
102- use the CADO 'replay' binary with --for_msieve to produce
103  a file <prefix>.cyc
104- concatenate all the relation files specified by purge.log in
105  the order specified, and name the file <prefix> in the same
106  directory as all the other CADO intermediate files. If Msieve was
107  compiled with zlib support, the files do not have to be uncompressed
108- create a <prefix>.fb file with the polynomials in Msieve format
109- create worktodo.ini with a single line containing N
110- run Msieve LA with
111
112  -v -nf <prefix>.fb -s <prefix> -nc2 "cado_filter=1"
113
114The string at the end may get extra options depending on whether
115the LA has more tweaking, like using MPI. The .cyc file gets
116overwritten during the LA, so re-running the LA does not require
117cado_filter=1.
118
119
120
121