├── macosx ├── Prime95 │ ├── Prime95.xcodeproj │ │ ├── .svn │ │ │ ├── format │ │ │ ├── prop-base │ │ │ │ └── TemplateIcon.icns.svn-base │ │ │ ├── text-base │ │ │ │ └── TemplateIcon.icns.svn-base │ │ │ └── entries │ │ └── TemplateIcon.icns │ ├── Mersenne.icns │ ├── English.lproj │ │ └── InfoPlist.strings │ ├── Prime95_Prefix.pch │ ├── main.m │ ├── StatusController.h │ ├── AboutController.h │ ├── WindowController.h │ ├── UnreserveController.h │ ├── ManualCommunicationController.h │ ├── QuitGIMPSController.h │ ├── StopController.h │ ├── ContinueController.h │ ├── TimeController.h │ ├── TestController.h │ ├── PrimeNetController.h │ ├── UnreserveController.m │ ├── StatusController.m │ ├── AboutController.m │ ├── PRPController.h │ ├── ConnectionController.h │ ├── TimeController.m │ ├── prime95.h │ ├── Pminus1Controller.h │ ├── CPUController.h │ ├── StopController.m │ ├── Info.plist │ ├── ContinueController.m │ ├── ECMController.h │ ├── ManualCommunicationController.m │ ├── TortureTestController.h │ ├── PRPController.m │ ├── TestController.m │ ├── PreferencesController.h │ ├── WorkerWindowsController.h │ ├── Pminus1Controller.m │ ├── ECMController.m │ └── QuitGIMPSController.m ├── makefile └── prime.h ├── .gitignore ├── comm95a.h ├── gwnum ├── gwnum.ld ├── strip.bat ├── test.c ├── memory.mac ├── makebsd64 ├── make64 ├── makefile ├── makehaiku ├── makemsys ├── gwutil.h ├── gwcommon.h ├── mult1.asm ├── mult.mac ├── mult3.asm ├── mult4.asm ├── yarch.mac └── gwthread.h ├── prime95 ├── Prime95.rc ├── hlp │ ├── images │ ├── Prime95.chm │ ├── OptionsMenu.html │ ├── OptionsMenuWin95.html │ ├── Thanks.html │ ├── TestMenuContinue.html │ ├── ThirdParty.html │ ├── OptionsMenuTortureTest.html │ ├── Disclaimer.html │ ├── TestMenuStop.html │ ├── HelpTopics.h │ ├── OptionsMenuBenchmark.html │ ├── TestMenuStatus.html │ ├── OptionsMenuCPU.html │ ├── AdvancedMenuTest.html │ ├── AdvancedMenuRoundoff.html │ ├── WhatIsThisProgram.html │ ├── AdvancedMenuManual.html │ ├── AdvancedMenuPriority.html │ ├── NewFeaturesInVersion_8.html │ ├── NewFeaturesInVersion_18.html │ ├── AdvancedMenuTime.html │ ├── NewFeaturesInVersion_13.html │ ├── AdvancedMenuQuit.html │ ├── CommandLine.html │ ├── AdvancedMenuPassword.html │ ├── AdvancedMenuUnreserve.html │ ├── TestMenuVacation.html │ ├── AdvancedMenuP1.html │ ├── RunningOnSeveralMachines.html │ ├── OptionsMenuTrayIcon.html │ ├── Proxy.html │ ├── TestMenuPrimeNet.html │ ├── Instructions.html │ ├── OptionsMenuPreferences.html │ ├── TestMenuUserInfo.html │ ├── Success.html │ ├── NewFeaturesInVersion_17.html │ ├── NewFeaturesInVersion_10.html │ ├── DoubleChecking.html │ ├── WhatAreMersennePrimes.html │ ├── EndUser.html │ ├── Prime95.hhp │ ├── AdvancedMenuECM.html │ ├── Alias.h │ ├── Newsletters.html │ ├── Welcome.html │ ├── InstructionsManual.html │ └── PossibleHardwareFailure.html ├── HyperLink.cpp ├── res │ ├── Prime95.ico │ ├── cursor1.cur │ ├── cursor2.cur │ ├── yellow_i.ico │ ├── Prime95Doc.ico │ └── Prime95.rc2 ├── StdAfx.cpp ├── StdAfx.h ├── ChildFrm.h ├── TimeDlg.h ├── WelcomeDlg.h ├── UnreserveDlg.h ├── TestDlg.h ├── ManualCommDlg.h ├── StopDlg.h ├── StartDlg.h ├── compile ├── EcmDlg.h ├── Pminus1Dlg.h ├── UnreserveDlg.cpp ├── TortureDlg.h ├── CpuDlg.h ├── WelcomeDlg.cpp ├── TimeDlg.cpp ├── prime95.sln ├── PreferencesDlg.h ├── compil64 ├── ManualCommDlg.cpp ├── StopDlg.cpp ├── StartDlg.cpp ├── ChildFrm.cpp ├── TestDlg.cpp ├── Pminus1Dlg.cpp ├── EcmDlg.cpp ├── WorkerDlg.h ├── MainFrm.h ├── Prime95View.h ├── PrimenetDlg.h ├── CpuDlg.cpp ├── Prime95.h └── PreferencesDlg.cpp ├── comm95b.h ├── comm95c.h ├── winnt ├── main.lnk ├── main64.lnk ├── main.h ├── Prime95.h ├── compile ├── compil64 └── prime.c ├── comm95a.c ├── linux ├── makehaikugcc4 ├── makehaikugcc2 ├── makebsd ├── makefile └── prime.h ├── qd ├── bits.h └── bits.cc ├── linux64 ├── makebsd ├── makefile └── prime.h ├── macosx64 ├── makefile └── prime.h ├── commona.h ├── common.h └── os2 └── makefile /macosx/Prime95/Prime95.xcodeproj/.svn/format: -------------------------------------------------------------------------------- 1 | 8 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.a 3 | *.lib 4 | *.o 5 | *.obj 6 | 7 | -------------------------------------------------------------------------------- /comm95a.h: -------------------------------------------------------------------------------- 1 | /* Common definitions in Prime95, Saver95, and NTPrime */ 2 | 3 | -------------------------------------------------------------------------------- /gwnum/gwnum.ld: -------------------------------------------------------------------------------- 1 | SECTIONS 2 | { 3 | .data : { . = ALIGN(0x20); *(_GWDATA) } 4 | } 5 | -------------------------------------------------------------------------------- /prime95/Prime95.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rudimeier/mprime/HEAD/prime95/Prime95.rc -------------------------------------------------------------------------------- /prime95/hlp/images: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rudimeier/mprime/HEAD/prime95/hlp/images -------------------------------------------------------------------------------- /prime95/HyperLink.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rudimeier/mprime/HEAD/prime95/HyperLink.cpp -------------------------------------------------------------------------------- /prime95/hlp/Prime95.chm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rudimeier/mprime/HEAD/prime95/hlp/Prime95.chm -------------------------------------------------------------------------------- /prime95/res/Prime95.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rudimeier/mprime/HEAD/prime95/res/Prime95.ico -------------------------------------------------------------------------------- /prime95/res/cursor1.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rudimeier/mprime/HEAD/prime95/res/cursor1.cur -------------------------------------------------------------------------------- /prime95/res/cursor2.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rudimeier/mprime/HEAD/prime95/res/cursor2.cur -------------------------------------------------------------------------------- /prime95/res/yellow_i.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rudimeier/mprime/HEAD/prime95/res/yellow_i.ico -------------------------------------------------------------------------------- /macosx/Prime95/Mersenne.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rudimeier/mprime/HEAD/macosx/Prime95/Mersenne.icns -------------------------------------------------------------------------------- /prime95/hlp/OptionsMenu.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rudimeier/mprime/HEAD/prime95/hlp/OptionsMenu.html -------------------------------------------------------------------------------- /prime95/res/Prime95Doc.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rudimeier/mprime/HEAD/prime95/res/Prime95Doc.ico -------------------------------------------------------------------------------- /prime95/hlp/OptionsMenuWin95.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rudimeier/mprime/HEAD/prime95/hlp/OptionsMenuWin95.html -------------------------------------------------------------------------------- /macosx/Prime95/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rudimeier/mprime/HEAD/macosx/Prime95/English.lproj/InfoPlist.strings -------------------------------------------------------------------------------- /macosx/Prime95/Prime95.xcodeproj/.svn/prop-base/TemplateIcon.icns.svn-base: -------------------------------------------------------------------------------- 1 | K 13 2 | svn:mime-type 3 | V 24 4 | application/octet-stream 5 | END 6 | -------------------------------------------------------------------------------- /macosx/Prime95/Prime95.xcodeproj/TemplateIcon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rudimeier/mprime/HEAD/macosx/Prime95/Prime95.xcodeproj/TemplateIcon.icns -------------------------------------------------------------------------------- /comm95b.h: -------------------------------------------------------------------------------- 1 | /* Common definitions in Prime95, Saver95, and NTPrime */ 2 | 3 | int isWindows95 (); 4 | int isWindows2000 (); 5 | int isWindowsVista (); 6 | 7 | -------------------------------------------------------------------------------- /macosx/Prime95/Prime95.xcodeproj/.svn/text-base/TemplateIcon.icns.svn-base: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rudimeier/mprime/HEAD/macosx/Prime95/Prime95.xcodeproj/.svn/text-base/TemplateIcon.icns.svn-base -------------------------------------------------------------------------------- /macosx/Prime95/Prime95_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'Prime95' target in the 'Prime95' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /comm95c.h: -------------------------------------------------------------------------------- 1 | /* Common definitions in Prime95 and NTPrime */ 2 | 3 | void getWindowsSerialNumber (char *); 4 | void getWindowsSID (char *); 5 | void getWindowsSerialNumber_2 (char *); 6 | void getWindowsSID_2 (char *); 7 | 8 | -------------------------------------------------------------------------------- /prime95/StdAfx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // Prime95.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | -------------------------------------------------------------------------------- /winnt/main.lnk: -------------------------------------------------------------------------------- 1 | /incremental:no /largeaddressaware /out:ntprime.exe service main prime ..\prime95\factor32 ..\gwnum\gwnum.lib \libcurl\curllib.lib libcmt.lib kernel32.lib user32.lib gdi32.lib ws2_32.lib advapi32.lib wininet.lib winmm.lib 2 | 3 | -------------------------------------------------------------------------------- /winnt/main64.lnk: -------------------------------------------------------------------------------- 1 | /incremental:no /largeaddressaware /out:ntprime64.exe /machine:x64 amd64\service amd64\main amd64\prime ..\prime95\amd64\factor64 ..\gwnum\gwnum64.lib \libcurl\x64\curllib.lib libcmt.lib kernel32.lib user32.lib gdi32.lib ws2_32.lib advapi32.lib wininet.lib winmm.lib psapi.lib 2 | -------------------------------------------------------------------------------- /comm95a.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Common routines and variables used by Prime95, Saver95, and NTPrime 3 | * 4 | * Comm95a contains information used only during setup 5 | * Comm95b contains information used only during execution 6 | * Comm95c contains information used during setup and execution 7 | */ 8 | -------------------------------------------------------------------------------- /gwnum/strip.bat: -------------------------------------------------------------------------------- 1 | REM 2 | REM Strip all debug info from the object file. We do this because 3 | REM object files built by MASM 10 are rejected by MSVC 2005's linker 4 | REM when building an executable with debug info. 5 | REM 6 | c:\objconv\objconv -felf %1 dummy.o 7 | c:\objconv\objconv -fcoff dummy.o %1 8 | del dummy.o 9 | -------------------------------------------------------------------------------- /gwnum/test.c: -------------------------------------------------------------------------------- 1 | #include "gwnum.h" 2 | 3 | int main () { 4 | gwhandle gwdata; 5 | gwnum x; 6 | 7 | gwinit (&gwdata); 8 | gwsetup (&gwdata, 1.0, 2, 640, -1); 9 | 10 | x = gwalloc (&gwdata); 11 | dbltogw (&gwdata, 2.0, x); 12 | gwsetnormroutine (&gwdata, 0, 1, 0); /* Enable error checking */ 13 | gwsquare (&gwdata, x); 14 | } 15 | -------------------------------------------------------------------------------- /macosx/Prime95/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Prime95 4 | // 5 | // Created by George Woltman on 4/15/09. 6 | // Copyright 2009 Mersenne Research, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | return NSApplicationMain(argc, (const char **) argv); 14 | } 15 | -------------------------------------------------------------------------------- /macosx/Prime95/StatusController.h: -------------------------------------------------------------------------------- 1 | // 2 | // StatusController.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 StatusController : NSWindowController { 12 | IBOutlet NSTextView *textView; 13 | } 14 | 15 | - (void)reInit; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /macosx/Prime95/AboutController.h: -------------------------------------------------------------------------------- 1 | // 2 | // AboutController.h 3 | // Prime95 4 | // 5 | // Created by George Woltman on 4/17/09. 6 | // Copyright 2009 Mersenne Research, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AboutController : NSWindowController { 12 | IBOutlet NSTextField *textField; 13 | } 14 | 15 | - (void)reInit; 16 | - (IBAction)linkToMersenneOrg:(id)sender; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /macosx/Prime95/WindowController.h: -------------------------------------------------------------------------------- 1 | // 2 | // WindowController.h 3 | // Prime95 4 | // 5 | // Created by George Woltman on 4/18/09. 6 | // Copyright 2009 Merenne Research, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface WindowController : NSWindowController { 13 | IBOutlet NSTextView *textView; 14 | NSString *baseTitle; 15 | } 16 | 17 | - (void)setFontSize:(int)newSize; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /prime95/res/Prime95.rc2: -------------------------------------------------------------------------------- 1 | // 2 | // PRIME95.RC2 - resources Microsoft Visual C++ does not edit directly 3 | // 4 | 5 | #ifdef APSTUDIO_INVOKED 6 | #error this file is not editable by Microsoft Visual C++ 7 | #endif //APSTUDIO_INVOKED 8 | 9 | 10 | ///////////////////////////////////////////////////////////////////////////// 11 | // Add manually edited resources here... 12 | 13 | ///////////////////////////////////////////////////////////////////////////// 14 | -------------------------------------------------------------------------------- /macosx/Prime95/UnreserveController.h: -------------------------------------------------------------------------------- 1 | // 2 | // UnreserveController.h 3 | // Prime95 4 | // 5 | // Created by George Woltman on 4/24/09. 6 | // Copyright 2009 Mersenne Research, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UnreserveController : NSWindowController { 12 | 13 | int exponent; 14 | } 15 | 16 | @property(readwrite, assign) int exponent; 17 | 18 | - (void)reInit; 19 | - (IBAction)ok:(id)sender; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /gwnum/memory.mac: -------------------------------------------------------------------------------- 1 | ; Copyright 1998-2004 - Mersenne Research, Inc. All rights reserved 2 | ; Author: George Woltman 3 | ; Email: woltman@alum.mit.edu 4 | ; 5 | 6 | SCD = 48 ;; Sizeof an entry in the sine/cosine tables 7 | PMD = 64 ;; Sizeof an entry in premultiplier table 8 | NMD = 16 ;; Sizeof a normalization entry 9 | 10 | ;; 11 | ;; Flatish memory model (x87 code only) - 64 pad bytes every 4KB 12 | ;; 13 | 14 | flat_distances MACRO 15 | dist1 = 16 16 | dist256 = (4096+64) 17 | ENDM 18 | 19 | -------------------------------------------------------------------------------- /macosx/Prime95/ManualCommunicationController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ManualCommunicationController.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 ManualCommunicationController : NSWindowController { 12 | int manualContact; 13 | } 14 | 15 | @property(readwrite, assign) int manualContact; 16 | 17 | - (void)reInit; 18 | - (IBAction)ok:(id)sender; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /macosx/Prime95/QuitGIMPSController.h: -------------------------------------------------------------------------------- 1 | // 2 | // QuitGIMPSController.h 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 10 | 11 | 12 | @interface QuitGIMPSController : NSWindowController { 13 | NSString *explanation; 14 | } 15 | 16 | @property(readwrite, retain) NSString *explanation; 17 | 18 | - (void)reInit; 19 | - (IBAction)quitLater:(id)sender; 20 | - (IBAction)quitNow:(id)sender; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /winnt/main.h: -------------------------------------------------------------------------------- 1 | 2 | /* Function prototypes */ 3 | 4 | void GetIniSettings (); 5 | void prime_main (); 6 | 7 | #undef GetProfileInt 8 | #undef GetProfileString 9 | #undef WriteProfileString 10 | #define GetProfileInt(k,v) GetPrivateProfileInt(INI_SECTION,k,v,INI_FILE) 11 | #define WriteProfileInt(k,v) {char c[20]; sprintf (c, "%ld", v); WritePrivateProfileString(INI_SECTION,k,c,INI_FILE);} 12 | #define GetProfileString(k,v,o) GetPrivateProfileString(INI_SECTION,k,v,o,256,INI_FILE) 13 | #define WriteProfileString(k,v) WritePrivateProfileString(INI_SECTION,k,v,INI_FILE) 14 | -------------------------------------------------------------------------------- /prime95/StdAfx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers 7 | 8 | #include // MFC core and standard components 9 | #include // MFC extensions 10 | #ifndef _AFX_NO_AFXCMN_SUPPORT 11 | #include // MFC support for Windows 95 Common Controls 12 | #endif // _AFX_NO_AFXCMN_SUPPORT 13 | 14 | #include 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /macosx/Prime95/StopController.h: -------------------------------------------------------------------------------- 1 | // 2 | // StopController.h 3 | // Prime95 4 | // 5 | // Created by George Woltman on 4/19/09. 6 | // Copyright 2009 Mersenne Research, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface StopController : NSWindowController { 12 | int stopAllWorkers; 13 | int workerNumber; 14 | int workerNumberMax; 15 | 16 | } 17 | 18 | @property(readwrite, assign) int stopAllWorkers; 19 | @property(readwrite, assign) int workerNumber; 20 | @property(readwrite, assign) int workerNumberMax; 21 | 22 | - (void)reInit; 23 | - (IBAction)ok:(id)sender; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /winnt/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 | #include 9 | //#define SERVER_TESTING 10 | #define NO_GUI 1 11 | #include "common.h" 12 | #include "cpuid.h" 13 | #include "gwnum.h" 14 | #include "commonb.h" 15 | #include "commonc.h" 16 | #include "comm95b.h" 17 | #include "comm95c.h" 18 | #include "primenet.h" 19 | 20 | // Global variables 21 | 22 | extern int THREAD_STOP; // TRUE if thread should stop 23 | extern int DEBUGGING; // TRUE if -debug switch used 24 | extern int C_OPTION; // TRUE if -c switch used 25 | -------------------------------------------------------------------------------- /macosx/Prime95/ContinueController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ContinueController.h 3 | // Prime95 4 | // 5 | // Created by George Woltman on 4/19/09. 6 | // Copyright 2009 Mersenne Research, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ContinueController : NSWindowController { 12 | int startAllWorkers; 13 | int workerNumber; 14 | int workerNumberMax; 15 | } 16 | 17 | @property(readwrite, assign) int startAllWorkers; 18 | @property(readwrite, assign) int workerNumber; 19 | @property(readwrite, assign) int workerNumberMax; 20 | 21 | - (void)reInit; 22 | - (IBAction)ok:(id)sender; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /macosx/Prime95/TimeController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TimeController.h 3 | // Prime95 4 | // 5 | // Created by George Woltman on 4/24/09. 6 | // Copyright 2009 Mersenne Research, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TimeController : NSWindowController { 12 | 13 | int exponentToTime; 14 | int exponentToTimeMax; 15 | int numberOfIterations; 16 | } 17 | 18 | @property(readwrite, assign) int exponentToTime; 19 | @property(readonly) int exponentToTimeMax; 20 | @property(readwrite, assign) int numberOfIterations; 21 | 22 | - (void)reInit; 23 | - (IBAction)ok:(id)sender; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /gwnum/makebsd64: -------------------------------------------------------------------------------- 1 | # Makefile for FreeBSD 10.0 64-bit gwnum library 2 | # 3 | 4 | CC = cc 5 | CFLAGS = -I.. -DX86_64 -O2 6 | 7 | CPP = cc 8 | CPPFLAGS = -I.. -I../qd -DX86_64 -O2 9 | 10 | AR = ar 11 | 12 | LINUXOBJS = cpuid.o gwnum.o gwtables.o gwthread.o gwutil.o gwdbldbl.o giants.o ecmstag1.o 13 | 14 | LIB = gwnum.a 15 | 16 | ######################################################################### 17 | 18 | $(LIB): $(LINUXOBJS) 19 | cp linux64/gwnum.a . 20 | $(AR) -rs $(LIB) $(LINUXOBJS) 21 | 22 | clean: 23 | rm -f $(LINUXOBJS) 24 | 25 | distclean: clean 26 | rm -f $(LIB) 27 | 28 | .c.o: 29 | $(CC) $(CFLAGS) -c $< 30 | 31 | .cpp.o: 32 | $(CPP) $(CPPFLAGS) -c $< 33 | -------------------------------------------------------------------------------- /gwnum/make64: -------------------------------------------------------------------------------- 1 | # Makefile for Linux and FreeBSD (pre 10.0) 64-bit gwnum library 2 | # 3 | 4 | CC = gcc 5 | CFLAGS = -I.. -DX86_64 -O2 6 | 7 | CPP = g++ 8 | CPPFLAGS = -I.. -I../qd -DX86_64 -O2 9 | 10 | AR = ar 11 | 12 | LINUXOBJS = cpuid.o gwnum.o gwtables.o gwthread.o gwutil.o gwdbldbl.o giants.o ecmstag1.o 13 | 14 | LIB = gwnum.a 15 | 16 | ######################################################################### 17 | 18 | $(LIB): $(LINUXOBJS) 19 | cp linux64/gwnum.a . 20 | $(AR) -rs $(LIB) $(LINUXOBJS) 21 | 22 | clean: 23 | rm -f $(LINUXOBJS) 24 | 25 | distclean: clean 26 | rm -f $(LIB) 27 | 28 | .c.o: 29 | $(CC) $(CFLAGS) -c $< 30 | 31 | .cpp.o: 32 | $(CPP) $(CPPFLAGS) -c $< 33 | -------------------------------------------------------------------------------- /gwnum/makefile: -------------------------------------------------------------------------------- 1 | # Makefile for Linux and FreeBSD 32-bit gwnum library 2 | # 3 | 4 | CC = gcc 5 | CFLAGS = -I.. -O2 -march=i486 -malign-double 6 | 7 | CPP = g++ 8 | CPPFLAGS = -I.. -I../qd -O2 -march=i486 -malign-double 9 | 10 | AR = ar 11 | 12 | OBJS = cpuid.o gwnum.o gwtables.o gwthread.o gwutil.o gwdbldbl.o giants.o ecmstag1.o 13 | 14 | LIB = gwnum.a 15 | 16 | ######################################################################### 17 | 18 | $(LIB): $(OBJS) 19 | cp linux/gwnum.a . 20 | $(AR) -rs $(LIB) $(OBJS) 21 | 22 | clean: 23 | rm -f $(OBJS) 24 | 25 | distclean: clean 26 | rm -f $(LIB) 27 | 28 | .c.o: 29 | $(CC) $(CFLAGS) -c $< 30 | 31 | .cpp.o: 32 | $(CPP) $(CPPFLAGS) -c $< 33 | -------------------------------------------------------------------------------- /gwnum/makehaiku: -------------------------------------------------------------------------------- 1 | # Makefile for Haiku gwnum library 2 | # 3 | 4 | CC = gcc 5 | CFLAGS = -I.. -O2 -march=i586 -malign-double 6 | 7 | CPP = g++ 8 | CPPFLAGS = -I.. -I../qd -O2 -march=i586 -malign-double 9 | 10 | AR = ar 11 | 12 | HAIKUOBJS = cpuid.o gwnum.o gwtables.o gwthread.o gwutil.o gwdbldbl.o giants.o ecmstag1.o 13 | 14 | LIB = gwnum.a 15 | 16 | ######################################################################### 17 | 18 | $(LIB): $(HAIKUOBJS) 19 | cp linux/gwnum.a . 20 | $(AR) -rs $(LIB) $(HAIKUOBJS) 21 | 22 | clean: 23 | rm -f $(HAIKUOBJS) 24 | 25 | distclean: clean 26 | rm -f $(LIB) 27 | 28 | .c.o: 29 | $(CC) $(CFLAGS) -c $< 30 | 31 | .cpp.o: 32 | $(CPP) $(CPPFLAGS) -c $< 33 | -------------------------------------------------------------------------------- /prime95/hlp/Thanks.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Thanks 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
 
15 | 16 | 17 | 18 | 19 |
History: Thanks
20 |

 

21 |

THANKS

22 |

HAPPY HUNTING AND THANKS FOR JOINING THE SEARCH,
23 |
24 | George Woltman
25 | woltman@alum.mit.edu
26 |
27 |  

28 | 29 | -------------------------------------------------------------------------------- /gwnum/makemsys: -------------------------------------------------------------------------------- 1 | # Makefile for Mingw/msys gwnum library 2 | # 3 | 4 | CC = gcc 5 | CFLAGS = -I.. -O2 -march=i486 -malign-double 6 | 7 | CPP = g++ 8 | CPPFLAGS = -I.. -I../qd -O2 -march=i486 -malign-double 9 | 10 | AR = ar 11 | 12 | LINUXOBJS = cpuid.o gwnum.o gwtables.o gwthread.o gwutil.o gwdbldbl.o giants.o ecmstag1.o 13 | 14 | LIB = gwnum.a 15 | 16 | ######################################################################### 17 | 18 | $(LIB): $(LINUXOBJS) $(COFFOBJS) 19 | cp linux/gwnum.a . 20 | $(AR) -rs $(LIB) $(LINUXOBJS) 21 | 22 | clean: 23 | rm -f $(LINUXOBJS) 24 | 25 | distclean: clean 26 | rm -f $(LIB) 27 | 28 | .c.o: 29 | $(CC) $(CFLAGS) -c $< 30 | 31 | .cpp.o: 32 | $(CPP) $(CPPFLAGS) -c $< 33 | -------------------------------------------------------------------------------- /winnt/compile: -------------------------------------------------------------------------------- 1 | # Choose compiler switches 2 | 3 | cl=cl /GF /W3 /MT /D_CRT_SECURE_NO_DEPRECATE /O2 /c 4 | cld=cl /GF /W3 /MT /D_CRT_SECURE_NO_DEPRECATE /DGDEBUG /Zi /c 5 | 6 | # Standard options 7 | copt=/I.. /I..\gwnum /I\libcurl 8 | 9 | # This line allows NMAKE to work as well 10 | 11 | all: ntprime.exe 12 | 13 | # Update the object files if necessary 14 | 15 | main.obj: main.c main.h prime95.h 16 | $(cl) $(copt) main.c 17 | 18 | service.obj: service.c service.h 19 | $(cl) $(copt) service.c 20 | 21 | prime.obj: prime.c prime95.h ..\commonc.c ..\commonb.c 22 | $(cl) $(copt) prime.c 23 | 24 | # Update the executable file 25 | 26 | ntprime.exe: main.obj prime.obj service.obj 27 | link @main.lnk 28 | -------------------------------------------------------------------------------- /prime95/ChildFrm.h: -------------------------------------------------------------------------------- 1 | // ChildFrm.h : interface of the CChildFrame class 2 | // 3 | 4 | 5 | #pragma once 6 | 7 | 8 | class CChildFrame : public CMDIChildWnd 9 | { 10 | DECLARE_DYNCREATE(CChildFrame) 11 | public: 12 | CChildFrame(); 13 | 14 | // Attributes 15 | public: 16 | 17 | // Operations 18 | public: 19 | 20 | // Overrides 21 | virtual BOOL PreCreateWindow(CREATESTRUCT& cs); 22 | virtual void OnUpdateFrameTitle(BOOL bAddToTitle); 23 | 24 | // Implementation 25 | public: 26 | virtual ~CChildFrame(); 27 | #ifdef _DEBUG 28 | virtual void AssertValid() const; 29 | virtual void Dump(CDumpContext& dc) const; 30 | #endif 31 | 32 | // Generated message map functions 33 | protected: 34 | DECLARE_MESSAGE_MAP() 35 | }; 36 | -------------------------------------------------------------------------------- /prime95/hlp/TestMenuContinue.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Test Menu - Continue 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
 
15 | 16 | 17 | 18 | 19 |
How to Use Prime95: Test Menu - Continue
20 |

 

21 |

TEST MENU - Continue

22 |

Continue

23 |

The Continue menu choice lets you resume prime95 after you have 24 | stopped it.

25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /macosx/Prime95/TestController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TestController.h 3 | // Prime95 4 | // 5 | // Created by George Woltman on 4/24/09. 6 | // Copyright 2009 Mersenne Research, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TestController : NSWindowController { 12 | int workerNumber; 13 | int workerNumberMax; 14 | int workerNumberEnabled; 15 | int exponentToTest; 16 | int exponentToTestMax; 17 | } 18 | 19 | @property(readwrite, assign) int workerNumber; 20 | @property(readwrite, assign) int workerNumberMax; 21 | @property(readwrite, assign) int workerNumberEnabled; 22 | @property(readwrite, assign) int exponentToTest; 23 | @property(readonly) int exponentToTestMax; 24 | 25 | - (void)reInit; 26 | - (IBAction)ok:(id)sender; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /prime95/hlp/ThirdParty.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Third Party Software Redistribution License 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
 
15 | 16 | 17 | 18 | 19 |
Legal Stuff: Third Party Software Redistribution License
20 |

 

21 |

THIRD PARTY SOFTWARE REDISTRIBUTION LICENSE

22 |

CONTAINS DISTRIBUTED COMPUTING SOFTWARE LICENSED FROM 23 | ENTROPIA.COM, INC.

24 | 25 |

 

26 | 27 | -------------------------------------------------------------------------------- /prime95/hlp/OptionsMenuTortureTest.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Options Menu - Torture Test 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
 
15 | 16 | 17 | 19 | 20 |
How to Use Prime95: Options Menu - Torture 18 | Test
21 |

 

22 |

OPTIONS MENU - Torture Test

23 |

Torture Test

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 | 18 | 19 |
Legal Stuff: Disclaimer
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 |  

26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /prime95/hlp/TestMenuStop.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Test Menu - Stop 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
 
15 | 16 | 17 | 18 | 19 |
How to Use Prime95: Test Menu - Stop
20 |

 

21 |

TEST MENU - Stop

22 |

Stop

23 |

 

24 |

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 |  

27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /macosx/Prime95/PrimeNetController.h: -------------------------------------------------------------------------------- 1 | // 2 | // PrimeNetController.h 3 | // Prime95 4 | // 5 | // Created by George Woltman on 4/26/09. 6 | // Copyright 2009 Mersenne Research, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | @class ConnectionController; 11 | 12 | @interface PrimeNetController : NSWindowController { 13 | int usePrimeNet; 14 | NSString *userID; 15 | NSString *computerName; 16 | ConnectionController *connectionController; 17 | int startupInProgress; 18 | } 19 | 20 | @property(readwrite, assign) int usePrimeNet; 21 | @property(readwrite, retain) NSString *userID; 22 | @property(readwrite, retain) NSString *computerName; 23 | 24 | - (void)reInit; 25 | - (IBAction)connection:(id)sender; 26 | - (IBAction)ok:(id)sender; 27 | - (IBAction)linkToMersenneOrg:(id)sender; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /winnt/compil64: -------------------------------------------------------------------------------- 1 | # Choose compiler switches 2 | 3 | cl64=cl /GF /W3 /MT /D_CRT_SECURE_NO_DEPRECATE /O2 /c 4 | cl64d=cl /GF /W3 /MT /D_CRT_SECURE_NO_DEPRECATE /DGDEBUG /Zi /c 5 | 6 | # Standard options 7 | copt=/I.. /I..\gwnum /I\libcurl 8 | 9 | # This line allows NMAKE to work as well 10 | 11 | all: ntprime64.exe 12 | 13 | # Update the object files if necessary 14 | 15 | amd64\main.obj: main.c main.h prime95.h 16 | $(cl64) $(copt) /Foamd64\main.obj main.c 17 | 18 | amd64\service.obj: service.c service.h 19 | $(cl64) $(copt) /Foamd64\service.obj service.c 20 | 21 | amd64\prime.obj: prime.c prime95.h ..\commonc.c ..\commonb.c 22 | $(cl64) $(copt) /Foamd64\prime.obj prime.c 23 | 24 | # Update the executable file 25 | 26 | ntprime64.exe: amd64\main.obj amd64\prime.obj amd64\service.obj 27 | link @main64.lnk 28 | -------------------------------------------------------------------------------- /macosx/Prime95/UnreserveController.m: -------------------------------------------------------------------------------- 1 | // 2 | // UnreserveController.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 "UnreserveController.h" 10 | #include "prime95.h" 11 | 12 | @implementation UnreserveController 13 | 14 | - (id)init 15 | { 16 | if (![super initWithWindowNibName:@"Unreserve"]) return nil; 17 | exponent = 50000000; 18 | return self; 19 | } 20 | 21 | - (void)windowDidLoad 22 | { 23 | [self reInit]; 24 | } 25 | 26 | - (void)reInit 27 | { 28 | } 29 | 30 | @synthesize exponent; 31 | 32 | - (IBAction)ok:(id)sender 33 | { 34 | [[self window] makeFirstResponder:nil]; // End any active text field edits 35 | 36 | unreserve (exponent); 37 | [[self window] performClose:self]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /macosx/Prime95/StatusController.m: -------------------------------------------------------------------------------- 1 | // 2 | // StatusController.m 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 "StatusController.h" 10 | #include "prime95.h" 11 | 12 | @implementation StatusController 13 | 14 | - (id)init 15 | { 16 | if (![super initWithWindowNibName:@"Status"]) return nil; 17 | return self; 18 | } 19 | 20 | - (void)windowDidLoad 21 | { 22 | [self reInit]; 23 | } 24 | 25 | - (void)reInit 26 | { 27 | char buf[20000]; 28 | NSRange endRange; 29 | 30 | rangeStatusMessage (buf, sizeof (buf)); 31 | 32 | endRange.location = 0; 33 | endRange.length = [[textView textStorage] length]; 34 | [textView replaceCharactersInRange:endRange withString:[[NSString alloc] initWithFormat:@"%s", buf]]; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /prime95/hlp/HelpTopics.h: -------------------------------------------------------------------------------- 1 | #define IDH_PRIMENET 11 2 | #define IDH_USERINFORMATION 12 3 | #define IDH_VACATION 13 4 | #define IDH_RANGE_STATUS 14 5 | #define IDH_CONTINUE 15 6 | #define IDH_STOP 16 7 | #define IDH_APP_EXIT 17 8 | #define IDH_PASSWORD 18 9 | #define IDH_TEST 19 10 | #define IDH_TIME 20 11 | #define IDH_PMINUS1 21 12 | #define IDH_ECM 22 13 | #define IDH_ERRCHK 23 14 | #define IDH_PRIORITY 24 15 | #define IDH_AFFINITY 25 16 | #define IDH_MANUALCOMM 26 17 | #define IDH_QUIT 27 18 | #define IDH_CPU 28 19 | #define IDH_PREFERENCES 29 20 | #define IDH_TORTURE 31 21 | #define IDH_TRAY 32 22 | #define IDH_HIDE 33 23 | #define IDH_SERVICE 34 24 | #define IDH_HELP_FINDER 35 25 | #define IDH_APP_ABOUT 36 26 | #define IDH_SERVER 37 27 | #define IDH_UNRESERVE 38 28 | #define IDH_WELCOME 39 29 | #define IDH_BENCHMARK 40 30 | -------------------------------------------------------------------------------- /prime95/hlp/OptionsMenuBenchmark.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Options Menu - Benchmark 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
 
15 | 16 | 17 | 18 | 19 |
How to Use Prime95: Options Menu - Benchmark
20 |

 

21 |

OPTIONS MENU - Benchmark

22 |

Benchmark

23 |

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

27 | 28 | -------------------------------------------------------------------------------- /macosx/Prime95/AboutController.m: -------------------------------------------------------------------------------- 1 | // 2 | // AboutController.m 3 | // Prime95 4 | // 5 | // Created by George Woltman on 4/17/09. 6 | // Copyright 2009 Mersenne Research, Inc. All rights reserved. 7 | // 8 | 9 | #import "AboutController.h" 10 | #include "prime95.h" 11 | 12 | @implementation AboutController 13 | 14 | - (id)init 15 | { 16 | if (![super initWithWindowNibName:@"About"]) return nil; 17 | return self; 18 | } 19 | 20 | - (void)windowDidLoad 21 | { 22 | [self reInit]; 23 | } 24 | 25 | - (void)reInit 26 | { 27 | char app_string[100]; 28 | generate_application_string (app_string); 29 | [textField setStringValue:[[NSString alloc] initWithFormat:@"%s", app_string]]; 30 | } 31 | 32 | - (IBAction)linkToMersenneOrg:(id)sender 33 | { 34 | NSURL *url = [NSURL URLWithString:@"http://mersenne.org"]; 35 | [[NSWorkspace sharedWorkspace] openURL:url]; 36 | } 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /macosx/Prime95/PRPController.h: -------------------------------------------------------------------------------- 1 | // 2 | // PRPController.h 3 | // Prime95 4 | // 5 | // Created by George Woltman on 4/24/09. 6 | // Copyright 2009 Mersenne Research, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface PRPController : NSWindowController { 12 | 13 | int workerNumber; 14 | int workerNumberMax; 15 | int workerNumberEnabled; 16 | double k; 17 | int b; 18 | int n; 19 | int nMax; 20 | int c; 21 | } 22 | 23 | @property(readwrite, assign) int workerNumber; 24 | @property(readwrite, assign) int workerNumberMax; 25 | @property(readwrite, assign) int workerNumberEnabled; 26 | @property(readwrite, assign) double k; 27 | @property(readwrite, assign) int b; 28 | @property(readwrite, assign) int n; 29 | @property(readonly) int nMax; 30 | @property(readwrite, assign) int c; 31 | 32 | - (void)reInit; 33 | - (IBAction)ok:(id)sender; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /prime95/hlp/TestMenuStatus.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Test Menu - Status 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
 
15 | 16 | 17 | 18 | 19 |
How to Use Prime95: Test Menu - Status
20 |

 

21 |

TEST MENU - Status

22 |

Status

23 |

24 |

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.

27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /prime95/TimeDlg.h: -------------------------------------------------------------------------------- 1 | // TimeDlg.h : header file 2 | // 3 | 4 | ///////////////////////////////////////////////////////////////////////////// 5 | // CTimeDlg dialog 6 | 7 | class CTimeDlg : public CDialog 8 | { 9 | // Construction 10 | public: 11 | CTimeDlg(CWnd* pParent = NULL); // standard constructor 12 | 13 | // Dialog Data 14 | //{{AFX_DATA(CTimeDlg) 15 | enum { IDD = IDD_TIME }; 16 | UINT m_p; 17 | UINT m_iter; 18 | //}}AFX_DATA 19 | 20 | 21 | // Overrides 22 | // ClassWizard generated virtual function overrides 23 | //{{AFX_VIRTUAL(CTimeDlg) 24 | protected: 25 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 26 | //}}AFX_VIRTUAL 27 | 28 | // Implementation 29 | protected: 30 | 31 | // Generated message map functions 32 | //{{AFX_MSG(CTimeDlg) 33 | // NOTE: the ClassWizard will add member functions here 34 | //}}AFX_MSG 35 | DECLARE_MESSAGE_MAP() 36 | }; 37 | -------------------------------------------------------------------------------- /macosx/Prime95/ConnectionController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ConnectionController.h 3 | // Prime95 4 | // 5 | // Created by George Woltman on 4/26/09. 6 | // Copyright 2009 Mersenne Research, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ConnectionController : NSWindowController { 12 | NSString *hostName; 13 | int proxyEnabled; 14 | int portNumber; 15 | NSString *userName; 16 | NSString *password; 17 | int debug; 18 | char szProxyHost[120], szProxyUser[50], szProxyPassword[50]; 19 | unsigned short nProxyPort; 20 | } 21 | 22 | @property(readwrite, retain) NSString *hostName; 23 | @property(readwrite, assign) int proxyEnabled; 24 | @property(readwrite, assign) int portNumber; 25 | @property(readwrite, retain) NSString *userName; 26 | @property(readwrite, retain) NSString *password; 27 | @property(readwrite, assign) int debug; 28 | 29 | - (void)reInit; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /prime95/WelcomeDlg.h: -------------------------------------------------------------------------------- 1 | // WelcomeDlg.h : header file 2 | // 3 | 4 | ///////////////////////////////////////////////////////////////////////////// 5 | // CWelcomeDlg dialog 6 | 7 | class CWelcomeDlg : public CDialog 8 | { 9 | // Construction 10 | public: 11 | CWelcomeDlg(CWnd* pParent = NULL); // standard constructor 12 | 13 | // Dialog Data 14 | //{{AFX_DATA(CWelcomeDlg) 15 | enum { IDD = IDD_WELCOME }; 16 | // NOTE: the ClassWizard will add data members here 17 | //}}AFX_DATA 18 | 19 | 20 | // Overrides 21 | // ClassWizard generated virtual function overrides 22 | //{{AFX_VIRTUAL(CWelcomeDlg) 23 | protected: 24 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 25 | //}}AFX_VIRTUAL 26 | 27 | // Implementation 28 | protected: 29 | 30 | // Generated message map functions 31 | //{{AFX_MSG(CWelcomeDlg) 32 | virtual void OnCancel(); 33 | //}}AFX_MSG 34 | DECLARE_MESSAGE_MAP() 35 | }; 36 | -------------------------------------------------------------------------------- /prime95/hlp/OptionsMenuCPU.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Options Menu - Cpu 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
 
15 | 16 | 17 | 18 | 19 |
How to Use Prime95: Options Menu - Cpu
20 |

 

21 |

OPTIONS MENU - Cpu

22 |

Cpu

23 |

24 |

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.

27 |

 

28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /prime95/UnreserveDlg.h: -------------------------------------------------------------------------------- 1 | // UnreserveDlg.h : header file 2 | // 3 | 4 | ///////////////////////////////////////////////////////////////////////////// 5 | // CUnreserveDlg dialog 6 | 7 | class CUnreserveDlg : public CDialog 8 | { 9 | // Construction 10 | public: 11 | CUnreserveDlg(CWnd* pParent = NULL); // standard constructor 12 | 13 | // Dialog Data 14 | //{{AFX_DATA(CUnreserveDlg) 15 | enum { IDD = IDD_UNRESERVE }; 16 | UINT m_p; 17 | //}}AFX_DATA 18 | 19 | 20 | // Overrides 21 | // ClassWizard generated virtual function overrides 22 | //{{AFX_VIRTUAL(CUnreserveDlg) 23 | protected: 24 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 25 | //}}AFX_VIRTUAL 26 | 27 | // Implementation 28 | protected: 29 | 30 | // Generated message map functions 31 | //{{AFX_MSG(CUnreserveDlg) 32 | // NOTE: the ClassWizard will add member functions here 33 | //}}AFX_MSG 34 | DECLARE_MESSAGE_MAP() 35 | }; 36 | -------------------------------------------------------------------------------- /linux/makehaikugcc4: -------------------------------------------------------------------------------- 1 | # Makefile for Haiku mprime 2 | # 3 | 4 | CC = gcc 5 | CFLAGS = -I.. -I../gwnum -O2 -march=i586 -malign-double 6 | 7 | CPP = g++ 8 | CPPFLAGS = -I.. -I../gwnum -O2 -march=i586 -malign-double 9 | 10 | LFLAGS = -Wl,-M 11 | LIBS = ../gwnum/gwnum.a ../gwnum/gwnum.ld -lnetwork -lcurl -lstdc++ 12 | 13 | FACTOROBJ = factor32.o 14 | HAIKUOBJS = prime.o menu.o 15 | EXE = mprime 16 | 17 | ######################################################################### 18 | 19 | $(EXE): security $(HAIKUOBJS) $(FACTOROBJ) 20 | $(CC) $(LFLAGS) -o $(EXE) $(HAIKUOBJS) $(FACTOROBJ) $(LIBS) 21 | 22 | security: 23 | [ ! -e ../security.h ] && touch ../security.h || true 24 | [ ! -e ../security.c ] && touch ../security.c || true 25 | [ ! -e ../secure5.c ] && touch ../secure5.c || true 26 | 27 | clean: 28 | rm -f $(EXE) $(HAIKUOBJS) 29 | 30 | .c.o: 31 | $(CC) $(CFLAGS) -c $< 32 | 33 | .cpp.o: 34 | $(CPP) $(CPPFLAGS) -c $< 35 | -------------------------------------------------------------------------------- /qd/bits.h: -------------------------------------------------------------------------------- 1 | /* 2 | * include/bits.h 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 | * This file defines various routines to get / set bits of a IEEE floating 11 | * point number. This is used by the library for debugging purposes. 12 | */ 13 | 14 | #ifndef _BITS_H_ 15 | #define _BITS_H_ 16 | 17 | /* Returns the exponent of the double precision number. 18 | Returns INT_MIN is x is zero, and INT_MAX if x is INF or NaN. */ 19 | int get_double_expn(double x); 20 | 21 | /* Prints 22 | SIGN EXPN MANTISSA 23 | of the given double. If x is NaN, INF, or Zero, this 24 | prints out the strings NaN, +/- INF, and 0. */ 25 | void print_double_info(double x); 26 | 27 | 28 | #endif /* _BITS_H_ */ 29 | 30 | -------------------------------------------------------------------------------- /linux/makehaikugcc2: -------------------------------------------------------------------------------- 1 | # Makefile for Haiku mprime 2 | # 3 | 4 | CC = gcc 5 | CFLAGS = -I.. -I../gwnum -O2 -march=i586 -malign-double 6 | 7 | CPP = g++ 8 | CPPFLAGS = -I.. -I../gwnum -O2 -march=i586 -malign-double 9 | 10 | LFLAGS = -Wl,-M 11 | LIBS = -L/boot/common/lib ../gwnum/gwnum.a ../gwnum/gwnum.ld -lnetwork -lcurl -lstdc++.r4 12 | 13 | FACTOROBJ = factor32.o 14 | HAIKUOBJS = prime.o menu.o 15 | EXE = mprime 16 | 17 | ######################################################################### 18 | 19 | $(EXE): security $(HAIKUOBJS) $(FACTOROBJ) 20 | $(CC) $(LFLAGS) -o $(EXE) $(HAIKUOBJS) $(FACTOROBJ) $(LIBS) 21 | 22 | security: 23 | [ ! -e ../security.h ] && touch ../security.h || true 24 | [ ! -e ../security.c ] && touch ../security.c || true 25 | [ ! -e ../secure5.c ] && touch ../secure5.c || true 26 | 27 | clean: 28 | rm -f $(EXE) $(HAIKUOBJS) 29 | 30 | .c.o: 31 | $(CC) $(CFLAGS) -c $< 32 | 33 | .cpp.o: 34 | $(CPP) $(CPPFLAGS) -c $< 35 | -------------------------------------------------------------------------------- /prime95/TestDlg.h: -------------------------------------------------------------------------------- 1 | // TestDlg.h : header file 2 | // 3 | 4 | ///////////////////////////////////////////////////////////////////////////// 5 | // CTestDlg dialog 6 | 7 | class CTestDlg : public CDialog 8 | { 9 | // Construction 10 | public: 11 | CTestDlg(CWnd* pParent = NULL); // standard constructor 12 | 13 | // Dialog Data 14 | //{{AFX_DATA(CTestDlg) 15 | enum { IDD = IDD_TEST }; 16 | CStatic c_thread_text; 17 | CEdit c_thread; 18 | UINT m_thread; 19 | UINT m_p; 20 | //}}AFX_DATA 21 | 22 | 23 | // Overrides 24 | // ClassWizard generated virtual function overrides 25 | //{{AFX_VIRTUAL(CTestDlg) 26 | protected: 27 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 28 | //}}AFX_VIRTUAL 29 | 30 | // Implementation 31 | protected: 32 | 33 | // Generated message map functions 34 | //{{AFX_MSG(CTestDlg) 35 | // NOTE: the ClassWizard will add member functions here 36 | //}}AFX_MSG 37 | DECLARE_MESSAGE_MAP() 38 | }; 39 | -------------------------------------------------------------------------------- /prime95/hlp/AdvancedMenuTest.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Advanced Menu - Test 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
 
15 | 16 | 17 | 18 | 19 |
How to Use Prime95: Advanced Menu - Test
20 |

 

21 |

ADVANCED MENU - Test

22 |

Test

23 |

24 |

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.

27 |

 

28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /prime95/hlp/AdvancedMenuRoundoff.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Advanced Menu-Round Off 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
 
15 | 16 | 17 | 18 | 19 |
How to Use Prime95: Advanced Menu - Round Off
20 |

 

21 |

ADVANCED MENU - Round Off

22 |

Round Off

23 |

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.

27 |

 

28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /prime95/ManualCommDlg.h: -------------------------------------------------------------------------------- 1 | // ManualCommDlg.h : header file 2 | // 3 | 4 | ///////////////////////////////////////////////////////////////////////////// 5 | // CManualCommDlg dialog 6 | 7 | class CManualCommDlg : public CDialog 8 | { 9 | // Construction 10 | public: 11 | CManualCommDlg(CWnd* pParent = NULL); // standard constructor 12 | 13 | // Dialog Data 14 | //{{AFX_DATA(CManualCommDlg) 15 | enum { IDD = IDD_MANUAL_COMM }; 16 | CButton c_comm_now; 17 | BOOL m_manual_comm; 18 | BOOL m_comm_now; 19 | BOOL m_new_dates; 20 | //}}AFX_DATA 21 | 22 | 23 | // Overrides 24 | // ClassWizard generated virtual function overrides 25 | //{{AFX_VIRTUAL(CManualCommDlg) 26 | protected: 27 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 28 | //}}AFX_VIRTUAL 29 | 30 | // Implementation 31 | protected: 32 | 33 | // Generated message map functions 34 | //{{AFX_MSG(CManualCommDlg) 35 | afx_msg void OnManual(); 36 | //}}AFX_MSG 37 | DECLARE_MESSAGE_MAP() 38 | }; 39 | -------------------------------------------------------------------------------- /macosx/Prime95/TimeController.m: -------------------------------------------------------------------------------- 1 | // 2 | // TimeController.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 "TimeController.h" 10 | #include "prime95.h" 11 | 12 | @implementation TimeController 13 | 14 | - (id)init 15 | { 16 | if (![super initWithWindowNibName:@"Time"]) return nil; 17 | exponentToTime = 50000000; 18 | exponentToTimeMax = MAX_PRIME_SSE2; 19 | numberOfIterations = 50; 20 | return self; 21 | } 22 | 23 | - (void)windowDidLoad 24 | { 25 | [self reInit]; 26 | } 27 | 28 | - (void)reInit 29 | { 30 | } 31 | 32 | @synthesize exponentToTime; 33 | @synthesize exponentToTimeMax; 34 | @synthesize numberOfIterations; 35 | 36 | - (IBAction)ok:(id)sender 37 | { 38 | [[self window] makeFirstResponder:nil]; // End any active text field edits 39 | 40 | LaunchAdvancedTime (exponentToTime, numberOfIterations); 41 | [[self window] performClose:self]; 42 | } 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /prime95/hlp/WhatIsThisProgram.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | What Is This Program? 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
 
15 | 16 | 17 | 18 | 19 |
Welcome...: What Is This Program?
20 |

 

21 |

WHAT IS THIS PROGRAM?

22 |

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 |  

29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /prime95/StopDlg.h: -------------------------------------------------------------------------------- 1 | // StopDlg.h : header file 2 | // 3 | 4 | ///////////////////////////////////////////////////////////////////////////// 5 | // CStopDlg dialog 6 | 7 | class CStopDlg : public CDialog 8 | { 9 | // Construction 10 | public: 11 | CStopDlg(CWnd* pParent = NULL); // standard constructor 12 | 13 | // Dialog Data 14 | //{{AFX_DATA(CStopDlg) 15 | enum { IDD = IDD_WORKER_STOP }; 16 | CStatic c_thread_text; 17 | CEdit c_thread; 18 | UINT m_thread; 19 | BOOL m_all_threads; 20 | //}}AFX_DATA 21 | 22 | 23 | // Overrides 24 | // ClassWizard generated virtual function overrides 25 | //{{AFX_VIRTUAL(CStopDlg) 26 | protected: 27 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 28 | //}}AFX_VIRTUAL 29 | 30 | // Implementation 31 | protected: 32 | 33 | // Generated message map functions 34 | //{{AFX_MSG(CStopDlg) 35 | // NOTE: the ClassWizard will add member functions here 36 | //}}AFX_MSG 37 | DECLARE_MESSAGE_MAP() 38 | 39 | afx_msg void OnBnClickedRadio1(); 40 | }; 41 | -------------------------------------------------------------------------------- /macosx/Prime95/prime95.h: -------------------------------------------------------------------------------- 1 | // 2 | // Prime95.h 3 | // Prime95 4 | // 5 | // Created by George Woltman on 4/17/09. 6 | // Copyright 2009 Mersenne Research, Inc. All rights reserved. 7 | // 8 | // This file contains the include files needed to access any 9 | // of the common C routines 10 | // 11 | 12 | /* Some necessary definitions */ 13 | 14 | #define NO_GUI 0 15 | #ifdef X86_64 16 | #define PORT 10 17 | #else 18 | #define PORT 9 19 | #endif 20 | 21 | /* Include our common C header files */ 22 | 23 | #include "common.h" 24 | #include "cpuid.h" 25 | #include "gwnum.h" 26 | #include "gwutil.h" 27 | #include "commona.h" 28 | #include "commonc.h" 29 | #include "commonb.h" 30 | #include "primenet.h" 31 | 32 | /* Redefine some things with better equivalents on the Mac */ 33 | 34 | #undef ASSERTG 35 | #define ASSERTG(a) NSCAssert(a,@"Assertion raised") 36 | 37 | /* Declare some functions */ 38 | 39 | void Sleep (long); 40 | #define max(a,b) ((a)>(b)?(a):(b)) 41 | void BiggerFonts (); 42 | void SmallerFonts (); 43 | 44 | -------------------------------------------------------------------------------- /prime95/StartDlg.h: -------------------------------------------------------------------------------- 1 | // StartDlg.h : header file 2 | // 3 | 4 | ///////////////////////////////////////////////////////////////////////////// 5 | // CStartDlg dialog 6 | 7 | class CStartDlg : public CDialog 8 | { 9 | // Construction 10 | public: 11 | CStartDlg(CWnd* pParent = NULL); // standard constructor 12 | 13 | // Dialog Data 14 | //{{AFX_DATA(CStartDlg) 15 | enum { IDD = IDD_WORKER_START }; 16 | CStatic c_thread_text; 17 | CEdit c_thread; 18 | UINT m_thread; 19 | BOOL m_all_threads; 20 | //}}AFX_DATA 21 | 22 | 23 | // Overrides 24 | // ClassWizard generated virtual function overrides 25 | //{{AFX_VIRTUAL(CStartDlg) 26 | protected: 27 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 28 | //}}AFX_VIRTUAL 29 | 30 | // Implementation 31 | protected: 32 | 33 | // Generated message map functions 34 | //{{AFX_MSG(CStartDlg) 35 | // NOTE: the ClassWizard will add member functions here 36 | //}}AFX_MSG 37 | DECLARE_MESSAGE_MAP() 38 | 39 | afx_msg void OnBnClickedRadio1(); 40 | }; 41 | -------------------------------------------------------------------------------- /linux/makebsd: -------------------------------------------------------------------------------- 1 | # Makefile for FreeBSD 32-bit mprime 2 | # 3 | 4 | CC = gcc 5 | CFLAGS = -I.. -I../gwnum -I/usr/local/include -O2 -march=i486 -malign-double 6 | 7 | CPP = g++ 8 | CPPFLAGS = -I.. -I../gwnum -I/usr/local/include -O2 -march=i486 -malign-double 9 | 10 | LFLAGS = -Wl,-M 11 | LIBS = ../gwnum/gwnum.a ../gwnum/gwnum.ld -lm -lpthread -Wl,-Bstatic /usr/local/lib/libcurl.a -lz -lcompat -lstdc++ -Wl,-Bdynamic -lssl 12 | 13 | FACTOROBJ = factor32.o 14 | OBJS = prime.o menu.o 15 | EXE = mprime 16 | 17 | ######################################################################### 18 | 19 | $(EXE): security $(OBJS) $(FACTOROBJ) 20 | $(CC) $(LFLAGS) -o $(EXE) $(OBJS) $(FACTOROBJ) $(LIBS) 21 | 22 | security: 23 | [ ! -e ../security.h ] && touch ../security.h || true 24 | [ ! -e ../security.c ] && touch ../security.c || true 25 | [ ! -e ../secure5.c ] && touch ../secure5.c || true 26 | 27 | clean: 28 | rm -f $(EXE) $(EXE2) $(OBJS) 29 | 30 | .c.o: 31 | $(CC) $(CFLAGS) -c $< 32 | 33 | .cpp.o: 34 | $(CPP) $(CPPFLAGS) -c $< 35 | -------------------------------------------------------------------------------- /linux64/makebsd: -------------------------------------------------------------------------------- 1 | # Makefile for FreeBSD 10.0 64-bit mprime 2 | # 3 | # Install the curl package. This will be installed to /usr/local by default. 4 | # 5 | 6 | CC = cc 7 | CFLAGS = -I.. -I../gwnum -I/usr/local/include -DX86_64 -O2 8 | 9 | CPP = cc 10 | CPPFLAGS = -I.. -I../gwnum -DX86_64 -O2 11 | 12 | LFLAGS = -L/usr/local/lib -Wl,-M 13 | LIBS = ../gwnum/gwnum.a ../gwnum/gwnum.ld -lm -lpthread -lcurl -lstdc++ -lcompat 14 | 15 | FACTOROBJ = factor64.o 16 | OBJS = prime.o menu.o 17 | EXE = mprime 18 | 19 | ######################################################################### 20 | 21 | $(EXE): security $(OBJS) $(FACTOROBJ) 22 | $(CC) $(LFLAGS) -o $(EXE) $(OBJS) $(FACTOROBJ) $(LIBS) 23 | 24 | security: 25 | [ ! -e ../security.h ] && touch ../security.h || true 26 | [ ! -e ../security.c ] && touch ../security.c || true 27 | [ ! -e ../secure5.c ] && touch ../secure5.c || true 28 | 29 | clean: 30 | rm -f $(EXE) $(EXE2) $(OBJS) 31 | 32 | .c.o: 33 | $(CC) $(CFLAGS) -c $< 34 | 35 | .cpp.o: 36 | $(CPP) $(CPPFLAGS) -c $< 37 | -------------------------------------------------------------------------------- /macosx/Prime95/Pminus1Controller.h: -------------------------------------------------------------------------------- 1 | // 2 | // Pminus1Controller.h 3 | // Prime95 4 | // 5 | // Created by George Woltman on 4/24/09. 6 | // Copyright 2009 Mersenne Research, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface Pminus1Controller : NSWindowController { 12 | int workerNumber; 13 | int workerNumberMax; 14 | int workerNumberEnabled; 15 | double k; 16 | int b; 17 | int n; 18 | int nMax; 19 | int c; 20 | double bound1; 21 | double bound2; 22 | } 23 | 24 | @property(readwrite, assign) int workerNumber; 25 | @property(readwrite, assign) int workerNumberMax; 26 | @property(readwrite, assign) int workerNumberEnabled; 27 | @property(readwrite, assign) double k; 28 | @property(readwrite, assign) int b; 29 | @property(readwrite, assign) int n; 30 | @property(readonly) int nMax; 31 | @property(readwrite, assign) int c; 32 | @property(readwrite, assign) double bound1; 33 | @property(readwrite, assign) double bound2; 34 | 35 | - (void)reInit; 36 | - (IBAction)ok:(id)sender; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /prime95/compile: -------------------------------------------------------------------------------- 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 | masm=ml /c /coff /I..\gwnum 7 | #masm=ml /c /coff /I..\gwnum /Fl /Sf /Sa 8 | 9 | # C compiler options - optimization is not necessary 10 | 11 | cl=cl /I.. /GF /W3 /MT /D_CRT_SECURE_NO_DEPRECATE /c 12 | #cl=cl /I.. /GF /W3 /MT /D_CRT_SECURE_NO_DEPRECATE /Zi /c 13 | objconv=c:\objconv\objconv 14 | 15 | # List of all buildables in this makefile 16 | 17 | all: factor32.obj service.obj 18 | 19 | # Create 32-bit object files 20 | 21 | factor32.obj: factor32.asm factor32.mac 22 | $(masm) /Fofactor32.obj factor32.asm 23 | ..\gwnum\strip factor32.obj 24 | $(objconv) -felf32 factor32.obj linux\factor32.o 25 | attrib -r linux\factor32.o 26 | $(objconv) -fmac -wd1050 factor32.obj macosx\factor32.o 27 | attrib -r macosx\factor32.o 28 | 29 | # Compile special services code 30 | 31 | service.obj: service.c 32 | $(cl) service.c 33 | 34 | -------------------------------------------------------------------------------- /macosx/Prime95/CPUController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CPUController.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 CPUController : NSWindowController { 12 | IBOutlet NSTextField *textField; 13 | int hoursPerDay; 14 | int dayMemory; 15 | int nightMemory; 16 | int memoryMax; 17 | int memoryEnabled; 18 | NSString *dayStartTime; 19 | NSString *dayEndTime; 20 | unsigned int origDayMemory; 21 | unsigned int origNightMemory; 22 | unsigned int origDayStartTime; 23 | unsigned int origDayEndTime; 24 | } 25 | 26 | @property(readwrite, assign) int hoursPerDay; 27 | @property(readwrite, assign) int dayMemory; 28 | @property(readwrite, assign) int nightMemory; 29 | @property(readonly) int memoryMax; 30 | @property(readwrite, assign) int memoryEnabled; 31 | @property(readwrite, retain) NSString *dayStartTime; 32 | @property(readwrite, retain) NSString *dayEndTime; 33 | 34 | - (void)reInit; 35 | 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /macosx/Prime95/Prime95.xcodeproj/.svn/entries: -------------------------------------------------------------------------------- 1 | 8 2 | 3 | dir 4 | 1072 5 | file:///Users/George/svn/trunk/macosx/Prime95/Prime95.xcodeproj 6 | file:///Users/George/svn 7 | 8 | 9 | 10 | 2009-05-02T22:58:07.596341Z 11 | 1072 12 | george 13 | 14 | 15 | svn:special svn:externals svn:needs-lock 16 | 17 | george.pbxuser 18 | file 19 | 20 | 21 | 22 | 23 | 2009-05-02T22:52:42.000000Z 24 | c87b3493af2d0640f2b2672bd18c7d25 25 | 2009-05-02T22:58:07.596341Z 26 | 1072 27 | george 28 | 29 | TemplateIcon.icns 30 | file 31 | 32 | 33 | 34 | 35 | 2009-04-16T02:31:32.000000Z 36 | 9561f993b01bc966e01c9437d0c443ad 37 | 2009-05-02T22:58:07.596341Z 38 | 1072 39 | george 40 | has-props 41 | 42 | george.perspectivev3 43 | file 44 | 45 | 46 | 47 | 48 | 2009-05-02T22:52:41.000000Z 49 | 7bccc2d01da0a19d716a697ececfa2e3 50 | 2009-05-02T22:58:07.596341Z 51 | 1072 52 | george 53 | 54 | project.pbxproj 55 | file 56 | 57 | 58 | 59 | 60 | 2009-05-02T22:52:42.000000Z 61 | 5b8d99ee25384d6163584dbdf5388825 62 | 2009-05-02T22:58:07.596341Z 63 | 1072 64 | george 65 | 66 | -------------------------------------------------------------------------------- /macosx/Prime95/StopController.m: -------------------------------------------------------------------------------- 1 | // 2 | // StopController.m 3 | // Prime95 4 | // 5 | // Created by George Woltman on 4/19/09. 6 | // Copyright 2009-2010 Mersenne Research, Inc. All rights reserved. 7 | // 8 | 9 | #import "StopController.h" 10 | #include "prime95.h" 11 | 12 | @implementation StopController 13 | 14 | - (id)init 15 | { 16 | if (![super initWithWindowNibName:@"Stop"]) return nil; 17 | return self; 18 | } 19 | 20 | - (void)windowDidLoad 21 | { 22 | [self reInit]; 23 | } 24 | 25 | - (void)reInit 26 | { 27 | [self setStopAllWorkers:YES]; 28 | [self setWorkerNumber:1]; 29 | [self setWorkerNumberMax:NUM_WORKER_THREADS]; 30 | } 31 | 32 | @synthesize stopAllWorkers; 33 | @synthesize workerNumber; 34 | @synthesize workerNumberMax; 35 | 36 | - (IBAction)ok:(id)sender 37 | { 38 | [[self window] makeFirstResponder:nil]; // End any active text field edits 39 | 40 | if (stopAllWorkers) 41 | stop_workers_for_escape (); 42 | else 43 | stop_one_worker (workerNumber - 1); 44 | [[self window] performClose:self]; 45 | } 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /macosx/Prime95/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | Mersenne 11 | CFBundleIdentifier 12 | org.mersenne.${PRODUCT_NAME:identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 28.8 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | NSMainNibFile 26 | MainMenu 27 | NSPrincipalClass 28 | NSApplication 29 | 30 | 31 | -------------------------------------------------------------------------------- /prime95/EcmDlg.h: -------------------------------------------------------------------------------- 1 | // EcmDlg.h : header file 2 | // 3 | 4 | ///////////////////////////////////////////////////////////////////////////// 5 | // CEcmDlg dialog 6 | 7 | class CEcmDlg : public CDialog 8 | { 9 | // Construction 10 | public: 11 | CEcmDlg(CWnd* pParent = NULL); // standard constructor 12 | 13 | // Dialog Data 14 | //{{AFX_DATA(CEcmDlg) 15 | enum { IDD = IDD_ECM }; 16 | CStatic c_thread_text; 17 | CEdit c_thread; 18 | UINT m_thread; 19 | double m_k; 20 | UINT m_b; 21 | UINT m_n; 22 | long m_c; 23 | double m_bound1; 24 | double m_bound2; 25 | UINT m_num_curves; 26 | //}}AFX_DATA 27 | 28 | 29 | // Overrides 30 | // ClassWizard generated virtual function overrides 31 | //{{AFX_VIRTUAL(CEcmDlg) 32 | protected: 33 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 34 | //}}AFX_VIRTUAL 35 | 36 | // Implementation 37 | protected: 38 | 39 | // Generated message map functions 40 | //{{AFX_MSG(CEcmDlg) 41 | // NOTE: the ClassWizard will add member functions here 42 | //}}AFX_MSG 43 | DECLARE_MESSAGE_MAP() 44 | }; 45 | -------------------------------------------------------------------------------- /prime95/Pminus1Dlg.h: -------------------------------------------------------------------------------- 1 | // Pminus1Dlg.h : header file 2 | // 3 | 4 | ///////////////////////////////////////////////////////////////////////////// 5 | // CPminus1Dlg dialog 6 | 7 | class CPminus1Dlg : public CDialog 8 | { 9 | // Construction 10 | public: 11 | CPminus1Dlg(CWnd* pParent = NULL); // standard constructor 12 | 13 | // Dialog Data 14 | //{{AFX_DATA(CPminus1Dlg) 15 | enum { IDD = IDD_PMINUS1 }; 16 | CStatic c_thread_text; 17 | CEdit c_thread; 18 | UINT m_thread; 19 | double m_k; 20 | UINT m_b; 21 | UINT m_n; 22 | long m_c; 23 | double m_bound1; 24 | double m_bound2; 25 | //}}AFX_DATA 26 | 27 | 28 | // Overrides 29 | // ClassWizard generated virtual function overrides 30 | //{{AFX_VIRTUAL(CPminus1Dlg) 31 | protected: 32 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 33 | //}}AFX_VIRTUAL 34 | 35 | // Implementation 36 | protected: 37 | 38 | // Generated message map functions 39 | //{{AFX_MSG(CPminus1Dlg) 40 | // NOTE: the ClassWizard will add member functions here 41 | //}}AFX_MSG 42 | DECLARE_MESSAGE_MAP() 43 | }; 44 | -------------------------------------------------------------------------------- /prime95/hlp/AdvancedMenuManual.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Advanced Menu - Manual Communication 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
 
15 | 16 | 17 | 19 | 20 |
How to Use Prime95: Advanced Menu - Manual 18 | Communication
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).

29 |

 

30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /prime95/hlp/AdvancedMenuPriority.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Advanced Menu - Priority 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
 
15 | 16 | 17 | 18 | 19 |
How to Use Prime95: Advanced Menu - Priority
20 |

 

21 |

ADVANCED MENU - Priority

22 |

Priority

23 |

24 |

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.

28 |

 

29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /macosx/makefile: -------------------------------------------------------------------------------- 1 | # Makefile for Mac OS X mprime 2 | # 3 | 4 | ENVP= MACOSX_DEPLOYMENT_TARGET=10.4 5 | 6 | CC = gcc 7 | CFLAGS = -I.. -I../gwnum -I../linux -O2 -m32 -march=i686 -DCOMMAND_LINE_MPRIME 8 | 9 | CPP = g++ 10 | CPPFLAGS = -I.. -I../gwnum -I../linux -O2 -m32 -march=i686 -DCOMMAND_LINE_MPRIME 11 | 12 | LFLAGS = -Wl,-no_pie 13 | LIBS = ../gwnum/release/gwnum.a -lm -lpthread -lcurl -framework IOKit -framework CoreFoundation -lstdc++ 14 | 15 | FACTOROBJ = ../prime95/macosx/factor32.o 16 | OBJS = prime.o menu.o 17 | EXE = mprime 18 | 19 | ######################################################################### 20 | 21 | $(EXE): security $(OBJS) $(FACTOROBJ) 22 | $(ENVP) $(CC) $(LFLAGS) -o $(EXE) $(OBJS) $(FACTOROBJ) $(LIBS) 23 | 24 | security: 25 | [ ! -e ../security.h ] && touch ../security.h || true 26 | [ ! -e ../security.c ] && touch ../security.c || true 27 | [ ! -e ../secure5.c ] && touch ../secure5.c || true 28 | 29 | clean: 30 | rm -f $(EXE) $(EXE2) $(OBJS) 31 | 32 | .c.o: 33 | $(ENVP) $(CC) $(CFLAGS) -c $< 34 | 35 | .cpp.o: 36 | $(ENVP) $(CPP) $(CPPFLAGS) -c $< 37 | -------------------------------------------------------------------------------- /macosx/Prime95/ContinueController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ContinueController.m 3 | // Prime95 4 | // 5 | // Created by George Woltman on 4/19/09. 6 | // Copyright 2009-2010 Mersenne Research, Inc. All rights reserved. 7 | // 8 | 9 | #import "ContinueController.h" 10 | #include "prime95.h" 11 | 12 | @implementation ContinueController 13 | 14 | - (id)init 15 | { 16 | if (![super initWithWindowNibName:@"Continue"]) return nil; 17 | return self; 18 | } 19 | 20 | - (void)windowDidLoad 21 | { 22 | [self reInit]; 23 | } 24 | 25 | - (void)reInit 26 | { 27 | [self setStartAllWorkers:YES]; 28 | [self setWorkerNumber:1]; 29 | [self setWorkerNumberMax:NUM_WORKER_THREADS]; 30 | } 31 | 32 | @synthesize startAllWorkers; 33 | @synthesize workerNumber; 34 | @synthesize workerNumberMax; 35 | 36 | - (IBAction)ok:(id)sender 37 | { 38 | [[self window] makeFirstResponder:nil]; // End any active text field edits 39 | 40 | if (startAllWorkers) 41 | LaunchWorkerThreads (ALL_WORKERS, FALSE); 42 | else 43 | LaunchWorkerThreads (workerNumber - 1, FALSE); 44 | [[self window] performClose:self]; 45 | } 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /macosx/Prime95/ECMController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ECMController.h 3 | // Prime95 4 | // 5 | // Created by George Woltman on 4/24/09. 6 | // Copyright 2009 Mersenne Research, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ECMController : NSWindowController { 12 | int workerNumber; 13 | int workerNumberMax; 14 | int workerNumberEnabled; 15 | double k; 16 | int b; 17 | int n; 18 | int nMax; 19 | int c; 20 | double bound1; 21 | double bound2; 22 | int numberOfCurves; 23 | } 24 | 25 | @property(readwrite, assign) int workerNumber; 26 | @property(readwrite, assign) int workerNumberMax; 27 | @property(readwrite, assign) int workerNumberEnabled; 28 | @property(readwrite, assign) double k; 29 | @property(readwrite, assign) int b; 30 | @property(readwrite, assign) int n; 31 | @property(readonly) int nMax; 32 | @property(readwrite, assign) int c; 33 | @property(readwrite, assign) double bound1; 34 | @property(readwrite, assign) double bound2; 35 | @property(readwrite, assign) int numberOfCurves; 36 | 37 | - (void)reInit; 38 | - (IBAction)ok:(id)sender; 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /macosx64/makefile: -------------------------------------------------------------------------------- 1 | # Makefile for Mac OS X 64-bit mprime 2 | # 3 | 4 | ENVP= MACOSX_DEPLOYMENT_TARGET=10.4 5 | 6 | CC = gcc 7 | CFLAGS = -I.. -I../gwnum -I../linux -O2 -DX86_64 -DCOMMAND_LINE_MPRIME -m64 8 | 9 | CPP = g++ 10 | CPPFLAGS = -I.. -I../gwnum -I../linux -O2 -DX86_64 -DCOMMAND_LINE_MPRIME -m64 11 | 12 | LFLAGS = -m64 -Wl,-no_pie 13 | LIBS = ../gwnum/amd64/release/gwnum.a -lm -lpthread -lcurl -framework IOKit -framework CoreFoundation -lstdc++ 14 | 15 | FACTOROBJ = ../prime95/macosx64/factor64.o 16 | OBJS = prime.o menu.o 17 | EXE = mprime 18 | 19 | ######################################################################### 20 | 21 | $(EXE): security $(OBJS) $(FACTOROBJ) 22 | $(ENVP) $(CC) $(LFLAGS) -o $(EXE) $(OBJS) $(FACTOROBJ) $(LIBS) 23 | 24 | security: 25 | [ ! -e ../security.h ] && touch ../security.h || true 26 | [ ! -e ../security.c ] && touch ../security.c || true 27 | [ ! -e ../secure5.c ] && touch ../secure5.c || true 28 | 29 | clean: 30 | rm -f $(EXE) $(EXE2) $(OBJS) 31 | 32 | .c.o: 33 | $(ENVP) $(CC) $(CFLAGS) -c $< 34 | 35 | .cpp.o: 36 | $(ENVP) $(CPP) $(CPPFLAGS) -c $< 37 | -------------------------------------------------------------------------------- /prime95/UnreserveDlg.cpp: -------------------------------------------------------------------------------- 1 | // UnreserveDlg.cpp : implementation file 2 | // 3 | 4 | #include "stdafx.h" 5 | #include "Prime95.h" 6 | #include "UnreserveDlg.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 | // CUnreserveDlg dialog 16 | 17 | 18 | CUnreserveDlg::CUnreserveDlg(CWnd* pParent /*=NULL*/) 19 | : CDialog(CUnreserveDlg::IDD, pParent) 20 | { 21 | //{{AFX_DATA_INIT(CUnreserveDlg) 22 | m_p = 0; 23 | //}}AFX_DATA_INIT 24 | } 25 | 26 | 27 | void CUnreserveDlg::DoDataExchange(CDataExchange* pDX) 28 | { 29 | CDialog::DoDataExchange(pDX); 30 | //{{AFX_DATA_MAP(CUnreserveDlg) 31 | DDX_Text(pDX, IDC_P, m_p); 32 | //}}AFX_DATA_MAP 33 | } 34 | 35 | 36 | BEGIN_MESSAGE_MAP(CUnreserveDlg, CDialog) 37 | //{{AFX_MSG_MAP(CUnreserveDlg) 38 | // NOTE: the ClassWizard will add message map macros here 39 | //}}AFX_MSG_MAP 40 | END_MESSAGE_MAP() 41 | 42 | ///////////////////////////////////////////////////////////////////////////// 43 | // CUnreserveDlg message handlers 44 | -------------------------------------------------------------------------------- /prime95/hlp/NewFeaturesInVersion_8.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | New Features in Version 8 of Prime95 5 | 6 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
 
20 | 21 | 22 | 24 | 25 |
What's New: New Features in Version 8.x of 23 | Prime95
26 |

 

27 |

NEW FEATURES IN VERSION 8.x of PRIME95.EXE

28 |

New Features in Version 8 of Prime95

29 |
    30 |
  1. Factoring speed has been doubled for Pentiums. 486 machines will notice a 31 | 15% improvement when factoring.
    32 |  
  2. 33 |
  3. The program will now automatically determine your CPU type and speed. This 34 | information is used in choosing the optimal factoring algorithm.
    35 |  
  4. 36 |
37 | 38 |

 

39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /prime95/hlp/NewFeaturesInVersion_18.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | New Features in Version 18 of Prime95 5 | 6 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
 
20 | 21 | 22 | 23 | 24 |
What's New: New Features in Version 18.x of Prime95
25 |

 

26 |

NEW FEATURES IN VERSION 18.x of PRIME95.EXE

27 |

New Features in Version 18.1 of Prime95

28 |
    29 |
  1. Added code so that server can distinguish between a v17 and v18 client.
    30 |  
  2. 31 |
  3. Only v17 save files above 4194304 are deleted.
    32 |  
  4. 33 |
34 |

New Features in Version 18.0 of Prime95

35 |
    36 |
  1. Bug fixed in Lucas-Lehmer testing of exponents above 4194304.
    37 |  
  2. 38 |
39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /prime95/hlp/AdvancedMenuTime.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Advanced Menu - Time 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
 
15 | 16 | 17 | 18 | 19 |
How to Use Prime95: Advanced Menu - Time
20 |

 

21 |

ADVANCED MENU - Time

22 |

Time

23 |

24 |

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.

30 |

 

31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /prime95/TortureDlg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "afxwin.h" 3 | 4 | 5 | // CTortureDlg dialog 6 | 7 | class CTortureDlg : public CDialog 8 | { 9 | DECLARE_DYNAMIC(CTortureDlg) 10 | 11 | public: 12 | CTortureDlg(CWnd* pParent = NULL); // standard constructor 13 | virtual ~CTortureDlg(); 14 | 15 | // Dialog Data 16 | enum { IDD = IDD_TORTURE }; 17 | CStatic c_thread_text; 18 | CEdit c_thread; 19 | UINT m_thread; 20 | 21 | protected: 22 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 23 | 24 | DECLARE_MESSAGE_MAP() 25 | public: 26 | int m_torture_type; 27 | int m_minfft; 28 | int m_maxfft; 29 | BOOL m_in_place_fft; 30 | int m_memory; 31 | int m_timefft; 32 | CStatic c_minfft_text; 33 | CEdit c_minfft; 34 | CStatic c_maxfft_text; 35 | CEdit c_maxfft; 36 | CButton c_in_place_fft; 37 | CStatic c_memory_text; 38 | CEdit c_memory; 39 | CStatic c_timefft_text; 40 | CEdit c_timefft; 41 | 42 | int m_blendmemory; 43 | 44 | afx_msg void OnBnClickedL2Cache(); 45 | afx_msg void OnBnClickedInPlace(); 46 | afx_msg void OnBnClickedBlend(); 47 | afx_msg void OnBnClickedCustom(); 48 | afx_msg void OnBnClickedInPlaceFft(); 49 | }; 50 | -------------------------------------------------------------------------------- /prime95/hlp/NewFeaturesInVersion_13.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | New Features in Version 13 of Prime95 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
 
15 | 16 | 17 | 18 | 19 |
What's New: New Features in Version 13.x of Prime95
20 |

 

21 |

NEW FEATURES IN VERSION 13.x of PRIME95.EXE

22 |

New Features in Version 13.2 of Prime95

23 |
    24 |
  1. 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 |  
  2. 27 |
28 |

New Features in Version 13.1 of Prime95

29 |
    30 |
  1. 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.
  2. 33 |
34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /prime95/hlp/AdvancedMenuQuit.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Advanced Menu - Quit 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
 
15 | 16 | 17 | 18 | 19 |
How to Use Prime95: Advanced Menu - Quit
20 |

 

21 |

ADVANCED MENU - Quit

22 |

Quit

23 |

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 |

30 |

 

31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /prime95/hlp/CommandLine.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Advanced Command Line Arguments 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
 
15 | 16 | 17 | 19 | 20 |
How to Use Prime95: Advanced Command Line 18 | Arguments
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 |  

35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /prime95/CpuDlg.h: -------------------------------------------------------------------------------- 1 | // CpuDlg.h : header file 2 | // 3 | 4 | ///////////////////////////////////////////////////////////////////////////// 5 | // CCpuDlg dialog 6 | 7 | class CCpuDlg : public CDialog 8 | { 9 | // Construction 10 | public: 11 | CCpuDlg(CWnd* pParent = NULL); // standard constructor 12 | 13 | // Dialog Data 14 | //{{AFX_DATA(CCpuDlg) 15 | enum { IDD = IDD_CPU }; 16 | UINT m_hours; 17 | CString m_start_time; 18 | CString m_end_time; 19 | UINT m_day_memory; 20 | UINT m_night_memory; 21 | CString m_cpu_info; 22 | BOOL m_memory_editable; 23 | CStatic c_day_memory_text; 24 | CEdit c_day_memory; 25 | CStatic c_night_memory_text; 26 | CEdit c_night_memory; 27 | CStatic c_start_time_text; 28 | CEdit c_start_time; 29 | CStatic c_end_time_text; 30 | CEdit c_end_time; 31 | //}}AFX_DATA 32 | 33 | 34 | // Overrides 35 | // ClassWizard generated virtual function overrides 36 | //{{AFX_VIRTUAL(CCpuDlg) 37 | protected: 38 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 39 | //}}AFX_VIRTUAL 40 | 41 | // Implementation 42 | protected: 43 | 44 | // Generated message map functions 45 | //{{AFX_MSG(CCpuDlg) 46 | //}}AFX_MSG 47 | DECLARE_MESSAGE_MAP() 48 | }; 49 | -------------------------------------------------------------------------------- /prime95/hlp/AdvancedMenuPassword.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Advanced Menu - Password 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
 
15 | 16 | 17 | 18 | 19 |
How to Use Prime95: Advanced Menu - Password
20 |

 

21 |

ADVANCED MENU - Password

22 |

Password

23 |

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.

30 |

 

31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /prime95/hlp/AdvancedMenuUnreserve.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Advanced Menu - Unreserve Exponent 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
 
15 | 16 | 17 | 19 | 20 |
How to Use Prime95: Advanced Menu - Unreserve 18 | Exponent
21 |

 

22 |

ADVANCED MENU - Unreserve Exponent

23 |

Unreserve Exponent

24 |

25 |

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.

31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /macosx/Prime95/ManualCommunicationController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ManualCommunicationController.m 3 | // Prime95 4 | // 5 | // Created by George Woltman on 4/25/09. 6 | // Copyright 2009-2010 Mersenne Research, Inc. All rights reserved. 7 | // 8 | 9 | #import "ManualCommunicationController.h" 10 | #include "prime95.h" 11 | 12 | @implementation ManualCommunicationController 13 | 14 | - (id)init 15 | { 16 | if (![super initWithWindowNibName:@"ManualCommunication"]) return nil; 17 | return self; 18 | } 19 | 20 | - (void)windowDidLoad 21 | { 22 | [self reInit]; 23 | } 24 | 25 | - (void)reInit 26 | { 27 | [self setManualContact:MANUAL_COMM]; 28 | } 29 | 30 | - (int)manualContact 31 | { 32 | return manualContact; 33 | } 34 | 35 | - (void)setManualContact:(int) _value 36 | { 37 | if ((MANUAL_COMM && !_value) || (!MANUAL_COMM && _value)) { 38 | MANUAL_COMM = _value; 39 | IniWriteInt (INI_FILE, "ManualComm", MANUAL_COMM); 40 | set_comm_timers (); 41 | } 42 | manualContact = _value; 43 | } 44 | 45 | - (IBAction)ok:(id)sender 46 | { 47 | [[self window] makeFirstResponder:nil]; // End any active text field edits 48 | 49 | UpdateEndDates (); 50 | do_manual_comm_now (); 51 | 52 | [[self window] performClose:self]; 53 | } 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /prime95/WelcomeDlg.cpp: -------------------------------------------------------------------------------- 1 | // WelcomeDlg.cpp : implementation file 2 | // 3 | 4 | #include "stdafx.h" 5 | #include "Prime95.h" 6 | #include "WelcomeDlg.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 | // CWelcomeDlg dialog 16 | 17 | 18 | CWelcomeDlg::CWelcomeDlg(CWnd* pParent /*=NULL*/) 19 | : CDialog(CWelcomeDlg::IDD, pParent) 20 | { 21 | //{{AFX_DATA_INIT(CWelcomeDlg) 22 | // NOTE: the ClassWizard will add member initialization here 23 | //}}AFX_DATA_INIT 24 | } 25 | 26 | 27 | void CWelcomeDlg::DoDataExchange(CDataExchange* pDX) 28 | { 29 | CDialog::DoDataExchange(pDX); 30 | //{{AFX_DATA_MAP(CWelcomeDlg) 31 | // NOTE: the ClassWizard will add DDX and DDV calls here 32 | //}}AFX_DATA_MAP 33 | } 34 | 35 | 36 | BEGIN_MESSAGE_MAP(CWelcomeDlg, CDialog) 37 | //{{AFX_MSG_MAP(CWelcomeDlg) 38 | //}}AFX_MSG_MAP 39 | END_MESSAGE_MAP() 40 | 41 | ///////////////////////////////////////////////////////////////////////////// 42 | // CWelcomeDlg message handlers 43 | 44 | void CWelcomeDlg::OnCancel() 45 | { 46 | // TODO: Add extra cleanup here 47 | 48 | CDialog::OnCancel(); 49 | } 50 | -------------------------------------------------------------------------------- /prime95/TimeDlg.cpp: -------------------------------------------------------------------------------- 1 | // TimeDlg.cpp : implementation file 2 | // 3 | 4 | #include "stdafx.h" 5 | #include "Prime95.h" 6 | #include "TimeDlg.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 | // CTimeDlg dialog 16 | 17 | 18 | CTimeDlg::CTimeDlg(CWnd* pParent /*=NULL*/) 19 | : CDialog(CTimeDlg::IDD, pParent) 20 | { 21 | //{{AFX_DATA_INIT(CTimeDlg) 22 | m_p = 0; 23 | m_iter = 0; 24 | //}}AFX_DATA_INIT 25 | } 26 | 27 | 28 | void CTimeDlg::DoDataExchange(CDataExchange* pDX) 29 | { 30 | CDialog::DoDataExchange(pDX); 31 | //{{AFX_DATA_MAP(CTimeDlg) 32 | DDX_Text(pDX, IDC_P, m_p); 33 | DDV_MinMaxUInt(pDX, m_p, MIN_PRIME, 34 | CPU_FLAGS & CPU_SSE2 ? MAX_PRIME_SSE2 : MAX_PRIME); 35 | DDX_Text(pDX, IDC_EDIT1, m_iter); 36 | DDV_MinMaxUInt(pDX, m_iter, 1, 1000); 37 | //}}AFX_DATA_MAP 38 | } 39 | 40 | 41 | BEGIN_MESSAGE_MAP(CTimeDlg, CDialog) 42 | //{{AFX_MSG_MAP(CTimeDlg) 43 | // NOTE: the ClassWizard will add message map macros here 44 | //}}AFX_MSG_MAP 45 | END_MESSAGE_MAP() 46 | 47 | ///////////////////////////////////////////////////////////////////////////// 48 | // CTimeDlg message handlers 49 | -------------------------------------------------------------------------------- /prime95/hlp/TestMenuVacation.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Test Menu - Vacation or Holiday 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
 
15 | 16 | 17 | 19 | 20 |
How to Use Prime95: Test Menu - Vacation or 18 | Holiday
21 |

 

22 |

TEST MENU - Vacation or Holiday

23 |

Vacation or Holiday

24 |

25 |

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 | 11 | 12 | 13 | 14 |
 
15 | 16 | 17 | 18 | 19 |
How to Use Prime95: Advanced Menu - P1
20 |

 

21 |

ADVANCED MENU - P1

22 |

P-1

23 |

24 |

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 | 19 | 20 |
How to Use Prime95: Running Prime95 on 18 | Several Machines
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 |  

-------------------------------------------------------------------------------- /macosx/Prime95/PreferencesController.h: -------------------------------------------------------------------------------- 1 | // 2 | // PreferencesController.h 3 | // Prime95 4 | // 5 | // Created by George Woltman on 4/25/09. 6 | // Copyright 2009-2014 Mersenne Research, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface PreferencesController : NSWindowController { 12 | int iterationsOutput; 13 | int iterationsResultsFile; 14 | int writeSaveFileMinutes; 15 | int modemRetryMinutes; 16 | int modemRetryMinutesEnabled; 17 | int primenetOptionsEnabled; 18 | int networkRetryMinutes; 19 | int daysOfWork; 20 | int daysBetweenEndDates; 21 | int numberOfBackupFiles; 22 | int makeNoise; 23 | int runOnBattery; 24 | int defeatPowerSave; 25 | } 26 | 27 | @property(readwrite, assign) int iterationsOutput; 28 | @property(readwrite, assign) int iterationsResultsFile; 29 | @property(readwrite, assign) int writeSaveFileMinutes; 30 | @property(readwrite, assign) int modemRetryMinutes; 31 | @property(readwrite, assign) int modemRetryMinutesEnabled; 32 | @property(readwrite, assign) int primenetOptionsEnabled; 33 | @property(readwrite, assign) int networkRetryMinutes; 34 | @property(readwrite, assign) int daysOfWork; 35 | @property(readwrite, assign) int daysBetweenEndDates; 36 | @property(readwrite, assign) int numberOfBackupFiles; 37 | @property(readwrite, assign) int makeNoise; 38 | @property(readwrite, assign) int runOnBattery; 39 | @property(readwrite, assign) int defeatPowerSave; 40 | 41 | - (void)reInit; 42 | 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /prime95/ManualCommDlg.cpp: -------------------------------------------------------------------------------- 1 | // ManualCommDlg.cpp : implementation file 2 | // 3 | 4 | #include "stdafx.h" 5 | #include "Prime95.h" 6 | #include "ManualCommDlg.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 | // CManualCommDlg dialog 16 | 17 | 18 | CManualCommDlg::CManualCommDlg(CWnd* pParent /*=NULL*/) 19 | : CDialog(CManualCommDlg::IDD, pParent) 20 | { 21 | //{{AFX_DATA_INIT(CManualCommDlg) 22 | m_manual_comm = FALSE; 23 | m_comm_now = FALSE; 24 | m_new_dates = FALSE; 25 | //}}AFX_DATA_INIT 26 | } 27 | 28 | 29 | void CManualCommDlg::DoDataExchange(CDataExchange* pDX) 30 | { 31 | CDialog::DoDataExchange(pDX); 32 | //{{AFX_DATA_MAP(CManualCommDlg) 33 | DDX_Control(pDX, IDC_NOW, c_comm_now); 34 | DDX_Check(pDX, IDC_MANUAL, m_manual_comm); 35 | DDX_Check(pDX, IDC_NOW, m_comm_now); 36 | DDX_Check(pDX, IDC_COMPLETION, m_new_dates); 37 | //}}AFX_DATA_MAP 38 | // c_comm_now.EnableWindow (m_manual_comm); 39 | } 40 | 41 | 42 | BEGIN_MESSAGE_MAP(CManualCommDlg, CDialog) 43 | //{{AFX_MSG_MAP(CManualCommDlg) 44 | ON_BN_CLICKED(IDC_MANUAL, OnManual) 45 | //}}AFX_MSG_MAP 46 | END_MESSAGE_MAP() 47 | 48 | ///////////////////////////////////////////////////////////////////////////// 49 | // CManualCommDlg message handlers 50 | 51 | void CManualCommDlg::OnManual() 52 | { 53 | UpdateData (); // Get the values from the dialog box 54 | } 55 | -------------------------------------------------------------------------------- /prime95/hlp/OptionsMenuTrayIcon.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Options Menu - Tray Icon 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
 
15 | 16 | 17 | 19 | 20 |
How to Use Prime95: Options Menu - Torture 18 | Test
21 |

 

22 |

OPTIONS MENU - Tray Icon

23 |

Tray Icon

24 |

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.

29 |

30 |

 

31 |

No Icon

32 |

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.

39 |

40 |

 

41 | 42 | -------------------------------------------------------------------------------- /macosx/Prime95/WorkerWindowsController.h: -------------------------------------------------------------------------------- 1 | // 2 | // WorkerWindowsController.h 3 | // Prime95 4 | // 5 | // Created by George Woltman on 4/26/09. 6 | // Copyright 2009-2016 Mersenne Research, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface WorkerWindowsController : NSWindowController { 12 | int numWorkers; 13 | int numWorkersMax; 14 | int numWorkersEnabled; 15 | int priority; 16 | NSMutableArray *workerData; 17 | NSMutableArray *affinityValues; 18 | IBOutlet NSArrayController *workerDataArrayController; 19 | int startupInProgress; 20 | } 21 | 22 | @property(readwrite, assign) int numWorkers; 23 | @property(readwrite, assign) int numWorkersMax; 24 | @property(readwrite, assign) int numWorkersEnabled; 25 | @property(readwrite, assign) int priority; 26 | @property(copy) NSArray *workerData; 27 | @property(copy) NSArray *affinityValues; 28 | 29 | - (void)reInit; 30 | - (IBAction)ok:(id)sender; 31 | 32 | @end 33 | 34 | 35 | @interface WorkerData : NSObject 36 | { 37 | NSString *workerNumber; 38 | int typeOfWork; 39 | int affinity; 40 | int affinityEnabled; 41 | int multithreading; 42 | int multithreadingMax; 43 | int multithreadingEnabled; 44 | } 45 | 46 | @property(copy) NSString *workerNumber; 47 | @property(readwrite, assign) int typeOfWork; 48 | @property(readwrite, assign) int affinity; 49 | @property(readwrite, assign) int affinityEnabled; 50 | @property(readwrite, assign) int multithreading; 51 | @property(readwrite, assign) int multithreadingMax; 52 | @property(readwrite, assign) int multithreadingEnabled; 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /prime95/StopDlg.cpp: -------------------------------------------------------------------------------- 1 | // StopDlg.cpp : implementation file 2 | // 3 | 4 | #include "stdafx.h" 5 | #include "Prime95.h" 6 | #include "StopDlg.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 | // CStopDlg dialog 16 | 17 | 18 | CStopDlg::CStopDlg(CWnd* pParent /*=NULL*/) 19 | : CDialog(CStopDlg::IDD, pParent) 20 | { 21 | //{{AFX_DATA_INIT(CStopDlg) 22 | m_thread = 1; 23 | m_all_threads = 1; 24 | //}}AFX_DATA_INIT 25 | } 26 | 27 | void CStopDlg::DoDataExchange(CDataExchange* pDX) 28 | { 29 | CDialog::DoDataExchange(pDX); 30 | //{{AFX_DATA_MAP(CStopDlg) 31 | DDX_Check(pDX, IDC_RADIO1, m_all_threads); 32 | DDX_Control(pDX, IDC_THREAD_TEXT, c_thread_text); 33 | DDX_Control(pDX, IDC_THREAD, c_thread); 34 | DDX_Text(pDX, IDC_THREAD, m_thread); 35 | DDV_MinMaxUInt(pDX, m_thread, 1, WORKER_THREADS_ACTIVE); 36 | //}}AFX_DATA_MAP 37 | c_thread_text.EnableWindow (!m_all_threads); 38 | c_thread.EnableWindow (!m_all_threads); 39 | } 40 | 41 | 42 | BEGIN_MESSAGE_MAP(CStopDlg, CDialog) 43 | //{{AFX_MSG_MAP(CStopDlg) 44 | ON_BN_CLICKED(IDC_RADIO1, OnBnClickedRadio1) 45 | //}}AFX_MSG_MAP 46 | END_MESSAGE_MAP() 47 | 48 | 49 | ///////////////////////////////////////////////////////////////////////////// 50 | // CStopDlg message handlers 51 | 52 | void CStopDlg::OnBnClickedRadio1() 53 | { 54 | UpdateData (); 55 | c_thread_text.EnableWindow (!m_all_threads); 56 | c_thread.EnableWindow (!m_all_threads); 57 | } 58 | 59 | -------------------------------------------------------------------------------- /macosx/Prime95/Pminus1Controller.m: -------------------------------------------------------------------------------- 1 | // 2 | // Pminus1Controller.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 "Pminus1Controller.h" 10 | #include "prime95.h" 11 | 12 | @implementation Pminus1Controller 13 | 14 | - (id)init 15 | { 16 | if (![super initWithWindowNibName:@"Pminus1"]) 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 | 25 | return self; 26 | } 27 | 28 | - (void)windowDidLoad 29 | { 30 | [self reInit]; 31 | } 32 | 33 | - (void)reInit 34 | { 35 | [self setWorkerNumber:1]; 36 | [self setWorkerNumberMax:NUM_WORKER_THREADS]; 37 | [self setWorkerNumberEnabled:(NUM_WORKER_THREADS > 1)]; 38 | } 39 | 40 | @synthesize workerNumber; 41 | @synthesize workerNumberMax; 42 | @synthesize workerNumberEnabled; 43 | @synthesize k; 44 | @synthesize b; 45 | @synthesize n; 46 | @synthesize nMax; 47 | @synthesize c; 48 | @synthesize bound1; 49 | @synthesize bound2; 50 | 51 | - (IBAction)ok:(id)sender 52 | { 53 | struct work_unit w; 54 | 55 | [[self window] makeFirstResponder:nil]; // End any active text field edits 56 | 57 | memset (&w, 0, sizeof (w)); 58 | w.work_type = WORK_PMINUS1; 59 | w.k = k; 60 | w.b = b; 61 | w.n = n; 62 | w.c = c; 63 | w.B1 = bound1; 64 | w.B2_start = 0; 65 | w.B2 = bound2; 66 | addWorkToDoLine (workerNumber - 1, &w); 67 | 68 | if (! WORKER_THREADS_ACTIVE) 69 | LaunchWorkerThreads (ALL_WORKERS, FALSE); 70 | 71 | [[self window] performClose:self]; 72 | } 73 | 74 | @end 75 | -------------------------------------------------------------------------------- /prime95/hlp/Proxy.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Advanced Menu 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
 
15 | 16 | 17 | 18 | 19 |
How to Use Prime95: Setting up a Proxy Server
20 |

 

21 |

SETTING UP A PROXY SERVER

22 | 23 |

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 |

[PrimeNet Proxy]
29 | ProxyHost=http://proxy.megacorp.com:8080
30 |  

If the proxy is secured by a userid/password, add the following two text lines, 31 | substituting the appropriate values:

32 | 33 | 34 |
ProxyUser=whatever_the_userid_is
35 | ProxyPass=whatever_the_password_is
36 | 37 |  

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 |  

43 |

-------------------------------------------------------------------------------- /prime95/StartDlg.cpp: -------------------------------------------------------------------------------- 1 | // StartDlg.cpp : implementation file 2 | // 3 | 4 | #include "stdafx.h" 5 | #include "Prime95.h" 6 | #include "StartDlg.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 | // CStartDlg dialog 16 | 17 | 18 | CStartDlg::CStartDlg(CWnd* pParent /*=NULL*/) 19 | : CDialog(CStartDlg::IDD, pParent) 20 | { 21 | //{{AFX_DATA_INIT(CStartDlg) 22 | m_thread = 1; 23 | m_all_threads = 1; 24 | //}}AFX_DATA_INIT 25 | } 26 | 27 | void CStartDlg::DoDataExchange(CDataExchange* pDX) 28 | { 29 | CDialog::DoDataExchange(pDX); 30 | //{{AFX_DATA_MAP(CStartDlg) 31 | DDX_Check(pDX, IDC_RADIO1, m_all_threads); 32 | DDX_Control(pDX, IDC_THREAD_TEXT, c_thread_text); 33 | DDX_Control(pDX, IDC_THREAD, c_thread); 34 | DDX_Text(pDX, IDC_THREAD, m_thread); 35 | DDV_MinMaxUInt(pDX, m_thread, 1, WORKER_THREADS_ACTIVE > NUM_WORKER_THREADS ? WORKER_THREADS_ACTIVE : NUM_WORKER_THREADS); 36 | //}}AFX_DATA_MAP 37 | c_thread_text.EnableWindow (!m_all_threads); 38 | c_thread.EnableWindow (!m_all_threads); 39 | } 40 | 41 | 42 | BEGIN_MESSAGE_MAP(CStartDlg, CDialog) 43 | //{{AFX_MSG_MAP(CStartDlg) 44 | ON_BN_CLICKED(IDC_RADIO1, OnBnClickedRadio1) 45 | //}}AFX_MSG_MAP 46 | END_MESSAGE_MAP() 47 | 48 | 49 | ///////////////////////////////////////////////////////////////////////////// 50 | // CStartDlg message handlers 51 | 52 | void CStartDlg::OnBnClickedRadio1() 53 | { 54 | UpdateData (); 55 | c_thread_text.EnableWindow (!m_all_threads); 56 | c_thread.EnableWindow (!m_all_threads); 57 | } 58 | 59 | -------------------------------------------------------------------------------- /linux64/makefile: -------------------------------------------------------------------------------- 1 | # Makefile for Linux 64-bit mprime 2 | # 3 | # Ugh, different linux variants require different makefiles. 4 | # The current makefile is for CentOS 5.10. We prefer to link against 5 | # older Linux versions because linking on the latest, greatest version 6 | # will create an mprime executable that will not run on older 7 | # Linux versions because of glibc incompatibilites. 8 | # 9 | # Some linux versions require some of the variations below: 10 | # "export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig" 11 | # CFLAGS = -I.. -I../gwnum -DX86_64 -O2 -Wno-unused-result 12 | # LFLAGS = -Wl,-M 13 | # LIBS = ../gwnum/gwnum.a ../gwnum/gwnum.ld -lm -lpthread -Wl,-Bstatic $(shell pkg-config --static --libs libcurl) -lstdc++ -Wl,-Bdynamic -ldl 14 | 15 | CC = gcc 16 | CFLAGS = -I.. -I../gwnum -I/usr/local/include -DX86_64 -O2 17 | 18 | CPP = g++ 19 | CPPFLAGS = -I.. -I../gwnum -DX86_64 -O2 20 | 21 | LFLAGS = -Wl,-M -Wl,-L/usr/local/lib 22 | LIBS = ../gwnum/gwnum.a ../gwnum/gwnum.ld -lm -lpthread -Wl,-Bstatic -lcurl -Wl,-Bdynamic -lrt -lstdc++ -ldl 23 | 24 | FACTOROBJ = factor64.o 25 | LINUXOBJS = prime.o menu.o 26 | EXE = mprime 27 | 28 | ######################################################################### 29 | 30 | $(EXE): security $(LINUXOBJS) $(FACTOROBJ) 31 | $(CC) $(LFLAGS) -o $(EXE) $(LINUXOBJS) $(FACTOROBJ) $(LIBS) 32 | 33 | security: 34 | [ ! -e ../security.h ] && touch ../security.h || true 35 | [ ! -e ../security.c ] && touch ../security.c || true 36 | [ ! -e ../secure5.c ] && touch ../secure5.c || true 37 | 38 | clean: 39 | rm -f $(EXE) $(EXE2) $(LINUXOBJS) 40 | 41 | .c.o: 42 | $(CC) $(CFLAGS) -c $< 43 | 44 | .cpp.o: 45 | $(CPP) $(CPPFLAGS) -c $< 46 | -------------------------------------------------------------------------------- /prime95/hlp/TestMenuPrimeNet.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Test Menu - PrimeNet 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
 
15 | 16 | 17 | 18 | 19 |
How to Use Prime95: Test Menu - PrimeNet
20 |

 

21 |

TEST MENU - PrimeNet

22 |

PrimeNet

23 |

24 |

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 | 18 | 19 |
Getting Started: General Instructions
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.

37 |

 

38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /prime95/hlp/OptionsMenuPreferences.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Options Menu - Preferences 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
 
15 | 16 | 17 | 19 | 20 |
How to Use Prime95: Options Menu - 18 | Preferences
21 |

 

22 |

OPTIONS MENU - Preferences

23 |

Preference

24 |

25 |

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 | 19 | 20 |
How to Use Prime95: Test Menu - User 18 | Information
21 |

 

22 |

TEST MENU - User Information

23 |

User Information

24 |

25 |

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.

36 |

 

37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /gwnum/mult.mac: -------------------------------------------------------------------------------- 1 | ; Copyright 1998-2009 - Mersenne Research, Inc. All rights reserved 2 | ; Author: George Woltman 3 | ; Email: woltman@alum.mit.edu 4 | ; 5 | ; These macros take the basic FFT building blocks and build even 6 | ; larger building blocks. 7 | ; 8 | 9 | pf MACRO stmt:vararg 10 | IFDEF PFETCH 11 | &stmt 12 | ENDIF 13 | ENDM 14 | 15 | prefetch64 MACRO x 16 | IFDEF PFETCH 17 | prefetcht1 x 18 | prefetcht1 x[32] 19 | ENDIF 20 | ENDM 21 | 22 | prefetch32 MACRO x 23 | IFDEF PFETCH 24 | prefetcht1 x 25 | ENDIF 26 | ENDM 27 | 28 | ; *************** macros to expand 4 types of fft macros ****************** 29 | 30 | ;; 31 | ;; Generate the 4 types of FFTs for the given run length. 32 | ;; The 4 types are: 33 | ;; 1) forward FFT, 34 | ;; 2) square (forward FFT, multiply, inverse FFT) 35 | ;; 3) multiply (forward FFT src1, multiply by src2, inverse FFT) 36 | ;; 4) multiply (multiply src1 by src2, inverse FFT) 37 | ;; 38 | 39 | fft MACRO fft_length 40 | fftgen &fft_length 41 | purge fft&fft_length 42 | ENDM 43 | 44 | fftclm MACRO fft_length, clm 45 | fftgen &fft_length, clm 46 | ENDM 47 | 48 | ;; 49 | ;; Do the forward FFT, squaring, and inverse FFT 50 | ;; 51 | 52 | fftgen MACRO fft_length, clm 53 | PROCFP fft&fft_length&clm 54 | ad_prolog 0,0,rbx,rbp,rsi,rdi 55 | mov esi, DESTARG 56 | mov ebx, DIST_TO_FFTSRCARG 57 | IFB 58 | fft&fft_length 59 | ELSE 60 | fft&fft_length clm 61 | ENDIF 62 | ENDPP fft&fft_length&clm 63 | ENDM 64 | 65 | ; Return from a type 1 FFT 66 | 67 | fft_1_ret MACRO 68 | ad_epilog 0,0,rbx,rbp,rsi,rdi 69 | ENDM 70 | 71 | ; Return from a type 3 FFT - either jump to the common 72 | ; error check or normalization code 73 | 74 | fft_3_ret MACRO 75 | mov eax, NORMRTN 76 | call eax 77 | ad_epilog 0,0,rbx,rbp,rsi,rdi 78 | ENDM 79 | -------------------------------------------------------------------------------- /prime95/hlp/Success.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | GIMPS Success Stories 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
 
15 | 16 | 17 | 18 | 19 |
History: GIMPS Success Stories
20 |

 

21 |

GIMPS SUCCESS STORIES

22 |

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 | 23 | 24 |
What's New: New Features in Version 17.x of Prime95
25 |

 

26 |

NEW FEATURES IN VERSION 17.x of PRIME95.EXE

27 |

New Features in Version 17.2 of Prime95

28 |
    29 |
  1. Faster 2^N+1 ECM factoring
    30 |  
  2. 31 |
32 |

New Features in Version 17.1 of Prime95

33 |
    34 |
  1. The -T command line switch has been deleted.
    35 |  
  2. 36 |
  3. 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 |  
  4. 39 |
  5. ECM factoring for 2^N+1 is now available.
    40 |  
  6. 41 |
  7. 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 |  
  8. 45 |
46 |

New features in Version 17.0 of Prime95

47 |
    48 |
  1. Prime95 can now be used to double-check its own results.
    49 |  
  2. 50 |
  3. Machines less powerful than a P133 will default to double-checking assignments.
    51 |  
  4. 52 |
  5. The total number of errors that occur during the Lucas-Lehmer test are now 53 | output in results.txt.
    54 |  
  6. 55 |
56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /prime95/EcmDlg.cpp: -------------------------------------------------------------------------------- 1 | // EcmDlg.cpp : implementation file 2 | // 3 | 4 | #include "stdafx.h" 5 | #include "Prime95.h" 6 | #include "EcmDlg.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 | // CEcmDlg dialog 16 | 17 | 18 | CEcmDlg::CEcmDlg(CWnd* pParent /*=NULL*/) 19 | : CDialog(CEcmDlg::IDD, pParent) 20 | { 21 | //{{AFX_DATA_INIT(CEcmDlg) 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 | m_num_curves = 100; 30 | //}}AFX_DATA_INIT 31 | } 32 | 33 | 34 | void CEcmDlg::DoDataExchange(CDataExchange* pDX) 35 | { 36 | CDialog::DoDataExchange(pDX); 37 | //{{AFX_DATA_MAP(CEcmDlg) 38 | DDX_Control(pDX, IDC_THREAD_TEXT, c_thread_text); 39 | DDX_Control(pDX, IDC_THREAD, c_thread); 40 | DDX_Text(pDX, IDC_THREAD, m_thread); 41 | DDV_MinMaxUInt(pDX, m_thread, 1, NUM_WORKER_THREADS); 42 | DDX_Text(pDX, IDC_P4, m_k); 43 | DDX_Text(pDX, IDC_P1, m_b); 44 | DDV_MinMaxUInt (pDX, m_b, 2, 1000000000); 45 | DDX_Text(pDX, IDC_P5, m_n); 46 | DDV_MinMaxUInt (pDX, m_n, 1, 47 | CPU_FLAGS & CPU_SSE2 ? MAX_PRIME_SSE2 : MAX_PRIME); 48 | DDX_Text(pDX, IDC_P6, m_c); 49 | DDX_Text(pDX, IDC_P2, m_bound1); 50 | DDX_Text(pDX, IDC_P3, m_bound2); 51 | DDX_Text(pDX, IDC_NUM_CURVES, m_num_curves); 52 | DDV_MinMaxUInt(pDX, m_num_curves, 1, 1000000); 53 | //}}AFX_DATA_MAP 54 | c_thread_text.EnableWindow (NUM_WORKER_THREADS > 1); 55 | c_thread.EnableWindow (NUM_WORKER_THREADS > 1); 56 | } 57 | 58 | 59 | BEGIN_MESSAGE_MAP(CEcmDlg, CDialog) 60 | //{{AFX_MSG_MAP(CEcmDlg) 61 | // NOTE: the ClassWizard will add message map macros here 62 | //}}AFX_MSG_MAP 63 | END_MESSAGE_MAP() 64 | 65 | ///////////////////////////////////////////////////////////////////////////// 66 | // CEcmDlg message handlers 67 | -------------------------------------------------------------------------------- /prime95/WorkerDlg.h: -------------------------------------------------------------------------------- 1 | // WorkerDlg.h : header file 2 | // 3 | // Copyright 1995-2016 Mersenne Research, Inc. All rights reserved 4 | // 5 | 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // CWorkerDlg dialog 8 | 9 | class CWorkerDlg : public CDialog 10 | { 11 | // Construction 12 | public: 13 | CWorkerDlg(CWnd* pParent = NULL); // standard constructor 14 | 15 | // Dialog Data 16 | //{{AFX_DATA(CWorkerDlg) 17 | enum { IDD = IDD_WORKER_THREADS }; 18 | CStatic c_num_thread_text; 19 | CEdit c_num_thread; 20 | UINT m_num_thread; 21 | UINT m_priority; 22 | CButton c_workgroup; 23 | CStatic c_threadnum_text; 24 | CComboBox c_threadnum; 25 | CStatic c_work_pref_text; 26 | CComboBox c_work_pref; 27 | int m_work_pref[MAX_NUM_WORKER_THREADS]; 28 | CStatic c_affinity_text; 29 | CComboBox c_affinity; 30 | int m_affinity[MAX_NUM_WORKER_THREADS]; 31 | CStatic c_numcpus_text; 32 | CEdit c_numcpus; 33 | int m_numcpus[MAX_NUM_WORKER_THREADS]; 34 | CStatic c_warn1_text; 35 | CStatic c_warn2_text; 36 | CStatic c_warn3_text; 37 | //}}AFX_DATA 38 | 39 | private: 40 | int thread_num; 41 | public: 42 | int AreAllTheSame (int *); 43 | void InitComboBoxText (void); 44 | 45 | // Overrides 46 | // ClassWizard generated virtual function overrides 47 | //{{AFX_VIRTUAL(CWorkerDlg) 48 | protected: 49 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 50 | //}}AFX_VIRTUAL 51 | 52 | // Implementation 53 | protected: 54 | 55 | // Generated message map functions 56 | //{{AFX_MSG(CWorkerDlg) 57 | virtual BOOL OnInitDialog(); 58 | afx_msg void OnEnKillfocusNumThread(); 59 | afx_msg void OnEnSetfocusPriority(); 60 | afx_msg void OnEnKillfocusPriority(); 61 | afx_msg void OnCbnKillfocusThreadNum(); 62 | afx_msg void OnCbnKillfocusWorkType(); 63 | afx_msg void OnCbnKillfocusAffinity(); 64 | afx_msg void OnEnKillfocusNumCpus(); 65 | //}}AFX_MSG 66 | DECLARE_MESSAGE_MAP() 67 | }; 68 | 69 | -------------------------------------------------------------------------------- /prime95/hlp/NewFeaturesInVersion_10.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | New Features in Version 10 of Prime95 5 | 6 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
 
20 | 21 | 22 | 24 | 25 |
What's New: New Features in Version 10.x of 23 | Prime95
26 |

 

27 |

NEW FEATURES IN VERSION 10.x of PRIME95.EXE

28 |

New Features in Version 10 of Prime95

29 |
    30 |
  1. 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 |  
  2. 35 |
  3. 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 |  
  4. 40 |
  5. The File menu has been renamed Range - it seems clearer to beginners.
    41 |  
  6. 42 |
  7. 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 |  
  8. 47 |
  9. A bug in stopping and continuing when factoring in Version 8 has been 48 | fixed.
    49 |  
  10. 50 |
51 | 52 |

 

53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /prime95/hlp/DoubleChecking.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Double Checking 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
 
15 | 16 | 17 | 18 | 19 |
Math: Double Checking
20 |

 

21 |

DOUBLE CHECKING

22 | 23 |

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 | 19 | 20 |
Welcome...: What Are Mersenne Primes and Why 18 | Do We Search for Them?
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 |  

43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /winnt/prime.c: -------------------------------------------------------------------------------- 1 | 2 | #include "windows.h" 3 | #include 4 | #include 5 | #include "main.h" 6 | #include "prime95.h" 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | #define PORT 5 20 | #include "gwnum.h" 21 | #include "gwutil.h" 22 | #include "commona.c" 23 | #include "commonb.c" 24 | #include "commonc.c" 25 | #include "ecm.c" 26 | #include "comm95b.c" 27 | #define _WIN32_WINNT 0x0502 // (Windows 2003 Server - same as afx_v32.h for sddl.h) 28 | #include "comm95c.c" 29 | #include "primenet.c" 30 | #include "gwtest.c" 31 | 32 | void create_window ( 33 | int thread_num) 34 | { 35 | } 36 | 37 | void destroy_window ( 38 | int thread_num) 39 | { 40 | } 41 | 42 | void title ( 43 | int thread_num, 44 | const char *msg) 45 | { 46 | } 47 | 48 | void base_title ( 49 | int thread_num, 50 | const char *msg) 51 | { 52 | } 53 | 54 | void flashWindowAndBeep () 55 | { 56 | MessageBeep (0xFFFFFFFF); 57 | } 58 | 59 | void RealOutputStr ( 60 | int thread_num, 61 | const char *buf) 62 | { 63 | if (DEBUGGING) printf ("thread_num %d: %s", thread_num, buf); 64 | } 65 | 66 | void ChangeIcon ( 67 | int thread_num, 68 | int icon_id) 69 | { 70 | } 71 | 72 | void BlinkIcon ( 73 | int thread_num, 74 | int duration) 75 | { 76 | } 77 | 78 | void stopCheckCallback ( 79 | int thread_num) 80 | { 81 | } 82 | 83 | /* Do some work prior to launching worker threads */ 84 | 85 | void PreLaunchCallback ( 86 | int launch_type) 87 | { 88 | 89 | // Stall if we've just booted (within 5 minutes of Windows starting) 90 | 91 | if (GetTickCount () < 300000 && launch_type == LD_CONTINUE) { 92 | int delay; 93 | delay = IniGetInt (INI_FILE, "BootDelay", 90); 94 | delay -= GetTickCount () / 1000; 95 | if (delay > 0) Sleep (delay * 1000); 96 | } 97 | } 98 | 99 | /* Do some work after worker threads have terminated */ 100 | 101 | void PostLaunchCallback ( 102 | int launch_type) 103 | { 104 | } 105 | 106 | -------------------------------------------------------------------------------- /prime95/hlp/EndUser.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | End User License Agreement 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
 
15 | 16 | 17 | 18 | 19 |
Legal Stuff: End User License Agreement
20 |

 

21 |

END USER LICENSE AGREEMENT

22 |

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 | 18 | 19 |
How to Use Prime95: Advanced Menu - ECM
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 | 16 | 17 | 18 | 19 |
 
20 | 21 | 22 | 23 | 24 |
History: Newsletters
25 |

 

26 |

NEWSLETTERS

27 |

Newsletters detailing the history of GIMPS are now available. Newsletters are 28 | dated: February 24, 1996, 29 | February 26, 1996, 30 | April 12, 1996, 31 | June 11,1996, 32 | July 31, 1996, 33 | September 3, 1996, 34 | November 1, 1996, 35 | November 23, 1996, 36 | January 15, 1997, 37 | March 11, 1997, 38 | May 26, 1997, 39 | September 1, 1997, 40 | February 2, 1998, 41 | May 22, 1998, 42 | April 3, 1999, 43 | July 6, 1999, 44 | October 4, 1999, 45 | September 25, 2001, and , 46 | December 2, 2003.  You can sign up to have 47 | future newsletters e-mailed to you.
48 |
49 |  

50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /prime95/PrimenetDlg.h: -------------------------------------------------------------------------------- 1 | // PrimenetDlg.h : header file 2 | // 3 | 4 | #include "hyperlink.h" 5 | 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // PrimenetDlg dialog 8 | 9 | class PrimenetDlg : public CDialog 10 | { 11 | // Construction 12 | public: 13 | PrimenetDlg(CWnd* pParent = NULL); // standard constructor 14 | 15 | // Dialog Data 16 | //{{AFX_DATA(PrimenetDlg) 17 | enum { IDD = IDD_PRIMENET }; 18 | BOOL m_primenet; 19 | CHyperLink m_new_user_link; 20 | CString m_userid; 21 | CString m_compid; 22 | CButton c_connection; 23 | BOOL m_dialup; 24 | CString m_proxyhost; 25 | UINT m_proxyport; 26 | CString m_proxyuser; 27 | CString m_proxypassword; 28 | BOOL m_debug; 29 | //}}AFX_DATA 30 | 31 | 32 | // Overrides 33 | // ClassWizard generated virtual function overrides 34 | //{{AFX_VIRTUAL(PrimenetDlg) 35 | protected: 36 | virtual BOOL OnInitDialog(); 37 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 38 | //}}AFX_VIRTUAL 39 | 40 | // Implementation 41 | protected: 42 | 43 | // Generated message map functions 44 | //{{AFX_MSG(PrimenetDlg) 45 | afx_msg void OnPrimenet(); 46 | afx_msg void OnConnection(); 47 | //}}AFX_MSG 48 | DECLARE_MESSAGE_MAP() 49 | }; 50 | 51 | 52 | ///////////////////////////////////////////////////////////////////////////// 53 | // PrimenetConnectionDlg dialog 54 | 55 | class PrimenetConnectionDlg : public CDialog 56 | { 57 | // Construction 58 | public: 59 | PrimenetConnectionDlg(CWnd* pParent = NULL); // standard constructor 60 | 61 | // Dialog Data 62 | //{{AFX_DATA(PrimenetDlg) 63 | enum { IDD = IDD_PRIMENET_CONNECTION }; 64 | BOOL m_dialup; 65 | CString m_proxyhost; 66 | CStatic c_proxyport_text; 67 | CEdit c_proxyport; 68 | UINT m_proxyport; 69 | CStatic c_proxyuser_text; 70 | CEdit c_proxyuser; 71 | CString m_proxyuser; 72 | CStatic c_proxypassword_text; 73 | CEdit c_proxypassword; 74 | CString m_proxypassword; 75 | BOOL m_debug; 76 | //}}AFX_DATA 77 | 78 | 79 | // Overrides 80 | // ClassWizard generated virtual function overrides 81 | //{{AFX_VIRTUAL(PrimenetConnectionDlg) 82 | protected: 83 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 84 | //}}AFX_VIRTUAL 85 | 86 | // Implementation 87 | protected: 88 | 89 | // Generated message map functions 90 | //{{AFX_MSG(PrimenetConnectionDlg) 91 | afx_msg void OnEnChangeProxyHost(); 92 | //}}AFX_MSG 93 | DECLARE_MESSAGE_MAP() 94 | }; 95 | -------------------------------------------------------------------------------- /prime95/CpuDlg.cpp: -------------------------------------------------------------------------------- 1 | // CpuDlg.cpp : implementation file 2 | // 3 | 4 | #include "stdafx.h" 5 | #include "Prime95.h" 6 | #include "CpuDlg.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 | // CCpuDlg dialog 16 | 17 | 18 | CCpuDlg::CCpuDlg(CWnd* pParent /*=NULL*/) 19 | : CDialog(CCpuDlg::IDD, pParent) 20 | { 21 | //{{AFX_DATA_INIT(CCpuDlg) 22 | m_hours = 0; 23 | m_start_time = _T(""); 24 | m_end_time = _T(""); 25 | m_day_memory = 0; 26 | m_night_memory = 0; 27 | m_cpu_info = _T(""); 28 | //}}AFX_DATA_INIT 29 | } 30 | 31 | 32 | void CCpuDlg::DoDataExchange(CDataExchange* pDX) 33 | { 34 | CDialog::DoDataExchange(pDX); 35 | //{{AFX_DATA_MAP(CCpuDlg) 36 | DDX_Text(pDX, IDC_HOURS, m_hours); 37 | DDV_MinMaxUInt(pDX, m_hours, 1, 24); 38 | DDX_Text(pDX, IDC_START_TIME, m_start_time); 39 | DDX_Text(pDX, IDC_END_TIME, m_end_time); 40 | DDX_Text(pDX, IDC_DAY_MEMORY, m_day_memory); 41 | DDV_MinMaxUInt(pDX, m_day_memory, 8, (UINT) (0.9 * physical_memory ())); 42 | DDX_Text(pDX, IDC_NIGHT_MEMORY, m_night_memory); 43 | DDV_MinMaxUInt(pDX, m_night_memory, 8, (UINT) (0.9 * physical_memory ())); 44 | DDX_Text(pDX, IDC_CPU_INFO, m_cpu_info); 45 | 46 | DDX_Control(pDX, IDC_DAY_MEMORY_TEXT, c_day_memory_text); 47 | DDX_Control(pDX, IDC_DAY_MEMORY, c_day_memory); 48 | DDX_Control(pDX, IDC_NIGHT_MEMORY_TEXT, c_night_memory_text); 49 | DDX_Control(pDX, IDC_NIGHT_MEMORY, c_night_memory); 50 | DDX_Control(pDX, IDC_START_TIME_TEXT, c_start_time_text); 51 | DDX_Control(pDX, IDC_START_TIME, c_start_time); 52 | DDX_Control(pDX, IDC_END_TIME_TEXT, c_end_time_text); 53 | DDX_Control(pDX, IDC_END_TIME, c_end_time); 54 | //}}AFX_DATA_MAP 55 | c_day_memory_text.EnableWindow (m_memory_editable); 56 | c_day_memory.EnableWindow (m_memory_editable); 57 | c_night_memory_text.EnableWindow (m_memory_editable); 58 | c_night_memory.EnableWindow (m_memory_editable); 59 | c_start_time_text.EnableWindow (m_memory_editable); 60 | c_start_time.EnableWindow (m_memory_editable); 61 | c_end_time_text.EnableWindow (m_memory_editable); 62 | c_end_time.EnableWindow (m_memory_editable); 63 | } 64 | 65 | 66 | BEGIN_MESSAGE_MAP(CCpuDlg, CDialog) 67 | //{{AFX_MSG_MAP(CCpuDlg) 68 | //}}AFX_MSG_MAP 69 | END_MESSAGE_MAP() 70 | 71 | ///////////////////////////////////////////////////////////////////////////// 72 | // CCpuDlg message handlers 73 | 74 | -------------------------------------------------------------------------------- /prime95/hlp/Welcome.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Welcome to GIMPS! 5 | 6 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 |
 
35 | 36 | 37 | 38 | 39 |
Welcome...: Welcome to GIMPS!
40 |

41 |

42 |

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.

58 |

To use this program you must agree to the prize rules at 59 | http://www.mersenne.org/prize.htm
60 |

61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /prime95/hlp/InstructionsManual.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Instructions for Manual Method 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
 
15 | 16 | 17 | 18 | 19 |
Getting Started: Instructions for Manual Method
20 |

 

21 |

INSTRUCTIONS FOR THE MANUAL METHOD

22 | 34 |
    35 |
  1. In the first dialog box, enter your name and email address.  Click OK. 36 |
    37 |  
  2. 38 |
  3. 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 |  
  4. 42 |
  5. In the third dialog box uncheck "Use PrimeNet to get work and report results" 43 | and click OK.
    44 |  
  6. 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 | 18 | 19 |
How to Use Prime95: Possible Hardware Failure
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 |
  1. 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.
  2. 42 |
  3. 43 | A true hardware error.
  4. 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 |  

56 | 57 |

58 | 59 | 60 | -------------------------------------------------------------------------------- /linux/prime.h: -------------------------------------------------------------------------------- 1 | /* Copyright 1995-2014 Mersenne Research, Inc. */ 2 | /* Author: George Woltman */ 3 | /* Email: woltman@alum.mit.edu */ 4 | 5 | /* Handy definitions */ 6 | 7 | #include "common.h" 8 | 9 | /* Port number used in version numbers and result reporting. */ 10 | 11 | #ifdef __linux__ 12 | #ifdef X86_64 13 | #define PORT 8 14 | #else 15 | #define PORT 2 16 | #endif 17 | #endif 18 | #ifdef __FreeBSD__ 19 | #ifdef X86_64 20 | #define PORT 12 21 | #else 22 | #define PORT 6 23 | #endif 24 | #endif 25 | #if defined (__EMX__) || defined (__IBMC__) || defined (__OS2__) 26 | #define PORT 7 27 | #endif 28 | #ifdef __APPLE__ 29 | #ifdef X86_64 30 | #define PORT 10 31 | #else 32 | #define PORT 9 33 | #endif 34 | #endif 35 | #ifdef __HAIKU__ 36 | #define PORT 11 37 | #endif 38 | 39 | /* This controls whether we want to pause computation if the load average */ 40 | /* becomes too great. This does not apply to OS/2. */ 41 | 42 | #if defined (__linux__) || defined (__FreeBSD__) 43 | #define MPRIME_LOADAVG 44 | #endif 45 | 46 | /* Handle differences between Windows and Linux runtime libraries */ 47 | 48 | #define _commit(f) fsync(f) 49 | #define _open open 50 | #define _close close 51 | #define _read read 52 | #define _write write 53 | #define _lseek lseek 54 | #define _unlink unlink 55 | #define _creat creat 56 | #define _chdir chdir 57 | #define closesocket close 58 | #define IsCharAlphaNumeric(c) isalnum(c) 59 | #define _stricmp strcasecmp 60 | 61 | #ifndef __WATCOMC__ 62 | #define _timeb timeb 63 | #define _ftime ftime 64 | #define _O_APPEND O_APPEND 65 | #define _O_RDONLY O_RDONLY 66 | #define _O_WRONLY O_WRONLY 67 | #define _O_RDWR O_RDWR 68 | #define _O_CREAT O_CREAT 69 | #define _O_TRUNC O_TRUNC 70 | #define _O_BINARY 0 71 | #define _O_TEXT 0 72 | #endif 73 | 74 | /* Handle differences between Windows and OS/2 runtime libraries */ 75 | 76 | #ifdef __IBMC__ 77 | #define stricmp(x,y) stricmp(x,y) 78 | #define _commit(f) /* no commit/fsync on OS/2 */ 79 | #define _ftime _ftime 80 | #endif 81 | 82 | /* The common include files */ 83 | 84 | #include 85 | /*#define SERVER_TESTING*/ 86 | extern int NO_GUI; 87 | #include "common.h" 88 | #include "cpuid.h" 89 | #include "gwnum.h" 90 | #include "commona.h" 91 | #include "commonc.h" 92 | #include "commonb.h" 93 | #include "primenet.h" 94 | 95 | /* Global variables */ 96 | 97 | extern int volatile THREAD_KILL; /* TRUE if program should terminate */ 98 | extern int MENUING; /* TRUE when main menu active */ 99 | 100 | /* Internal routines */ 101 | 102 | void main_menu (void); 103 | void linuxContinue (char *, int, int); 104 | void Sleep (long); 105 | void test_user(void); 106 | void test_welcome(void); 107 | void test_status(void); 108 | 109 | /* Routine definitions */ 110 | 111 | void rangeStatus (void); 112 | void options_cpu (void); 113 | -------------------------------------------------------------------------------- /macosx/prime.h: -------------------------------------------------------------------------------- 1 | /* Copyright 1995-2014 Mersenne Research, Inc. */ 2 | /* Author: George Woltman */ 3 | /* Email: woltman@alum.mit.edu */ 4 | 5 | /* Handy definitions */ 6 | 7 | #include "common.h" 8 | 9 | /* Port number used in version numbers and result reporting. */ 10 | 11 | #ifdef __linux__ 12 | #ifdef X86_64 13 | #define PORT 8 14 | #else 15 | #define PORT 2 16 | #endif 17 | #endif 18 | #ifdef __FreeBSD__ 19 | #ifdef X86_64 20 | #define PORT 12 21 | #else 22 | #define PORT 6 23 | #endif 24 | #endif 25 | #if defined (__EMX__) || defined (__IBMC__) || defined (__OS2__) 26 | #define PORT 7 27 | #endif 28 | #ifdef __APPLE__ 29 | #ifdef X86_64 30 | #define PORT 10 31 | #else 32 | #define PORT 9 33 | #endif 34 | #endif 35 | #ifdef __HAIKU__ 36 | #define PORT 11 37 | #endif 38 | 39 | /* This controls whether we want to pause computation if the load average */ 40 | /* becomes too great. This does not apply to OS/2. */ 41 | 42 | #if defined (__linux__) || defined (__FreeBSD__) 43 | #define MPRIME_LOADAVG 44 | #endif 45 | 46 | /* Handle differences between Windows and Linux runtime libraries */ 47 | 48 | #define _commit(f) fsync(f) 49 | #define _open open 50 | #define _close close 51 | #define _read read 52 | #define _write write 53 | #define _lseek lseek 54 | #define _unlink unlink 55 | #define _creat creat 56 | #define _chdir chdir 57 | #define closesocket close 58 | #define IsCharAlphaNumeric(c) isalnum(c) 59 | #define _stricmp strcasecmp 60 | 61 | #ifndef __WATCOMC__ 62 | #define _timeb timeb 63 | #define _ftime ftime 64 | #define _O_APPEND O_APPEND 65 | #define _O_RDONLY O_RDONLY 66 | #define _O_WRONLY O_WRONLY 67 | #define _O_RDWR O_RDWR 68 | #define _O_CREAT O_CREAT 69 | #define _O_TRUNC O_TRUNC 70 | #define _O_BINARY 0 71 | #define _O_TEXT 0 72 | #endif 73 | 74 | /* Handle differences between Windows and OS/2 runtime libraries */ 75 | 76 | #ifdef __IBMC__ 77 | #define stricmp(x,y) stricmp(x,y) 78 | #define _commit(f) /* no commit/fsync on OS/2 */ 79 | #define _ftime _ftime 80 | #endif 81 | 82 | /* The common include files */ 83 | 84 | #include 85 | /*#define SERVER_TESTING*/ 86 | extern int NO_GUI; 87 | #include "common.h" 88 | #include "cpuid.h" 89 | #include "gwnum.h" 90 | #include "commona.h" 91 | #include "commonc.h" 92 | #include "commonb.h" 93 | #include "primenet.h" 94 | 95 | /* Global variables */ 96 | 97 | extern int volatile THREAD_KILL; /* TRUE if program should terminate */ 98 | extern int MENUING; /* TRUE when main menu active */ 99 | 100 | /* Internal routines */ 101 | 102 | void main_menu (void); 103 | void linuxContinue (char *, int, int); 104 | void Sleep (long); 105 | void test_user(void); 106 | void test_welcome(void); 107 | void test_status(void); 108 | 109 | /* Routine definitions */ 110 | 111 | void rangeStatus (void); 112 | void options_cpu (void); 113 | -------------------------------------------------------------------------------- /linux64/prime.h: -------------------------------------------------------------------------------- 1 | /* Copyright 1995-2014 Mersenne Research, Inc. */ 2 | /* Author: George Woltman */ 3 | /* Email: woltman@alum.mit.edu */ 4 | 5 | /* Handy definitions */ 6 | 7 | #include "common.h" 8 | 9 | /* Port number used in version numbers and result reporting. */ 10 | 11 | #ifdef __linux__ 12 | #ifdef X86_64 13 | #define PORT 8 14 | #else 15 | #define PORT 2 16 | #endif 17 | #endif 18 | #ifdef __FreeBSD__ 19 | #ifdef X86_64 20 | #define PORT 12 21 | #else 22 | #define PORT 6 23 | #endif 24 | #endif 25 | #if defined (__EMX__) || defined (__IBMC__) || defined (__OS2__) 26 | #define PORT 7 27 | #endif 28 | #ifdef __APPLE__ 29 | #ifdef X86_64 30 | #define PORT 10 31 | #else 32 | #define PORT 9 33 | #endif 34 | #endif 35 | #ifdef __HAIKU__ 36 | #define PORT 11 37 | #endif 38 | 39 | /* This controls whether we want to pause computation if the load average */ 40 | /* becomes too great. This does not apply to OS/2. */ 41 | 42 | #if defined (__linux__) || defined (__FreeBSD__) 43 | #define MPRIME_LOADAVG 44 | #endif 45 | 46 | /* Handle differences between Windows and Linux runtime libraries */ 47 | 48 | #define _commit(f) fsync(f) 49 | #define _open open 50 | #define _close close 51 | #define _read read 52 | #define _write write 53 | #define _lseek lseek 54 | #define _unlink unlink 55 | #define _creat creat 56 | #define _chdir chdir 57 | #define closesocket close 58 | #define IsCharAlphaNumeric(c) isalnum(c) 59 | #define _stricmp strcasecmp 60 | 61 | #ifndef __WATCOMC__ 62 | #define _timeb timeb 63 | #define _ftime ftime 64 | #define _O_APPEND O_APPEND 65 | #define _O_RDONLY O_RDONLY 66 | #define _O_WRONLY O_WRONLY 67 | #define _O_RDWR O_RDWR 68 | #define _O_CREAT O_CREAT 69 | #define _O_TRUNC O_TRUNC 70 | #define _O_BINARY 0 71 | #define _O_TEXT 0 72 | #endif 73 | 74 | /* Handle differences between Windows and OS/2 runtime libraries */ 75 | 76 | #ifdef __IBMC__ 77 | #define stricmp(x,y) stricmp(x,y) 78 | #define _commit(f) /* no commit/fsync on OS/2 */ 79 | #define _ftime _ftime 80 | #endif 81 | 82 | /* The common include files */ 83 | 84 | #include 85 | /*#define SERVER_TESTING*/ 86 | extern int NO_GUI; 87 | #include "common.h" 88 | #include "cpuid.h" 89 | #include "gwnum.h" 90 | #include "commona.h" 91 | #include "commonc.h" 92 | #include "commonb.h" 93 | #include "primenet.h" 94 | 95 | /* Global variables */ 96 | 97 | extern int volatile THREAD_KILL; /* TRUE if program should terminate */ 98 | extern int MENUING; /* TRUE when main menu active */ 99 | 100 | /* Internal routines */ 101 | 102 | void main_menu (void); 103 | void linuxContinue (char *, int, int); 104 | void Sleep (long); 105 | void test_user(void); 106 | void test_welcome(void); 107 | void test_status(void); 108 | 109 | /* Routine definitions */ 110 | 111 | void rangeStatus (void); 112 | void options_cpu (void); 113 | -------------------------------------------------------------------------------- /macosx64/prime.h: -------------------------------------------------------------------------------- 1 | /* Copyright 1995-2014 Mersenne Research, Inc. */ 2 | /* Author: George Woltman */ 3 | /* Email: woltman@alum.mit.edu */ 4 | 5 | /* Handy definitions */ 6 | 7 | #include "common.h" 8 | 9 | /* Port number used in version numbers and result reporting. */ 10 | 11 | #ifdef __linux__ 12 | #ifdef X86_64 13 | #define PORT 8 14 | #else 15 | #define PORT 2 16 | #endif 17 | #endif 18 | #ifdef __FreeBSD__ 19 | #ifdef X86_64 20 | #define PORT 12 21 | #else 22 | #define PORT 6 23 | #endif 24 | #endif 25 | #if defined (__EMX__) || defined (__IBMC__) || defined (__OS2__) 26 | #define PORT 7 27 | #endif 28 | #ifdef __APPLE__ 29 | #ifdef X86_64 30 | #define PORT 10 31 | #else 32 | #define PORT 9 33 | #endif 34 | #endif 35 | #ifdef __HAIKU__ 36 | #define PORT 11 37 | #endif 38 | 39 | /* This controls whether we want to pause computation if the load average */ 40 | /* becomes too great. This does not apply to OS/2. */ 41 | 42 | #if defined (__linux__) || defined (__FreeBSD__) 43 | #define MPRIME_LOADAVG 44 | #endif 45 | 46 | /* Handle differences between Windows and Linux runtime libraries */ 47 | 48 | #define _commit(f) fsync(f) 49 | #define _open open 50 | #define _close close 51 | #define _read read 52 | #define _write write 53 | #define _lseek lseek 54 | #define _unlink unlink 55 | #define _creat creat 56 | #define _chdir chdir 57 | #define closesocket close 58 | #define IsCharAlphaNumeric(c) isalnum(c) 59 | #define _stricmp strcasecmp 60 | 61 | #ifndef __WATCOMC__ 62 | #define _timeb timeb 63 | #define _ftime ftime 64 | #define _O_APPEND O_APPEND 65 | #define _O_RDONLY O_RDONLY 66 | #define _O_WRONLY O_WRONLY 67 | #define _O_RDWR O_RDWR 68 | #define _O_CREAT O_CREAT 69 | #define _O_TRUNC O_TRUNC 70 | #define _O_BINARY 0 71 | #define _O_TEXT 0 72 | #endif 73 | 74 | /* Handle differences between Windows and OS/2 runtime libraries */ 75 | 76 | #ifdef __IBMC__ 77 | #define stricmp(x,y) stricmp(x,y) 78 | #define _commit(f) /* no commit/fsync on OS/2 */ 79 | #define _ftime _ftime 80 | #endif 81 | 82 | /* The common include files */ 83 | 84 | #include 85 | /*#define SERVER_TESTING*/ 86 | extern int NO_GUI; 87 | #include "common.h" 88 | #include "cpuid.h" 89 | #include "gwnum.h" 90 | #include "commona.h" 91 | #include "commonc.h" 92 | #include "commonb.h" 93 | #include "primenet.h" 94 | 95 | /* Global variables */ 96 | 97 | extern int volatile THREAD_KILL; /* TRUE if program should terminate */ 98 | extern int MENUING; /* TRUE when main menu active */ 99 | 100 | /* Internal routines */ 101 | 102 | void main_menu (void); 103 | void linuxContinue (char *, int, int); 104 | void Sleep (long); 105 | void test_user(void); 106 | void test_welcome(void); 107 | void test_status(void); 108 | 109 | /* Routine definitions */ 110 | 111 | void rangeStatus (void); 112 | void options_cpu (void); 113 | -------------------------------------------------------------------------------- /prime95/PreferencesDlg.cpp: -------------------------------------------------------------------------------- 1 | // PreferencesDlg.cpp : implementation file 2 | // 3 | 4 | #include "stdafx.h" 5 | #include "Prime95.h" 6 | #include "PreferencesDlg.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 | // CPreferencesDlg dialog 16 | 17 | 18 | CPreferencesDlg::CPreferencesDlg(CWnd* pParent /*=NULL*/) 19 | : CDialog(CPreferencesDlg::IDD, pParent) 20 | { 21 | //{{AFX_DATA_INIT(CPreferencesDlg) 22 | m_iter = 0; 23 | m_disk_write_time = 0; 24 | m_backup = FALSE; 25 | m_noise = FALSE; 26 | m_retry = 0; 27 | m_r_iter = 0; 28 | m_work = 0; 29 | m_end_dates = 0; 30 | m_modem = 0; 31 | m_battery = FALSE; 32 | //}}AFX_DATA_INIT 33 | } 34 | 35 | 36 | void CPreferencesDlg::DoDataExchange(CDataExchange* pDX) 37 | { 38 | CDialog::DoDataExchange(pDX); 39 | //{{AFX_DATA_MAP(CPreferencesDlg) 40 | DDX_Control(pDX, IDC_MODEM_TEXT, c_modem_text); 41 | DDX_Control(pDX, IDC_MODEM, c_modem); 42 | DDX_Control(pDX, IDC_WORK_TEXT, c_work_text); 43 | DDX_Control(pDX, IDC_WORK, c_work); 44 | DDX_Control(pDX, IDC_END_DATES_TEXT, c_end_dates_text); 45 | DDX_Control(pDX, IDC_END_DATES, c_end_dates); 46 | DDX_Control(pDX, IDC_NETWORK_TEXT, c_network_text); 47 | DDX_Control(pDX, IDC_NETWORK, c_network); 48 | DDX_Text(pDX, IDC_P, m_iter); 49 | DDV_MinMaxUInt(pDX, m_iter, 1, 999999999); 50 | DDX_Text(pDX, IDC_DISK, m_disk_write_time); 51 | DDV_MinMaxUInt(pDX, m_disk_write_time, 10, 999999); 52 | DDX_Text(pDX, IDC_BACKUP, m_backup); 53 | DDV_MinMaxUInt(pDX, m_backup, 1, 3); 54 | DDX_Check(pDX, IDC_NOISE, m_noise); 55 | DDX_Text(pDX, IDC_NETWORK, m_retry); 56 | DDV_MinMaxUInt(pDX, m_retry, 1, 300); 57 | DDX_Text(pDX, IDC_R_ITER, m_r_iter); 58 | DDV_MinMaxUInt(pDX, m_r_iter, 10000, 999999999); 59 | DDX_Text(pDX, IDC_WORK, m_work); 60 | DDV_MinMaxUInt(pDX, m_work, 0, 90); 61 | DDX_Text(pDX, IDC_END_DATES, m_end_dates); 62 | DDV_MinMaxFloat(pDX, m_end_dates, 0.125, 7.0); 63 | DDX_Text(pDX, IDC_MODEM, m_modem); 64 | DDV_MinMaxUInt(pDX, m_modem, 1, 300); 65 | DDX_Check(pDX, IDC_BATTERY, m_battery); 66 | //}}AFX_DATA_MAP 67 | c_modem_text.EnableWindow (USE_PRIMENET && DIAL_UP); 68 | c_modem.EnableWindow (USE_PRIMENET && DIAL_UP); 69 | c_network_text.EnableWindow (USE_PRIMENET); 70 | c_network.EnableWindow (USE_PRIMENET); 71 | c_work_text.EnableWindow (USE_PRIMENET); 72 | c_work.EnableWindow (USE_PRIMENET); 73 | c_end_dates_text.EnableWindow (USE_PRIMENET); 74 | c_end_dates.EnableWindow (USE_PRIMENET); 75 | } 76 | 77 | 78 | BEGIN_MESSAGE_MAP(CPreferencesDlg, CDialog) 79 | //{{AFX_MSG_MAP(CPreferencesDlg) 80 | // NOTE: the ClassWizard will add message map macros here 81 | //}}AFX_MSG_MAP 82 | END_MESSAGE_MAP() 83 | 84 | ///////////////////////////////////////////////////////////////////////////// 85 | // CPreferencesDlg message handlers 86 | --------------------------------------------------------------------------------