24 | The Torture Test choice will run a continuous self-test. This is great for
25 | testing machines for hardware problems.
26 |
27 |
--------------------------------------------------------------------------------
/prime95/hlp/Disclaimer.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Disclaimer
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
Legal Stuff: Disclaimer
18 |
19 |
20 |
21 |
DISCLAIMER
22 |
THIS PROGRAM AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
23 | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
24 | WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE
25 |
The Stop menu choice lets you stop the program. When you continue, you
25 | will pick up right where you left off. This is the same as hitting the ESC key.
26 |
24 | The Benchmark choice times the program on several FFT lengths. You can then
25 | compare your computer's speed to others list at
26 | http://www.mersenne.org/bench.htm
The Status menu choice will tell you what exponents you are working on.
25 | It will also estimate how long that will take and your chances of finding a new
26 | Mersenne prime.
The CPU menu choice lets you tell the program how often the program will
25 | run and how much memory the program can use. The dialog box also displays your CPU
26 | type, speed, and capabilities.
The Test choice can be used to run a Lucas-Lehmer test on one Mersenne number.
25 | Enter the Mersenne number's exponent - this must be a prime number between 5 and
26 | 79300000.
Round off checking. This option will slow the program down by about 15%.
24 | This option displays the smallest and largest "convolution error". The convolution
25 | error must be less than 0.49 or the results will be incorrect. There really is no
26 | good reason to turn this option on.
This program is used to find Mersenne Prime numbers. See
23 |
24 | http://www.utm.edu/research/primes/mersenne.shtml for a good description of
25 | Mersenne primes. Mersenne numbers can be proved composite (not prime) by either
26 | finding a factor or by running a Lucas-Lehmer
27 | primality test.
28 |
How to Use Prime95: Advanced Menu - Manual
18 | Communication
19 |
20 |
21 |
22 |
ADVANCED MENU - Manual Communication
23 |
Manual Communication
24 |
25 |
The Manual Communication menu choice should only be used if the automatic
26 | detection of an Internet connection is not working for you. Using this option means
27 | you have to remember to communicate with the server every week or two (by using
28 | this same menu choice).
The Priority menu is used to adjust the priority prime95 runs at. You
25 | should not need to change this. You might raise the priority if you (or your coworker)
26 | just cannot live without a screen saver (bad idea), or if you are running some ill-behaved
27 | program that is using CPU cycles for no good reason.
The Time choice can be used to see how long each iteration of a
25 | Lucas-Lehmer test will take on your computer
26 | and how long it will take to test a given exponent. For example, if you want to
27 | know how long a Lucas-Lehmer test will
28 | take to test the exponent 876543, choose Advanced/Time and enter 876543 for 100
29 | iterations.
What's New: New Features in Version 13.x of Prime95
18 |
19 |
20 |
21 |
NEW FEATURES IN VERSION 13.x of PRIME95.EXE
22 |
New Features in Version 13.2 of Prime95
23 |
24 |
Minor adjustments made to the per-iteration error checking code. It
25 | was occasionally raising a FATAL ERROR when it should not have been.
26 |
27 |
28 |
New Features in Version 13.1 of Prime95
29 |
30 |
Faster! Prime now supports a wider variety of FFT run lengths.
31 | This means Lucas-Lehmer tests on exponents between 1.33M and 2.33M will be 13
32 | to 40% faster.
The Quit GIMPS menu choice is used when you no longer want this computer
24 | to work on the GIMPS project. You may rejoin
25 | at a later date. If you are a
26 | PrimeNet user your
27 | unfinished work will be returned to the server. If you are a manual user, you need
28 | to send me email containing your results.txt file and a note saying you are quitting.
29 |
How to Use Prime95: Advanced Command Line
18 | Arguments
19 |
20 |
21 |
22 |
23 |
COMMAND LINE ARGUMENTS
24 |
25 |
-An
This is used to run two or more copies of prime95 from the same directory.
26 | Using this command line argument causes Prime95 to use a different set of
27 | filenames for the INI files, the results file, the log file, and the spool file.
28 | Just use a different value of n for each copy of prime95.exe you start.
29 |
30 |
-t
Run the torture test. Same as Options/Torture Test.
31 |
-Wdirectory
This tells Prime95 to find all its files in a different directory
32 | than the executable.
33 |
34 |
You should not need to use the Advanced menu. This menu choice is provided only
24 | for those who are curious to play with. To avoid confusion for novice users, all
25 | the choices in the Advanced menu have been grayed. Please read this section if you
26 | want to know what the Advanced menu choices do. To turn on the Advanced menu, use
27 | the Advanced Password dialog box and enter a value of 9876. Also note that many
28 | of the menu choices are grayed while testing is in progress. Choose Test/Stop to
29 | activate these menu choices.
The Unreserve Exponent choice lets you tell the server to unreserved an
26 | exponent you have been assigned. You might do this if a second computer you had
27 | been running GIMPS on died or if you had been assigned an exponent of one work type
28 | (such as a first-time-test) and now you have switched to another work type (such
29 | as 10,000,000 digit numbers). Any work you have done on the unreserved exponent
30 | will be lost.
26 | The Vacation/Holiday menu choice lets prime95 update the expected completion
27 | dates on the
28 | PrimeNet server. This will prevent one of your exponents from being reassigned
29 | while you're gone. Also, if you are taking a long vacation, prime95 will get extra
30 | exponents to test. For example, if you are leaving for a 6 week vacation, connect
31 | to the Internet and choose 42 days.
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/macosx/Prime95/TortureTestController.h:
--------------------------------------------------------------------------------
1 | //
2 | // TortureTestController.h
3 | // Prime95
4 | //
5 | // Created by George Woltman on 4/25/09.
6 | // Copyright 2009 Mersenne Research, Inc. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface TortureTestController : NSWindowController {
12 | int tortureType;
13 | int numberOfThreads;
14 | int numberOfThreadsMax;
15 | int numberOfThreadsEnabled;
16 | int customSettingsEnabled;
17 | int customMemoryEnabled;
18 | int minFFTSize;
19 | int maxFFTSize;
20 | int runFFTsInPlace;
21 | int memoryToUse;
22 | int timeToRunEachFFT;
23 | int blendMemory;
24 | }
25 |
26 | @property(readwrite, assign) int tortureType;
27 | @property(readwrite, assign) int numberOfThreads;
28 | @property(readwrite, assign) int numberOfThreadsMax;
29 | @property(readwrite, assign) int numberOfThreadsEnabled;
30 | @property(readwrite, assign) int customSettingsEnabled;
31 | @property(readwrite, assign) int customMemoryEnabled;
32 | @property(readwrite, assign) int minFFTSize;
33 | @property(readwrite, assign) int maxFFTSize;
34 | @property(readwrite, assign) int runFFTsInPlace;
35 | @property(readwrite, assign) int memoryToUse;
36 | @property(readwrite, assign) int timeToRunEachFFT;
37 |
38 | - (void)reInit;
39 | - (IBAction)ok:(id)sender;
40 |
41 | @end
42 |
--------------------------------------------------------------------------------
/prime95/prime95.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 9.00
3 | # Visual Studio 2005
4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Prime95", "prime95.vcproj", "{12CE8FC3-4697-4DF8-8111-196225B01F11}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Win32 = Debug|Win32
9 | Debug|x64 = Debug|x64
10 | Release|Win32 = Release|Win32
11 | Release|x64 = Release|x64
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {12CE8FC3-4697-4DF8-8111-196225B01F11}.Debug|Win32.ActiveCfg = Debug|Win32
15 | {12CE8FC3-4697-4DF8-8111-196225B01F11}.Debug|Win32.Build.0 = Debug|Win32
16 | {12CE8FC3-4697-4DF8-8111-196225B01F11}.Debug|x64.ActiveCfg = Debug|x64
17 | {12CE8FC3-4697-4DF8-8111-196225B01F11}.Debug|x64.Build.0 = Debug|x64
18 | {12CE8FC3-4697-4DF8-8111-196225B01F11}.Release|Win32.ActiveCfg = Release|Win32
19 | {12CE8FC3-4697-4DF8-8111-196225B01F11}.Release|Win32.Build.0 = Release|Win32
20 | {12CE8FC3-4697-4DF8-8111-196225B01F11}.Release|x64.ActiveCfg = Release|x64
21 | {12CE8FC3-4697-4DF8-8111-196225B01F11}.Release|x64.Build.0 = Release|x64
22 | EndGlobalSection
23 | GlobalSection(SolutionProperties) = preSolution
24 | HideSolutionNode = FALSE
25 | EndGlobalSection
26 | EndGlobal
27 |
--------------------------------------------------------------------------------
/prime95/hlp/AdvancedMenuP1.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Advanced Menu - P1
5 |
6 |
7 |
8 |
9 |
10 |
The P-1 choice lets you factor Mersenne numbers using the P-1 method of
25 | factoring. There is presently no web site which tells you how much P-1 factoring
26 | has already been done on exponents. You can also edit the
27 | worktodo.ini file directly. For example:
28 |
Pminus1=751001,1000000,0,0,0
29 |
The first value is the exponent. The second value is bound #1. The third value
30 | is bound #2. The fourth value is 0 for 2^N-1 factoring, 1 for 2^N+1 factoring. The
31 | fifth value is no longer used.
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/prime95/PreferencesDlg.h:
--------------------------------------------------------------------------------
1 | // PreferencesDlg.h : header file
2 | //
3 |
4 | /////////////////////////////////////////////////////////////////////////////
5 | // CPreferencesDlg dialog
6 |
7 | class CPreferencesDlg : public CDialog
8 | {
9 | // Construction
10 | public:
11 | CPreferencesDlg(CWnd* pParent = NULL); // standard constructor
12 |
13 | // Dialog Data
14 | //{{AFX_DATA(CPreferencesDlg)
15 | enum { IDD = IDD_PREFERENCES };
16 | CStatic c_modem_text;
17 | CEdit c_modem;
18 | CStatic c_work_text;
19 | CEdit c_work;
20 | CStatic c_end_dates_text;
21 | CEdit c_end_dates;
22 | CStatic c_network_text;
23 | CEdit c_network;
24 | UINT m_iter;
25 | UINT m_disk_write_time;
26 | UINT m_backup;
27 | BOOL m_noise;
28 | UINT m_retry;
29 | UINT m_r_iter;
30 | UINT m_work;
31 | float m_end_dates;
32 | UINT m_modem;
33 | BOOL m_battery;
34 | //}}AFX_DATA
35 |
36 |
37 | // Overrides
38 | // ClassWizard generated virtual function overrides
39 | //{{AFX_VIRTUAL(CPreferencesDlg)
40 | protected:
41 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
42 | //}}AFX_VIRTUAL
43 |
44 | // Implementation
45 | protected:
46 |
47 | // Generated message map functions
48 | //{{AFX_MSG(CPreferencesDlg)
49 | // NOTE: the ClassWizard will add member functions here
50 | //}}AFX_MSG
51 | DECLARE_MESSAGE_MAP()
52 | };
53 |
--------------------------------------------------------------------------------
/gwnum/gwutil.h:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------------
2 | | This file contains various utility routines that may be used by gwnum
3 | | routines, prime95, or PRP.
4 | |
5 | | Copyright 2004-2009 Mersenne Research, Inc. All rights reserved.
6 | +---------------------------------------------------------------------*/
7 |
8 | #ifndef _GWUTIL_H
9 | #define _GWUTIL_H
10 |
11 | /* This is a C library. If used in a C++ program, don't let the C++ */
12 | /* compiler mangle names. */
13 |
14 | #ifdef __cplusplus
15 | extern "C" {
16 | #endif
17 |
18 | /* Align a pointer to the given boundary (boundary must be a power of 2) */
19 |
20 | #ifdef _WIN64
21 | #define align_ptr(p,n) (void *) (((uint64_t)(p) + (n)-1) & ~((n)-1))
22 | #else
23 | #define align_ptr(p,n) (void *) (((long)(p) + (n)-1) & ~((n)-1))
24 | #endif
25 |
26 | /* Aligned malloc routines. MSVC 8 supports these in the C runtime library. */
27 | /* Emulate these routines for other ports. */
28 |
29 | void * aligned_offset_malloc (size_t size, size_t alignment, size_t mod);
30 | void * aligned_malloc (size_t size, size_t alignment);
31 | void aligned_free (void *ptr);
32 |
33 | /* Large page allocation routines */
34 |
35 | void * large_pages_malloc (size_t size);
36 | void large_pages_free (void *ptr);
37 |
38 | #ifdef __cplusplus
39 | }
40 | #endif
41 |
42 | #endif
43 |
--------------------------------------------------------------------------------
/prime95/compil64:
--------------------------------------------------------------------------------
1 | # Assembler command lines, without and with listings
2 | #
3 | # objconv comes courtesy of Agner Fog. Download available at
4 | # http://www.agner.org/optimize/#objconv
5 |
6 | masm64=ml64 /c /DX86_64 /DWINDOWS64 /I..\gwnum
7 | #masm64=ml64 /c /DX86_64 /DWINDOWS64 /I..\gwnum /Fl /Sf /Sa
8 | masm64lx=ml64 /c /DX86_64 /DLINUX64 /I..\gwnum
9 |
10 | # Use the 64-bit C compiler - optimization not necessary
11 |
12 | cl64=cl /GF /W3 /MT /DX86_64 /D_CRT_SECURE_NO_DEPRECATE /c
13 | cl64d=cl /GF /W3 /MT /DX86_64 /D_CRT_SECURE_NO_DEPRECATE /DGDEBUG /Zi /c
14 | objconv=c:\objconv\objconv
15 |
16 | # List of all buildables in this makefile
17 |
18 | all: amd64\factor64.obj linux64\factor64.o amd64\service.obj
19 |
20 | # Create 64-bit object files
21 |
22 | amd64\factor64.obj: factor64.asm factor64.mac
23 | $(masm64) /Foamd64\factor64.obj factor64.asm
24 | ..\gwnum\strip amd64\factor64.obj
25 |
26 | # Create Linux 64-bit object files
27 |
28 | linux64\factor64.o: factor64.asm factor64.mac
29 | $(masm64lx) /Folinux64\factor64.obj factor64.asm
30 | $(objconv) -felf64 linux64\factor64.obj linux64\factor64.o
31 | attrib -r linux64\factor64.o
32 | $(objconv) -fmacho64 -nu+ linux64\factor64.obj macosx64\factor64.o
33 | attrib -r macosx64\factor64.o
34 | del linux64\factor64.obj
35 |
36 | # Compile special services code
37 |
38 | amd64\service.obj: service.c
39 | $(cl64) /Foamd64\service.obj service.c
40 |
41 |
--------------------------------------------------------------------------------
/macosx/Prime95/PRPController.m:
--------------------------------------------------------------------------------
1 | //
2 | // PRPController.m
3 | // Prime95
4 | //
5 | // Created by George Woltman on 4/24/09.
6 | // Copyright 2009-2010 Mersenne Research, Inc. All rights reserved.
7 | //
8 |
9 | #import "PRPController.h"
10 | #include "prime95.h"
11 |
12 | @implementation PRPController
13 |
14 | - (id)init
15 | {
16 | if (![super initWithWindowNibName:@"PRP"]) return nil;
17 | k = 4605.0;
18 | b = 2;
19 | n = 3313;
20 | nMax = MAX_PRIME_SSE2;
21 | c = 1;
22 |
23 | return self;
24 | }
25 |
26 | - (void)windowDidLoad
27 | {
28 | [self reInit];
29 | }
30 |
31 | - (void)reInit
32 | {
33 | [self setWorkerNumber:1];
34 | [self setWorkerNumberMax:NUM_WORKER_THREADS];
35 | [self setWorkerNumberEnabled:(NUM_WORKER_THREADS > 1)];
36 | }
37 |
38 | @synthesize workerNumber;
39 | @synthesize workerNumberMax;
40 | @synthesize workerNumberEnabled;
41 | @synthesize k;
42 | @synthesize b;
43 | @synthesize n;
44 | @synthesize nMax;
45 | @synthesize c;
46 |
47 | - (IBAction)ok:(id)sender
48 | {
49 | struct work_unit w;
50 |
51 | [[self window] makeFirstResponder:nil]; // End any active text field edits
52 |
53 | memset (&w, 0, sizeof (w));
54 | w.work_type = WORK_PRP;
55 | w.k = k;
56 | w.b = b;
57 | w.n = n;
58 | w.c = c;
59 | addWorkToDoLine (workerNumber - 1, &w);
60 |
61 | if (! WORKER_THREADS_ACTIVE)
62 | LaunchWorkerThreads (ALL_WORKERS, FALSE);
63 |
64 | [[self window] performClose:self];
65 | }
66 |
67 | @end
68 |
--------------------------------------------------------------------------------
/gwnum/gwcommon.h:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------------
2 | | gwcommon.h
3 | |
4 | | This file contains handy #defines that I use in all my projects
5 | |
6 | | Copyright 2005-2010 Mersenne Research, Inc. All rights reserved.
7 | +---------------------------------------------------------------------*/
8 |
9 | #ifndef _GWCOMMON_H
10 | #define _GWCOMMON_H
11 |
12 | #ifndef TRUE
13 | #define TRUE 1
14 | #endif
15 | #ifndef FALSE
16 | #define FALSE 0
17 | #endif
18 |
19 | /* In many cases where the C code is interfacing with the assembly code */
20 | /* we must declare variables that are exactly 32-bits wide. This is the */
21 | /* portable way to do this, as the linux x86-64 C compiler defines the */
22 | /* long data type as 64 bits. We also use portable definitions for */
23 | /* values that can be either an integer or a pointer. */
24 |
25 | #ifdef _MSC_VER
26 | typedef __int32 int32_t;
27 | typedef unsigned __int32 uint32_t;
28 | typedef unsigned __int64 uint64_t;
29 | #ifdef _WIN64
30 | typedef __int64 intptr_t;
31 | typedef unsigned __int64 uintptr_t;
32 | #else
33 | typedef int intptr_t;
34 | typedef unsigned int uintptr_t;
35 | #endif
36 | #else
37 | #include "inttypes.h"
38 | #endif
39 |
40 | /* Define the ASSERT macro I use while debugging */
41 |
42 | #include
43 | #ifdef GDEBUG
44 | #define ASSERTG assert
45 | #else
46 | #define ASSERTG(a)
47 | #endif
48 | #define GWASSERT assert
49 |
50 | #endif
51 |
--------------------------------------------------------------------------------
/macosx/Prime95/TestController.m:
--------------------------------------------------------------------------------
1 | //
2 | // TestController.m
3 | // Prime95
4 | //
5 | // Created by George Woltman on 4/24/09.
6 | // Copyright 2009-2010 Mersenne Research, Inc. All rights reserved.
7 | //
8 |
9 | #import "TestController.h"
10 | #include "prime95.h"
11 |
12 | @implementation TestController
13 |
14 | - (id)init
15 | {
16 | if (![super initWithWindowNibName:@"Test"]) return nil;
17 | exponentToTest = 5;
18 | exponentToTestMax = MAX_PRIME_SSE2;
19 | return self;
20 | }
21 |
22 | - (void)windowDidLoad
23 | {
24 | [self reInit];
25 | }
26 |
27 | - (void)reInit
28 | {
29 | [self setWorkerNumber:1];
30 | [self setWorkerNumberMax:NUM_WORKER_THREADS];
31 | [self setWorkerNumberEnabled:(NUM_WORKER_THREADS > 1)];
32 | }
33 |
34 | @synthesize workerNumber;
35 | @synthesize workerNumberMax;
36 | @synthesize workerNumberEnabled;
37 | @synthesize exponentToTest;
38 | @synthesize exponentToTestMax;
39 |
40 | - (IBAction)ok:(id)sender
41 | {
42 | struct work_unit w;
43 |
44 | [[self window] makeFirstResponder:nil]; // End any active text field edits
45 |
46 | memset (&w, 0, sizeof (w));
47 | w.work_type = WORK_ADVANCEDTEST;
48 | w.k = 1.0;
49 | w.b = 2;
50 | w.n = exponentToTest;
51 | w.c = -1;
52 | addWorkToDoLine (workerNumber - 1, &w);
53 | if (WORKER_THREADS_ACTIVE)
54 | stop_worker_for_advanced_test (workerNumber - 1);
55 | else
56 | LaunchWorkerThreads (ALL_WORKERS, FALSE);
57 | [[self window] performClose:self];
58 | }
59 |
60 | @end
61 |
--------------------------------------------------------------------------------
/prime95/hlp/RunningOnSeveralMachines.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Running Prime95 on Several Machines
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
How to Use Prime95: Running Prime95 on
18 | Several Machines
19 |
20 |
21 |
22 |
RUNNING PRIME95 ON SEVERAL MACHINES
23 |
24 | The easiest way to do this is to first set up prime95 on one computer. Next copy
25 | all the files to the second computer. Delete the
26 | local.ini file and worktodo.ini files. These
27 | files contain information that is specific to the first computer. Start prime95
28 | on the second computer and optionally use
29 | Test/User Information to give the second computer a unique computer ID.
30 | Repeat this process for all the computers you wish to run prime95 on.
31 |
If you do not follow the instruction above, be sure you use
32 | Test/User Information to give each computer
33 | the same userid and password. Failure to do this will result in all your work
34 | being credited to different user IDs.
35 |
25 | The Tray Icon choice will cause prime95 to have a small icon on the taskbar
26 | when it is minimized. You can activate or hide the program by double-clicking on
27 | the small icon. If you place the cursor over the small icon, a tool tip will display
28 | the current status.
33 | The No Icon choice is only enabled if the Advanced Menu is activated with
34 | the password. Using this menu choice means there will be no prime95 icon on the
35 | taskbar once you minimize the program - making it very hard to reactivate! You can
36 | reactivate the program by trying to execute prime95 a second time. Alternatively,
37 | you can turn this feature off by editing prime.ini and change the line "HideIcon=1"
38 | to "HideIcon=0", then reboot.
For the latest information on this and other networking issues visit the FAQ
24 | at http://mersenne.org/ips/faq.html
25 | Create a file in the same local folder as Prime95.exe, called "primenet.ini". Add
26 | these text lines, substituting the appropriate proxy server URL and port:
27 |
28 |
After the first time
38 | PrimeNet is contacted through a secure proxy, the proxy password
39 | is encoded and a new parameter 'ProxyMask=1' set. To change the password, simply
40 | change the ProxyPass= value, and either delete the ProxyMask text line or set ProxyMask=0.
41 |
42 |
The PrimeNet menu choice lets you configure the type of work you get from
25 | the server. The "Use PrimeNet..." option can be turned on to switch from the manual
26 | method to the automatic method. The "Request whatever..." box should be left checked.
27 | However, if you are running a slow computer and don't mind waiting several months
28 | for a single Lucas-Lehmer test to complete
29 | OR you are running a faster computer and would rather do factoring, then uncheck
30 | this box and choose a different type of work to do. The "Always have at least this
31 | many days of work queued up" value should be changed based on how often you connect
32 | to the Internet. As long as you connect at least once in the given time period,
33 | prime95 will have an uninterrupted stream of work. However, the program will not
34 | checkout more than 20 exponents no matter what this value is set at.
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/macosx/Prime95/ECMController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ECMController.m
3 | // Prime95
4 | //
5 | // Created by George Woltman on 4/24/09.
6 | // Copyright 2009-2010 Mersenne Research, Inc. All rights reserved.
7 | //
8 |
9 | #import "ECMController.h"
10 | #include "prime95.h"
11 |
12 | @implementation ECMController
13 |
14 | - (id)init
15 | {
16 | if (![super initWithWindowNibName:@"ECM"]) return nil;
17 | k = 1.0;
18 | b = 2;
19 | n = 1061;
20 | nMax = MAX_PRIME_SSE2;
21 | c = -1;
22 | bound1 = 1000000.0;
23 | bound2 = 0.0;
24 | numberOfCurves = 100;
25 |
26 | return self;
27 | }
28 |
29 | - (void)windowDidLoad
30 | {
31 | [self reInit];
32 | }
33 |
34 | - (void)reInit
35 | {
36 | [self setWorkerNumber:1];
37 | [self setWorkerNumberMax:NUM_WORKER_THREADS];
38 | [self setWorkerNumberEnabled:(NUM_WORKER_THREADS > 1)];
39 | }
40 |
41 | @synthesize workerNumber;
42 | @synthesize workerNumberMax;
43 | @synthesize workerNumberEnabled;
44 | @synthesize k;
45 | @synthesize b;
46 | @synthesize n;
47 | @synthesize nMax;
48 | @synthesize c;
49 | @synthesize bound1;
50 | @synthesize bound2;
51 | @synthesize numberOfCurves;
52 |
53 | - (IBAction)ok:(id)sender
54 | {
55 | struct work_unit w;
56 |
57 | [[self window] makeFirstResponder:nil]; // End any active text field edits
58 |
59 | memset (&w, 0, sizeof (w));
60 | w.work_type = WORK_ECM;
61 | w.k = k;
62 | w.b = b;
63 | w.n = n;
64 | w.c = c;
65 | w.B1 = bound1;
66 | w.B2_start = 0;
67 | w.B2 = bound2;
68 | w.curves_to_do = numberOfCurves;
69 | addWorkToDoLine (workerNumber - 1, &w);
70 |
71 | if (! WORKER_THREADS_ACTIVE)
72 | LaunchWorkerThreads (ALL_WORKERS, FALSE);
73 |
74 | [[self window] performClose:self];
75 | }
76 |
77 | @end
78 |
--------------------------------------------------------------------------------
/commona.h:
--------------------------------------------------------------------------------
1 | /* Copyright 1995-2016 Mersenne Research, Inc. All rights reserved */
2 |
3 | /* Common strings */
4 |
5 | #define MANUAL_QUIT "You have elected to remove this computer from the Great Internet Mersenne Prime Search. Other computers using this user ID will not be affected. Please send the file results.txt to woltman@alum.mit.edu.\n\nAre you sure you want to do this?"
6 | #define PRIMENET_QUIT "You have elected to remove this computer from the Great Internet Mersenne Prime Search. Other computers using this user ID will not be affected.\n\nPlease make sure your results have been successfully sent to the server (the program will be idle rather than looping trying to contact the server) before uninstalling the program. If in doubt, you can send the results.txt file to woltman@alum.mit.edu.\n\nYou can either complete your current assignment or you can quit GIMPS immediately. Do you wish to complete your current work assignments before quitting?"
7 | #define PING_ERROR "Unable to get version information from PrimeNet server."
8 | #define MSG_MEMORY "You have left the available memory fields at 8 megabytes. You can increase your chances of finding a Mersenne prime very slightly if you let the program occasionally use more memory. The readme.txt file has more information. Do you want to let the program use more memory?"
9 | #define MSG_THREADS "You have allocated more threads than CPUs available. This is likely to GREATLY REDUCE performance. Do you want to correct this?"
10 |
11 | /* Common routines */
12 |
13 | void sanitizeString (char *);
14 | void rangeStatusMessage (char *, unsigned int);
15 | unsigned int user_configurable_hyperthreads ();
16 | int min_cores_for_work_type (int work_type);
17 |
--------------------------------------------------------------------------------
/prime95/hlp/Instructions.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Instructions
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
Getting Started: General Instructions
18 |
19 |
20 |
21 |
INSTRUCTIONS
22 |
There are two ways to use this program. The
23 | automatic way uses a central server,
24 | which we call the PrimeNet server, to get work to do and report your results. Anyone
25 | with Internet access, including AOL, CompuServe, and dial-up ISP users should use
26 | this method. You do not need a permanent connection to the Internet.
27 |
28 |
The second method is the
29 | manual method. It requires a little more work and monitoring. I
30 | recommend this for computers with no Internet access or with some kind of firewall
31 | problem that prevents the automatic method from working.
32 |
If you are running this program at your place of employment, you should first
33 | GET PERMISSION from your network administrator
34 | or boss. This is especially true if you are installing the software on several
35 | machines. Some companies are reluctant to run any software they are not familiar
36 | with.
The Preferences menu choice lets you control how often a line is written
26 | to the main window and how often a line is written to the results file. It also
27 | lets you change how often intermediate files (to guard against power failure and
28 | crashes) are created. You can control how often the program checks to see if you
29 | are connected to the Internet. The program polls whenever it has new data to send
30 | to or work to get from the PrimeNet server. If you are low on disk space, you can
31 | select one intermediate file instead of two. However, if you crash in the middle
32 | of writing the one intermediate file, you may have to restart an exponent from scratch.
33 | You can also tell the program to be quiet, rather than beeping like crazy, if a
34 | new Mersenne prime is found. You can also make prime95 go idle whenever your laptop
35 | is running on battery power (does not work under Windows NT/2000/XP).
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/gwnum/mult1.asm:
--------------------------------------------------------------------------------
1 | ; Copyright 1995-2009 Mersenne Research, Inc. All rights reserved
2 | ; Author: George Woltman
3 | ; Email: woltman@alum.mit.edu
4 | ;
5 | ; This routine implements a discrete weighted transform to quickly multiply
6 | ; two numbers.
7 | ;
8 | ; This code handles FFTs that use a simple linear memory model and
9 | ; the simplified normalization code. FFT sizes from 32 doubles to
10 | ; 128 doubles are supported.
11 | ;
12 | ; You will not stand a chance of understanding any of this code without
13 | ; thoroughly familiarizing yourself with fast fourier transforms. This
14 | ; code was adapted from an algorithm described in Richard Crandall's article
15 | ; on Discrete Weighted Transforms and Large-Integer Arithmetic.
16 | ;
17 |
18 | TITLE setup
19 |
20 | .686
21 | .XMM
22 | .MODEL FLAT
23 |
24 | _TEXT SEGMENT
25 |
26 | INCLUDE unravel.mac
27 | INCLUDE extrn.mac
28 | INCLUDE lucas.mac
29 | INCLUDE pfa.mac
30 | INCLUDE mult.mac
31 | INCLUDE fft1.mac
32 | INCLUDE memory.mac
33 |
34 | flat_distances
35 |
36 | ;; All the FFT routines for each FFT length
37 |
38 | fft 32
39 | fft 32p
40 | fft 40
41 | fft 48
42 | fft 48p
43 | fft 56
44 | fft 64
45 | fft 64p
46 | fft 80
47 | fft 96
48 | fft 96p
49 | fft 112
50 | fft 128
51 | fft 128p
52 | fft 160
53 | fft 192
54 | fft 192p
55 | fft 224
56 | fft 256
57 | fft 256p
58 | fft 320
59 | fft 384
60 | fft 384p
61 | fft 448
62 | fft 512
63 | fft 512p
64 | fft 640
65 | fft 768
66 | fft 768p
67 | fft 896
68 | fft 1024
69 | fft 1024p
70 | fft 1280
71 | fft 1536
72 | fft 1536p
73 | fft 1792
74 | fft 2048
75 | fft 2048p
76 | fft 2560
77 | fft 3072
78 | fft 3072p
79 | fft 3584
80 | fft 4096
81 | fft 4096p
82 |
83 | _TEXT ENDS
84 | END
85 |
--------------------------------------------------------------------------------
/prime95/ChildFrm.cpp:
--------------------------------------------------------------------------------
1 | // ChildFrm.cpp : implementation of the CChildFrame class
2 | //
3 | #include "stdafx.h"
4 | #include "prime95.h"
5 |
6 | #include "ChildFrm.h"
7 | #include "Prime95Doc.h"
8 | #include "Prime95View.h"
9 |
10 | #ifdef _DEBUG
11 | #define new DEBUG_NEW
12 | #endif
13 |
14 |
15 | // CChildFrame
16 |
17 | IMPLEMENT_DYNCREATE(CChildFrame, CMDIChildWnd)
18 |
19 | BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWnd)
20 | END_MESSAGE_MAP()
21 |
22 |
23 | // CChildFrame construction/destruction
24 |
25 | CChildFrame::CChildFrame()
26 | {
27 | // TODO: add member initialization code here
28 | }
29 |
30 | CChildFrame::~CChildFrame()
31 | {
32 | }
33 |
34 |
35 | BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
36 | {
37 | // TODO: Modify the Window class or styles here by modifying the CREATESTRUCT cs
38 |
39 | // cs.style &= ~FWS_ADDTOTITLE; // We'll control window titles!
40 | cs.style &= ~WS_MINIMIZEBOX; // Disable minimize button
41 | if( !CMDIChildWnd::PreCreateWindow(cs) )
42 | return FALSE;
43 |
44 | return TRUE;
45 | }
46 |
47 |
48 | void CChildFrame::OnUpdateFrameTitle(BOOL bAddToTitle)
49 | {
50 | // GetMDIFrame()->OnUpdateFrameTitle(bAddToTitle);
51 |
52 | // For lack of a better place to do this, disable SC_CLOSE system menu here
53 |
54 | CMenu *pSysMenu = GetSystemMenu(FALSE);
55 | ASSERT(pSysMenu != NULL);
56 | pSysMenu->EnableMenuItem(SC_CLOSE, MF_BYCOMMAND | MF_GRAYED);
57 | }
58 |
59 | // CChildFrame diagnostics
60 |
61 | #ifdef _DEBUG
62 | void CChildFrame::AssertValid() const
63 | {
64 | CMDIChildWnd::AssertValid();
65 | }
66 |
67 | void CChildFrame::Dump(CDumpContext& dc) const
68 | {
69 | CMDIChildWnd::Dump(dc);
70 | }
71 |
72 | #endif //_DEBUG
73 |
74 |
75 | // CChildFrame message handlers
76 |
--------------------------------------------------------------------------------
/common.h:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------------
2 | | common.h
3 | |
4 | | This file contains handy #defines that I use in all my projects
5 | |
6 | | Copyright 2005-2014 Mersenne Research, Inc.
7 | | All Rights Reserved.
8 | +---------------------------------------------------------------------*/
9 |
10 | #ifndef _COMMON_H
11 | #define _COMMON_H
12 |
13 | #ifdef __cplusplus
14 | #define EXTERNC extern "C"
15 | #else
16 | #define EXTERNC
17 | #endif
18 |
19 | #define TRUE 1
20 | #define FALSE 0
21 |
22 | /* Define the world/group/owner read/write attributes for creating files */
23 | /* I've always used 0666 in Unix (everyone gets R/W access), but MSVC 8 */
24 | /* now refuses to work with that setting -- insisting on 0600 instead. */
25 |
26 | #ifdef _WIN32
27 | #define CREATE_FILE_ACCESS 0600
28 | #else
29 | #define CREATE_FILE_ACCESS 0666
30 | #endif
31 |
32 | /* Define the ASSERT macro I use while debugging */
33 |
34 | #ifdef GDEBUG
35 | #include
36 | #define ASSERTG assert
37 | #else
38 | #define ASSERTG(a)
39 | #endif
40 |
41 | /* Define a "safe" strcpy. The official C runtime library says that overlapping */
42 | /* buffers produce undefined results. This safe strcpy allows overlapping */
43 | /* buffers by using memmove instead. */
44 |
45 | #define safe_strcpy(d,s) memmove (d, s, strlen (s) + 1)
46 | #ifdef GDEBUG
47 | #undef strcpy
48 | #define strcpy(d,s) assert((d) >= ((s)+strlen(s)+1) || (s) >= (d)+strlen(s)+1), safe_strcpy(d,s)
49 | #endif
50 |
51 | /* Utility routines in commonc.c */
52 |
53 | void truncated_strcpy (char *buf, unsigned int bufsize, const char *val);
54 | void truncated_strcpy_with_len (char *buf, unsigned int bufsize, const char *val, unsigned int valsize);
55 |
56 | #endif
57 |
--------------------------------------------------------------------------------
/prime95/hlp/TestMenuUserInfo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Test Menu - User Information
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
How to Use Prime95: Test Menu - User
18 | Information
The User Information menu choice lets you change your name and email address.
26 | Your name will be used in credits and "top producers" web pages. Your email address
27 | may be used to send you a newsletter once every few months. Select the "Receive
28 | occasional newsletters..." checkbox to enable these emails. The userid you use will
29 | appear in the status pages on the PrimeNet server. You can also set the ComputerID
30 | field if you have several computers and want to keep track of which computers produced
31 | which results. You can create a team by choosing the "Create a team..." checkbox.
32 | The user name you entered becomes the team name and a message is sent to the server
33 | which prevents the team name from changing. Thus, you can handout the userid and
34 | password for others to join your team and these team members are not able to accidentally
35 | or maliciously change the team name that appears on the statistics page.
GIMPS has discovered eight Mersenne primes so far. On February 18, 2005, Dr.
23 | Martin Nowak discovered the 42nd known Mersenne prime, 225964951-1.
25 | This is the largest known prime number. On May 15, 2004, Josh
26 | Findley discovered the previous record prime, 224036583-1.
28 | On November 17, 2003 Michael Shafer found the prime, 220996011-1.
30 | On November 14th 2001, Michael Cameron found the prime, 213466917-1.
32 | On June 1st 1999, Nayan Hajratwala found the prime, 26972593-1.
34 | On January 27th 1998, Roland Clarkson found the prime, 23021377-1.
36 | On August 24th 1997, Gordon Spence discovered the prime 22976221-1.
38 | In November 1996, Joel Armengaud found GIMPS' first prime, 21398269-1.
40 | Could you be next?
41 |
--------------------------------------------------------------------------------
/prime95/TestDlg.cpp:
--------------------------------------------------------------------------------
1 | // TestDlg.cpp : implementation file
2 | //
3 |
4 | #include "stdafx.h"
5 | #include "Prime95.h"
6 | #include "TestDlg.h"
7 |
8 | #ifdef _DEBUG
9 | #define new DEBUG_NEW
10 | #undef THIS_FILE
11 | static char THIS_FILE[] = __FILE__;
12 | #endif
13 |
14 | /////////////////////////////////////////////////////////////////////////////
15 | // CTestDlg dialog
16 |
17 |
18 | CTestDlg::CTestDlg(CWnd* pParent /*=NULL*/)
19 | : CDialog(CTestDlg::IDD, pParent)
20 | {
21 | //{{AFX_DATA_INIT(CTestDlg)
22 | m_thread = 1;
23 | m_p = 0;
24 | //}}AFX_DATA_INIT
25 | }
26 |
27 |
28 | // make sure number is a prime
29 |
30 | char NOTPRIMEERR[] = "This number is not prime, there is no need to test it.";
31 | void DDV_prime (
32 | CDataExchange* pDX,
33 | long p)
34 | {
35 | if (! isPrime (p)) {
36 | AfxMessageBox (NOTPRIMEERR, MB_ICONEXCLAMATION);
37 | pDX->Fail ();
38 | }
39 | }
40 |
41 | void CTestDlg::DoDataExchange(CDataExchange* pDX)
42 | {
43 | CDialog::DoDataExchange(pDX);
44 | //{{AFX_DATA_MAP(CTestDlg)
45 | DDX_Control(pDX, IDC_THREAD_TEXT, c_thread_text);
46 | DDX_Control(pDX, IDC_THREAD, c_thread);
47 | DDX_Text(pDX, IDC_THREAD, m_thread);
48 | DDV_MinMaxUInt(pDX, m_thread, 1, NUM_WORKER_THREADS);
49 | DDX_Text(pDX, IDC_P, m_p);
50 | //}}AFX_DATA_MAP
51 | c_thread_text.EnableWindow (NUM_WORKER_THREADS > 1);
52 | c_thread.EnableWindow (NUM_WORKER_THREADS > 1);
53 | DDV_MinMaxUInt(pDX, m_p, MIN_PRIME,
54 | CPU_FLAGS & CPU_SSE2 ? MAX_PRIME_SSE2 : MAX_PRIME);
55 | DDV_prime(pDX, m_p);
56 | }
57 |
58 |
59 | BEGIN_MESSAGE_MAP(CTestDlg, CDialog)
60 | //{{AFX_MSG_MAP(CTestDlg)
61 | // NOTE: the ClassWizard will add message map macros here
62 | //}}AFX_MSG_MAP
63 | END_MESSAGE_MAP()
64 |
65 | /////////////////////////////////////////////////////////////////////////////
66 | // CTestDlg message handlers
67 |
--------------------------------------------------------------------------------
/gwnum/mult3.asm:
--------------------------------------------------------------------------------
1 | ; Copyright 1995-2009 Mersenne Research, Inc. All rights reserved
2 | ; Author: George Woltman
3 | ; Email: woltman@alum.mit.edu
4 | ;
5 | ; This code handles FFTs that use two passes with 10 levels done on the
6 | ; second pass.
7 | ;
8 | ; You will not stand a chance of understanding any of this code without
9 | ; thoroughly familiarizing yourself with fast fourier transforms. This
10 | ; code was adapted from an algorithm described in Richard Crandall's article
11 | ; on Discrete Weighted Transforms and Large-Integer Arithmetic.
12 | ;
13 |
14 | TITLE setup
15 |
16 | .686
17 | .XMM
18 | .MODEL FLAT
19 |
20 | INCLUDE unravel.mac
21 | INCLUDE extrn.mac
22 | INCLUDE lucas.mac
23 | INCLUDE pfa.mac
24 | INCLUDE mult.mac
25 | INCLUDE pass1.mac
26 | INCLUDE fft3.mac
27 | INCLUDE memory.mac
28 |
29 | EXTRN gw_finish_fft:PROC
30 | EXTRN gw_carries:PROC
31 | EXTRN gw_finish_mult:PROC
32 |
33 | EXTRNP pass2_10_levels
34 |
35 | _TEXT SEGMENT
36 |
37 | flat_distances
38 |
39 | ;; Distance between two pass 2 data blocks. Pass 2 does 10 FFT levels.
40 | ;; 2^10 complex values = 2^11 doubles = 16KB.
41 |
42 | blkdst = (4*(4096+64)+64)
43 |
44 | ;; All the FFT routines for each FFT length.
45 |
46 | IFNDEF PFETCH
47 | ; fft 20K
48 | ; fft 24K
49 | ; fft 24Kp
50 | ; fft 28K
51 | ; fft 32K
52 | ; fft 32Kp
53 | ENDIF
54 | ; fft 40K
55 | ; fft 48K
56 | ; fft 48Kp
57 | ; fft 56K
58 | ; fft 64K
59 | ; fft 64Kp
60 | ; fft 80K
61 | fft 96K
62 | fft 96Kp
63 | fft 112K
64 | fft 128K
65 | fft 128Kp
66 |
67 | INCLUDE pass1scr.mac
68 |
69 | fft 160K
70 | fft 192K
71 | fft 192Kp
72 | fft 224K
73 | fft 256K
74 | fft 256Kp
75 | fft 320K
76 | fft 384K
77 | fft 384Kp
78 | fft 448K
79 | fft 512K
80 | fft 512Kp
81 | fft 640K
82 | fft 768K
83 | fft 768Kp
84 | fft 896K
85 | fftclm 1024K, 2
86 | fft 1024Kp
87 |
88 | _TEXT ENDS
89 | END
90 |
--------------------------------------------------------------------------------
/prime95/Pminus1Dlg.cpp:
--------------------------------------------------------------------------------
1 | // Pminus1Dlg.cpp : implementation file
2 | //
3 |
4 | #include "stdafx.h"
5 | #include "Prime95.h"
6 | #include "Pminus1Dlg.h"
7 |
8 | #ifdef _DEBUG
9 | #define new DEBUG_NEW
10 | #undef THIS_FILE
11 | static char THIS_FILE[] = __FILE__;
12 | #endif
13 |
14 | /////////////////////////////////////////////////////////////////////////////
15 | // CPminus1Dlg dialog
16 |
17 |
18 | CPminus1Dlg::CPminus1Dlg(CWnd* pParent /*=NULL*/)
19 | : CDialog(CPminus1Dlg::IDD, pParent)
20 | {
21 | //{{AFX_DATA_INIT(CPminus1Dlg)
22 | m_thread = 1;
23 | m_k = 1.0;
24 | m_b = 2;
25 | m_n = 1061;
26 | m_c = -1;
27 | m_bound1 = 1000000.0;
28 | m_bound2 = 0.0;
29 | //}}AFX_DATA_INIT
30 | }
31 |
32 |
33 | void CPminus1Dlg::DoDataExchange(CDataExchange* pDX)
34 | {
35 | CDialog::DoDataExchange(pDX);
36 | //{{AFX_DATA_MAP(CPminus1Dlg)
37 | DDX_Control(pDX, IDC_THREAD_TEXT, c_thread_text);
38 | DDX_Control(pDX, IDC_THREAD, c_thread);
39 | DDX_Text(pDX, IDC_THREAD, m_thread);
40 | DDV_MinMaxUInt(pDX, m_thread, 1, NUM_WORKER_THREADS);
41 | DDX_Text(pDX, IDC_P4, m_k);
42 | DDX_Text(pDX, IDC_P1, m_b);
43 | DDV_MinMaxUInt (pDX, m_b, 2, 1000000000);
44 | DDX_Text(pDX, IDC_P5, m_n);
45 | DDV_MinMaxUInt (pDX, m_n, 1,
46 | CPU_FLAGS & CPU_SSE2 ? MAX_PRIME_SSE2 : MAX_PRIME);
47 | DDX_Text(pDX, IDC_P6, m_c);
48 | DDX_Text(pDX, IDC_P2, m_bound1);
49 | DDX_Text(pDX, IDC_P3, m_bound2);
50 | //}}AFX_DATA_MAP
51 | c_thread_text.EnableWindow (NUM_WORKER_THREADS > 1);
52 | c_thread.EnableWindow (NUM_WORKER_THREADS > 1);
53 | }
54 |
55 |
56 | BEGIN_MESSAGE_MAP(CPminus1Dlg, CDialog)
57 | //{{AFX_MSG_MAP(CPminus1Dlg)
58 | // NOTE: the ClassWizard will add message map macros here
59 | //}}AFX_MSG_MAP
60 | END_MESSAGE_MAP()
61 |
62 | /////////////////////////////////////////////////////////////////////////////
63 | // CPminus1Dlg message handlers
64 |
--------------------------------------------------------------------------------
/macosx/Prime95/QuitGIMPSController.m:
--------------------------------------------------------------------------------
1 | //
2 | // QuitGIMPSController.m
3 | // Prime95
4 | //
5 | // Created by George Woltman on 5/1/09.
6 | // Copyright 2009 Mersenne Research, Inc. All rights reserved.
7 | //
8 |
9 | #import "QuitGIMPSController.h"
10 | #include "prime95.h"
11 |
12 | @implementation QuitGIMPSController
13 |
14 | - (id)init
15 | {
16 | if (![super initWithWindowNibName:@"QuitGIMPS"]) return nil;
17 | return self;
18 | }
19 |
20 | - (void)windowDidLoad
21 | {
22 | [self reInit];
23 | }
24 |
25 | #define MAC_MANUAL_QUIT "You have elected to remove this computer from the Great Internet Mersenne Prime Search. Other computers using this user ID will not be affected.\n\nPlease send the file results.txt to woltman@alum.mit.edu.\n\nAre you sure you want to do this?"
26 | #define MAC_PRIMENET_QUIT "You have elected to remove this computer from the Great Internet Mersenne Prime Search. Other computers using this user ID will not be affected.\n\nPlease make sure your results have been successfully sent to the server before uninstalling the program. If in doubt, you can send the results.txt file to woltman@alum.mit.edu.\n\nYou can either complete your current assignment or you can quit GIMPS immediately."
27 |
28 | - (void)reInit
29 | {
30 | [self setExplanation:[[NSString alloc] initWithFormat:@"%s", !USE_PRIMENET ? MAC_MANUAL_QUIT : MAC_PRIMENET_QUIT]];
31 | }
32 |
33 | @synthesize explanation;
34 |
35 | - (IBAction)quitLater:(id)sender
36 | {
37 | OutputBoth (MAIN_THREAD_NUM, "Quitting GIMPS after current work completes.\n");
38 | IniWriteInt (INI_FILE, "NoMoreWork", 1);
39 | [[self window] performClose:self];
40 | }
41 |
42 | - (IBAction)quitNow:(id)sender
43 | {
44 | OutputBoth (MAIN_THREAD_NUM, "Quitting GIMPS immediately.\n");
45 | stop_workers_for_escape ();
46 | if (USE_PRIMENET) spoolMessage (MSG_QUIT_GIMPS, NULL);
47 | [[self window] performClose:self];
48 | }
49 |
50 | @end
51 |
--------------------------------------------------------------------------------
/prime95/hlp/NewFeaturesInVersion_17.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | New Features in Version 17 of Prime95
5 |
6 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
What's New: New Features in Version 17.x of Prime95
23 |
24 |
25 |
26 |
NEW FEATURES IN VERSION 17.x of PRIME95.EXE
27 |
New Features in Version 17.2 of Prime95
28 |
29 |
Faster 2^N+1 ECM factoring
30 |
31 |
32 |
New Features in Version 17.1 of Prime95
33 |
34 |
The -T command line switch has been deleted.
35 |
36 |
You can now fine tune your control of the program by adding Time= lines to
37 | your prime.ini file - see the readme.txt file.
38 |
39 |
ECM factoring for 2^N+1 is now available.
40 |
41 |
By default, ECM factoring stops if a factor is found for exponents above 5825
42 | and continues (if the cofactor is composite) for exponents below 5825. You can
43 | override this behavior by setting ContinueECM=0 or 1 in prime.ini.
44 |
45 |
46 |
New features in Version 17.0 of Prime95
47 |
48 |
Prime95 can now be used to double-check its own results.
49 |
50 |
Machines less powerful than a P133 will default to double-checking assignments.
51 |
52 |
The total number of errors that occur during the Lucas-Lehmer test are now
53 | output in results.txt.
54 |
What's New: New Features in Version 10.x of
23 | Prime95
24 |
25 |
26 |
27 |
NEW FEATURES IN VERSION 10.x of PRIME95.EXE
28 |
New Features in Version 10 of Prime95
29 |
30 |
The program will now undergo an hour long self-test before running any
31 | Lucas-Lehmer tests in your selected range. This self-test is also available
32 | from the menus. You might want to run this when you install new hardware or
33 | device drivers.
34 |
35 |
You can now get a status report on your range. Choose Range Status from
36 | the menus to get a report on the number of Mersenne numbers left to test,
37 | expected time to completion, etc. This information is also displayed whenever
38 | you choose a new range with Range Start or Range Next.
39 |
40 |
The File menu has been renamed Range - it seems clearer to beginners.
41 |
42 |
The Advanced menu has been disabled. You must read the readme.txt file to
43 | learn how to activate it. This is designed to keep novice users out of
44 | trouble. There is no reason, other than curiosity, for you to use any of the
45 | Advanced menu choices.
46 |
47 |
A bug in stopping and continuing when factoring in Version 8 has been
48 | fixed.
49 |
To verify that a first-time Lucas-Lehmer
24 | primality test was performed without error, GIMPS runs the primality test a
25 | second time. During each test, the low order 64 bits of the final S(P)-2 value,
26 | called a residue, are printed. If these match, then GIMPS declares the exponent
27 | properly double-checked. If they do not match, then the primality test is run
28 | again until a match finally occurs.
29 |
30 | GIMPS goes a bit further to guard against programming errors. Prior to starting
31 | the Lucas-Lehmer test, the S(0) value
32 | is left shifted by a random amount. Each squaring just doubles how much we have
33 | shifted the S value. Note that the mod 2p-1 step merely rotates the
34 | p-th bits and above to the least significant bits, so there is no loss of
35 | information. Why do we go to this trouble? If there were a bug in the FFT code,
36 | then the shifting of the S values insures that the FFTs in the first primality
37 | test are dealing with completely different data than the FFTs in the second
38 | primality test. It would be near impossible for a programming bug to produce the
39 | same final 64-bit residues.
40 |
41 | Historically, the error rate for a
42 | Lucas-Lehmer test is a little over one percent.
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/gwnum/mult4.asm:
--------------------------------------------------------------------------------
1 | ; Copyright 1995-2009 Mersenne Research, Inc. All rights reserved
2 | ; Author: George Woltman
3 | ; Email: woltman@alum.mit.edu
4 | ;
5 | ; This routine implements a discrete weighted transform to quickly multiply
6 | ; two numbers.
7 | ;
8 | ; This code handles FFTs that uses a scratch area in pass 1.
9 | ;
10 | ; You will not stand a chance of understanding any of this code without
11 | ; thoroughly familiarizing yourself with fast fourier transforms. This
12 | ; code was adapted from an algorithm described in Richard Crandall's article
13 | ; on Discrete Weighted Transforms and Large-Integer Arithmetic.
14 | ;
15 |
16 | TITLE setup
17 |
18 | .686
19 | .XMM
20 | .MODEL FLAT
21 |
22 | INCLUDE unravel.mac
23 | INCLUDE extrn.mac
24 | INCLUDE lucas.mac
25 | INCLUDE pfa.mac
26 | INCLUDE mult.mac
27 | INCLUDE pass1.mac
28 | INCLUDE fft4.mac
29 | INCLUDE memory.mac
30 |
31 | EXTRN gw_finish_fft:PROC
32 | EXTRN gw_carries:PROC
33 | EXTRN gw_finish_mult:PROC
34 |
35 | EXTRNP pass2_12_levels
36 |
37 | _TEXT SEGMENT
38 |
39 | flat_distances
40 |
41 | ;; All the FFT routines for each FFT length
42 |
43 | ;; Distance between two pass 2 data blocks. Pass 2 does 12 FFT levels.
44 | ;; 2^12 complex values = 2^13 doubles = 64KB.
45 |
46 | blkdst = (16*(4096+64)+64)
47 |
48 | ; fft 80K
49 | ; fft 96K
50 | ; fft 96Kp
51 | ; fft 112K
52 | ; fft 128K
53 | ; fft 128Kp
54 | ; fft 160K
55 | ; fft 192K
56 | ; fft 192Kp
57 | ; fft 224K
58 | ; fft 256K
59 | ; fft 256Kp
60 | ; fft 320K
61 | ; fft 384K
62 | ; fft 384Kp
63 | ; fft 448K
64 | ; fft 512K
65 | ; fft 512Kp
66 |
67 | INCLUDE pass1scr.mac
68 |
69 | ; fft 640K
70 | ; fft 768K
71 | ; fft 768Kp
72 | ; fft 896K
73 | ; fftclm 1024K, 2
74 | ; fft 1024Kp
75 | fft 1280K
76 | fft 1536K
77 | fft 1536Kp
78 | fft 1792K
79 | fftclm 2048K, 2
80 | fft 2048Kp
81 | fftclm 2560K, 2
82 | fftclm 3072K, 2
83 | fftclm 3072Kp, 2
84 | fftclm 3584K, 2
85 | fftclm 4096K, 2
86 | fftclm 4096Kp, 2
87 |
88 | _TEXT ENDS
89 | END
90 |
--------------------------------------------------------------------------------
/prime95/MainFrm.h:
--------------------------------------------------------------------------------
1 | // MainFrm.h : interface of the CMainFrame class
2 | //
3 | /////////////////////////////////////////////////////////////////////////////
4 | const int MYWM_TRAYMESSAGE = WM_APP + 100;
5 |
6 | #define ID_WINDOW_POSITION 0xE136
7 |
8 | class CMainFrame : public CMDIFrameWnd
9 | {
10 | DECLARE_DYNCREATE(CMainFrame)
11 | public:
12 | CMainFrame();
13 |
14 | // Attributes
15 | public:
16 |
17 | // Operations
18 | public:
19 |
20 | // Overrides
21 | // ClassWizard generated virtual function overrides
22 | //{{AFX_VIRTUAL(CMainFrame)
23 | public:
24 | virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
25 | virtual void OnUpdateFrameTitle(BOOL bAddToTitle);
26 | virtual BOOL DestroyWindow();
27 | protected:
28 | virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
29 | //}}AFX_VIRTUAL
30 | afx_msg LRESULT OnPower( WPARAM, LPARAM );
31 | afx_msg LRESULT OnTrayMessage( WPARAM, LPARAM );
32 | LRESULT OnTaskBarCreated (WPARAM, LPARAM);
33 |
34 | // Implementation
35 | public:
36 | virtual ~CMainFrame();
37 | #ifdef _DEBUG
38 | virtual void AssertValid() const;
39 | virtual void Dump(CDumpContext& dc) const;
40 | #endif
41 |
42 | CStatusBar m_wndStatusBar;
43 | protected: // control bar embedded members
44 |
45 | // Generated message map functions
46 | protected:
47 | afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
48 | //{{AFX_MSG(CMainFrame)
49 | afx_msg void OnSize(UINT nType, int cx, int cy);
50 | afx_msg void OnEndSession(BOOL bEnding);
51 | afx_msg void OnActivateApp(BOOL bActive, DWORD hTask);
52 | afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
53 | afx_msg void OnTrayOpenWindow();
54 | afx_msg void OnStopContinue();
55 | afx_msg void OnTile();
56 | afx_msg void OnPosition();
57 | afx_msg LRESULT OnServiceStop(WPARAM wParam, LPARAM lParam);
58 | //}}AFX_MSG
59 | DECLARE_MESSAGE_MAP()
60 | public:
61 | };
62 |
63 | /////////////////////////////////////////////////////////////////////////////
64 |
--------------------------------------------------------------------------------
/os2/makefile:
--------------------------------------------------------------------------------
1 | # Makefile for OS/2 mprime
2 | # to compile with Watcom 11c / OpenWatcom
3 | # use with GNUMAKE
4 | # (c) Max Alekseyev
5 |
6 | CC = wcc386
7 | CPP = wpp386
8 | CFLAGS = /ox /d0 /I..;..\linux;..\gwnum;..\qd /5s /D__IBMC__ /DTCPV40HDRS
9 | LINK = wlink
10 | LFLAGS = LIBPath ..\prime95;..\linux;..\gwnum op m import DosQuerySysState DOSCALLS.368
11 |
12 | # debug version
13 | # CFLAGS = /ox /d3 /I.. /5s /D__IBMC__ /D_DEBUG
14 | # LFLAGS = LIBPath ..\prime95 op m debug all import DosQuerySysState DOSCALLS.368
15 |
16 | COFFOBJS = cpuidhlp.obj,factor32.obj,gianthlp.obj,mult.obj,mult1.obj,mult1aux.obj,mult2.obj,mult2a.obj,mult2aux.obj,mult2p.obj,mult3.obj,mult3a.obj,mult3ap.obj,mult3p.obj,mult4.obj,mult4p.obj,xmult1.obj,xmult1ax.obj,xmult2.obj,xmult2a.obj,xmult2ap.obj,xmult2ax.obj,xmult2p.obj,xmult3.obj,xmult3a.obj,xmult3ap.obj,xmult3p.obj,xmult4.obj,xmult4p.obj,xmult5.obj,xmult5p.obj,xmult6.obj,xmult6p.obj
17 | DUMMYOBJS = dummy4.obj,dummy8.obj,dummy12.obj,dummy16.obj,dummy20.obj,dummy24.obj,dummy28.obj
18 | PRIMEOBJS = prime.obj,menu.obj
19 |
20 | # PRIMESRC = prime.c,menu.c
21 | # LIBS = tcpip32.lib
22 | LIBS = so32dll.lib,tcp32dll.lib
23 | EXE = primeos2.exe
24 |
25 | $(EXE): prime.obj menu.obj cpuid.obj giants.obj gwdbldbl.obj gwnum.obj gwutil.obj # $(PRIMEOBJS),$(COFFOBJS),$(DUMMYOBJS)
26 | $(LINK) $(LFLAGS) file prime.obj,menu.obj,cpuid.obj,giants.obj,gwdbldbl.obj,gwnum.obj,gwutil.obj name $(EXE) libfile $(COFFOBJS) library $(LIBS)
27 |
28 | prime.obj: ..\linux\prime.c
29 | $(CC) $(CFLAGS) $<
30 |
31 | menu.obj: ..\linux\menu.c
32 | $(CC) $(CFLAGS) $<
33 |
34 | gwdbldbl.obj: ..\gwnum\gwdbldbl.cpp
35 | $(CPP) $(CFLAGS) $<
36 |
37 | cpuid.obj: ..\gwnum\cpuid.c
38 | $(CC) $(CFLAGS) /DADD_UNDERSCORES $<
39 |
40 | giants.obj: ..\gwnum\giants.c
41 | $(CC) $(CFLAGS) /DADD_UNDERSCORES $<
42 |
43 | gwnum.obj: ..\gwnum\gwnum.c
44 | $(CC) $(CFLAGS) /DADD_UNDERSCORES $<
45 |
46 | gwutil.obj: ..\gwnum\gwutil.c
47 | $(CC) $(CFLAGS) $<
48 |
49 | clean:
50 | del $(EXE) *.obj
51 |
--------------------------------------------------------------------------------
/qd/bits.cc:
--------------------------------------------------------------------------------
1 | /*
2 | * src/bits.cc
3 | *
4 | * This work was supported by the Director, Office of Science, Division
5 | * of Mathematical, Information, and Computational Sciences of the
6 | * U.S. Department of Energy under contract number DE-AC03-76SF00098.
7 | *
8 | * Copyright (c) 2000-2001
9 | *
10 | * Defines various routines to get / set bits of a IEEE floating point
11 | * number. This used by the library for debugging purposes.
12 | */
13 |
14 | #include
15 | #include
16 | #include
17 | #include "bits.h"
18 |
19 | #ifdef CRAY
20 | #include
21 | #endif
22 |
23 | using namespace std;
24 |
25 | #ifndef isinf
26 | #define isinf(x) ((x) != 0.0 && (x) == (2.0*x))
27 | #endif
28 | #ifndef isnan
29 | #define isnan(x) ((x) != (x))
30 | #endif
31 |
32 | int get_double_expn(double x) {
33 | if (x == 0.0)
34 | return INT_MIN;
35 | if (isinf(x) || isnan(x))
36 | return INT_MAX;
37 |
38 | double y = fabs(x);
39 | int i = 0;
40 | if (y < 1.0) {
41 | while (y < 1.0) {
42 | y *= 2.0;
43 | i++;
44 | }
45 | return -i;
46 | } else if (y >= 2.0) {
47 | while (y >= 2.0) {
48 | y *= 0.5;
49 | i++;
50 | }
51 | return i;
52 | }
53 | return 0;
54 | }
55 |
56 | #ifdef STREAMS
57 |
58 | void print_double_info(double x) {
59 | if (isnan(x)) {
60 | cout << "NaN";
61 | return;
62 | }
63 |
64 | double sign = copysign(1.0, x);
65 | cout << (sign < 0.0 ? "- " : "+ ");
66 | if (isinf(x)) {
67 | cout << "Inf";
68 | return;
69 | }
70 |
71 | if (x == 0.0) {
72 | cout << "0";
73 | return;
74 | }
75 |
76 | /* Now that we handled NaNs, Infs, and Zeros,
77 | x should be a normal number. */
78 | x = fabs(x);
79 | int expn = get_double_expn(x);
80 | double d = ldexp(1.0, expn);
81 | cout << expn << " ";
82 | while (x != 0.0) {
83 | if (x >= d) {
84 | x -= d;
85 | cout << '1';
86 | } else
87 | cout << '0';
88 | d *= 0.5;
89 | }
90 | }
91 |
92 | #endif
93 |
--------------------------------------------------------------------------------
/linux/makefile:
--------------------------------------------------------------------------------
1 | # Makefile for Linux 32-bit mprime
2 | #
3 | # NOTES: libcurl built by downloading latest sources and:
4 | # ./configure --without-ssl --without-libssh2 --without-libidn --disable-ldap --disable-ldaps --without-gssapi --enable-ipv6 --without-krb4
5 | # make
6 | # make install
7 | # After linking, check to see if too many dynamic libraries are required by doing:
8 | # ldd mprime
9 | #
10 | # Ugh, different linux variants require different makefiles.
11 | # The current makefile is for CentOS 5.10. We prefer to link against
12 | # older Linux versions because linking on the latest, greatest version
13 | # will create an mprime executable that will not run on older
14 | # Linux versions because of glibc incompatibilites.
15 | #
16 | # Some linux versions require some of the variations below:
17 | # "export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig"
18 | # CFLAGS = -I.. -I../gwnum -O2 -march=i486 -malign-double -Wno-unused-result
19 | # LFLAGS = -Wl,-M
20 | # LIBS = ../gwnum/gwnum.a ../gwnum/gwnum.ld -lm -lpthread -Wl,-Bstatic $(shell pkg-config --static --libs libcurl) -lstdc++ -Wl,-Bdynamic -ldl
21 |
22 | CC = gcc
23 | CFLAGS = -I.. -I../gwnum -O2 -march=i486 -malign-double
24 |
25 | CPP = g++
26 | CPPFLAGS = -I.. -I../gwnum -O2 -march=i486 -malign-double
27 |
28 | LFLAGS = -Wl,-M -Wl,-L/usr/local/lib
29 | LIBS = ../gwnum/gwnum.a ../gwnum/gwnum.ld -lm -lpthread -Wl,-Bstatic -lcurl -Wl,-Bdynamic -lrt -lstdc++ -ldl
30 |
31 | FACTOROBJ = factor32.o
32 | LINUXOBJS = prime.o menu.o
33 | EXE = mprime
34 |
35 | #########################################################################
36 |
37 | $(EXE): security $(LINUXOBJS) $(FACTOROBJ)
38 | $(CC) $(LFLAGS) -o $(EXE) $(LINUXOBJS) $(FACTOROBJ) $(LIBS)
39 |
40 | security:
41 | [ ! -e ../security.h ] && touch ../security.h || true
42 | [ ! -e ../security.c ] && touch ../security.c || true
43 | [ ! -e ../secure5.c ] && touch ../secure5.c || true
44 |
45 | clean:
46 | rm -f $(EXE) $(EXE2) $(LINUXOBJS)
47 |
48 | .c.o:
49 | $(CC) $(CFLAGS) -c $<
50 |
51 | .cpp.o:
52 | $(CPP) $(CPPFLAGS) -c $<
53 |
--------------------------------------------------------------------------------
/prime95/hlp/WhatAreMersennePrimes.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | What Are Mersenne Primes and Why Do We Search for Them?
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
Welcome...: What Are Mersenne Primes and Why
18 | Do We Search for Them?
19 |
20 |
21 |
22 |
WHAT ARE MERSENNE PRIMES AND WHY DO WE SEARCH FOR THEM?
23 |
Prime numbers have long fascinated amateur and professional mathematicians.
24 | An integer greater than one is called a prime number if its only divisors are
25 | one and itself. The first prime numbers are 2, 3, 5, 7, 11, etc. For example,
26 | the number 10 is not prime because it is divisible by 2 and 5.
27 |
28 | A Mersenne prime is a prime of the form 2P-1. The first Mersenne
29 | primes are 3, 7, 31, 127, etc. There are only 40 known Mersenne primes.
30 | GIMPS, the Great
31 | Internet Mersenne Prime Search, was formed in January 1996 to discover new
32 | world-record-size Mersenne primes. GIMPS harnesses the power of thousands of
33 | small computers like yours to search for these "needles in a haystack".
34 |
35 | Most GIMPS members join the search for the thrill of possibly discovering a
36 | record setting, rare, and historic new Mersenne prime. Of course, there are
37 | many other
38 | reasons.
39 |
40 | Not enough info? See http://www.utm.edu/research/primes/mersenne.shtml for a
41 | good description of Mersenne primes.
42 |
Great Internet Mersenne Prime Search Research Computing Software v24
23 |
24 | It is up to you to get your employer's permission before
25 | installing this software on any office machines. Many companies have a strict policy
26 | against running any non-business software, however hundreds of companies and other
27 | large organizations are participating successfully in the GIMPS research project.
28 | Your network administrator, MIS or IT manager is welcome to contact us about this
29 | software at primenet@mersenne.org.
30 | You can also ask for help or more information at
31 | http://www.mersenneforum.org.
32 |
33 | Every effort has been made to ensure that you will be assigned an exponent that
34 | no one else has tested or is testing. We are not responsible for lost prize money,
35 | fame, credit, etc. should someone accidentally or maliciously test the number you
36 | are working on and find it to be prime. We are not responsible should the program
37 | determine a number composite even though it is prime - the program's heavy use of
38 | memory and FPU could trigger an error that goes undetected.
39 |
40 | Finally, as with all freeware, the program is provided "as is". However, please
41 | do send bug reports and suggestions for improvements to
42 | woltman@alum.mit.edu. See
43 | http://www.mersenne.org/freesoft.htm
44 | for free updates
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/prime95/hlp/Prime95.hhp:
--------------------------------------------------------------------------------
1 | [OPTIONS]
2 | Compatibility=1.1 or later
3 | Compiled file=Prime95.chm
4 | Contents file=Prime95.hhc
5 | Default topic=Welcome.html
6 | Display compile progress=Yes
7 | Full-text search=Yes
8 | Index file=Prime95.hhk
9 | Language=0x409 English (United States)
10 | Title=Prime95 Help
11 |
12 |
13 | [FILES]
14 | AdvancedMenu.html
15 | AdvancedMenuECM.html
16 | AdvancedMenuManual.html
17 | AdvancedMenuP1.html
18 | AdvancedMenuPassword.html
19 | AdvancedMenuPriority.html
20 | AdvancedMenuQuit.html
21 | AdvancedMenuRoundoff.html
22 | AdvancedMenuTest.html
23 | AdvancedMenuTime.html
24 | AdvancedMenuUnreserve.html
25 | AvailableMemory.html
26 | CashAwards.html
27 | CommandLine.html
28 | Disclaimer.html
29 | DoubleChecking.html
30 | EndUser.html
31 | Factoring.html
32 | FileList.html
33 | HowGIMPSWorks.html
34 | Instructions.html
35 | InstructionsAutomatic.html
36 | InstructionsManual.html
37 | Lucas-LehmerDetails.html
38 | NewFeaturesInVersion_8.html
39 | NewFeaturesInVersion_10.html
40 | NewFeaturesInVersion_12.html
41 | NewFeaturesInVersion_13.html
42 | NewFeaturesInVersion_14.html
43 | NewFeaturesInVersion_15.html
44 | NewFeaturesInVersion_16.html
45 | NewFeaturesInVersion_17.html
46 | NewFeaturesInVersion_18.html
47 | NewFeaturesInVersion_19.html
48 | NewFeaturesInVersion_20.html
49 | NewFeaturesInVersion_21.html
50 | NewFeaturesInVersion_22.html
51 | NewFeaturesInVersion_23.html
52 | NewFeaturesInVersion_24.html
53 | Newsletters.html
54 | Notes.html
55 | OptionsMenu.html
56 | OptionsMenuBenchmark.html
57 | OptionsMenuCPU.html
58 | OptionsMenuPreferences.html
59 | OptionsMenuTortureTest.html
60 | OptionsMenuTrayIcon.html
61 | OptionsMenuWin95.html
62 | PossibleHardwareFailure.html
63 | ProgramOutput.html
64 | Proxy.html
65 | RunningonSeveralMachines.html
66 | StressTestingYourComputer.html
67 | Success.html
68 | TestMenu.html
69 | TestMenuContinue.html
70 | TestMenuPrimeNet.html
71 | TestMenuStatus.html
72 | TestMenuStop.html
73 | TestMenuUserInfo.html
74 | TestMenuVacation.html
75 | Thanks.html
76 | ThirdParty.html
77 | Undoc.html
78 | Welcome.html
79 | WhatAreMersennePrimes.html
80 | WhatIsThisProgram.html
81 |
82 | [ALIAS]
83 | #include Alias.h
84 |
85 | [MAP]
86 | #include HelpTopics.h
87 | #include HtmlDefines.h
88 |
89 | [INFOTYPES]
90 |
91 |
--------------------------------------------------------------------------------
/prime95/hlp/AdvancedMenuECM.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Advanced Menu - ECM
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
How to Use Prime95: Advanced Menu - ECM
18 |
19 |
20 |
21 |
ADVANCED MENU - ECM
22 |
ECM
23 |
24 |
The ECM choice lets you factor Mersenne numbers using the Elliptic Curve
25 | Method of factoring. Select a few exponents and bounds to factor from the
26 | http://www.mersenne.org/ecm.htm web
27 | pages.
28 |
29 |
Note: You do not reserve exponents to work on, several people can
30 | do ECM factoring on the same exponent. The program uses a random number generator
31 | to select elliptic curves to test. You must email results to me at
32 | woltman@alum.mit.edu -
33 | PrimeNet does not support
34 | ECM factoring. WARNING: ECM does not adhere to the memory limits specified in the
35 | Options/CPU dialog box. ECM requires a minimum of 192 times the FFT size. Thus,
36 | ECM factoring of F20 which uses a 64K FFT will use a minimum of 192 * 64K or 12MB
37 | of memory. You can also edit the worktodo.ini file directly.
38 | For example:
39 |
ECM=751,3000000,0,100,0,0,0,0
40 |
The first value is the exponent. The second value is bound #1. The third value
41 | is bound #2 - leave it as zero. The fourth value is the number of curves to test.
42 | The fifth value is no longer used. The sixth value is the specific curve to test
43 | - it is only used in debugging. The seventh value is 0 for 2^N-1 factoring, 1 for
44 | 2^N+1 factoring. The eighth value is no longer used.
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/prime95/Prime95View.h:
--------------------------------------------------------------------------------
1 | // Prime95View.h : interface of the CPrime95View class
2 | //
3 | /////////////////////////////////////////////////////////////////////////////
4 |
5 | #define MAX_VIEW_LINES 1000
6 |
7 | class CPrime95View : public CScrollView
8 | {
9 | protected: // create from serialization only
10 | CPrime95View();
11 | DECLARE_DYNCREATE(CPrime95View)
12 |
13 | // Attributes
14 | public:
15 | CPrime95Doc* GetDocument();
16 |
17 | // Operations
18 | public:
19 |
20 | // Overrides
21 | // ClassWizard generated virtual function overrides
22 | //{{AFX_VIRTUAL(CPrime95View)
23 | public:
24 | virtual void OnDraw(CDC* pDC); // overridden to draw this view
25 | virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
26 | virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
27 | protected:
28 | //}}AFX_VIRTUAL
29 |
30 | // Implementation
31 | public:
32 | virtual ~CPrime95View();
33 | #ifdef _DEBUG
34 | virtual void AssertValid() const;
35 | virtual void Dump(CDumpContext& dc) const;
36 | #endif
37 |
38 | protected:
39 | char BaseTitle[80]; // Base Title (prefix) of MDI window
40 | char Title[80]; // Title of MDI window
41 | char LineData[MAX_VIEW_LINES][160]; // Data area for lines of text
42 | char *Lines[MAX_VIEW_LINES]; // Pointers to lines of text
43 | int NumLines; // Number of text lines we have
44 | int MaxLineSize; // Number of chars in widest line
45 | HICON icon; // Icon to display
46 |
47 | public:
48 | void base_title (const char *);
49 | void title (const char *);
50 | void ChangeIcon (int);
51 | void getCharSize ();
52 | void position (int, int, BOOL);
53 | void LineFeed ();
54 | void RealOutputStr (const char *);
55 |
56 | // Generated message map functions
57 | protected:
58 | //{{AFX_MSG(CPrime95View)
59 | afx_msg void OnScroll();
60 | afx_msg void OnTitle();
61 | afx_msg void OnIcon();
62 | afx_msg void OnEditCopy();
63 | //}}AFX_MSG
64 | DECLARE_MESSAGE_MAP()
65 | public:
66 | afx_msg void OnDestroy();
67 | };
68 |
69 | #ifndef _DEBUG // debug version in Prime95View.cpp
70 | inline CPrime95Doc* CPrime95View::GetDocument()
71 | { return (CPrime95Doc*)m_pDocument; }
72 | #endif
73 |
74 | void PositionViews (int forceTile);
75 | void SaveViews (void);
76 |
77 | /////////////////////////////////////////////////////////////////////////////
78 |
79 |
--------------------------------------------------------------------------------
/gwnum/yarch.mac:
--------------------------------------------------------------------------------
1 | ; Copyright 2011-2013 - Mersenne Research, Inc. All rights reserved
2 | ; Author: George Woltman
3 | ; Email: woltman@alum.mit.edu
4 | ;
5 |
6 | ;
7 | ; Expand the command line architecture definition into its names and features
8 | ;
9 |
10 | IF @INSTR(,%ARCH,) NE 0
11 | yarch TEXTEQU
12 | PREFETCHING = 64
13 | TLB_PRIMING = 0
14 | ELSEIF @INSTR(,%ARCH,) NE 0
15 | yarch TEXTEQU
16 | PREFETCHING = 64
17 | TLB_PRIMING = 0
18 | ELSEIF @INSTR(,%ARCH,) NE 0
19 | yarch TEXTEQU
20 | PREFETCHING = 64
21 | TLB_PRIMING = 0
22 | ELSEIF @INSTR(,%ARCH,) NE 0
23 | yarch TEXTEQU
24 | PREFETCHING = 64
25 | TLB_PRIMING = 0
26 | ELSE
27 | arch_not_given_on_command_line
28 | ENDIF
29 |
30 | ;
31 | ; Macros used to conditionally eliminate some FFT implementations.
32 | ; Using macros allows us change our minds and include these implementations
33 | ; for a test build.
34 | ;
35 |
36 | CORE = 01h ; Assemble this FFT for CORE architecture
37 | FMA3 = 02h ; Assemble this FFT for Haswell architecture
38 | BULL = 04h ; Assemble this FFT for Bulldozer architecture
39 |
40 | IFDEF X86_64
41 | CORE_32 = 0
42 | FMA3_32 = 0
43 | BULL_32 = 0
44 | CORE_64 = CORE
45 | FMA3_64 = FMA3
46 | BULL_64 = BULL
47 | ELSE
48 | CORE_32 = CORE
49 | FMA3_32 = FMA3
50 | BULL_32 = BULL
51 | CORE_64 = 0
52 | FMA3_64 = 0
53 | BULL_64 = 0
54 | ENDIF
55 |
56 | ;; Used to conditionally assemble FFT implementations for various CPU architectures
57 | buildfor MACRO archs, ops:vararg
58 | IFB
59 | local_archs = 0
60 | ELSE
61 | local_archs = archs
62 | ENDIF
63 | ;; Here is where we can force assembling all implementations.
64 | ;; Used when we are benchmarking to find the best FFT implementations.
65 | IFDEF IMPL_ALL_CORE
66 | local_archs = local_archs OR CORE
67 | ENDIF
68 | IFDEF IMPL_ALL_FMA3
69 | local_archs = local_archs OR FMA3
70 | ENDIF
71 | IFDEF IMPL_ALL_BULL
72 | local_archs = local_archs OR BULL
73 | ENDIF
74 | ;; Conditionally assemble this FFT implementation
75 | IF (@INSTR(,%yarch,) NE 0) AND (local_archs AND CORE) NE 0
76 | &ops
77 | ENDIF
78 | IF (@INSTR(,%yarch,) NE 0) AND (local_archs AND FMA3) NE 0
79 | &ops
80 | ENDIF
81 | IF (@INSTR(,%yarch,) NE 0) AND (local_archs AND BULL) NE 0
82 | &ops
83 | ENDIF
84 | ENDM
85 |
86 |
--------------------------------------------------------------------------------
/prime95/hlp/Alias.h:
--------------------------------------------------------------------------------
1 | HIDM_CONTINUE=TestMenuContinue.html
2 | HIDM_STOP=TestMenuStop.html
3 | HIDM_ERRCHK=AdvancedMenuRoundoff.html
4 | HIDD_TEST=AdvancedMenuTest.html
5 | HIDM_TEST=AdvancedMenuTest.html
6 | HIDD_TIME=AdvancedMenuTime.html
7 | HIDM_TIME=AdvancedMenuTime.html
8 | HIDD_PREFERENCES=OptionsMenuPreferences.html
9 | HIDM_PREFERENCES=OptionsMenuPreferences.html
10 | HIDD_CPU=OptionsMenuCPU.html
11 | HIDM_CPU=OptionsMenuCPU.html
12 | HID_RANGE_STATUS=TestMenuStatus.html
13 | HIDD_PASSWORD=AdvancedMenuPassword.html
14 | HIDM_PASSWORD=AdvancedMenuPassword.html
15 | HIDM_TRAY=OptionsMenuTrayIcon.html
16 | HIDM_HIDE=OptionsMenuTrayIcon.html
17 | HIDM_TORTURE=OptionsMenuTortureTest.html
18 | HIDD_USER=TestMenuUserInfo.html
19 | HID_RANGE_USERINFORMATION=TestMenuUserInfo.html
20 | HIDD_PRIMENET=TestMenuPrimeNet.html
21 | HIDM_PRIMENET=TestMenuPrimeNet.html
22 | HIDD_PRIORITY=AdvancedMenuPriority.html
23 | HIDM_PRIORITY=AdvancedMenuPriority.html
24 | HIDM_QUIT=AdvancedMenuQuit.html
25 | HIDD_VACATION=TestMenuVacation.html
26 | HIDM_VACATION=TestMenuVacation.html
27 | HIDM_SERVICE=OptionsMenuWin95.html
28 | HIDD_MANUAL_COMM=AdvancedMenuManual.html
29 | HID_MANUALCOMM=AdvancedMenuManual.html
30 | HIDD_ECM=AdvancedMenuECM.html
31 | HIDM_ECM=AdvancedMenuECM.html
32 | HIDD_AFFINITY=Notes.html
33 | HIDM_AFFINITY=Notes.html
34 | HIDD_PMINUS1=AdvancedMenuP1.html
35 | HIDM_PMINUS1=AdvancedMenuP1.html
36 | HIDD_UNRESERVE=AdvancedMenuUnreserve.html
37 | HIDM_UNRESERVE=AdvancedMenuUnreserve.html
38 | HIDM_BENCHMARK=OptionsMenuBenchmark.html
39 | HIDD_WELCOME=Welcome.html
40 | HID_APP_EXIT=TestMenuStop.html
41 |
42 | HIDM_SERVER=TestMenu.html
43 | HID_HELP_FINDER=Welcome.html
44 | HIDD_ABOUTBOX=Welcome.html
45 | HIDD_ABOUTSERVER=Welcome.html
46 |
47 | HIDR_MAINFRAME=Welcome.html
48 | HID_HT_NOWHERE=Welcome.html
49 | HID_HT_CAPTION=Welcome.html
50 | HID_HT_SIZE=Welcome.html
51 | HID_HT_HSCROLL=Welcome.html
52 | HID_HT_VSCROLL=Welcome.html
53 | HID_HT_MINBUTTON=Welcome.html
54 | HID_HT_MAXBUTTON=Welcome.html
55 | HID_HT_OBJECT=Welcome.html
56 | HID_HT_CLOSE=Welcome.html
57 | HID_HT_HELP=Welcome.html
58 | HID_SC_SIZE=Welcome.html
59 | HID_SC_MOVE=Welcome.html
60 | HID_SC_MINIMIZE=Welcome.html
61 | HID_SC_MAXIMIZE=Welcome.html
62 | HID_SC_NEXTWINDOW=Welcome.html
63 | HID_SC_PREVWINDOW=Welcome.html
64 | HID_SC_CLOSE=Welcome.html
65 | HID_SC_RESTORE=Welcome.html
66 | HID_SC_TASKLIST=Welcome.html
67 |
--------------------------------------------------------------------------------
/prime95/hlp/Newsletters.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Newsletters
5 |
6 |
11 |
12 |
13 |
14 |
15 |
WELCOME TO THE GREAT INTERNET MERSENNE PRIME SEARCH!
43 |
Thank you for joining the Great Internet Mersenne Prime Search!
44 | You could discover one of the most coveted finds in all of Mathematics - a new Mersenne
45 | prime number. We've found eight already. Join in on this fun, yet serious research
46 | project. All you need is a personal computer, patience, and a lot of luck.
In
47 | addition to the joy of making a mathematical discovery, you might win some cash.
48 | The Electronic Frontier Foundation is offering a $100,000 award to the first person
49 | or group to discover a ten million-digit prime number! See how GIMPS will distribute
50 | this award if we are lucky enough to find a ten million-digit prime.
51 |
In case you ever forget, the URL is
52 | http://www.mersenne.org/prime.htm. My email
53 | address is woltman@alum.mit.edu. For networking questions, contact Scott Kurowski's
54 | technical support team at primenet@mersenne.org.
55 | http://www.mersenneforum.org forum is for anyone
56 | participating in the GIMPS project regardless of team affiliation and has
57 | answers to most of the questions you might be looking for.
Run prime95.exe. You will see 3 dialog boxes:
32 |
33 |
34 |
35 |
In the first dialog box, enter your name and email address. Click OK.
36 |
37 |
38 |
In the second dialog box, fill in roughly how many hours a day you leave your
39 | computer running. Please be sure to read instructions on how to configure
40 | memory settings before you continue any further. Click OK.
41 |
42 |
In the third dialog box uncheck "Use PrimeNet to get work and report results"
43 | and click OK.
44 |
45 |
46 |
47 |
Disable screen savers
48 | or use the "blank screen" screen saver. If this is not practical, consider
49 | raising prime95's priority to 4 or 5.
50 |
51 |
Once a month or when
52 | done with your exponents, use the web page again to send the file "results.txt"
53 | to the PrimeNet server. It is important to do this so the exponents you are
54 | testing are not reassigned to someone else.
55 |
56 |
57 |
The "Start at Bootup" menu choice (on by default) will run prime95 every time
58 | you boot your computer.
59 |
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/prime95/Prime95.h:
--------------------------------------------------------------------------------
1 | // Prime95.h : main header file for the PRIME95 application
2 | //
3 |
4 | #ifdef _WIN64
5 | #define X86_64
6 | #endif
7 |
8 | #ifndef __AFXWIN_H__
9 | #error include 'stdafx.h' before including this file for PCH
10 | #endif
11 |
12 | #include "resource.h" // main symbols
13 | //#define SERVER_TESTING
14 | #define NO_GUI 0
15 | #include "common.h"
16 | #include "cpuid.h"
17 | #include "gwnum.h"
18 | #include "commona.h"
19 | #include "commonb.h"
20 | #include "commonc.h"
21 | #include "comm95b.h"
22 | #include "comm95c.h"
23 | #include "primenet.h"
24 |
25 | /////////////////////////////////////////////////////////////////////////////
26 | // CPrime95App:
27 | // See Prime95.cpp for the implementation of this class
28 | //
29 |
30 | class CPrime95App : public CWinApp
31 | {
32 | public:
33 | CPrime95App();
34 | void TrayMessage (UINT, LPCSTR, HICON);
35 |
36 | // Overrides
37 | // ClassWizard generated virtual function overrides
38 | //{{AFX_VIRTUAL(CPrime95App)
39 | public:
40 | virtual BOOL InitInstance();
41 | virtual int ExitInstance();
42 | //}}AFX_VIRTUAL
43 |
44 | // Implementation
45 |
46 | //{{AFX_MSG(CPrime95App)
47 | afx_msg void OnAppAbout();
48 | // NOTE - the ClassWizard will add and remove member functions here.
49 | // DO NOT EDIT what you see in these blocks of generated code !
50 | //}}AFX_MSG
51 | DECLARE_MESSAGE_MAP()
52 | };
53 |
54 |
55 | /////////////////////////////////////////////////////////////////////////////
56 | // My non-MFC stuff went here
57 | /////////////////////////////////////////////////////////////////////////////
58 |
59 | // Global variables
60 |
61 | extern HANDLE g_hMutexInst;
62 |
63 | extern HICON ICON_IDLE; // Red = program stopped
64 | extern HICON ICON_WORKING; // Green = threads working
65 |
66 | extern int EXIT_IN_PROGRESS; // True if we are exiting
67 |
68 | extern int WINDOWS95_SERVICE; // True if we're running as a Win95 service
69 | extern int WINDOWS95_A_SWITCH; // Value of the -A command line switch
70 | extern LONG WM_ENDSESSION_LPARAM; // LPARAM of WM_ENDSESSION message
71 | extern int WINDOWS95_TRAY_ADD; // True if we need to add the icon
72 | // to the shell once the user logs in
73 |
74 | extern gwmutex VIEW_MUTEX; /* Lock for accessing Views Array */
75 | extern gwmutex VIEW_LINES_MUTEX; /* Lock for accessing Lines array */
76 |
77 | // Variables used to communicate with the NT service code
78 |
79 | extern "C" char NTSERVICENAME[32]; // name of the NT service
80 | extern "C" HWND MAINFRAME_HWND; // Handle of main frame window
81 |
82 | // Internal routines
83 |
84 | UINT threadDispatch (LPVOID);
85 | int canModifyServices ();
86 | void Service95 ();
87 |
--------------------------------------------------------------------------------
/gwnum/gwthread.h:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------------
2 | | gwthread.h
3 | |
4 | | This file contains the headers and definitions that are used to implement
5 | | multi-threading. Specifically, threads, mutexes, and events.
6 | |
7 | | Gwnum math routines use these routines to implement multi-threaded
8 | | multiplications. However, you can use these routines without using
9 | | the rest of the gwnum package if you so desire.
10 | |
11 | | NOTE: MFC users may not be able to use the thread creation routines as
12 | | because we call the C runtime library thread create rather than the
13 | | MFC thread create routine.
14 | |
15 | | Copyright 2006 Mersenne Research, Inc. All rights reserved.
16 | +---------------------------------------------------------------------*/
17 |
18 | #ifndef _GWTHREAD_H
19 | #define _GWTHREAD_H
20 |
21 | /* This is a C library. If used in a C++ program, don't let the C++ */
22 | /* compiler mangle names. */
23 |
24 | #ifdef __cplusplus
25 | extern "C" {
26 | #endif
27 |
28 | /******************************************************************************
29 | * Mutex and Events Routines *
30 | ******************************************************************************/
31 |
32 | typedef void *gwmutex; /* Definition of a mutex */
33 |
34 | void gwmutex_init (gwmutex *mutex); /* Mutex to init */
35 | void gwmutex_lock (gwmutex *mutex); /* Mutex to lock */
36 | void gwmutex_unlock (gwmutex *mutex); /* Mutex to unlock */
37 | void gwmutex_destroy (gwmutex *mutex); /* Mutex to destroy */
38 |
39 | typedef void *gwevent; /* Definition of an event handle */
40 |
41 | void gwevent_init (gwevent *event); /* Event to init */
42 | #define GWEVENT_TIMED_OUT 1
43 | #define GWEVENT_SIGNALED 2
44 | int gwevent_wait (gwevent *event, int seconds);
45 | void gwevent_signal (gwevent *event); /* Event to signal */
46 | void gwevent_reset (gwevent *event); /* Event to reset */
47 | void gwevent_destroy (gwevent *event); /* Event to destroy */
48 |
49 | /******************************************************************************
50 | * Thread Routines *
51 | ******************************************************************************/
52 |
53 | typedef void *gwthread; /* Definition of a thread handle */
54 |
55 | void gwthread_create (gwthread *thread_id, void (*thread_proc)(void *), void *arg);
56 | void gwthread_create_waitable (gwthread *thread_id, void (*thread_proc)(void *), void *arg);
57 | void gwthread_wait_for_exit (gwthread *thread_id);
58 | void gwthread_kill (gwthread *thread_id);
59 |
60 | #ifdef __cplusplus
61 | }
62 | #endif
63 |
64 | #endif
65 |
--------------------------------------------------------------------------------
/prime95/hlp/PossibleHardwareFailure.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Possible Hardware Failure
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
How to Use Prime95: Possible Hardware Failure
18 |
19 |
20 |
21 |
POSSIBLE HARDWARE FAILURE
22 | If the message, "Possible hardware failure, consult the readme file.", appears
23 | in the results file, then prime95's error-checking has detected a problem. After
24 | waiting 5 minutes, the program will continue testing from the last save file.
25 |
Could it be a software problem? If the error is ILLEGAL SUMOUT, then there is a
26 | good chance that this is a software problem. A device driver or VxD may not be
27 | saving and restoring FPU state correctly. The good news is that prime95 recovers
28 | very well from ILLEGAL SUMOUT errors. Try seeing if the problem occurs only when
29 | a specific device is active or a specific program is running.
30 |
31 |
The other two errors messages, SUMINP! = SUMOUT and ROUND OFF > 0.40 are caused
32 | by one of two things:
33 |
34 |
35 |
36 |
37 |
For reasons too complicated to go into here, the program's error checking is
38 | not perfect. Some errors can be missed and some correct results flagged as an
39 | error. If you get the message "Disregard last error..." upon continuing from the
40 | last save file, then you may have found the rare case where a good result was
41 | flagged as an error.
42 |
43 | A true hardware error.
44 |
45 |
If you do not get the "Disregard last error..." message or this happens more
46 | than once, then your machine is a good candidate for a torture test. See the
47 | stress.txt file or
48 | click here for more information.
49 |
Running the program on a computer with hardware problems may produce incorrect
50 | results. This won't hurt the GIMPS project since all results will be
51 | double-checked. However, you could be wasting your CPU time. If you are getting
52 | several errors during each primality test, then I recommend using your machine
53 | to factor Mersenne numbers or run less strenuous distributed computing projects
54 | at http://www.mersenne.org/projects.htm.
55 |