radical-collaboration / hpc-workflows

NSF16514 EarthCube Project - Award Number:1639694
5 stars 0 forks source link

Possible to put a timeout in the jsrun command? #146

Closed wjlei1990 closed 2 years ago

wjlei1990 commented 3 years ago

Hi team,

Is it possible to put timeout in the jsrun command?

I used to run the command like this:

timeout 300 jsrun -n384 -a1 -c1 -g1 ./bin/xspecfem3D
andre-merzky commented 3 years ago

Hi @wjlei1990 - we don't support timeouts at the moment. A quick workaround would be to wrap the task in a shell script and to kill it after some time. Please let us know if you need help with setting this up!

wjlei1990 commented 3 years ago

Hi @andre-merzky, could you be more specific?

So originally I have this:

timeout 300 jsrun -n384 -a1 -c1 -g1 ./bin/xspecfem3D

What should I put into the shell script, and how should I prepare the entk commands?

andre-merzky commented 3 years ago

Hi @wjlei1990,

if timeout is available on the compute nodes, you could change the EnTK task description from

executable = './bin/xspecfem3D'
arguments  = []

to

executable = 'timeout'
arguments  = ['300', './bin/xspecfem3D']

If that is not an option, have a look at this stackoverflow page for a couple of ways on how to time out a command. Let me know if that helps!