Skip to content
Snippets Groups Projects
Commit d416bd14 authored by Yngve Levinsen's avatar Yngve Levinsen
Browse files

added a confirmation question to the execute script

parent ac9964ad
No related branches found
No related tags found
No related merge requests found
...@@ -155,6 +155,7 @@ def setup_multi(args): ...@@ -155,6 +155,7 @@ def setup_multi(args):
raise ValueError("Could not find any simulation folders in "+args.calc_dir) raise ValueError("Could not find any simulation folders in "+args.calc_dir)
print "Total number of new jobs", num_jobs print "Total number of new jobs", num_jobs
args.num_jobs=num_jobs
def setup(args): def setup(args):
import os,random import os,random
...@@ -208,7 +209,17 @@ def setup(args): ...@@ -208,7 +209,17 @@ def setup(args):
rand=rand_lst[i] rand=rand_lst[i]
out.write(queue_template.format(**locals())) out.write(queue_template.format(**locals()))
def ask(args):
print "You have now set up an error study running {} jobs in folder {}".format(args.num_jobs,args.calc_dir)
if args.multi>1:
print "This is a multi-error study"
answer=raw_input("Are you sure you want to continue? (yes/no)")
if answer=='yes':
return 0
import sys
sys.exit(0)
def execute(calc_dir,multi): def execute(calc_dir,multi):
import subprocess import subprocess
if multi: if multi:
...@@ -220,4 +231,5 @@ def execute(calc_dir,multi): ...@@ -220,4 +231,5 @@ def execute(calc_dir,multi):
if __name__=="__main__": if __name__=="__main__":
args=define_and_handle_args() args=define_and_handle_args()
setup(args) setup(args)
ask(args)
execute(args.calc_dir,args.multi>1) execute(args.calc_dir,args.multi>1)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment