mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Software (https://www.mersenneforum.org/forumdisplay.php?f=10)
-   -   Prime95 version 29.6/29.7/29.8 (https://www.mersenneforum.org/showthread.php?t=24094)

chalsall 2019-11-02 15:01

Feature request: Exit when out of work.
 
@George: Could you please add this feature when you have a moment.

Basic use-case is in a fully scripted Colab / Kaggle environment. It would be nice having a setting (probably in prime.txt) which causes mprime to exit when worktodo.txt is empty. Rather than it continuing to run, consuming 0% of the CPU, while it watches worktodo.txt for more work.

Some of my scripts watch worktodo.txt and SIGINTs mprime when it becomes empty. But in some designs it would be much easier if we could just "`./mprime`;" (Perl; "!./mprime" in Python) and then loop around and fetch more work and feed it to a new run of mprime.

Prime95 2019-11-04 02:47

[QUOTE=chalsall;529474]@George: Could you please add this feature when you have a moment.

Basic use-case is in a fully scripted Colab / Kaggle environment. It would be nice having a setting (probably in prime.txt) which causes mprime to exit when worktodo.txt is empty. Rather than it continuing to run, consuming 0% of the CPU, while it watches worktodo.txt for more work.[/QUOTE]


Are you expecting mprime to first get work and populate worktodo.txt and run until it is empty?

Or are you pre-populating worktodo.txt and running mprime until worktodo.txt is empty?

Is this option only for one-worker mprime runs?

chalsall 2019-11-04 03:35

[QUOTE=Prime95;529599]Are you expecting mprime to first get work and populate worktodo.txt and run until it is empty? Or are you pre-populating worktodo.txt and running mprime until worktodo.txt is empty?[/QUOTE]

The latter.

[QUOTE=Prime95;529599]Is this option only for one-worker mprime runs?[/QUOTE]

Not quite sure what you mean by this.

The workflow would be a new compute instance (nominally a Colab or Kaggle run) is the host for an ephemeral mprime run. Work in the worktodo.txt file is to be processed by mprime, and then mprime exits.

It would then be up to the instance's "bootstrap" code to fetch more work, place it in worktodo.txt, and then mprime is launched again.

I hope that makes sense. Thanks for considering this.

axn 2019-11-04 03:55

[QUOTE=Prime95;529599]Is this option only for one-worker mprime runs?[/QUOTE]

My personal use case has two Worker threads (each with approximately same amount of work). So, the instance would quit if _all_ of the workers are empty.

I suppose, the feature is applicable only if:
a) UsePrimenet = 0 (this is the kaggle/colab) OR
b) UsePrimenet = 1 and NoMoreWork = 1 (and worktodo.add is not there/empty??) (regular GIMPS, but we want to stop work, and quit the instance as well).

chalsall 2019-11-04 14:32

[QUOTE=axn;529602]My personal use case has two Worker threads (each with approximately same amount of work).[/QUOTE]

Ah, I now understand George's question.

In the Colab / Kaggle Notebook instances, if a GPU is attached the CPU available is only a single core (HT enabled). Kaggle offers two CPU cores (again HT enabled) when running CPU only.

So, only one worker.

Edit: Oh, and it would be fine if mprime reported back to Primenet before exiting. In my use-case I'll proxy it if needed.

Mark Rose 2019-11-04 18:37

This would also be nice for automated benchmarking.

Prime95 2019-11-04 23:31

Exit when out of work: Please try build 29.8 build 7. I did not test this, let me know if it works or could be improved upon. New feature is described in undoc.txt.

chalsall 2019-11-04 23:33

[QUOTE=Prime95;529656]New feature is described in undoc.txt.[/QUOTE]

Sweet! Thanks, George!

It will be a couple of days before I can test this myself.

mathwiz 2019-11-04 23:40

[QUOTE=Prime95;529656]Exit when out of work: Please try build 29.8 build 7. I did not test this, let me know if it works or could be improved upon. New feature is described in undoc.txt.[/QUOTE]

Will the source for this release be posted somewhere?

Prime95 2019-11-04 23:48

[QUOTE=mathwiz;529658]Will the source for this release be posted somewhere?[/QUOTE]

If the feature works and someone needs the source. Do you need it?

axn 2019-11-05 02:46

[QUOTE=Prime95;529656]Exit when out of work: Please try build 29.8 build 7. I did not test this, let me know if it works or could be improved upon. New feature is described in undoc.txt.[/QUOTE]

Link?


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

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