mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Information & Answers (https://www.mersenneforum.org/forumdisplay.php?f=38)
-   -   Running prime95 over night then automatically stop/start (https://www.mersenneforum.org/showthread.php?t=22485)

patgie 2017-07-29 16:05

Running prime95 over night then automatically stop/start
 
Is it possible to set up prime95 to only run during certain hours and then automatically stop/start? Thank you.

thyw 2017-07-29 19:29

[URL]http://www.mersenneforum.org/showthread.php?t=11584[/URL]
I haven't tried it, but you could probably use #5 post on windows.

I don't know Powershell, but [URL]http://www.mersenneforum.org/showthread.php?t=18322[/URL]

Or you can try messing around with the prime services ( + sc) and/or taskschd, scripts with bat files.
Other options to consider:
from undoc.txt
Throttle=n
..For example, Throttle=40 means the program will run 40% and be idle 60% of the time.

or maybe LowMemWhileRunning or lower priority

[SIZE=1]
Or by cron [URL]http://www.mersenneforum.org/showthread.php?t=11584[/URL] for linux[/SIZE]

[I][SIZE=1]("Time=" hasn't been working since [URL="http://mersenneforum.org/showthread.php?t=3635"]~25.7[/URL], tried it too.)[/SIZE][/I]

sdbardwick 2017-07-29 21:59

This might help, but doesn't cause the program to exit/restart:
Adjust the start/stop times below and insert into prime.txt
[CODE]PauseWhileRunning=* during 08:00-17:00[/CODE]
(Above code will pause Prime95 from 8am to 5pm)

patgie 2017-07-30 00:20

Thank you sdbardwick and thyw.

PauseWhileRunning works ok, I would then only have to restart prime95 in the evening.

Is there any way to make PauseWhileRunning day specific, e.g. only pause on certain days?

sdbardwick 2017-07-30 01:11

[QUOTE=patgie;464492]Thank you sdbardwick and thyw.

PauseWhileRunning works ok, I would then only have to restart prime95 in the evening.

Is there any way to make PauseWhileRunning day specific, e.g. only pause on certain days?[/QUOTE]

Yup! undoc.txt in the Prime95 directory lists all of the various options; below is only a portion.
[CODE]In rare cases, users have reported the program can interfere with the
performance of some programs such as disk defragmenters and some games.
You can pause the program automatically when these programs are running by
adding this line to prime.txt:
PauseWhileRunning=prog1[n1],prog2[n2],etc
The [n1], [n2] values are optional and indicate the number of worker threads
to pause when prog1 and prog2 are running. The default value for n1 and n2
is to pause all worker threads. Note that the program will pause if the program
name matches any part of the running program's file name. That is "foobar"
will match "c:\foobar.exe", "C:\FOOBAR\name.exe", and even "C:\myfoobarprog.exe".
Also, if prog1 is "*" the program will pause no matter what. Examples:
PauseWhileRunning=*[1] during 6-7/2:00-3:00
PauseWhileRunning=* during 23:00-24:00 else decomp[1],mygame[2]
The first example pauses one worker thread on Saturday and Sunday between
2AM and 3AM. The second example pauses all workers between 11PM and 12AM and
pauses 1 worker if decomp is running and 2 if mygame is running.[/CODE]

patgie 2017-07-30 21:10

Thank you sdbardwick it works great, took a while to make it work on 'X' machines but will make things easier.

patgie 2017-07-31 23:20

So despite putting in prime.txt:

V24OptionsConverted=1
WGUID_version=2
StressTester=0
UsePrimenet=0
Windows95Service=0
DialUp=0
V5UserID=ANONYMOUS
HideIcon=0
TrayIcon=1
Left=343
Top=338
Right=1783
Bottom=1097
W1=0 0 1422 339 0 -1 -1 -1 -1
W2=0 339 1422 679 0 -1 -1 -1 -1
PauseWhileRunning=*[1] during 1-5/8:00-18:00

[PrimeNet]
Debug=0
ProxyHost=
ProxyUser=
ProxyPass=
ProxyMask=0


The worker #1 did not go to sleep at 8 in the morning on all of my machines. It only goes to sleep when I stop prime95 and then press continue between 8:00-18:00. It then sleeps until 18:00 and starts working again at 18:00 as expected.

Any idea how to make prime95 pick PauseWhileRunning automatically?

Thank you.

S485122 2017-08-01 04:28

You might have found a bug.

Ttry the following setting :
"By default, the program will check the PauseWhileRunning list every 10 seconds.
You can adjust the time period with this prime.txt setting:
PauseCheckInterval=n
where n is the number of seconds between checking which programs are running."
to see if it changes something.

Jacob

thyw 2017-08-01 13:13

Guessing about unkown things
 
Ok, so i tried the option, with PauseCheckInterval, PauseCheckInterval * or program name, running it as admin, and i even upgraded to 28.10 from 28.7. And every combinaion of these.
Also if i leave out the "during" word it will "sleep forever".
Tried to put it into local.txt, still every combination, no.
Looking at whatsnew: 22.9 introduce this feature, 25.7 enchanted. Oldest i could find is 25.9. Still doesn't work with * or program PauseCheckInterval.
Also trying with CheatEngine (really new to that program too), prime95 definitely has that program string in memory after defined in PauseWhileRunning.
Even the older version does "It only goes to sleep when I stop prime95 and then press continue between 8:00-18:00."
Looking at the source code (the newest i could find was 28.10) - looks like it's in [I]commonb.c[/I] from line 2070.
[B]I do not understand most of it,[/B] someone who knows what he's doing should look at the code. I can only guess, 2 cents or something, but maybe
[CODE] from 2153
seconds_until_reread = 0;
IniGetTimedString (INI_FILE, "PauseWhileRunning", buf, sizeof (buf), NULL, &seconds);
if (seconds && (seconds_until_reread == 0 || seconds < seconds_until_reread))
seconds_until_reread = seconds;
parse_pause_info (buf, ALL_WORKERS, FALSE);
[I](and then the if seconds... section repeats inside a for[/I] loop.)
Looks like IniGetTimedString is only specified in one other place ([I]\gwnum\gwini.c[/I]/h line 247)
And the last (6th) value for this void function[I] [U]seconds [/U]has this comment: [/I][I]/* Return length of time this timed INI setting is good for. */
[/I]looks like [I]seconds_until_reread [/I]won't change (0) inside lines 1135-2190 (
And only the part of that [I]if[/I] and at end

/* Add the event that fires when the memory settings expire. */

if (seconds_until_reread)
add_timed_event (TE_READ_PAUSE_DATA, seconds_until_reread);


[B]So it won't change seconds_until_reread [/B]because if both [I]seconds [/I]and [I]seconds_until_reread[/I] are 0, then true, thus [I]seconds_until_reread = seconds;[/I] or[I] seconds[/I] is 0 and [I]seconds < seconds_until_reread[/I] then it changes to 0 too. It will always be true.

[STRIKE]So it will be (#2180)
if (seconds_until_reread)
add_timed_event (TE_READ_PAUSE_DATA, seconds_until_reread);
seconds_until_reread=0 and in commonc.h #440-9 it's event 11 and it's in commonb.c #2389 [/STRIKE]
[/CODE]

patgie 2017-08-01 14:24

Just an update, all my machines went to sleep after running overnight (more than 10 separate instances) as I set them to go to sleep in the morning at 8:00 today using PauseWhileRunning. Not sure why this has not been picked up yesterday but has been the next day. Any ideas?

S485122 2017-08-01 16:01

One thing that we and the document perhaps forgot to say, or that you did not notice : when changing settings or data in the configuration or work files, it is best to stop Prime95, when you restart it, it reads local.txt, prime.txt and worktodo.txt again.

Jacob

GP2 2017-08-01 17:30

[QUOTE=S485122;464687]One thing that we and the document perhaps forgot to say, or that you did not notice : when changing settings or data in the configuration or work files, it is best to stop Prime95, when you restart it, it reads local.txt, prime.txt and worktodo.txt again.

Jacob[/QUOTE]

There is a trick you can use to modify worktodo.txt without stopping Prime95/mprime first.

It's based on the fact that if you create a worktodo.add file (or worktodo.add.txt) in the same working directory as your worktodo.txt file, then the next time the program does a disk write to save the p* savefiles, it will read the "add" file and append its lines to the existing worktodo.txt file.

The interval in minutes is specified in the DiskWriteTime= line in prime.txt, and is usually 30 minutes. So you can just look at the timestamp for the most recent p* savefile, and figure out when the next disk write is due.

So if you want to edit the worktodo.txt file without stopping Prime95/mprime, you can just go ahead and edit it and then create an empty worktodo.add (or worktodo.add.txt) file. At the next disk write, the program will read the empty "add" file, "append" nothing to the worktodo.txt file, and voilĂ , you've just successfully modified worktodo.txt

Note, if you merely edit the worktodo.txt file and fail to create an empty worktodo.add (or worktodo.add.txt) file, then at the next disk write your edits will get overwritten and the original version of worktodo.txt will be restored.

This method is primarily useful if you are running mprime on a server, starting automatically at boot time, and don't have a convenient user interface to start and stop it.

There is only one way the above method might fail: if an exponent is very close to completing, and actually completes [I]before[/I] the next scheduled disk write. The program then overwrites the existing worktodo.txt file, removing the top line to reflect the completion of that exponent, so it will probably undo your edit before it proceeds to read the empty worktodo.add (or worktodo.add.txt) file. I haven't tested this fail scenario though, but I suspect it might happen.

patgie 2017-08-03 21:36

After 24h pausewhilerunning started to work fine (sleeping at chosen time and then restarting), no idea why it needed 24h to start working properly. Hopefully it will stay this way, thank you for all help.

patgie 2018-01-28 19:08

Hi all, so the pausewhilerunning feature seems to work when I start prime95 during period when it is supposed to sleep, it then goes to sleep when I start it, and then resume the work as specified in the prime.txt, e.g.

OutputIterations=10000
ResultsFileIterations=999999999
DiskWriteTime=30
NetworkRetryTime=2
NetworkRetryTime2=70
DaysOfWork=3
DaysBetweenCheckins= 1
NumBackupFiles=3
SilentVictory=0
Priority=1
RunOnBattery=1
WorkPreference=100
ManualComm=1
PauseWhileRunning=*[1] during 1-7/19:07-19:30
PauseCheckInterval=10

[PrimeNet]
Debug=0
ProxyHost=
ProxyUser=

[Worker #1]
WorkPreference=100


works fine when I start prime95 between 19:07 and 19:30 however if I start prime95 at 19:00 it will not go to sleep at 19:07 unless I restart it between 19:07 and 19:30,

do you have any idea what may be done to fix it? I have had that issue since my last post but would be nice to get it to work properly.

Thank you in advance.


All times are UTC. The time now is 19:28.

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