mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Software (https://www.mersenneforum.org/forumdisplay.php?f=10)
-   -   Memory available to P-1 (https://www.mersenneforum.org/showthread.php?t=13197)

lycorn 2010-03-24 13:02

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

Prime95 2010-03-24 14:03

Windows memory management is a mystery to me.

lycorn 2010-03-24 14:13

Does that mean I shall abandon any hopes of getting P-1 to run a bit faster by allocating more memory?

petrw1 2010-03-24 14:51

[QUOTE=lycorn;209378]Does that mean I shall abandon any hopes of getting P-1 to run a bit faster by allocating more memory?[/QUOTE]

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.

R.D. Silverman 2010-03-24 15:07

[QUOTE=lycorn;209374]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[/QUOTE]


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.

retina 2010-03-24 15:14

[QUOTE=R.D. Silverman;209382]You need to put the /3G switch in the sysini file.[/QUOTE]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.

Prime95 2010-03-24 15:19

[QUOTE=R.D. Silverman;209382]You need to put the /3G switch in the sysini file.[/QUOTE]

[QUOTE=retina;209383]IIRC only the "professional" versions honour it.[/QUOTE]

Ahhh, some of the mysteries of Windows memory management are becoming clearer. Thanks.

R.D. Silverman 2010-03-24 15:27

[QUOTE=Prime95;209385]Ahhh, some of the mysteries of Windows memory management are becoming clearer. Thanks.[/QUOTE]

I think you mean "Windows memory mismanagement"

cheesehead 2010-03-25 03:30

"Microsoft Marketing Tactics"

lycorn 2010-03-26 10:04

[QUOTE=R.D. Silverman;209382]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.[/QUOTE]

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.

lycorn 2010-03-26 10:18

[QUOTE=petrw1;209380]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.[/QUOTE]

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?


All times are UTC. The time now is 07:17.

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