Skip to content
Snippets Groups Projects
Commit 0e65a1dd authored by Izzard, Robert Dr (Maths & Physics)'s avatar Izzard, Robert Dr (Maths & Physics)
Browse files

add batchname to condor script

parent b0c53017
No related branches found
No related tags found
No related merge requests found
...@@ -174,7 +174,7 @@ class condor(): ...@@ -174,7 +174,7 @@ class condor():
# run a grid of stars only, leaving the results # run a grid of stars only, leaving the results
# in the appropriate outfile # in the appropriate outfile
return False return False
elif self.grid_options['condor'] == 3: elif self.grid_options['condor'] == 3:
# joining : set the evolution type to "join" and return # joining : set the evolution type to "join" and return
# False to continue # False to continue
...@@ -184,7 +184,7 @@ class condor(): ...@@ -184,7 +184,7 @@ class condor():
elif self.grid_options['condor'] == 1: elif self.grid_options['condor'] == 1:
# if condor=1, we should have no evolution type, we # if condor=1, we should have no evolution type, we
# set up the Condor scripts and get them evolving # set up the Condor scripts and get them evolving
# in a Condor queue # in a Condor queue
self.grid_options['evolution_type'] = None self.grid_options['evolution_type'] = None
# make dirs # make dirs
...@@ -202,18 +202,18 @@ class condor(): ...@@ -202,18 +202,18 @@ class condor():
# get job array index # get job array index
Process = self.grid_options['condor_Process'] if self.grid_options['condor_Process'] != "" else '$Process' Process = self.grid_options['condor_Process'] if self.grid_options['condor_Process'] != "" else '$Process'
if self.grid_options['condor_njobs'] == 0: if self.grid_options['condor_njobs'] == 0:
print("binary_c-python Condor : You must set grid_option condor_njobs to be non-zero") print("binary_c-python Condor : You must set grid_option condor_njobs to be non-zero")
self.exit(code=1) self.exit(code=1)
# find the path to the Python script that we are running # find the path to the Python script that we are running
pyscriptpath = str(lib_programname.get_path_executed_script()) pyscriptpath = str(lib_programname.get_path_executed_script())
# set the condor initial dir to be our current working directory # set the condor initial dir to be our current working directory
if not self.grid_options['condor_initial_dir']: if not self.grid_options['condor_initial_dir']:
self.grid_options['condor_initial_dir'] = os.getcwd() self.grid_options['condor_initial_dir'] = os.getcwd()
# build the grid command # build the grid command
grid_command = [ grid_command = [
os.path.join("/usr","bin","env"), os.path.join("/usr","bin","env"),
...@@ -306,7 +306,7 @@ echo {condor_dir}/results/$ClusterID.$Process.gz >> {condor_dir}/results/$Cluste ...@@ -306,7 +306,7 @@ echo {condor_dir}/results/$ClusterID.$Process.gz >> {condor_dir}/results/$Cluste
key=key, key=key,
value=self.grid_options['condor_extra_settings'][key] value=self.grid_options['condor_extra_settings'][key]
) )
jobid = '$(Cluster).$(Process)' jobid = '$(Cluster).$(Process)'
condor_submit_script = """ condor_submit_script = """
executable = {usr_bin_env} executable = {usr_bin_env}
...@@ -324,8 +324,9 @@ request_cpus = {request_cpus} ...@@ -324,8 +324,9 @@ request_cpus = {request_cpus}
should_transfer_files = {should_transfer_files} should_transfer_files = {should_transfer_files}
when_to_transfer_output = {when_to_transfer_output} when_to_transfer_output = {when_to_transfer_output}
requirements = {requirements} requirements = {requirements}
JobBatchName = {batchname}
{extra_settings} {extra_settings}
queue {njobs} queue {njobs}
""".format( """.format(
usr_bin_env = self.grid_options['condor_usr_bin_env'], usr_bin_env = self.grid_options['condor_usr_bin_env'],
bash = self.grid_options['condor_bash'], bash = self.grid_options['condor_bash'],
...@@ -349,6 +350,7 @@ queue {njobs} ...@@ -349,6 +350,7 @@ queue {njobs}
should_transfer_files = self.grid_options['condor_should_transfer_files'], should_transfer_files = self.grid_options['condor_should_transfer_files'],
when_to_transfer_output = self.grid_options['when_to_transfer_output'], when_to_transfer_output = self.grid_options['when_to_transfer_output'],
requirements = self.grid_options['condor_requirements'], requirements = self.grid_options['condor_requirements'],
batchname = self.grid_options['condor_batchname'],
extra_settings = extra_settings, extra_settings = extra_settings,
njobs = self.grid_options['condor_njobs'], njobs = self.grid_options['condor_njobs'],
) )
...@@ -400,7 +402,5 @@ queue {njobs} ...@@ -400,7 +402,5 @@ queue {njobs}
print("Condor jobs launched.") print("Condor jobs launched.")
print("All done in condor_grid().") print("All done in condor_grid().")
# return True so we exit immediately # return True so we exit immediately
return True return True
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