20101001, 02:47  #353  
Account Deleted
"Tim Sorbera"
Aug 2006
San Antonio, TX USA
17·251 Posts 
Not really.
Quote:
The memory limit you set in Options > CPU is for the whole processor (more accurately: the whole Prime95 instance). The workers share from that as needed. If they'll be doing P1 stage 2 at the same time, that'd mean you should enter 512 MB (it will see that 512 MB is available and two workers need to run P1, and split it to 256 MB per worker). If they'll be doing it at separate times, 256 MB will be fine (it will see that 256 MB is available and only one worker needs to use it at a time, and each will get 256 MB in their turn). Or you can try to set the memory limit for each worker individually, (this would probably be best: you don't have to worry about when they do it  they'll each just take 256 MB when needed, whether that means you use 0, 256, or 512 MB for stage 2 at that moment) but this might not be working yet (see http://www.mersenneforum.org/showthr...097#post232097 and the link in it, and the post after it, for more info). Last fiddled with by MiniGeek on 20101001 at 02:57 

20101001, 02:54  #354 
Aug 2002
Ann Arbor, MI
1B1_{16} Posts 
Actually, I'd suggest putting it a little bit higher than that. Since the memory limit you input is for the entire instance of Prime95, even if only one core is doing P1 stage 2, if the other core is doing LL work, then Prime95 will account for the 2030MB of memory that test requires and only assign P1 stage 2 ~230MB.

20101001, 03:22  #355  
Account Deleted
"Tim Sorbera"
Aug 2006
San Antonio, TX USA
4267_{10} Posts 
Quote:
I'd say the best bet would be to get the two workers to do stage 2 at separate times and set the whole instance to 256 MB. This might be of note: Code:
You can set MaxHighMemWorkers=n in local.txt. This tells the program how wany workers are allowed to use lots of memory. This occurs doing stage 2 of P1 or ECM on mediumtolarge numbers. Default is available memory / 200MB. So, if I'm interpreting this right, it will already automatically choose that only one worker can do highmemory work at a time. (as long as 256/200 is rounded down) Hopefully it does this in a graceful way, (instead of just having one skip stage 2 or something) but in any case, this may play into this. Sorry for putting so much detail and confusion in to such a simple question. But it's surprisingly confusing when you get down to the nitty gritty (not to mention bugs, like the workerspecific memory limits). Luckily, there isn't too much riding on you getting your settings perfectly right and efficient: just a tiny difference of chance for the numbers you P1 (which is small even if you are only doing P1, and nearly insignificant if you're just doing it as part of LL tests). Last fiddled with by MiniGeek on 20101001 at 03:26 

20101001, 03:44  #356 
Aug 2002
Ann Arbor, MI
433 Posts 
Well right now I have 2 workers out of 4 running P1 stage 2 on an i5 with global memory settings of 2056 MB, and each one is only using 988MB of memory. Generally, I think the program will say "x MB" of memory available at the start of stage 2, but then only actually uses something like (x20) MB (or maybe .95x MB, who knows).
Also, I wanted to suggest something a little higher because I thought the actual minimum for P1 testing was 300MB, not 256MB (and now that I've looked it up, that is indeed the case). 
20101001, 12:35  #357  
Account Deleted
"Tim Sorbera"
Aug 2006
San Antonio, TX USA
4267_{10} Posts 
Quote:
e.g. I recently did a P1 on M53250707. It was the only worker. When I set the memory to: 500 MB it does 16 relative primes at a time, and reports 491 MB used 800 MB it does 29 relative primes at a time, and reports 788 MB used 1000 MB it does 38 relative primes at a time, and reports 993 MB used (this was all after the B1 and B2 had been chosen; FFT length for P1 was 2880K, B1=625000, B2=16250000) I suspected that the memory needed would directly or linearly relate with the relative primes calculated at a time, and I seem to be right (from these data points). I calculated that [memory usage] ~= 22.85*[number of relative primes at a time] + 125.4. (expect these constants to vary greatly with the p, B1, and B2) It appears that Prime95 always chose the number of relative primes that puts the predicted memory usage as close to the allowed amount without going over. This can explain why your P1 workers are only using 988 MB of memory, even without taking memory out for LL: if each considers itself to have 1028 MB available, and the next higher relative prime would take more than (1028988=)40 MB, then it'd limit itself to that. Last fiddled with by MiniGeek on 20101001 at 12:45 

20101001, 13:28  #358 
Account Deleted
"Tim Sorbera"
Aug 2006
San Antonio, TX USA
17×251 Posts 
Two more results from more testing I've done:
It picks the closest without going over, not the closest. e.g. if 15 rel. primes will take 291 MB, and that worker is allowed 290 MB, it will go all the way down to 14 rel. primes (277 MB) rather than go over. You're right, it does reserve some memory for LL threads. It changes depending on the FFT size, of course, but it's roughly (FFT size)*12.5 bytes (e.g. 1792K*12.5 bytes = 22400 KB ~= 22 MB) for each LL. This amount is subtracted from the "Available memory is x MB" message on the P1 worker. Between these two effects, I think I get how your memory is distributed, and how all that works. Last fiddled with by MiniGeek on 20101001 at 13:43 
20101001, 14:25  #359  
May 2010
3^{2}·7 Posts 
Quote:
To add another tidbit  additional memory, at least beyond a certain point, does not speed up the P1 task noticeably. The total number of iterations didn't change, and neither did the time per iteration (beyond the 1% noise level). What did happen with larger memory allocations is that the estimated % of finding a factor went up very slightly. 2000 MB gave me a 6.88% chance, 3000 MB gave 6.91% Just don't set the memory so high that it starts disk swapping. Swapping will slow your machine to a relative crawl. 

20101001, 15:17  #360  
Aug 2002
Termonfeckin, IE
2764_{10} Posts 
Note that the 300MB minimum for P1 is not the minimum needed for P1 to be performed effectively. It is the minimum memory you need to have before the server will assign you P1 tests. You could manually ask for P1 tests and do perfectly OK with 256MB. This is what George says in the readme.txt:
Quote:


20101001, 21:07  #361  
"Lucan"
Dec 2006
England
2·3·13·83 Posts 
Quote:
(1K with 16K pack extra), but aren't we talking peanuts here? David Yes I do know what cache means. Last fiddled with by davieddy on 20101001 at 21:33 

20101001, 22:47  #362 
Aug 2002
Ann Arbor, MI
433 Posts 
Peanuts in terms of impact to a system, or peanuts in terms of likelihood of finding a factor? The extra 50MB of memory is only going to marginally increase the chances of finding a factor, but there's really no reason to not do it if the impact to your system is negligible. I presume if the person was debating between 256MB and 512MB, that means that 512MB was an option, and they could afford to move up to 300MB (which is closer to where the marginal benefit of additional memory begins to become negligible).

20101103, 11:46  #363  
Sep 2010
Scandinavia
3·5·41 Posts 
Quote:
Quote:
All types of work require memory. LL only takes a few MB. The actual amount used for P1 is displayed only when stage 2 starts. I deduced linear functions pretty much the same way you did. I presently have 845MB allowed 24/7, and I'm running two workers. I also use MaxHighMemWorkers=1, which works great. All workers restart with the new memory setting when highmem work is finished, so that a worker that has moved on in its work queue because another worker is running stage 2 will stop whatever nonstage2work it's doing and go back to highmem work in its own queue when the other worker finishes its highmem work. That way you don't "waste" memory by not allocating it. Last fiddled with by lorgix on 20101103 at 11:47 Reason: typo 
