mersenneforum.org  

Go Back   mersenneforum.org > Prime Search Projects > Prime Gap Searches

Reply
 
Thread Tools
Old 2020-12-13, 23:06   #23
robert44444uk
 
robert44444uk's Avatar
 
Jun 2003
Oxford, UK

22·13·37 Posts
Default

Quote:
Originally Posted by SethTro View Post



The code uses gmp for numbers with < 8000 bits and pfgw for larger numbers. Sadly it's currently making one call per prime (e.g. hundreds per interval) I haven't found any easy way to make multiple calls (maybe I can write a list of all the offsets to check like Robert did in https://www.mersenneforum.org/showpo...&postcount=203 but I wasn't sure if pfgw stopped after the first prime.

.
OpenPFGW has a stop on success capability, I seem to remember

https://sourceforge.net/projects/openpfgw/

What command do I do to get openPFGW for Linux into my Ubuntu library?

Last fiddled with by robert44444uk on 2020-12-13 at 23:11
robert44444uk is offline   Reply With Quote
Old 2020-12-14, 03:29   #24
rogue
 
rogue's Avatar
 
"Mark"
Apr 2003
Between here and the

186416 Posts
Default

Quote:
Originally Posted by robert44444uk View Post
OpenPFGW has a stop on success capability, I seem to remember

https://sourceforge.net/projects/openpfgw/

What command do I do to get openPFGW for Linux into my Ubuntu library?
There is a linux build at sourceforge, but I don't know if it will run on your OS. If not, you will need to d/l the sources from source forge. You will need to build GMP and get the gwnum library. I'm not 100% certain if the makefiles will work, but I wouldn't expect them to need major changes. If you have more questions, contact me via PM.
rogue is offline   Reply With Quote
Old 2020-12-14, 09:48   #25
henryzz
Just call me Henry
 
henryzz's Avatar
 
"David"
Sep 2007
Cambridge (GMT/BST)

2·2,909 Posts
Default

Quote:
Originally Posted by rogue View Post
There is a linux build at sourceforge, but I don't know if it will run on your OS. If not, you will need to d/l the sources from source forge. You will need to build GMP and get the gwnum library. I'm not 100% certain if the makefiles will work, but I wouldn't expect them to need major changes. If you have more questions, contact me via PM.
That version worked on Ubuntu 20.04 for me
henryzz is offline   Reply With Quote
Old 2020-12-14, 13:21   #26
henryzz
Just call me Henry
 
henryzz's Avatar
 
"David"
Sep 2007
Cambridge (GMT/BST)

132728 Posts
Default

I am getting an error when I try to get the plots:

Code:
david@DESKTOP-BVMNJE2:/mnt/e/Mersenne/primegaps/sethsieve/build/prime-gap$ ./gap_test.py --unknown-filename 9973_208110_1_1999999_s100000_l1000000M.txt --no-one-side-skip --num-plots 3 --prp-top-percent 100
K = 14260 bits, 4293 digits, log(K) = 9883.75
Min Gap ~= 118604 (for merit > 12.0)

        Loaded 80726 records (112558 to 345816) from 'gaps.db'
        Min merit for record 11.39, gapsize for likely record 15.22 150448
        Loading unknowns from '9973_208110_1_1999999_s100000_l1000000M.txt'

Found 4584 (1.0%) results
        expect 878 left, 0.878% of SL=100000 after 1000000M
        0.010% of 4293 digit numbers are prime
        0.498% of tests should be prime (49.2x speedup)
        ~2x200.9 = 401.7 PRP tests per m
        sieve_length=100000 is insufficient ~1.26% of time


Starting m(456682) 1 to 1999999

Testing 456682 m where prob(record) >= 0

        Thread 0 started

^CReceived first  Ctrl+C | Waiting for current work to finish
No more work pushing NONE
Waiting on 1 of 1 results
        Thread 0 stopped
         61  879 <- unknowns ->  887    2160 <- gap -> 42062
            tests      1         (67.9 secs/test, 64.6 secs/test)  68, 65 secs
            unknowns   1766      (avg: 1766.00), 99.12% composite  49.77% <- % -> 50.23%
            prp tests  259       (avg: 129.50/side, 259.00/m) (3.816 tests/sec)
            sum(prob_minmerit):  1.7154e-06, 0.00218/day        found: 0
            sum(prob_record):    0.010897, 13.9/day     found: 0
            merit      4.472     (at m=61)
Joining work_q (should be instant)
Joining 1 processes
Done!
experimental_gap size mismatch 456682 787

R^2 for expected gap: 0.001, gap = 156430.5 + -0.765 * expected

|P(gap)| = 6996, Sum(P(gap)) = 450916.2
|P(gap)| = 48724, Sum(P(gap)) = 36292.3
gap > min_merit(12)  | sum(P) = 3923.5862
gap = record         | sum(P) = 4997.0288
Traceback (most recent call last):
  File "./gap_test.py", line 520, in <module>
    prime_gap_test(args)
  File "./gap_test.py", line 506, in prime_gap_test
    gap_test_plotting.plot_stuff(
  File "/mnt/e/Mersenne/primegaps/sethsieve/build/prime-gap/gap_test_plotting.py", line 439, in plot_stuff
    stats_plots(
  File "/mnt/e/Mersenne/primegaps/sethsieve/build/prime-gap/gap_test_plotting.py", line 312, in stats_plots
    verify_no_trend(valid_m, d)
  File "/mnt/e/Mersenne/primegaps/sethsieve/build/prime-gap/gap_test_plotting.py", line 43, in verify_no_trend
    trend, _ = np.polyfit(m_values, d, 1)
  File "<__array_function__ internals>", line 5, in polyfit
  File "/home/david/.local/lib/python3.8/site-packages/numpy/lib/polynomial.py", line 603, in polyfit
    raise TypeError("expected x and y to have same length")
TypeError: expected x and y to have same length
Am I doing something wrong? I haven't been able to work out how to call the plots without running at least 1 m and stopping the script either?


edit: What happens if you get a record or first occurrence gap below min_merit?

Last fiddled with by henryzz on 2020-12-14 at 15:03
henryzz is offline   Reply With Quote
Old 2020-12-14, 15:40   #27
SethTro
 
SethTro's Avatar
 
"Seth"
Apr 2019

111110102 Posts
Default

Quote:
Originally Posted by henryzz View Post
I am getting an error when I try to get the plots:

Am I doing something wrong? I haven't been able to work out how to call the plots without running at least 1 m and stopping the script either?

edit: What happens if you get a record or first occurrence gap below min_merit?
A couple of places in the plotting code assume that all m have been tested (AKA --prp-test-percent=100 --no-one-side-skip), I've been working on fixing that but haven't finished. I'll change it so that it prints an relevant error (e.g. "not all m are finished") or works sometimes soon.

All records are always printed even if they are below min_merit.
SethTro is offline   Reply With Quote
Old 2020-12-15, 01:01   #28
SethTro
 
SethTro's Avatar
 
"Seth"
Apr 2019

2·53 Posts
Default

Quote:
Originally Posted by henryzz View Post
I am getting an error when I try to get the plots:
Am I doing something wrong? I haven't been able to work out how to call the plots without running at least 1 m and stopping the script either?
Quote:
Originally Posted by SethTro View Post
A couple of places in the plotting code assume that all m have been tested (AKA --prp-test-percent=100 --no-one-side-skip), I've been working on fixing that but haven't finished. I'll change it so that it prints an relevant error (e.g. "not all m are finished") or works sometimes soon.

This is fixed (you'll need to git pull). Plotting works with zero, some, or all of the experimental data. If you want to not test any gaps you can pass --prp-top-percent=0

Last fiddled with by SethTro on 2020-12-15 at 01:01
SethTro is offline   Reply With Quote
Old 2020-12-15, 17:19   #29
robert44444uk
 
robert44444uk's Avatar
 
Jun 2003
Oxford, UK

22·13·37 Posts
Default

Hi Seth

Hmm, something went wrong today - I seem to have lost a key file. Can you tell me what I must do to repair or start afresh?

gap stats went well, as did the combined sieve

Code:
./gap_test.py --unknown-filename 1789_46410_5000000_5000000_s20000_l1000M.txt --prp-top-percent 5  --min-merit 18 --threads 16
K = 2511 bits, 756 digits, log(K) = 1740.29
Min Gap ~= 31602 (for merit > 18.0)

Traceback (most recent call last):
  File "./gap_test.py", line 528, in <module>
    prime_gap_test(args)
  File "./gap_test.py", line 395, in prime_gap_test
    record_gaps = gap_test_stats.load_records(conn, M_log)
  File "/home/robert4444uk/prime-gap/gap_test_stats.py", line 103, in load_records
    rv = conn.execute(
sqlite3.OperationalError: no such table: gaps
robert44444uk is offline   Reply With Quote
Old 2020-12-15, 19:08   #30
SethTro
 
SethTro's Avatar
 
"Seth"
Apr 2019

2×53 Posts
Default

Quote:
Originally Posted by robert44444uk View Post
Hi Seth

Hmm, something went wrong today - I seem to have lost a key file. Can you tell me what I must do to repair or start afresh?

gap stats went well, as did the combined sieve

Code:
./gap_test.py --unknown-filename 1789_46410_5000000_5000000_s20000_l1000M.txt --prp-top-percent 5  --min-merit 18 --threads 16
K = 2511 bits, 756 digits, log(K) = 1740.29
Min Gap ~= 31602 (for merit > 18.0)

Traceback (most recent call last):
  File "./gap_test.py", line 528, in <module>
    prime_gap_test(args)
  File "./gap_test.py", line 395, in prime_gap_test
    record_gaps = gap_test_stats.load_records(conn, M_log)
  File "/home/robert4444uk/prime-gap/gap_test_stats.py", line 103, in load_records
    rv = conn.execute(
sqlite3.OperationalError: no such table: gaps

you lost gaps.db maybe from following my update instruction maybe some other way.

Code:
sqlite3 gaps.db < prime-gap-list/allgaps.sql
SethTro is offline   Reply With Quote
Old 2020-12-15, 20:15   #31
henryzz
Just call me Henry
 
henryzz's Avatar
 
"David"
Sep 2007
Cambridge (GMT/BST)

16BA16 Posts
Default

I am getting:
Code:
  File "./gap_test.py", line 528, in <module>
    prime_gap_test(args)
  File "./gap_test.py", line 464, in prime_gap_test
    data_db, misc_db = gap_test_stats.load_stats(conn, args)
  File "/mnt/e/Mersenne/primegaps/sethsieve/build/prime-gap/gap_test_stats.py", line 146, in load_stats
    (data.expected_prev, data.expected_next, data.expected_gap,
ValueError: not enough values to unpack (expected 7, got 0)
straight after running gap_stats.
It is possible to run more tests for old work.

edit: solved by adding --save-unknowns to the stats call

Last fiddled with by henryzz on 2020-12-15 at 20:20
henryzz is offline   Reply With Quote
Old 2020-12-15, 22:26   #32
henryzz
Just call me Henry
 
henryzz's Avatar
 
"David"
Sep 2007
Cambridge (GMT/BST)

2·2,909 Posts
Default

It would be useful if it was possible to specify decimal prp-top-percent.
henryzz is offline   Reply With Quote
Old 2020-12-16, 00:00   #33
SethTro
 
SethTro's Avatar
 
"Seth"
Apr 2019

3728 Posts
Default

Quote:
Originally Posted by henryzz View Post
It would be useful if it was possible to specify decimal prp-top-percent.
I'm happy to add this but it would be an easy change if you wanted to write and contribute it. I believe you only need to change these two locations:

https://github.com/sethtroisi/prime-..._stats.py#L392 and https://github.com/sethtroisi/prime-...ap_test.py#L71

(This section assumes you don't have a lot of git experience in case this is your first time using got)

You don't have permission to write to my git project so you can clone my project under your name and save (and propose) your local changes from there. Github makes this easy they have a button called "fork" in the upper right when your signed in (you'll need to create an account if you don't have one). After you fork the project on github you need to tell your computer where it is and what to call it we do this with `git remote add` if you find the clone command under your forked project (under the green code button) you can copy that url (something like https://github.com/<your username>/prime-gap.git) and run `git remote add <name like "personal"> <url ending in .git>`

After you make the change you commit it with `git commit -am "allow decimal percent to test"` then push it to your new project with `git push -u <name from earlier e.g. "personal"> main`

I'm writing this from mobile and giving up here but can help more if these steps don't work (and implicitly assumed that you want to make and contribute this change)

If you don't want to do this you can always attach the result of a `git diff` or `git mail` but setting up git makes it easier for others to see and coordinate.
SethTro is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
UPS /combined UPS and PS for P95 computer Christenson Hardware 12 2011-10-27 03:41
Combined sieving discussion ltd Prime Sierpinski Project 76 2008-07-25 11:44
Combined Sieve Guide Discussion Joe O Prime Sierpinski Project 35 2006-09-01 13:44
Combined Sieving? jaat Sierpinski/Riesel Base 5 5 2006-04-18 02:26
Sieve discussion Meaning of first/second pass, combined Citrix Prime Sierpinski Project 14 2005-12-31 19:39

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

Sat Feb 27 04:47:55 UTC 2021 up 86 days, 59 mins, 0 users, load averages: 1.52, 1.67, 1.79

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