diff --git a/CEP/Pipeline/recipes/sip/master/executable_args.py b/CEP/Pipeline/recipes/sip/master/executable_args.py index 4c07727745f06af08cdf6b0b8a608335383d6800..2bec87956bb666f4792cd5e9d4c646616b659c7f 100644 --- a/CEP/Pipeline/recipes/sip/master/executable_args.py +++ b/CEP/Pipeline/recipes/sip/master/executable_args.py @@ -35,6 +35,11 @@ class executable_args(BaseRecipe, RemoteCommandRecipeMixIn): default='', optional=True ), + 'nthreads': ingredient.IntField( + '--nthreads', + default=8, + help="Number of threads per process" + ), 'nodescript': ingredient.StringField( '--nodescript', help="Name of the node script to execute", @@ -369,7 +374,10 @@ class executable_args(BaseRecipe, RemoteCommandRecipeMixIn): self.inputs['parsetasfile'], args_format, self.environment - ] + ], + resources={ + "cores": self.inputs['nthreads'] + } ) ) max_per_node = self.inputs['max_per_node'] diff --git a/CEP/Pipeline/recipes/sip/master/imager_prepare.py b/CEP/Pipeline/recipes/sip/master/imager_prepare.py index f17ce182724a9d434bbede320f87fc9e866857e3..3ba13b86007ed11c712e24bb4ba0976cf1cf89f4 100644 --- a/CEP/Pipeline/recipes/sip/master/imager_prepare.py +++ b/CEP/Pipeline/recipes/sip/master/imager_prepare.py @@ -57,6 +57,11 @@ class imager_prepare(BaseRecipe, RemoteCommandRecipeMixIn): '-w', '--working-directory', help="Working directory used by the nodes: local data" ), + 'nthreads': ingredient.IntField( + '--nthreads', + default=8, + help="Number of threads per process" + ), 'target_mapfile': ingredient.StringField( '--target-mapfile', help="Contains the node and path to target files, defines" @@ -191,7 +196,7 @@ class imager_prepare(BaseRecipe, RemoteCommandRecipeMixIn): paths_to_image_mapfiles.append( tuple([item.host, inputs_for_image_mapfile_path, False])) - # use a unique working directory per job, to prevent interference between jobs on a global fs + # use unique working directories per job, to prevent interference between jobs on a global fs working_dir = os.path.join(self.inputs['working_directory'], "ms_per_image_{0}".format(idx_sb_group)) arguments = [self.environment, @@ -211,7 +216,10 @@ class imager_prepare(BaseRecipe, RemoteCommandRecipeMixIn): self.inputs['add_beam_tables'], globalfs] - jobs.append(ComputeJob(item.host, node_command, arguments)) + jobs.append(ComputeJob(item.host, node_command, arguments, + resources={ + "cores": self.inputs['nthreads'] + })) # Hand over the job(s) to the pipeline scheduler self._schedule_jobs(jobs) diff --git a/CEP/Pipeline/recipes/sip/master/long_baseline.py b/CEP/Pipeline/recipes/sip/master/long_baseline.py index 45734bd28e82268824705c8ef27868d44b8ae7b7..fe399f5263c579f7e5354da76d5cbae92e599dcc 100644 --- a/CEP/Pipeline/recipes/sip/master/long_baseline.py +++ b/CEP/Pipeline/recipes/sip/master/long_baseline.py @@ -63,6 +63,11 @@ class long_baseline(BaseRecipe, RemoteCommandRecipeMixIn): '-w', '--working-directory', help="Working directory used by the nodes: local data" ), + 'nthreads': ingredient.IntField( + '--nthreads', + default=8, + help="Number of threads per process" + ), 'target_mapfile': ingredient.StringField( '--target-mapfile', help="Contains the node and path to target files, defines" @@ -212,7 +217,10 @@ class long_baseline(BaseRecipe, RemoteCommandRecipeMixIn): globalfs, final_item.file] - jobs.append(ComputeJob(output_item.host, node_command, arguments)) + jobs.append(ComputeJob(output_item.host, node_command, arguments, + resources={ + "cores": self.inputs['nthreads'] + })) # Hand over the job(s) to the pipeline scheduler self._schedule_jobs(jobs, max_per_node=self.inputs['nproc']) diff --git a/CEP/Pipeline/recipes/sip/tasks.cfg.in b/CEP/Pipeline/recipes/sip/tasks.cfg.in index e2968e1bc5b9c6327b0b130890b47450b8f2657f..ab6fcb96cbe487190693196e1e850dcb62b40240 100644 --- a/CEP/Pipeline/recipes/sip/tasks.cfg.in +++ b/CEP/Pipeline/recipes/sip/tasks.cfg.in @@ -62,6 +62,7 @@ asciistat_executable = %(lofarroot)s/bin/asciistats.py statplot_executable = %(lofarroot)s/bin/statsplot.py msselect_executable = %(casaroot)s/bin/msselect rficonsole_executable = %(lofarroot)s/bin/rficonsole +nthreads = 8 [long_baseline] recipe = long_baseline @@ -71,6 +72,7 @@ statplot_executable = %(lofarroot)s/bin/statsplot.py msselect_executable = %(casaroot)s/bin/msselect rficonsole_executable = %(lofarroot)s/bin/rficonsole nproc = 1 +nthreads = 8 [imager_awimager] recipe = imager_awimager @@ -134,6 +136,7 @@ inplace = False outputsuffixes = [] parsetasfile = False #args_format=gnu +nthreads = 8 [casapy-imager] recipe = executable_args @@ -141,20 +144,24 @@ parsetasfile = True #executable = /path/to/your/casapy/bin/casa outputsuffixes = [flux,image,model,residual,psf] nodescript = executable_casa +nthreads = 8 [pythonplugin] recipe = executable_args nodescript = python_plugin +nthreads = 8 [python-calibrate-stand-alone] recipe=executable_args nodescript=calibrate-stand-alone executable=%(lofarroot)s/bin/bbs-reducer parsetasfile=True +nthreads = 8 [calibrate-stand-alone] recipe = executable_args executable = %(lofarroot)s/bin/calibrate-stand-alone +nthreads = 8 [dppp] recipe = executable_args @@ -163,6 +170,7 @@ executable = %(lofarroot)s/bin/NDPPP outputsuffixes = [] args_format=lofar outputkey=msout +nthreads = 8 [awimager] recipe = executable_args @@ -172,7 +180,9 @@ outputsuffixes = [.model, .model.corr, .residual, .residual.corr, .restored, .re max_per_node = 1 args_format=lofar outputkey=image +nthreads = 8 [rficonsole] recipe = executable_args executable = %(lofarroot)s/bin/rficonsole +nthreads = 8