def __init__(self, options, memNeeded = None):
        # better: self.options = options ... ?
        # TODO the additional argument `mem` represents the
        # server's estimate of the amount of memory
        # an executor may need to run available jobs
        # -- perhaps options.mem should be renamed
        # options.max_mem since this represents a per-node
        # limit (or at least a per-executor limit)
        logger.debug("memNeeded: %s", memNeeded)
        self.mem = memNeeded or options.mem
        logger.debug("self.mem = %0.2fG", self.mem)
        if self.mem > options.mem:
            raise InsufficientResources("executor requesting %.2fG memory but maximum is %.2fG" % (options.mem, self.mem))
        self.procs = options.proc
        self.ppn = options.ppn
        self.pe  = options.pe
        self.mem_request_variable = options.mem_request_variable
        self.queue_type = options.queue_type
        self.queue_name = options.queue_name
        self.queue_opts = options.queue_opts
        self.ns = options.use_ns
        self.uri_file = options.urifile
        if self.uri_file is None:
            self.uri_file = os.path.abspath(os.path.join(os.curdir, options.pipeline_name + "_uri"))
        # the next variable is used to keep track of how long the
        # executor has been continuously idle/sleeping for. Measured
        # in seconds
        self.idle_time = 0
        self.prev_time = None
        self.current_time = None
        # the maximum number of minutes an executor can be continuously
        # idle for, before it has to kill itself.
        self.time_to_seppuku = options.time_to_seppuku
        # the time in minutes after which an executor will not accept new jobs
        self.time_to_accept_jobs = options.time_to_accept_jobs
        # stores the time of connection with the server
        self.connection_time_with_server = None
        #initialize runningMem and Procs
        self.runningMem = 0.0
        self.runningProcs = 0   
        self.runningChildren = [] # no scissors (i.e. children should not run around with sharp objects...)
        self.pool = None
        self.pyro_proxy_for_server = None
        self.clientURI = None
        self.serverURI = None
        self.current_running_job_pids = []
        self.registered_with_server = False
        self.heartbeat_thread_crashed = False
        # we associate an event with each executor which is set when jobs complete.
        # in the future it might also be set by the server, and we might have more
        # than one event (for reclaiming, server messages, ...)
        self.e = threading.Event()
dataset/ETHPy150Open Mouse-Imaging-Centre/pydpiper/pydpiper/pipeline_executor.py/pipelineExecutor.__init__/original