autoprimenet

🖧 The PrimeNet automated assignment handler program for the Great Internet Mersenne Prime Search (GIMPS)

https://github.com/tdulcet/autoprimenet

Science Score: 54.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 4 committers (25.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.2%) to scientific vocabulary
Last synced: 7 months ago · JSON representation ·

Repository

🖧 The PrimeNet automated assignment handler program for the Great Internet Mersenne Prime Search (GIMPS)

Basic Info
Statistics
  • Stars: 16
  • Watchers: 2
  • Forks: 2
  • Open Issues: 0
  • Releases: 0
Created over 1 year ago · Last pushed 8 months ago
Metadata Files
Readme License Citation

README.md

Actions Status

AutoPrimeNet

The PrimeNet automated assignment handler program for GIMPS

Copyright © 2024 Teal Dulcet

Automatically gets and registers assignments, reports assignment progress and results, uploads proof files to and downloads certification starting values from PrimeNet for the Mlucas, GpuOwl, PRPLL, CUDALucas, mfaktc and mfakto GIMPS programs. Additionally, it can get assignments and report results to mersenne.ca for exponents above the PrimeNet limit of 1G. Supports both Python 2 and 3 and Windows, macOS and Linux. Requires the Requests library, which is included with most Python 3 installations. The program will automatically prompt to install Requests on first run if it is not already installed.

Adapted from the PrimeNet Python script from Mlucas by Loïc Le Loarer and Ernst W. Mayer, which itself was adapted from primetools by Mark Rose and teknohog.

AutoPrimeNet (the PrimeNet program) was moved from the Distributed Computing Scripts repository.

❤️ Please visit tealdulcet.com to support this program and my other software development.

Features

  • Interactive setup with a --setup option
  • Command line interface and configuration file
  • Automatically registers the instance with PrimeNet
  • PrimeNet/mersenne.org
    • Supports all applicable PrimeNet v5 API functionality
      • Registers and updates instance
      • Gets and sets program options
      • Gets and recovers assignments
      • Registers assignments
      • Unreserve assignments
      • Reports assignment progress
      • Reports assignment results
      • Ping server
    • Uploads PRP proof files
    • Downloads PRP certification starting values
  • mersenne.ca for exponents above PrimeNet limit of 1G (1,000,000,000)
    • Supports all available functionality
      • Gets and recovers assignments
      • Unreserve assignments
      • Reports assignment results
  • Supported GIMPS software
    • Full support
      • Mlucas
      • GpuOwl
      • CUDALucas
      • mfaktc
      • mfakto
    • Partial support
      • PRPLL
      • CUDAPm1
    • Report results only
      • Prime95/MPrime
      • cofact
      • PrMers
  • Supported worktypes
    • LL
    • PRP
    • PRP cofactor
    • Trial Factor (TF)
    • P-1 factor
    • PRP Certification (CERT)
  • Supports multiple workers (CPU Cores or GPUs)
    • Supports setting per worker options, including work preferences
  • Can be used anonymously
  • Supports submitting results and uploading proof files immediately, without polling the filesystem
  • Automatically reports assignment progress
  • Can specify minimum and maximum exponent for assignments
    • Can specify minimum and maximum bit level for assignments
  • Automatically registers assignments without an assignment ID (AID)
    • Interactively register specific exponents with a --register-exponents option
      • Automatically gets existing parameters from mersenne.ca
    • Supports a worktodo.add file
  • Supports recovering all assignments
  • Supports unreserving specific exponents or all assignments
  • Supports automatically updating assignments
    • Force TF assignments to factor to the target bit level
    • Force P-1 factoring before LL/PRP tests
    • Use the optimal P-1 bounds
    • Convert LL assignments to PRP
    • Convert PRP assignments to LL
  • Calculates rolling average to improve assignment expected completion dates
  • Stop getting new assignments with a --no-more-work option
    • Resume getting assignments with a --resume-work option
  • Logging to both console and a file
    • Optional color output
    • Automatically rotates log file
  • Monitors available and used disk space
  • Automatic AutoPrimeNet and GIMPS program version check
  • Optional e-mail and text message notifications
    • There is an error
      • Failed to get new assignments
      • Assignment results were rejected
      • Failed to report assignment results
      • Failed to upload a proof file
    • GIMPS program has stalled
      • GIMPS program has stalled (not made any progress)
      • GIMPS program has resumed after previously stalling
    • Disk space is low
      • Disk space used is greater than % of configured limit
      • Disk space available is less than % of total
    • GIMPS program found a new Mersenne Prime!
    • There is a new version of the GIMPS program
      • New version of AutoPrimeNet is available
      • New version of the GIMPS program is available
  • Automatically detects e-mail configuration when using --setup option
  • File locking of both work and results files
  • Optionally archives PRP proof files after upload
  • Saves submitted results to a results_sent.txt file
  • Automatically detects system information
    • Processor (CPU)
      • CPU model
      • Frequency/Speed
      • Total memory
      • Number of cores/threads
      • L1/L2/L3 cache sizes
    • Graphics Processor (GPU) with Nvidia Management Library (NVML) and OpenCL
      • GPU model
      • Frequency/Speed
      • Total memory
  • Optional status report
    • Expected completion dates for all assignments
    • Probability each assignment is prime
    • Outputs number of and first/last 20 decimal digits
  • Verifies each found factor divides number
    • Outputs number of decimal digits and bits
  • Optional alert after finding a new Mersenne Prime!
  • Supports both Python 2 and 3
  • Supports Windows, macOS and Linux
  • 100% Open Source
  • Can claim full EFF Awards

Usage

``` Usage: autoprimenet.py [options] Use -h/--help to see all options Use --setup to configure this instance of the program

This program will automatically get and register assignments, report assignment progress and results, upload proof files to and download certification starting values from PrimeNet for the Mlucas, GpuOwl, PRPLL, CUDALucas, mfaktc and mfakto GIMPS programs. It can get assignments and report results to mersenne.ca for exponents above the PrimeNet limit of 1G. It also saves its configuration to a 'prime.ini' file by default, so it is only necessary to give most of the arguments once. The first time it is run, it will register the current Mlucas/GpuOwl/PRPLL/CUDALucas/mfaktc/mfakto instance with PrimeNet (see the Registering Options below). Then, it will report assignment results and upload any proof files to PrimeNet immediately. It will get assignments on the --timeout interval, or only once if --timeout is 0. It will additionally report the progress on the --checkin interval.

Options: --version show program's version number and exit -h, --help show this help message and exit -d, --debug Output detailed information. Provide multiple times for even more verbose output. -w WORKDIR, --workdir=WORKDIR Working directory with the configuration file from this program, Default: . (current directory) -D DIRS, --dir=DIRS Directories relative to --workdir with the work and results files from the GIMPS program. Provide once for each worker. This is incompatible with PRPLL. -i WORKTODOFILE, --work-file=WORKTODOFILE Work file filename, Default: 'worktodo.txt'. Not used with PRPLL. -r RESULTSFILE, --results-file=RESULTSFILE Results file filename, Default: 'results.json.txt' for mfaktc/mfakto or 'results.txt' otherwise. Not used with PRPLL. -L LOGFILE, --logfile=LOGFILE Log file filename, Default: 'autoprimenet.log' -l LOCALFILE, --config-file=LOCALFILE Local configuration file filename, Default: 'prime.ini' --archive-proofs=ARCHIVEDIR Directory to archive PRP proof files after upload, Default: none -u USERID, --username=USERID GIMPS/PrimeNet User ID. Create a GIMPS/PrimeNet account: https://www.mersenne.org/update/. If you do not want a PrimeNet account, you can use ANONYMOUS. -T WORKPREFERENCE, --workpref=WORKPREFERENCE Work preference, Default: 150. Supported work preferences: 2 (Trial factoring), 4 (P-1 factoring), 12 (Trial factoring GPU), 100 (First time LL tests), 101 (Double-check LL tests), 102 (World record LL tests), 104 (100M digit LL tests), 106 (Double-check LL tests with zero shift count), 150 (First time PRP tests), 151 (Double-check PRP tests), 152 (World record PRP tests), 153 (100M digit PRP tests), 154 (Smallest available first time PRP that needs P-1 factoring), 155 (Double-check using PRP with proof), 156 (Double-check using PRP with proof and nonzero shift count), 160 (First time PRP on Mersenne cofactors), 161 (Double-check PRP on Mersenne cofactors). Provide once to use the same work preference for all workers or once for each worker to use different work preferences. Not all worktypes are supported by all the GIMPS programs. --cert-work Get PRP proof certification work, Default: none. Currently only supported by PRPLL. --no-cert-work --cert-work-limit=CERTCPULIMIT PRP proof certification work limit in percentage of CPU or GPU time, Default: 10%. Requires the --cert- work option. --min-exp=MINEXP Minimum exponent to get from PrimeNet or TF1G (2 - 9,999,999,999). TF1G assignments are supported by setting this flag to 1,000,000,000 or above. --max-exp=MAXEXP Maximum exponent to get from PrimeNet or TF1G (2 - 9,999,999,999) --min-bit=MINBIT Minimum bit level of TF assignments to get from PrimeNet or TF1G --max-bit=MAXBIT Maximum bit level of TF assignments to get from PrimeNet or TF1G --force-target-bits Perform a depth first factor search by forcing TF assignments to factor to the target bit level (as listed on mersenne.ca) -m, --mlucas Get assignments for Mlucas. -g, --gpuowl Get assignments for GpuOwl. --prpll Get assignments for PRPLL. This is experimental and for testing only. PRPLL is not PrimeNet server compatible and thus is not yet fully supported. --cudalucas Get assignments for CUDALucas. --mfaktc Get assignments for mfaktc. --mfakto Get assignments for mfakto. --num-workers=NUMWORKERS Number of workers (CPU Cores/GPUs), Default: 1 -n NUMCACHE, --num-cache=NUMCACHE Number of assignments to cache, Default: 0. Deprecated in favor of the --days-work option. -W DAYSOFWORK, --days-work=DAYSOFWORK Days of work to queue ((0-180] days), Default: 1 day for mfaktc/mfakto or 3 days otherwise. Increases numcache when the time left for all assignments is less than this number of days. --force-pminus1=TESTSSAVED Force P-1 factoring before LL/PRP tests and/or change the default PrimeNet PRP and P-1 testssaved value. --pminus1-threshold=PM1MULTIPLIER Retry the P-1 factoring before LL/PRP tests only if the existing P-1 bounds are less than the target bounds (as listed on mersenne.ca) times this threshold/multiplier. Requires the --force-pminus1 option. --force-pminus1-bounds=PM1BOUNDS Force using the 'MIN', 'MID' or 'MAX' optimal P-1 bounds (as listed on mersenne.ca) for P-1 tests. For Mlucas, this will rewrite Pfactor= assignments to Pminus1=. For GpuOwl, this will use a nonstandard Pfactor= format to add the bounds. Can be used in combination with the --force-pminus1 option. --convert-ll-to-prp Convert all LL assignments to PRP. This is for use when registering assignments. --convert-prp-to-ll Convert all PRP assignments to LL. This is automatically enabled for first time PRP assignments when the --workpref option is for a first time LL worktype. --no-report-100m Do not report any prime results for exponents greater than or equal to 100 million digits. You must setup another method to notify yourself, such as setting the notification options below. --report-100m --checkin=HOURSBETWEENCHECKINS Hours to wait between sending assignment progress and expected completion dates (1-168 hours), Default: 1 hours. -t TIMEOUT, --timeout=TIMEOUT Seconds to wait between updates, Default: 3600 seconds (1 hour). Use 0 to update once and exit. -s, --status Output a status report and any expected completion dates for all assignments and exit. --report-results Report assignment results and exit. Requires PrimeNet User ID. --upload-proofs Report assignment results, upload all PRP proofs and exit. Requires PrimeNet User ID. --recover Report assignment results, recover all assignments and exit. This will overwrite any existing work files. --recover-all The same as --recover, except for PrimeNet it will additionally recover expired assignments and for mersenne.ca it will recover all assignments for all systems/workers to the first worker. This will overwrite any existing work files. --register-exponents Prompt for all parameters needed to register one or more specific exponents and exit. --unreserve=EXPONENT Unreserve the exponent and exit. Use this only if you are sure you will not be finishing this exponent. --unreserve-all Report assignment results, unreserve all assignments and exit. --no-more-work Prevent this program from getting new assignments and exit. --resume-work Resume getting new assignments after having previously run the --no-more-work option and exit. --ping Ping the PrimeNet server, show version information and exit. --v6 Use the experimental PrimeNet v6 API. Currently only works with the --ping option. --no-version-check Disable the automatic AutoPrimeNet and GIMPS program version check --version-check --version-check-channel=VERSIONCHECK_CHANNEL Prefer the 'alpha', 'beta' or 'stable' channel/branch when checking for new versions of AutoPrimeNet and the GIMPS program. Not all programs provide alpha or beta releases. Default: 'stable' --no-watch Report assignment results and upload proof files on the --timeout interval instead of immediately. This may be needed if the filesystem is unsupported. --watch --no-color Do not use color in output. --color --setup Prompt for all the options that are needed to setup this program and exit.

Registering Options: Sent to PrimeNet/GIMPS when registering. It will automatically send the progress, which allows the program to then be monitored on the GIMPS website CPUs page (https://www.mersenne.org/cpus/), just like with Prime95/MPrime. This also allows the program to get much smaller Category 0 and 1 exponents, if it meets the other requirements (https://www.mersenne.org/thresholds/). AutoPrimeNet should automatically detect most of this system information. When using the --setup option and a GPU based GIMPS program, it can optionally report the GPU instead of the CPU.

-H COMPUTER_ID, --hostname=COMPUTER_ID
                    Optional computer name, Default: example
--cpu-model=CPU_BRAND
                    Processor (CPU) model, Default: cpu.unknown
--features=CPU_FEATURES
                    CPU features, Default: ''
--frequency=CPU_SPEED
                    CPU frequency/speed (MHz), Default: 1000 MHz
--memory=MEMORY     Total physical memory (RAM) (MiB), Default: 1024 MiB
--max-memory=DAY_NIGHT_MEMORY
                    Configured day/night P-1 stage 2 memory (MiB),
                    Default: 921 MiB (90% of physical memory). Required
                    for P-1 assignments.
--max-disk-space=WORKER_DISK_SPACE
                    Configured disk space limit per worker to store the
                    proof interim residues files for PRP tests
                    (GiB/worker), Default: 0.0 GiB/worker. Use 0 to not
                    send.
--l1=CPU_L1_CACHE_SIZE
                    L1 Data Cache size (KiB), Default: 8 KiB
--l2=CPU_L2_CACHE_SIZE
                    L2 Cache size (KiB), Default: 512 KiB
--l3=CPU_L3_CACHE_SIZE
                    L3 Cache size (KiB), Default: 0 KiB
--cores=NUM_CORES   Number of physical CPU cores, Default: 1
--hyperthreads=CPU_HYPERTHREADS
                    Number of CPU threads per core (0 is unknown),
                    Default: 0. Choose 1 for non-hyperthreaded and 2 or
                    more for hyperthreaded.
--hours=CPU_HOURS   Hours per day you expect the GIMPS program will run (1
                    - 24), Default: 24 hours. Used to give better
                    estimated completion dates.

Notification Options: Optionally configure this program to automatically send an e-mail/text message notification if there is an error, if the GIMPS program has stalled, if the available disk space is low, if it found a new Mersenne prime or if there is a new version of the GIMPS program. Send text messages by using your mobile providers e-mail to SMS or MMS gateway. Use the --test-email option to verify the configuration. When using the --setup option, it will automatically lookup the configuration.

--to=TOEMAILS       To e-mail address. Use multiple times for multiple
                    To/recipient e-mail addresses. Defaults to the --from
                    value if not provided.
-f FROMEMAIL, --from=FROMEMAIL
                    From e-mail address
-S SMTP, --smtp=SMTP
                    SMTP server. Optionally include a port with the
                    'hostname:port' syntax. Defaults to port 465 with
                    --tls and port 25 otherwise.
--tls               Use a secure connection with SSL/TLS
--no-tls
--starttls          Upgrade to a secure connection with StartTLS
--no-starttls
-U EMAIL_USERNAME, --email-username=EMAIL_USERNAME
                    SMTP server username
-P EMAIL_PASSWORD, --email-password=EMAIL_PASSWORD
                    SMTP server password
--test-email        Send a test e-mail message and exit

```

Contributing

Pull requests welcome! Ideas for contributions:

  • Support more GIMPS programs.
  • Support FreeBSD and Android.
    • ⭐ Help wanted
  • Support setting more of the program options.
  • Improve the error handling of PrimeNet API calls.
  • Improve the performance.
  • Support reporting interim residues.
  • Localize the program and translate the output into other languages (see here).
  • Adapt Loïc Le Loarer's test suite.
  • Add an optional GUI using Tk and the tkinter library
  • Add docstrings to all functions
  • Add an option to show debugging information
  • Support submitting P-1 results for Fermat numbers

Thanks to Daniel Connelly for updating the PrimeNet Python script from Mlucas to eliminate the password requirement by getting assignments using the PrimeNet API and to support reporting the assignment results and progress for CUDALucas using the PrimeNet API!

Thanks to Isaac Terrell for providing the needed PRP proof files to test the proof file uploading feature.

Thanks to Tyler Busby for updating AutoPrimeNet to support mfaktc/mfakto and getting assignments and reporting results to mersenne.ca for exponents above the PrimeNet limit of 1G.

Owner

  • Name: Teal Dulcet
  • Login: tdulcet
  • Kind: user
  • Location: Portland, Oregon

👨‍💻 Computer Scientist, BS, CRTGR, MS @Thunderbird Council member

Citation (CITATION.cff)

cff-version: 1.2.0
title: AutoPrimeNet
message: >-
  If you use this software, please cite it using the
  metadata from this file.
type: software
authors:
  - given-names: Teal
    family-names: Dulcet
    affiliation: Portland State University
    orcid: 'https://orcid.org/0009-0008-6616-2631'
repository-code: 'https://github.com/tdulcet/AutoPrimeNet'
url: 'https://download.mersenne.ca/AutoPrimeNet/'
abstract: >-
  The AutoPrimeNet automated assignment handler program for
  the Great Internet Mersenne Prime Search (GIMPS).
license: GPL-3.0

GitHub Events

Total
  • Create event: 3
  • Issues event: 7
  • Watch event: 16
  • Delete event: 1
  • Issue comment event: 15
  • Member event: 2
  • Push event: 105
  • Pull request review comment event: 1
  • Pull request review event: 7
  • Pull request event: 13
  • Fork event: 4
Last Year
  • Create event: 3
  • Issues event: 7
  • Watch event: 16
  • Delete event: 1
  • Issue comment event: 15
  • Member event: 2
  • Push event: 105
  • Pull request review comment event: 1
  • Pull request review event: 7
  • Pull request event: 13
  • Fork event: 4

Committers

Last synced: 10 months ago

All Time
  • Total Commits: 29
  • Total Committers: 4
  • Avg Commits per committer: 7.25
  • Development Distribution Score (DDS): 0.172
Past Year
  • Commits: 29
  • Committers: 4
  • Avg Commits per committer: 7.25
  • Development Distribution Score (DDS): 0.172
Top Committers
Name Email Commits
Teal Dulcet t****t@p****u 24
Valerii Huhnin 3****k 3
jcoxdco 6****o 1
brubsby 5****y 1
Committer Domains (Top 20 + Academic)
pdx.edu: 1

Issues and Pull Requests

Last synced: 7 months ago

All Time
  • Total issues: 4
  • Total pull requests: 15
  • Average time to close issues: 28 days
  • Average time to close pull requests: 11 days
  • Total issue authors: 3
  • Total pull request authors: 4
  • Average comments per issue: 2.0
  • Average comments per pull request: 1.6
  • Merged pull requests: 10
  • Bot issues: 0
  • Bot pull requests: 1
Past Year
  • Issues: 4
  • Pull requests: 15
  • Average time to close issues: 28 days
  • Average time to close pull requests: 11 days
  • Issue authors: 3
  • Pull request authors: 4
  • Average comments per issue: 2.0
  • Average comments per pull request: 1.6
  • Merged pull requests: 10
  • Bot issues: 0
  • Bot pull requests: 1
Top Authors
Issue Authors
  • olympichek (2)
  • JamesHeinrich (1)
  • jcoxdco (1)
Pull Request Authors
  • olympichek (7)
  • brubsby (4)
  • jcoxdco (4)
  • dependabot[bot] (1)
Top Labels
Issue Labels
Pull Request Labels
enhancement (6) duplicate (1) bug (1) dependencies (1) github_actions (1)

Dependencies

.github/workflows/cd.yml actions
  • actions/checkout v4 composite
  • actions/download-artifact v4 composite
  • actions/setup-python v5 composite
  • actions/upload-artifact v4 composite
.github/workflows/ci.yml actions
  • actions/checkout v4 composite
pyproject.toml pypi