-
-
Notifications
You must be signed in to change notification settings - Fork 52
Configuration and Command Line Options
Every option YAFU accepts can be set in two ways:
-
On the command line, prefixed with
-, e.g.-threads 4. -
In
yafu.ini, in the same directory as the executable, as<flag>=<value>on a single line. Flags with no value (boolean switches) appear as just<flag>. Lines starting with%are comments.
Precedence: command line overrides yafu.ini, which overrides defaults.
There is also an interactive mode where some of these (B1pm1, OBASE, etc.) can be set as global variables. See Expressions, Variables, and Reserved Words.
This page lists every option, grouped the same way yafu.ini does, with the type/default where one exists.
| Option | Description |
|---|---|
threads=N |
Number of threads for multi-threaded algorithms (SIQS, ECM, NFS sieving). Default 1. |
nprp=N |
Number of Rabin-Miller witnesses used in PRP checks. Default 1. |
v |
Increase verbosity by one level. Repeat (on separate lines or repeated -v) for more. Default level is 0. |
silent |
Suppress all screen output except the logfile. Not available in the interactive environment. |
terse |
Print a one-line terse summary of the complete factorization. |
obase=N |
Output number base. Valid: 2, 8, 10, 16. Default 10. |
no_clk_test |
Skip the 100 ms clock-speed test at startup. |
script="filename" |
Run the script in filename. |
session="session.log" |
Session logfile name. Records commands run, RNG seed, system/build info, and startup options. |
batchfile="file" |
Run the given command on each number in file (see Tips, Examples, and Troubleshooting#batchfiles). |
seed=N |
RNG seed for this session. |
vproc |
Print verbose processor-detection info at startup. |
logfile="factor.log" |
Logfile that records factorization info. |
p |
Run YAFU at idle priority. |
repeat=N |
Repeat the given expression/command N times. |
These influence the top-level Functions Reference#factor driver.
| Option | Description |
|---|---|
pretest_ratio=R |
When plan=custom, ECM pretest up to R * input_size digits before running NFS. Floating-point value. |
xover=N |
GNFS/SIQS crossover, in decimal digits. Overrides the value computed by tune(). |
snfs_xover=N |
SNFS/SIQS crossover, in decimal digits. |
plan=NAME |
Pretesting plan. One of none, noecm, light (2/9), normal (4/13), deep (1/3), custom (uses pretest_ratio). See Pretesting Plans and T-Levels. Default normal. |
pretest |
Only pretest the input (rho, P-1, ECM); skip NFS/SIQS. Optional max depth. |
work=N |
Tell factor() the input has already received pretesting equivalent to t-level N. Floating-point. If < 1.0, treated as a fraction of the input size (e.g. a 213-digit input with work=0.1 → t21.3). |
op="pfile.dat" |
File to record primes/PRPs found by factor(). |
of="factored.dat" |
File to record input + all found factors. |
ou="unfactored.dat" |
File to record unfactored composite residues. |
no_expr |
When writing numbers to file, write full decimal expansion instead of expression form. |
noecm |
Skip all ECM stages — go straight to QS/NFS after small-factor detection. |
one |
Stop factor() as soon as one factor is found, of any size. |
stople=N / stoplt=N / stopeq=N / stopgt=N / stopge=N
|
Stop on finding a factor whose size satisfies the comparison vs N (≤, <, =, >, ≥). |
stopbase=B |
Base in which the stop* sizes are evaluated. Default 10. |
stopprime |
The factor that triggers the stop condition must be prime. |
stopk=N |
Stop after finding N factors. |
max_siqs=N |
Do not start SIQS on composites above this digit size. -1 = no limit (default). |
max_nfs=N |
Do not start NFS on composites above this digit size. -1 = no limit (default). |
aprcl_p=N |
Decimal-digit threshold below which numbers are proved prime using APR-CL. Default 500. Hard upper limit 6021. |
aprcl_d=N |
Decimal-digit threshold above which APR-CL proofs print extra verbosity. Default 200. |
Affect the Functions Reference#siqs function.
| Option | Description |
|---|---|
forceDLP |
Force use of the double-large-prime variation. |
forceTLP |
Force use of the triple-large-prime variation. Other parameters may not be tuned for TLP. |
siqsLPB=N |
Large prime bound in bits, used with 1, 2, or 3 large primes. |
siqsMFBD=R |
Residues smaller than pmax^siqsMFBD are considered for DLP factoring (pmax = largest factor-base prime). |
siqsMFBT=R |
Same as above but for TLP factoring. |
siqsBDiv=N |
In batch factoring of TLP residues: largest prime used in the batch GCD, as a divisor of the max FB prime. Larger divisors → fewer primes in the GCD. Default 3. |
siqsBT=N |
Batch size for TLP batch factoring. Larger batches are slower per batch but more efficient. Default 1000000. |
siqsTFSm=N |
Small-prime variation threshold. Default 18. |
qssave="siqs.dat" |
SIQS savefile name. |
siqsB=N |
Factor-base size (number of primes). |
siqsTF=N |
Trial-factoring cutoff in bits — sieve locations whose value is larger than this are reported for TF. |
siqsR=N |
Stop SIQS after finding N relations. |
siqsT=N |
Stop SIQS after N seconds. |
siqsNB=N |
Number of sieve blocks (per side). |
siqsM=N |
Large prime bound as a multiplier of the max factor-base prime. |
noopt |
Do not perform optimization of the small-prime variation threshold. |
inmem=N |
Inputs smaller than N digits do not use a savefile — relations are kept in memory. Faster, but the run can't be resumed. Default 70. |
Affect Functions Reference#nfs and Functions Reference#snfs.
| Option | Description |
|---|---|
cadoMsieve |
Run the experimental cado-nfs + msieve NFS path. |
cado_dir="path/" |
Directory containing CADO-NFS files. Must end with / or \. |
convert_poly_path="path" |
Full path to the convert_poly executable. Build it via make convert_poly inside the CADO-NFS tree; the binary appears under build/*/misc/convert_poly. |
| Option | Description |
|---|---|
ggnfs_dir="path/" |
Directory containing ggnfs-lasieve4I* binaries. Without this, NFS will not run. Example values shipped in the comments of yafu.ini: factor\lasieve5_64\bin\mingw\avx512\, factor/lasieve5_64/bin/avx512/. |
siever=N |
GGNFS siever version (<num> in ggnfs-lasieve4I<num>e). |
| Option | Description |
|---|---|
poly_testsieve=N |
Bit-size threshold above which polyselect runs a test sieve every time it finds a new best polynomial, to estimate sieving time. Default 390 (commented example). |
poly_percent_max=N |
Max time spent in poly select, as a percentage of estimated sieving time. Used with poly_testsieve to cap polyselect when it grows out of proportion with sieving. |
psearch=NAME |
Parallel polyselect strategy: fast (split range across N threads), wide (search N× the range), deep (all threads on same leading coefficient), min / avg / good (stop on Batalov heuristic of minimum/average/good quality, multipliers 1.0 / 1.036 / 1.072). Default avg. |
pbatch=N |
Block size of leading coefficients to distribute during polyselect. Default 250. |
np[=X,Y] |
Run only the polyselect phase. Optional comma-delimited range start,stop of leading coefficients. Overwrites any existing poly file.
|
| Option | Description |
|---|---|
ns[=X,Y] |
Run only the sieving phase. Optional range of special-Q in the form start,stop. |
a |
Use algebraic-side sieving. |
r |
Use rational-side sieving. |
job="name" |
Input job file. Default ggnfs.job. |
o="name" |
Output data file. Default msieve.dat. |
ggnfsT=N |
NFS timeout in seconds. Default infinity. |
nt=file1,file2,... |
Automated trial sieving of the listed job files, then exit. YAFU fills any missing GGNFS parameters. |
testsieve=N |
(SNFS only) digit size above which YAFU will test-sieve the top 3 polys found by SNFS. Default 140. |
nfs_params="file" |
Path to a comma-delimited NFS parameter file (assumes algebraic-side sieving). Overrides YAFU's built-in NFS parameters; if YAFU decides on rational-side sieving, the a- and r-side parameters in the file are swapped automatically. |
| Option | Description |
|---|---|
nc |
Run all postprocessing phases only (filter → LA → sqrt). |
nc1 |
Run only the filtering phase. |
nc2 |
Run only linear algebra. Starts the LA from scratch — use ncr to resume. |
nc3 |
Run only the square-root phase. |
ncr |
Resume an in-progress matrix solve. |
lathreads=N |
Threads to use for the linear-algebra phase. Independent of the general threads setting. |
filt_bump=R |
Percentage to raise min_rels on unsuccessful filtering attempts. Floating-point percent. Default 5. The new min_rels is not remembered across aborts. |
| Option | Description |
|---|---|
gnfs |
Force GNFS even if the input has an SNFS form. |
R |
Restart NFS when a previous savefile exists (required for resumes). |
| Option | Description |
|---|---|
B1ecm=N |
Stage 1 bound. Default 11000. |
B2ecm=N |
Stage 2 bound. Leave unset to use the GMP-ECM default for the current B1. |
ecm_path="path" |
Path to external ECM executable. |
prefer_gmpecm |
Use GMP-ECM instead of AVX-ECM even when AVX-ECM is available. |
prefer_gmpecm_stg2 |
Use GMP-ECM for stage 2 even when AVX-ECM is available. |
saveB1 |
Output the stage-1 residues from AVX-ECM. |
ext_ecm=N |
Crossover B1 above which YAFU uses the external ECM binary (set via ecm_path) instead of the built-in implementation. Default 1000000000. |
sigma=N |
Specific curve sigma. For AVX-ECM, this is the starting sigma for vector lane 0; later lanes increment from it. Limited to 32 bits on the command line. |
| Option | Description |
|---|---|
B1pm1=N |
Stage 1 bound. (Commented example value 100000.) |
B2pm1=N |
Stage 2 bound. Leave unset for the GMP-ECM default. |
| Option | Description |
|---|---|
B1pp1=N |
Stage 1 bound. Default 20000. |
B2pp1=N |
Stage 2 bound. Leave unset for the GMP-ECM default. |
| Option | Description |
|---|---|
rhomax=N |
Max iterations in rho. (Commented example value 200.) |
| Option | Description |
|---|---|
fmtmax=N |
Max iterations in the Fermat method. (Commented example value 1000000.) |
Affect Functions Reference#primes and Functions Reference#bigprimes.
| Option | Description |
|---|---|
pfile |
Output found primes to primes.dat. |
pscreen |
Output found primes to the screen. |
soe_block=N |
Sieve block size. |
tune() measures partial SIQS/NFS factorizations, performs regression analysis, and writes the result to yafu.ini as tune_info=... lines. Those lines are then used to estimate the optimal SIQS/NFS crossover.
Example lines you might see appear after running tune():
tune_info=Intel(R) Xeon(R) Gold 5122 CPU @ 3.60GHz,LINUX64,1.59078e-05,0.196092,0.299688,0.0999245,102.36,42
tune_info=AMD EPYC 9174F 16-Core Processor ,LINUX64,4.44807e-06,...
You do not normally edit tune_info lines by hand — tune() writes them for you.
Some flags only appear in command-line examples in docfile.txt. They behave the same way as the ones above but are listed here for completeness:
| Flag | Description |
|---|---|
-script <file> |
Run the script (also available as script= in yafu.ini). |
-batchfile <file> |
Same as batchfile=. Lines are removed from the file as they are processed. |
-seed <hi,lo> |
32-bit high,low pair for seeding the RNG (CLI form). |
-pretest [num] |
ECM-pretest only; optional max depth (digits or t-level). |
Note. The
yafu.inifile shipped with YAFU contains every option in this list as a comment, with example values. It is the most reliable quick reference — open it next to this page and you'll see the same content from a different angle.