Commit 36e4b0bf authored by Jerome Mariette's avatar Jerome Mariette
Browse files

give the component the batch options it can use

parent c5822f8e
......@@ -16,6 +16,7 @@
import os
import re
import sys
import inspect
import tempfile
......@@ -49,6 +50,19 @@ class Component(object):
if isinstance(self.version, bytes):
self.version = self.version.decode()
self.batch_options = self.config_reader.get_component_batch_options(self.__class__.__name__)
# in case of SGE, parse the cpu and memory parameter
type, options, limit_submission = self.jflow_config_reader.get_batch()
if type.lower() == "sge":
self.__cpu = int(re.match( r'.*-pe\s+(\w+)\s+(\d+)\s?.*', self.batch_options).group(2))
self.__memory = int(re.match( r'.*-l\s+mem=(\d+\S+)\s?.*', self.batch_options))
except: pass
def get_cpu(self):
return self.__cpu
def get_memory(self):
return self.__memory
def is_dynamic(self):
return len(self.get_dynamic_outputs()) != 0
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment