mersenneforum.org  

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

Reply
 
Thread Tools
Old 2010-03-24, 13:02   #1
lycorn
 
lycorn's Avatar
 
Sep 2002
Oeiras, Portugal

101011111012 Posts
Default Memory available to P-1

I remember this has been discussed sometime ago, but couldn´t find out the outcome (if there was one...) of said discussion, so here it goes:

I am runnhing P-1 tests on a Pentium IV, with 2G of RAM. I use to allocate 1.7G for Stage 2, and it happily takes 1678 Mb, processing chunks of 36 relative primes for a 80M exponent.
Now I´ve just upgraded the memory to 3G, and I´ve allocated 2.5G to Prime95. The Stage 2 restarts, calculates the B1 and B2, then abandons those values and uses the ones from the savefile (previously calculated with 1.7G available), and starts processing 56 relative primes. So far so good, but after approximately 1 minute it stops with a mem allocation error, and restarts with something like 1900M (42 relative primes), and then again stops with the mem allocation error and goes down to 1557M (34 relative primes, less than when I was allocating 1.7G out of 2G...). I remember George posting that had something to do with a compiler option that would be incorporated from version 25.8 onwards, and would allow P95 to use up to 3G of memory instead of 2. Now I´m using 25.11, it should work. Any ideas why I´m getting this?
P.S.: OS is Windows XP 32bit, SP2

Last fiddled with by lycorn on 2010-03-24 at 14:02
lycorn is offline   Reply With Quote
Old 2010-03-24, 14:03   #2
Prime95
P90 years forever!
 
Prime95's Avatar
 
Aug 2002
Yeehaw, FL

25×223 Posts
Default

Windows memory management is a mystery to me.
Prime95 is offline   Reply With Quote
Old 2010-03-24, 14:13   #3
lycorn
 
lycorn's Avatar
 
Sep 2002
Oeiras, Portugal

5×281 Posts
Default

Does that mean I shall abandon any hopes of getting P-1 to run a bit faster by allocating more memory?
lycorn is offline   Reply With Quote
Old 2010-03-24, 14:51   #4
petrw1
1976 Toyota Corona years forever!
 
petrw1's Avatar
 
"Wayne"
Nov 2006
Saskatchewan, Canada

23×7×79 Posts
Default

Quote:
Originally Posted by lycorn View Post
Does that mean I shall abandon any hopes of getting P-1 to run a bit faster by allocating more memory?
In my experience with similar experiments adding more memory makes very little difference on the speed of completion; but rather it increases the B1/B2 bound which give a slightly higher percentage of success and with it slightly more points. With higher B1/B2 it may actually run longer.

There have been similar posts by others...I think in the "P-1 Factoring Anyone?" thread.
petrw1 is offline   Reply With Quote
Old 2010-03-24, 15:07   #5
R.D. Silverman
 
R.D. Silverman's Avatar
 
Nov 2003

26·113 Posts
Default

Quote:
Originally Posted by lycorn View Post
I remember this has been discussed sometime ago, but couldn´t find out the outcome (if there was one...) of said discussion, so here it goes:

I am runnhing P-1 tests on a Pentium IV, with 2G of RAM. I use to allocate 1.7G for Stage 2, and it happily takes 1678 Mb, processing chunks of 36 relative primes for a 80M exponent.
Now I´ve just upgraded the memory to 3G, and I´ve allocated 2.5G to Prime95. The Stage 2 restarts, calculates the B1 and B2, then abandons those values and uses the ones from the savefile (previously calculated with 1.7G available), and starts processing 56 relative primes. So far so good, but after approximately 1 minute it stops with a mem allocation error, and restarts with something like 1900M (42 relative primes), and then again stops with the mem allocation error and goes down to 1557M (34 relative primes, less than when I was allocating 1.7G out of 2G...). I remember George posting that had something to do with a compiler option that would be incorporated from version 25.8 onwards, and would allow P95 to use up to 3G of memory instead of 2. Now I´m using 25.11, it should work. Any ideas why I´m getting this?
P.S.: OS is Windows XP 32bit, SP2

You need to put the /3G switch in the sysini file. Otherwise, under XP no
user process will EVER be allowed to use more than 2G of memory.

This is what causes the malloc errors; the code is trying to malloc a
total of more than 2G.

Note also that one must use the /LARGEADDRESSAWARE switch in the
compiler to allow the executable to address more than 2G.
R.D. Silverman is offline   Reply With Quote
Old 2010-03-24, 15:14   #6
retina
Undefined
 
retina's Avatar
 
"The unspeakable one"
Jun 2006
My evil lair

5,791 Posts
Default

Quote:
Originally Posted by R.D. Silverman View Post
You need to put the /3G switch in the sysini file.
IIRC only the "professional" versions honour it. If you have a "home" version then I think you can never get 3G per process no matter what you do.

Last fiddled with by retina on 2010-03-24 at 15:15
retina is offline   Reply With Quote
Old 2010-03-24, 15:19   #7
Prime95
P90 years forever!
 
Prime95's Avatar
 
Aug 2002
Yeehaw, FL

25×223 Posts
Default

Quote:
Originally Posted by R.D. Silverman View Post
You need to put the /3G switch in the sysini file.
Quote:
Originally Posted by retina View Post
IIRC only the "professional" versions honour it.
Ahhh, some of the mysteries of Windows memory management are becoming clearer. Thanks.
Prime95 is offline   Reply With Quote
Old 2010-03-24, 15:27   #8
R.D. Silverman
 
R.D. Silverman's Avatar
 
Nov 2003

11100010000002 Posts
Default

Quote:
Originally Posted by Prime95 View Post
Ahhh, some of the mysteries of Windows memory management are becoming clearer. Thanks.
I think you mean "Windows memory mismanagement"
R.D. Silverman is offline   Reply With Quote
Old 2010-03-25, 03:30   #9
cheesehead
 
cheesehead's Avatar
 
"Richard B. Woods"
Aug 2002
Wisconsin USA

22×3×599 Posts
Default

"Microsoft Marketing Tactics"
cheesehead is offline   Reply With Quote
Old 2010-03-26, 10:04   #10
lycorn
 
lycorn's Avatar
 
Sep 2002
Oeiras, Portugal

5·281 Posts
Default

Quote:
Originally Posted by R.D. Silverman View Post
You need to put the /3G switch in the sysini file. Otherwise, under XP no
user process will EVER be allowed to use more than 2G of memory.

This is what causes the malloc errors; the code is trying to malloc a
total of more than 2G.

Note also that one must use the /LARGEADDRESSAWARE switch in the
compiler to allow the executable to address more than 2G.
Thanks a bunch for your information. I´ve since been searching for more details on the subject in several places. As this particular system is a dual boot (XP Professional/Vista Ultimate 32 bits), I have added the switch to the boot.ini file in the XP partition, and also fiddled with the command line bcdedit for Vista (there I used the /set command to increase the user space to 3G). But unfortunately, to no avail. P95 can´t still allocate more than 2G of mem. In principle this should have worked, I´ll have to keep on digging...
Of course this is more of a technical challenge than a real need, but I´ve always liked challenges, as a way of improving knowledge in any subject.
P.S.: I´m assuming the code was compiled/linked with the /LARGEADDRESSAWARE switch, as it is version 25.11.

Last fiddled with by lycorn on 2010-03-26 at 10:08
lycorn is offline   Reply With Quote
Old 2010-03-26, 10:18   #11
lycorn
 
lycorn's Avatar
 
Sep 2002
Oeiras, Portugal

5×281 Posts
Default

Quote:
Originally Posted by petrw1 View Post
In my experience with similar experiments adding more memory makes very little difference on the speed of completion; but rather it increases the B1/B2 bound which give a slightly higher percentage of success and with it slightly more points. With higher B1/B2 it may actually run longer.

There have been similar posts by others...I think in the "P-1 Factoring Anyone?" thread.
You´re right in that more memory basically leads to higher B1/B2, so potentially making the test longer. But I was referring to a situation where the bounds were calculated for a given amount of memory, and then the mem size was increased. The effect is that for the same bounds more relative primes are processed simultaneously, which may lead to less restarts of the test and consequently to a shorter completion time.
Again, much like I´ve written in my previous post, this is more a curiosity, a study subject, than something really meaningful in terms of effectiveness of the search. Oh well, but the GIMPS search itself also falls in this category, isn´t it?
lycorn is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Hybrid Memory Cube" offers 1 Tb/s memory bandwith at just 1.4 mW/Gb/s ixfd64 Hardware 4 2011-12-14 21:24
How much memory do you have? fivemack Factoring 17 2009-08-23 16:00
memory victorvicentim Information & Answers 5 2009-08-19 12:34
How much memory? Unregistered Software 29 2004-09-04 19:35
P-1 Memory... Xyzzy Marin's Mersenne-aries 7 2004-03-12 13:34

All times are UTC. The time now is 21:45.

Fri Oct 23 21:45:00 UTC 2020 up 43 days, 18:55, 0 users, load averages: 1.75, 1.74, 1.94

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.