mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > PrimeNet

Reply
 
Thread Tools
Old 2021-03-08, 05:55   #1
danc2
 
Dec 2019

22×32 Posts
Default Newest PrimeNet interaction python program

Hello fellow Crunchers,
Cruncher Teal Dulcet (@tdulcet) and I (@danc2) have been working to expedite the computation of prime numbers. As a part of a separate project, we decided to debug, optimize, and add features to the existing PrimeNet Python script that exists to interact with the GIMPS project's V5 API. Please feel free to use, give feedback, and contribute to the project. Below are an unordered list of features. You may download the newest PrimeNet at this link.

Features
  • Builds on Loïc Le Loarer’s PrimeNet script with support for completely using the PrimeNet API.
  • Uses the PrimeNet API to get assignments if registered, which eliminates the password requirement and allows for the program to get much smaller Category 0 and 1 exponents, if it meets the other requirements (https://www.mersenne.org/thresholds/).
  • Improved error handling of the PrimeNet API calls.
  • Automatically detects the CPU model for the --cpu_model option.
  • Automatically registers the computer with PrimeNet if the user does NOT provide a password, which eliminates the -r/--register option.
  • Added a new --status option to output a status report and any expected completion dates for all assignments, similar to Prime95/MPrime. Includes the probability that each assignment is prime and the approximate number of decimal digits.
  • Added a new --unreserve_all option to unreserve all assignments in the worktodo file using the PrimeNet API.
  • Added many other new options, including -i/--workfile, -r/--resultsfile, -l/--localfile, --num_workers, -c/--cpu_num and -L/--days_work (replaces -L/--percent_limit). Run the --help option for more information about these new options.
  • Sends the FFT length when reporting assignment progress so the user can get partial CPU credit.
  • Outputs more debug messages when using the -d/--debug option. Debug messages now include the date and time. Output is much more consistent with Prime95/MPrime.
  • Outputs dates and numbers in locale format.
  • Outputs a message and bell sound before reporting prime results, similar to Prime95/MPrime.
  • Numerous bug fixes and performance improvements. Fixed many linting issues. Simplified script by using more Python modules. Removed lots of duplicate code. Updated all regular expressions to be more robust. Code formatted with autopep8.
  • When registering, it correctly sets the “application version string” on Windows and macOS and on 32-bit systems.
  • Uses the PRPDC= prefix for PRP DC assignments (the 151 worktype) as Prime95/MPrime does, so it can differentiate PRP and PRP DC tests after they have been written to the worktodo file.
  • Supports the 160 and 161 worktypes if/when Mlucas or GpuOwl supports them.
  • Support for getting the 4 P-1 factoring worktype if/when Mlucas supports it.
  • Preliminary support for getting the 200 proof certification worktype if/when Mlucas or GpuOwl supports it.
  • Complete CUDALucas support using a new -g/--gpu option. Easily extensible to support more GIMPS programs, such as GpuOwl.
  • Still supports Python 2.6 to 3.10. Supports Windows, macOS and Linux. Still supports Mlucas v19 and v18 (highly recommend that people use v19, as v18 does not output prime results to the results file).
  • Drop in replacement for any already setup instances of Loïc Le Loarer’s PrimeNet script.
  • The Mlucas and CUDALucas Linux scripts (1, 2) automatically download, setup and run it, including automatically setting most of the register options with the computer's system info.
danc2 is offline   Reply With Quote
Old 2021-04-14, 20:50   #2
Mark Rose
 
Mark Rose's Avatar
 
"/X\(‘-‘)/X\"
Jan 2013
https://pedan.tech/

3,203 Posts
Default

Nice! Will you be adding GPU72 support?
Mark Rose is offline   Reply With Quote
Old 2021-04-15, 09:26   #3
tdulcet
 
tdulcet's Avatar
 
"Teal Dulcet"
Jun 2018
Computer Scientist

3·43 Posts
Default

Quote:
Originally Posted by Mark Rose View Post
Nice! Will you be adding GPU72 support?
No, it is primarily for primality testing. We are currently working on adding support for GpuOwl. However, if anyone wanted to add support for GPU72 and trial factoring, we would definitely accept a pull request.
tdulcet is offline   Reply With Quote
Old 2021-09-01, 14:17   #4
tdulcet
 
tdulcet's Avatar
 
"Teal Dulcet"
Jun 2018
Computer Scientist

3·43 Posts
Default Updated PrimeNet script

Since Daniel's update above almost six months ago, I have added several new features to our PrimeNet script:
  • Added new --no_more_work option to prevent the script from getting new assignments, but still allow it to report any results. Requested by @ewmayer here.
  • Added new --min_exp and --max_exp options so users can reserve exponents in a range. Supports both the v5 API and manual assignments. Useful for users who want to test exponents outside of the current wavefront. Requested by @danc2 here.
  • Added new --hours option, which sets the hours per day parameter when registering the system with PrimeNet and is also used for calculating the estimated completion dates. Previously this parameter was hardcoded to 24 hours.
  • Added new --L3 option, which sets the optional L3 cache size parameter when registering the system with PrimeNet.
  • Added support for the PFactor= (capital F) and Pfactor= assignment formats used by Mlucas v20 and GpuOwl v6. Added support for the PMinus1= (capital M) and Pminus1= assignment formats used by Mlucas v20. The script will also now ignore any lines in the worktodo file that it is not able to parse.
  • Added support for reporting P-1 assignment progress for Mlucas v20. Added support for reporting P-1 results, including for standalone assignments and when done before an LL/PRP test, for Mlucas v20.
  • Added support for reporting LL/PRP and P-1 assignment progress for GpuOwl. Added support for reporting LL/PRP and P-1 results (including standalone assignments, when done before an LL/PRP test and when combined with a PRP test) for GpuOwl. Added new -g/--gpuowl option for GpuOwl and --cudalucas option (replaces -g/--gpu) for CUDALucas. Adding PRP proof upload support is now the last piece remaining for complete GpuOwl support.
  • Added support for the 155 worktype (double-check using PRP with proof) for GpuOwl and Mlucas if/when it supports PRP proofs.
  • Worked with @Prime95 to support using Mlucas v20 and greater, GpuOwl and CUDALucas in the application version string when registering with PrimeNet.
  • Updated the -L/--days_work option to -W/--days_work and the --status option to -s/--status.
  • The worktype, nw, days_work, hostname, frequency, np, hp, guid config file variables were all renamed to WorkPreference, WorkerThreads, DaysOfWork, ComputerID, CpuSpeed, NumCPUs, CpuNumHyperthreads, ComputerGUID respectively for consistency with Prime95/MPrime.
  • It now stores the Hardware GUID in a HardwareGUID variable in the config file when first registering, similar to Prime95/MPrime. Needed for users who switch computers, so they do not get an error from the PrimeNet server that the GUID does not match.
  • Users can now set a SilentVictory variable in the config file to disable the sound when a new prime is found, similar to Prime95/MPrime. It will also now make the sound indefinitely in a separate thread if a new Prime is found, similar to Prime95/MPrime, instead of just three times.
  • Implemented many of the necessary changes to eventually support reserving individual assignments using the register assignment endpoint of the v5 API. Added support for parsing assignments in the worktodo file with N/A, n/a or 0 for the assignment ID and assignments with no ID at all.
  • Implemented many of the necessary changes to eventually support unreserving individual assignments in the worktodo file with an --unreserve option. Users can always use --unreserve_all to unreserve all assignments.
  • Worked around a bug in Mlucas v19.0/19.1 where the residues in the results file were not zero padded/filled. See here for more information.
  • Added this feature for those who need it.
  • Many other minor fixes and improvements. The script will now retry to submit results in more cases. All errors are now output without the need for the -d/--debug option, so the script will not silently fail.
Run the -h/--help option for more information about many of these new features. Feedback is welcome! @ewmayer wrote some very good documentation on how to use the script on the bottom of this page. While his documentation is for Mlucas, most of it also applies to GpuOwl and CUDALucas.

If anyone would like to contribute, there is a list of ideas here.
tdulcet is offline   Reply With Quote
Old 2022-05-22, 15:39   #5
tdulcet
 
tdulcet's Avatar
 
"Teal Dulcet"
Jun 2018
Computer Scientist

3×43 Posts
Default

Since my last update above almost nine months ago, I have added several new features to our PrimeNet script:
  • Added PRP proof uploading support. It will automatically upload any PRP proof files every hour by default in a background thread. Like with Prime95/MPrime, this can be disabled by setting a ProofUploads=0 option in the config file. Unlike the script included with GpuOwl, it will automatically delete the proof files after upload. This can be changed by using the --archive_proofs option to specify a directory to archive the proof files to after upload. Users can also use the --upload_proofs option to manually upload any PRP proof files. Thanks to @techn1ciaN for providing the needed PRP proof files so I could finish and test my proof uploading implementation. Our PrimeNet script now fully supports GpuOwl. Compared to the upload script included with GpuOwl, my implementation has these advantages (see here for more details):
    • Much more error checking, similar to Prime95/MPrime.
    • Requires significantly less memory (RAM), as it only reads one 5 MiB chunk into memory at a time, instead of the entire proof file.
    • Only uploads the requested sections of the file, in case it fails and is resumed.
    • Securely uploads the proof files with HTTPS.
    • Automatically deletes the proof files after upload by default to save disk space.
    • Saves the PrimeNet User ID and optional proof archive directory to the config file, so they only need to be provided once.
    • Supports both Python 2 and 3. (Python 3 is recommended.)
    • Proof uploading functionality is ingratiated into the main primenet.py script, instead of a separate upload.py script.
  • Added a new -D/--dir option, similar to the --dirs option in the script included with GpuOwl, so that users will only need to run a single copy of the script for multiple instances/workers. This reduces RAM usage by only having a single copy of the script running and ensures that only one proof file is uploaded at a time. This also automatically sets the -c/--cpu_num option.
  • Rewrote the logging functionality so that all output will follow a constant format and be prefixed by the thread name and current date/time, similar to Prime95/MPrime. Before there was only the -d/--debug option and without it, users got almost no output except errors. Now users will get minimal output by default and they can provide the -d/--debug option up to two times to get output that is more verbose.
  • Changed the keys in the config file to be case sensitive at the request of @ewmayer, so Mlucas and the PrimeNet script could share a config file. This unfortunately breaks backwards compatibility with previous versions of the PrimeNet script. The NumCPUs config file variable was also renamed to NumCores for consistency with Prime95/MPrime 30.7.
  • Added support for the 154 worktype (smallest available first-time PRP that needs P-1 factoring) for Mlucas and GpuOwl.
  • Improved ETA calculation by considering the difference between exponents when estimating the speed per iteration for future assignments in the worktodo file. It also now uses the correct number of iterations for PRP tests. Thanks to @kriesel for helping to determine correct primality test speed scaling algorithm/formula.
  • Updated script to reuse HTTP connections with the PrimeNet API to improve performance. Connections will also now timeout after 3 minutes (same as Prime95/MPrime).
  • Added support for submitting results without an assignment ID.
  • It will no longer make a sound when a known Mersenne prime is found.
  • Improved assignment parsing to accept floating-point numbers. This is needed for P-1 assignments, which now return 1.3 tests saved instead of 2 (see here for more information).
  • Many other minor fixes and improvements. The PrimeNet User ID now defaults to ANONYMOUS. It will now exit with an error for unexpected arguments instead of silently ignoring them. The Unix shebang now uses Python 3. Added docstrings to all functions.
Run the -h/--help option for more information about many of these new features. Feedback is welcome!

If anyone would like to contribute, there is a list of ideas here.
tdulcet is offline   Reply With Quote
Old 2023-05-13, 14:01   #6
tdulcet
 
tdulcet's Avatar
 
"Teal Dulcet"
Jun 2018
Computer Scientist

3·43 Posts
Smile Official version 1.0 release

As can be seen from this very long post, a lot has happened since my last update above almost a year ago. I now consider our PrimeNet script to be feature complete, so I thought it would be a good opportunity to officially announce the version 1.0 release. Going forward I will increment this version number whenever I make any additional fixes or improvements. Users can of course use the --version option at any time to output their current version. I will also try to avoid any more backwards incompatible changes if possible, except for consistency in cases where Prime95/MPrime is making a change. Our PrimeNet script does not support the "Benchmark Data Statistics" (bd) endpoint, as I presume @Prime95 does not want users submitting benchmarks for GIMPS programs other than Prime95/MPrime, but our script now fully supports all eight other endpoints of the PrimeNet v5 API, including 2½ additional ones since my last update.

Here are the notable changes to our PrimeNet script since my last update, which are now all included in this version 1.0 release:
  • Many of the new features below first required a significant refactoring of how our PrimeNet script was designed, so I needed to rewrite most of it from scratch. It will now only read the worktodo file once per update interval (the -t/--timeout value) instead of up to three times, which should result in a performance improvement, especially for large worktodo files. It also now supports writing out the full worktodo file when needed, instead of just appending new assignments to the end.
  • Added support for automatically detecting the CPU frequency/speed, total physical memory (RAM) and number of CPU cores/threads on Windows, macOS and Linux. This will automatically set the --frequency, -m/--memory, --np and --hp options respectively and set the respective parameters when registering the system with PrimeNet. Note that the CPU frequency is not provided on all Linux systems.
  • Fixed the existing code to detect the CPU model on Windows and macOS for the --cpu-model option. On Windows it previously included extraneous information with the model name and on macOS it looks like this hit an exception and never worked correctly (I have never had access to a Mac system to test this myself). It will also now identify as "Mac OS X" on macOS instead of as "Darwin", for consistency with Prime95. I would greatly appreciate if someone with a macOS system could confirm that this all now works as expected.
  • Added support for a worktodo.add file. This works the same as with Prime95/MPrime. Before the script reads the regular worktodo file, it will check for a worktodo.add file. If present, it first will copy the contents to the end of regular worktodo file and then remove the worktodo.add file.
  • Added support reserving individual assignments using the register assignment (ra) endpoint of the v5 API. This is mainly for users of the strategic double checks thread, but can be used by anyone who wants to test exponents above the respective wavefronts. This works the same as with Prime95/MPrime. Just add one or more assignments without an assignment ID (AID) into the worktodo file and the script will automatically attempt to register them. If successfully, it will update the assignment with the new AID, otherwise it will just put N/A for the AID.
  • Added support for unreserving individual assignments in the worktodo file with a new --unreserve option. It will automatically delete all assignments with the same assignment ID from the worktodo file to handle the assignment spiting that is done by some versions of Mlucas and GpuOwl. I also updated the existing --unreserve-all option to automatically delete any successfully unreserved assignments from the worktodo file.
  • Added a new --force-pminus1 option. This allows the user to force P-1 factoring before LL/PRP tests and/or change the default PrimeNet PRP tests_saved value. For example, users with lots of RAM could use --force-pminus1=2.0 to force P-1 factoring before all LL/PRP tests and change the default PRP tests_saved value from 1.3 to the previous default of 2.0. Users with very little RAM could instead use --force-pminus1=0 to disable P-1 testing before all LL/PRP tests. (Note that the actual tests_saved value is not currently used by any version of Mlucas or GpuOwl, it is only used as a binary property, so --force-pminus1=1 would produce the same bounds as --force-pminus1=100. @ewmayer has previously said that a future version of Mlucas will use the actual value.)
  • Added a new --pminus1-threshold option. This allows the user to retry P-1 factoring before LL/PRP tests only if the existing P-1 B2 bounds are less than the target B2 bounds (as listed on mersenne.ca) times this threshold/multiplier. This requires the --force-pminus1 option. For example, users with lots of RAM could use --force-pminus1=2.0 and --pminus1-threshold=1.0 to force P-1 factoring before LL/PRP tests whenever the existing bounds are less than the target bounds. With lots of RAM, these users could potentially do bounds significantly higher than those target bounds (depending on how they configured Mlucas or GpuOwl), so it might make since for them to redo the P-1 factoring when it was previously only done to low bounds, as they would still have a high probability of finding a factor. Huge thanks to @James Heinrich for adding a new API to allow the script to determine the existing P-1 bounds and for providing a copy of the PHP code his mersenne.ca website uses to determine those target bounds for each exponent. James's code was adapted and ported from C++ and Python code written by @preda for GpuOwl, which was also adapted and ported to C by @Prime95 for Prime95/MPrime. I adapted @preda's Python version, but backported @James Heinrich's changes. I also integrated some select improvements from @preda's C++ version, as well as @Prime95's C port (his pm1prob.cpp file). Thanks to @preda for writing this code and to @James Heinrich and @Prime95 for their improvements.
  • Added a new --recover-all option to recover all assignments from the PrimeNet server. This is useful when the worktodo file gets accidentally deleted or corrupted. This will also automatically apply any changes to the assignments, including those performed by the new --force-pminus1 and --pminus1-threshold options above, the same as when the assignments were originally received. Note that this will overwrite any existing worktodo files, including any unregistered assignments. Assignment recovery is now is one of the few PrimeNet v5 API features that our script supports that Prime95/MPrime itself does not. Huge thanks to @Prime95 for fixing a few PrimeNet API bugs so that this functionality works as expected.
  • Added a new --max-memory option. This sets the configured day/night P-1 stage 2 memory values that are sent to the PrimeNet server. Previously this was hard coded to 90% of the value of the -m/--memory option, which is now the default. The assignments rules require that this value be at least 1024 MiB (1 GiB) to get P-1 assignments. Neither Mlucas nor GpuOwl support using different amounts of memory in the daytime vs the nighttime like Prime95/MPrime does, so this option is used to set both the day and night parameters.
  • Added a new --ping option to ping the PrimeNet server using the ping server (ps) endpoint of the v5 API.
  • Updated to use wheel factorization to verify that exponents are prime, which is approximately three times faster than the previous brute force implementation. I first tried using the first two primes (2 and 3) and later changed it to use the first three primes (2, 3 and 5), which provided the best balance of performance and complexity.
  • Significantly improved the error handling of PrimeNet API calls. It now catches and handles more exceptions, including timeouts. It also now verifies that the pnErrorResult and pnErrorDetail values are always in the response from the PrimeNet server as expected.
  • Added a check if the respective log/output file was modified since the last progress update. It will now output a debug message if it was not, but eventually it should be able to skip sending the progress update entirely. This would prevent the script from repeatedly sending the same progress update and thus allow the user to be notified when their GIMPS program crashes or otherwise stops making progress.
  • For P-1 results, added a sanity check that any found factors actually divide the exponent. It will output a warning if it does not.
  • Unnecessary default values will not be automatically added to the config file for several options, including --min-exp, --max-exp and -g/--gpuowl.
  • Changed the cpu_model and features config file options to CpuBrand (same as Prime95/MPrime) and cpu_features respectively.
  • Replaced the underscores in some of the long options with standard dashes, which are what is used by almost all other command line programs. Specifically, the --archive_proofs, --min_exp, --max_exp, --num_workers, --cpu_num, --num_cache, --days_work, --upload_proofs, --unreserve_all, --no_more_work and --cpu_model options are now --archive-proofs, --min-exp, --max-exp, --num-worker, --cpu-num, --num-cache, --days-work, --upload-proofs, --unreserve-all, --no-more-work and --cpu-model respectively.
  • Restored support for reporting assignment progress when no stat/log/output files exist. This is required to prevent assignments from expiring in some cases after the first time the script is run after it is setup. I previously disabled this, as it just sets the estimated completion time to an arbitrary 7 days and I thought it would be better for it to just wait until the next update interval when it would be able to calculate an actual estimate. However, this violates the PrimeNet API, which requires immediately acknowledging the receipt of assignments to prevent them from expiring. The official documentation says assignments will "expire within several minutes", but in practice this seems to be after 24 hours.
  • After getting one or more new assignments, it will no longer redo the progress update for all of the assignments in the worktodo file. Instead, it will just report the progress for those newly obtained assignments, which is required to acknowledge receipt and prevent them from expiring.
  • Added support for a MaxExponents config file option to limit the maximum number of assignments, which defaults to 15 for consistency with Prime95/MPrime. This is mainly as a safety measure, to prevent the script from accidentally getting too many assignments. (Our script does not and will never automatically unreserve any assignments.)
  • Added support for using a RollingAverage config file option when calculating the estimated completion dates. This is also sets the rolling average parameter when registering the system with PrimeNet. It does not yet support automatically calculating the rolling average like Prime95/MPrime.
  • Setup a continuous integration (CI) system to automatically test the script on Windows, macOS and Linux after every change. Our script does not yet have a test suite (help wanted!), so this does not yet test all the functionality, but it does test that this new system information detection works as expected on each platform, since this is our only platform specific code.
  • Setup this CI system to also automatically run the Pylint and Ruff Python linters after every change, which will help maintain high quality and readable code.
  • Many other minor fixes and improvements. Added sanity checking for the --days-work and --hours options. The -d/--debug option will no longer output the function name with each log statement, unless the option is provided at least twice (e.g. -dd). Removed duplicate/redundant debug logging.

Run the -h/--help option for more information about many of these new features. Feedback is welcome!

For some context on what it took to get to version 1.0, the original PrimeNet script by @ewmayer et al. was 481 lines of code (LoC). Another similar version by @preda et al., which also supports PRP proof uploading, is 272 LoC (across two files). The updated version by Loïc Le Loarer in 2020, which added partial PrimeNet API support, was 919 LoC. The initial release by @danc2 and I at the top of this thread in 2021 was 1,716 LoC. This version 1.0 release is now 3,015 LoC, over six times larger than that original version and over 11 times larger than @perda's variant. LoC can be a bad metric for comparing code, because more does not necessarily mean better, but this this case our version 1.0 PrimeNet script has significantly more functionality then those previous versions, including full support for three GIMPS programs (Mlucas, GpuOwl and CUDALucas). I have actually have gone to great lengths to reduce the LoC as much as possible, so that our script can still be easily reviewed by users before they run it. Hopefully our script can now replace all those previous versions, so that there can be just a single PrimeNet script going forwards.

Thank you to everyone who has tested and provided feedback on the many previous versions of our script, which has enabled us to get to this point.
tdulcet is offline   Reply With Quote
Old 2023-05-30, 15:55   #7
tdulcet
 
tdulcet's Avatar
 
"Teal Dulcet"
Jun 2018
Computer Scientist

3×43 Posts
Default Version 1.0.1 release

It has only been a couple of weeks since the official version 1.0 release, but I am now releasing a version 1.0.1 update with some changes requested by @Madpoo to help make the PrimeNet administrators lives easier. Users are encouraged to upgrade at their earliest convenience.

Here are the notable changes to our PrimeNet script:
  • The Python and script versions are now both included in the "application version string" when registering with the PrimeNet server. The format of this string is now platform,program/code,program version;script interpreter version,script version. For example, with GpuOwl on Linux the resulting string could look like this: Linux64,GpuOwl,v7.2.1;Python 3.10.6,primenet.py 1.0.1. This should make it easy in the future for users to quickly see on the mersenne.org CPU page which of their systems they might need to upgrade the script on. This will also be helpful for us to determine which versions of Python our script still needs to support.
  • The Python and script versions are now both included in each JSON result that is submitted to the server. This was requested by @Madpoo. Specifically it will add a new "script" key to the result with an object with the "name", "version", "interpreter", "interpreter-verison" keys. For example, it might look like this: "script":{"name":"primenet.py", "version":"1.0.1", "interpreter":"Python", "interpreter-verison":"3.10.6"}.
  • Results for CUDALucas will now be submitted to the server in JSON format. This was requested by @Madpoo. CUDALucas of course does not natively output JSON results, but our script has always converted the raw results into JSON format for internal use. It will now submit this JSON formatted version instead of the raw result line. In addition, these JSON results will include a new "result" key with the raw result line as a backup.
  • Added new --convert-ll-to-prp and --convert-prp-to-ll options to convert all LL assignments to PRP and all PRP assignments to LL respectively. The former is mainly for users of the strategic double checks thread when registering assignments to work around a PrimeNet server limitation. Both of these options should be used with care, as they may have undesired consequences like changing DC assignments. In general, it is of course best to change ones work preference with the --worktype option if possible instead of using these new options.
  • Added support for updating assignments after registering them with the register assignment (ra) endpoint. This is specifically to support the new --convert-ll-to-prp option for registered assignments, but also enables other existing options including --force-pminus1 and --pminus1-threshold.
  • Added sanity checking for the --max-memory option to make sure it is less than or equal to the -m/--memory option.
  • Added a backup notification when submitting prime PRP and LL results. I have had a fear (probably irrational) that we are going to find the next Mersenne prime, but will never know due to some bug with the PrimeNet server and/or our script. This adds a simple backup notification to hopefully help alleviate that fear.
  • Changed the name of the PRP proof uploading thread that is shown is log messages to UploadProofs. This is mainly for Python 3.10+ users, as Python changed the default thread name from Thread-N (where N is an incrementing decimal number) to include the function name, which made it excessively long.

Run the -h/--help option for more information about many of these new features. Feedback is welcome!

Note that the next major version of our script (version 2.0) is most likely going to drop support for Python 2.6 - 3.2, as well as support for doing manual testing with the --password option. This version will probably not be released for a while, but please do let us know before then if you still need support for these older Python versions and/or for doing manual testing.

We occasionally are asked the easiest way to initially download and update our script, so I thought I should provide brief instructions here:
  1. Install Python: macOS and Linux should already include Python. Windows users can install it from python.org.
  2. Download our script: Recent versions of Windows, macOS and Linux should include the curl command. To download the latest version of our script, just run this from your terminal in the directory where you want to save the primenet.py file:
    Code:
    curl -sSLO https://raw.github.com/tdulcet/Distributed-Computing-Scripts/master/primenet.py
    It will automatically update any existing version of our script. Alternatively, you could open that link in your browser to download it from there.
  3. Run our script: Just run: python3 primenet.py --help to verify that everything works. Windows users may need to use python or py instead of python3.
tdulcet is offline   Reply With Quote
Old 2023-06-04, 07:40   #8
Mark Rose
 
Mark Rose's Avatar
 
"/X\(‘-‘)/X\"
Jan 2013
https://pedan.tech/

3,203 Posts
Default

Quote:
Originally Posted by tdulcet View Post
For example, with GpuOwl on Linux the resulting string could look like this: Linux64,GpuOwl,v7.2.1;Python 3.10.6,primenet.py 1.0.1.
Linux64 is vague. Is that arm64? x86-64? Or one of the many other 64 bit architectures Linux runs on?

mlucas runs on many architectures, for instance.

I'm sure it won't be long until someone is running GpuOwl on a RISC-V host.

Might be better to concatenate platform.system() with platform.platform().
Mark Rose is offline   Reply With Quote
Old 2023-06-04, 10:37   #9
tdulcet
 
tdulcet's Avatar
 
"Teal Dulcet"
Jun 2018
Computer Scientist

3×43 Posts
Default

Quote:
Originally Posted by Mark Rose View Post
Linux64 is vague. Is that arm64? x86-64? Or one of the many other 64 bit architectures Linux runs on?

mlucas runs on many architectures, for instance.

I'm sure it won't be long until someone is running GpuOwl on a RISC-V host.
Yes, I completely agree. Unfortunately, that part of the "application version string" is already standardized by the PrimeNet v5 API (see section 5.1.2.1 of the official documentation) and it is also what is used by Prime95/MPrime (see the generate_application_string() function in @Prime95's commonc.c file). I do not believe this could be changed without significant changes to the server.

However, @Madpoo did recently suggest including more detailed OS information in the JSON results that are submitted to the server. I am still waiting for him to make a more detailed proposal with what specifically he wants added and in what format, but I am sure the architecture could be added as well. This could then be included in my next update of our script.

Quote:
Originally Posted by Mark Rose View Post
Might be better to concatenate platform.system() with platform.platform().
This is similar to what our script already does, although platform.platform() would be too verbose for this (the string has a 64 character limit). See our generate_application_str() function for my implementation. For reference, the specific values for the platform that our script currently supports are Windows64, Windows, Mac OS X 64-bit, Mac OS X, Linux64 and Linux. Prime95/MPrime of course supports a few additional platforms such as FreeBSD that we should be able to support as well, although I would first need to know what the platform.system() function returns on those platforms, as I do not have access to any such systems and it is not documented.
tdulcet is offline   Reply With Quote
Old 2023-06-16, 13:40   #10
tdulcet
 
tdulcet's Avatar
 
"Teal Dulcet"
Jun 2018
Computer Scientist

2018 Posts
Default New Windows standalone executable and Instructions

Shortly after the version 1.0.1 announcement in post #7, we realized that the new "application version string" format was causing issues with the PrimeNet server, so unfortunately I had to revert this change. I still believe that this information would be valuable to both users and the PrimeNet administrators, so hopefully we will be able to readd it in some format in a future version of our script.

Thanks to @James Heinrich, we now have a download mirror of our script on his mersenne.ca website: https://download.mersenne.ca/primenet.py/. This will automatically update nightly with the latest version of our script. This allows users to download the latest version of our script by just clicking a link instead of having to run that curl command listed in post #7. In addition, the mirror includes basic instructions to download and setup our script at the top of the page. Feedback on the instructions is welcome!

For Windows users on x86 systems, we now also have a standalone executable that packages the latest versions of both Python and our script. Similar to @kriesel's standalone executables for @preda's legacy PrimeNet script, this allows Windows users to use our script without needing to first download, install and setup Python on each of their systems. I setup a continuous deployment (CD) system in my repository to automatically build these executables with PyInstaller and then upload them to the download mirror whenever our script is updated. The mirror also includes simple instructions to download and setup these standalone executables at the top of the page. Both x86 (32-bit) and x86-64 (64-bit) executables are available. They use the latest stable version of Python, which is currently 3.11, so they require Windows 8.1 or newer. However, if any users still need support for older versions of Windows, I could change this to use an older version of Python. For example, Python 3.8 should support Windows Vista or newer.

Huge thanks to @James Heinrich for setting up this mirror and for working with me to automate the process of uploading the Windows executables.
tdulcet is offline   Reply With Quote
Old 2023-07-07, 20:05   #11
Prime95
P90 years forever!
 
Prime95's Avatar
 
Aug 2002
Yeehaw, FL

22×2,089 Posts
Default

Thank you for this software! I've just gotten around to using it. So far no issues.

Any thoughts on how one might implement a new feature: send me an email if the GPU makes no progress since the last update. Even better might be an auto-reboot if no progress since last update.
Prime95 is online now   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange GPU interaction (bump) kladner Hardware 2 2017-02-24 21:34
PHP vs. Python vs. C (all with GMP) daxmick Programming 2 2014-02-10 01:45
Program interaction Chuck GPU Computing 6 2014-01-06 04:29
Newest idea of an idiot science_man_88 Miscellaneous Math 33 2010-04-21 16:33
Help w/ python. a216vcti Programming 7 2005-10-30 00:37

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


Sat Sep 23 11:47:52 UTC 2023 up 10 days, 9:30, 0 users, load averages: 0.84, 1.03, 1.05

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, 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.

≠ ± ∓ ÷ × · − √ ‰ ⊗ ⊕ ⊖ ⊘ ⊙ ≤ ≥ ≦ ≧ ≨ ≩ ≺ ≻ ≼ ≽ ⊏ ⊐ ⊑ ⊒ ² ³ °
∠ ∟ ° ≅ ~ ‖ ⟂ ⫛
≡ ≜ ≈ ∝ ∞ ≪ ≫ ⌊⌋ ⌈⌉ ∘ ∏ ∐ ∑ ∧ ∨ ∩ ∪ ⨀ ⊕ ⊗ 𝖕 𝖖 𝖗 ⊲ ⊳
∅ ∖ ∁ ↦ ↣ ∩ ∪ ⊆ ⊂ ⊄ ⊊ ⊇ ⊃ ⊅ ⊋ ⊖ ∈ ∉ ∋ ∌ ℕ ℤ ℚ ℝ ℂ ℵ ℶ ℷ ℸ 𝓟
¬ ∨ ∧ ⊕ → ← ⇒ ⇐ ⇔ ∀ ∃ ∄ ∴ ∵ ⊤ ⊥ ⊢ ⊨ ⫤ ⊣ … ⋯ ⋮ ⋰ ⋱
∫ ∬ ∭ ∮ ∯ ∰ ∇ ∆ δ ∂ ℱ ℒ ℓ
𝛢𝛼 𝛣𝛽 𝛤𝛾 𝛥𝛿 𝛦𝜀𝜖 𝛧𝜁 𝛨𝜂 𝛩𝜃𝜗 𝛪𝜄 𝛫𝜅 𝛬𝜆 𝛭𝜇 𝛮𝜈 𝛯𝜉 𝛰𝜊 𝛱𝜋 𝛲𝜌 𝛴𝜎𝜍 𝛵𝜏 𝛶𝜐 𝛷𝜙𝜑 𝛸𝜒 𝛹𝜓 𝛺𝜔