clawpack / clawutil

General utility programs
BSD 3-Clause "New" or "Revised" License
10 stars 31 forks source link

Nohup #75

Closed rjleveque closed 10 years ago

rjleveque commented 10 years ago

For running in batch mode on remote machines it is useful to be able to run the code in nohup mode (keep running if connection is broken) and to nice the job.

rjleveque commented 10 years ago

This PR was updated in April so that it doesn't always use nice with nohup, and some other improvements. It's been used fairly extensively since then on a probabilistic tsunami study, so I suggest merging in unless there are more suggestions.

mandli commented 10 years ago

This looks good to me and will be a nice additional feature.

ahmadia commented 10 years ago

Don't let me get in the way of merging this PR. I just want to point out that the default behavior from the Makefile is to now call the program with nice 7, which might be confusing to somebody who expects their simulation to run at normal speed.

rjleveque commented 10 years ago

Good catch @ahmadia. That wasn't the intention and I fixed it so None is the default.

ahmadia commented 10 years ago

Does that do what you want? I can't figure out from looking at the code so I'm trying to run a test case.

ahmadia commented 10 years ago

@rjleveque - I don't think does what you want. Re-reading the code, you're passing "None" is as a string, which won't be automatically converted into the None type. I know the options-parsing in Python is not great, but this code would really benefit from refactoring either into the optparse (portable) or argparse (2.7+) module.

rjleveque commented 10 years ago

@ahmadia, yes I agree it should be cleaned up at some point, but I thought it worked now with the change to runclaw.py that's also in this commit, which resets the string to a proper None.

ahmadia commented 10 years ago

Sorry, I missed that. The logic looks correct now, and it sounds like you're using this in production. I don't really maintain clawutil (I think it's mostly you and Kyle), so I think you should just merge this in when you're ready.