mersenneforum.org  

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

Reply
 
Thread Tools
Old 2019-11-02, 15:01   #386
chalsall
If I May
 
chalsall's Avatar
 
"Chris Halsall"
Sep 2002
Barbados

100110001001112 Posts
Default 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.
chalsall is online now   Reply With Quote
Old 2019-11-04, 02:47   #387
Prime95
P90 years forever!
 
Prime95's Avatar
 
Aug 2002
Yeehaw, FL

165578 Posts
Default

Quote:
Originally Posted by chalsall View Post
@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.

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?
Prime95 is online now   Reply With Quote
Old 2019-11-04, 03:35   #388
chalsall
If I May
 
chalsall's Avatar
 
"Chris Halsall"
Sep 2002
Barbados

9,767 Posts
Default

Quote:
Originally Posted by Prime95 View Post
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?
The latter.

Quote:
Originally Posted by Prime95 View Post
Is this option only for one-worker mprime runs?
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.
chalsall is online now   Reply With Quote
Old 2019-11-04, 03:55   #389
axn
 
axn's Avatar
 
Jun 2003

10011110110102 Posts
Default

Quote:
Originally Posted by Prime95 View Post
Is this option only for one-worker mprime runs?
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).
axn is offline   Reply With Quote
Old 2019-11-04, 14:32   #390
chalsall
If I May
 
chalsall's Avatar
 
"Chris Halsall"
Sep 2002
Barbados

100110001001112 Posts
Default

Quote:
Originally Posted by axn View Post
My personal use case has two Worker threads (each with approximately same amount of work).
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.

Last fiddled with by chalsall on 2019-11-04 at 14:34
chalsall is online now   Reply With Quote
Old 2019-11-04, 18:37   #391
Mark Rose
 
Mark Rose's Avatar
 
"/X\(‘-‘)/X\"
Jan 2013

2×5×293 Posts
Default

This would also be nice for automated benchmarking.
Mark Rose is offline   Reply With Quote
Old 2019-11-04, 23:31   #392
Prime95
P90 years forever!
 
Prime95's Avatar
 
Aug 2002
Yeehaw, FL

11101011011112 Posts
Default

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.
Prime95 is online now   Reply With Quote
Old 2019-11-04, 23:33   #393
chalsall
If I May
 
chalsall's Avatar
 
"Chris Halsall"
Sep 2002
Barbados

262716 Posts
Default

Quote:
Originally Posted by Prime95 View Post
New feature is described in undoc.txt.
Sweet! Thanks, George!

It will be a couple of days before I can test this myself.
chalsall is online now   Reply With Quote
Old 2019-11-04, 23:40   #394
mathwiz
 
Mar 2019

18310 Posts
Default

Quote:
Originally Posted by Prime95 View Post
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.
Will the source for this release be posted somewhere?
mathwiz is offline   Reply With Quote
Old 2019-11-04, 23:48   #395
Prime95
P90 years forever!
 
Prime95's Avatar
 
Aug 2002
Yeehaw, FL

5·11·137 Posts
Default

Quote:
Originally Posted by mathwiz View Post
Will the source for this release be posted somewhere?
If the feature works and someone needs the source. Do you need it?

Last fiddled with by Prime95 on 2019-11-04 at 23:50
Prime95 is online now   Reply With Quote
Old 2019-11-05, 02:46   #396
axn
 
axn's Avatar
 
Jun 2003

2·3·7·112 Posts
Default

Quote:
Originally Posted by Prime95 View Post
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.
Link?
axn is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Prime95 version 29.2 Prime95 Software 71 2017-09-16 16:55
Prime95 version 29.1 Prime95 Software 95 2017-08-22 22:46
Prime95 version 26.5 Prime95 Software 175 2011-04-04 22:35
Prime95 version 25.9 Prime95 Software 143 2010-01-05 22:53
Prime95 version 25.8 Prime95 Software 159 2009-09-21 16:30

All times are UTC. The time now is 20:29.


Sun Aug 1 20:29:13 UTC 2021 up 9 days, 14:58, 0 users, load averages: 2.51, 2.22, 1.88

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, 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.