Skip to content

Commit

Permalink
Minor cleanup of remote workflow examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
riga committed Nov 16, 2022
1 parent e3fb025 commit ab27ab4
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 14 deletions.
13 changes: 9 additions & 4 deletions examples/htcondor_at_cern/analysis/framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,22 @@ class HTCondorWorkflow(law.htcondor.HTCondorWorkflow):
configuration is required.
"""

max_runtime = law.DurationParameter(default=2.0, unit="h", significant=False,
description="maximum runtime, default unit is hours, default: 2")
max_runtime = law.DurationParameter(
default=1.0,
unit="h",
significant=False,
description="maximum runtime; default unit is hours; default: 1",
)

def htcondor_output_directory(self):
# the directory where submission meta data should be stored
return law.LocalDirectoryTarget(self.local_path())

def htcondor_bootstrap_file(self):
# each job can define a bootstrap file that is executed prior to the actual job
# in order to setup software and environment variables
return law.util.rel_path(__file__, "bootstrap.sh")
# configure it to be shared across jobs and rendered as part of the job itself
bootstrap_file = law.util.rel_path(__file__, "bootstrap.sh")
return law.JobInputFile(bootstrap_file, share=True, render_job=True)

def htcondor_job_config(self, config, job_num, branches):
# render_variables are rendered into all files sent with a job
Expand Down
12 changes: 10 additions & 2 deletions examples/htcondor_at_naf/analysis/framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,22 @@ class HTCondorWorkflow(law.htcondor.HTCondorWorkflow):
configuration is required.
"""

max_runtime = law.DurationParameter(
default=1.0,
unit="h",
significant=False,
description="maximum runtime; default unit is hours; default: 1",
)

def htcondor_output_directory(self):
# the directory where submission meta data should be stored
return law.LocalDirectoryTarget(self.local_path())

def htcondor_bootstrap_file(self):
# each job can define a bootstrap file that is executed prior to the actual job
# in order to setup software and environment variables
return law.util.rel_path(__file__, "bootstrap.sh")
# configure it to be shared across jobs and rendered as part of the job itself
bootstrap_file = law.util.rel_path(__file__, "bootstrap.sh")
return law.JobInputFile(bootstrap_file, share=True, render_job=True)

def htcondor_job_config(self, config, job_num, branches):
# render_variables are rendered into all files sent with a job
Expand Down
18 changes: 14 additions & 4 deletions examples/htcondor_at_vispa/analysis/framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,27 @@ class HTCondorWorkflow(law.htcondor.HTCondorWorkflow):
configuration is required.
"""

htcondor_gpus = luigi.IntParameter(default=law.NO_INT, significant=False, description="number "
"of GPUs to request on the VISPA cluster, leave empty to use only CPUs")
max_runtime = law.DurationParameter(
default=1.0,
unit="h",
significant=False,
description="maximum runtime; default unit is hours; default: 1",
)
htcondor_gpus = luigi.IntParameter(
default=law.NO_INT,
significant=False,
description="number of GPUs to request on the VISPA cluster; leave empty to use only CPUs",
)

def htcondor_output_directory(self):
# the directory where submission meta data should be stored
return law.LocalDirectoryTarget(self.local_path())

def htcondor_bootstrap_file(self):
# each job can define a bootstrap file that is executed prior to the actual job
# in order to setup software and environment variables
return law.util.rel_path(__file__, "bootstrap.sh")
# configure it to be shared across jobs and rendered as part of the job itself
bootstrap_file = law.util.rel_path(__file__, "bootstrap.sh")
return law.JobInputFile(bootstrap_file, share=True, render_job=True)

def htcondor_job_config(self, config, job_num, branches):
# render_variables are rendered into all files sent with a job
Expand Down
5 changes: 3 additions & 2 deletions examples/lsf_at_cern/analysis/framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ def lsf_output_directory(self):

def lsf_bootstrap_file(self):
# each job can define a bootstrap file that is executed prior to the actual job
# in order to setup software and environment variables
return law.util.rel_path(__file__, "bootstrap.sh")
# configure it to be shared across jobs and rendered as part of the job itself
bootstrap_file = law.util.rel_path(__file__, "bootstrap.sh")
return law.JobInputFile(bootstrap_file, share=True, render_job=True)

def lsf_job_config(self, config, job_num, branches):
# render_variables is rendered into all files sent with a job
Expand Down
5 changes: 3 additions & 2 deletions examples/slurm_at_maxwell/analysis/framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ def slurm_output_directory(self):

def slurm_bootstrap_file(self):
# each job can define a bootstrap file that is executed prior to the actual job
# in order to setup software and environment variables
return law.util.rel_path(__file__, "bootstrap.sh")
# configure it to be shared across jobs and rendered as part of the job itself
bootstrap_file = law.util.rel_path(__file__, "bootstrap.sh")
return law.JobInputFile(bootstrap_file, share=True, render_job=True)

def slurm_job_config(self, config, job_num, branches):
# render_variables are rendered into all files sent with a job
Expand Down

0 comments on commit ab27ab4

Please sign in to comment.