From 872a28401efc7ea0b7d7945b6ca377f283a824ce Mon Sep 17 00:00:00 2001
From: Wouter Klijn <klijn@astron.nl>
Date: Mon, 5 Jan 2015 13:47:13 +0000
Subject: [PATCH] Task #7168: Add a nproc parameter to the longbaseline
 pipeline master recipe. Make it default to 1. Add it to the task.cfg as well

---
 CEP/Pipeline/recipes/sip/master/long_baseline.py | 8 +++++++-
 CEP/Pipeline/recipes/sip/tasks.cfg.in            | 1 +
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/CEP/Pipeline/recipes/sip/master/long_baseline.py b/CEP/Pipeline/recipes/sip/master/long_baseline.py
index a680cbcb13b..4d9f5b7ee75 100644
--- a/CEP/Pipeline/recipes/sip/master/long_baseline.py
+++ b/CEP/Pipeline/recipes/sip/master/long_baseline.py
@@ -45,6 +45,12 @@ class long_baseline(BaseRecipe, RemoteCommandRecipeMixIn):
     """
 
     inputs = {
+        'nproc': ingredient.IntField(
+            '--nproc',
+            default=1,   # More then one might cause issues when ndppp shares 
+                         # temp files between runs
+            help="Maximum number of simultaneous processes per output node"
+        ),
         'ndppp_exec': ingredient.ExecField(
             '--ndppp-exec',
             help="The full path to the ndppp executable"
@@ -202,7 +208,7 @@ class long_baseline(BaseRecipe, RemoteCommandRecipeMixIn):
             jobs.append(ComputeJob(output_item.host, node_command, arguments))
 
         # Hand over the job(s) to the pipeline scheduler
-        self._schedule_jobs(jobs)
+        self._schedule_jobs(jobs, max_per_node=self.inputs['nproc'])
 
         # *********************************************************************
         # validate the output, cleanup, return output
diff --git a/CEP/Pipeline/recipes/sip/tasks.cfg.in b/CEP/Pipeline/recipes/sip/tasks.cfg.in
index 0b93bbbbb20..9bcac447a89 100644
--- a/CEP/Pipeline/recipes/sip/tasks.cfg.in
+++ b/CEP/Pipeline/recipes/sip/tasks.cfg.in
@@ -70,6 +70,7 @@ asciistat_executable = %(lofarroot)s/bin/asciistats.py
 statplot_executable = %(lofarroot)s/bin/statsplot.py
 msselect_executable = %(lofarroot)s/bin/msselect
 rficonsole_executable = %(lofarroot)s/bin/rficonsole
+nproc = 1
 
 [imager_awimager]
 recipe = imager_awimager
-- 
GitLab