示例#1
0
    def __init__(
        self,
        job=Null(),
        channel=None,
        name="",
        intensive=True,
        remote_path="",
        runscript_fn="run.sh",
        host=None,
        nproc=1,
        nnode=1,
        node_list=[],
    ):

        self.initialize()

        self._job = job
        if self._job:
            self.reload_job()
        else:
            self.__channel = channel
            self.__name = name
            self.__remote_path = remote_path
            self.__runscript_fn = runscript_fn
            self.__intensive = intensive

        c = Config()

        self._nproc = nproc
        self._nnode = nnode
        self._node_list = node_list
        if host:
            self.__host = host
        else:
            self.__host = c.get_common()["location"]["default"]
        self.__id = None

        host_config = c.get_common()["location"][self.__host]
        self.__init_file = host_config["init_file"]
        self.__mpi_command = host_config["mpi_command"]

        # lsf commands
        self.__rerun_command = "bresume "
        self.__stop_command = "bstop "
        self.__cancel_command = "bkill "
        self.__submit_template = "bsub -o jms.log -J {jobname} -n {nproc}"
示例#2
0
    def __init__(self, job=Null(), channel=None, name='', intensive=True,
                 remote_path='', runscript_fn='run.sh', host=None,
                 nproc=1, nnode=1, node_list=[]):

        self.initialize()

        self._job = job
        if self._job:
            self.reload_job()
        else:
            self.__channel      = channel
            self.__name         = name
            self.__remote_path  = remote_path
            self.__runscript_fn = runscript_fn
            self.__intensive    = intensive

        c = Config()

        self._nproc     = nproc
        self._nnode     = nnode
        self._node_list = node_list
        if host:
            self.__host = host
        else:
            self.__host = c.get_common()['location']['default']
        self.__id = None

        host_config = c.get_common()['location'][self.__host]
        self.__init_file   = host_config['init_file']
        self.__mpi_command = host_config['mpi_command']

        # lsf commands
        self.__rerun_command  = 'bresume '
        self.__stop_command   = 'bstop '
        self.__cancel_command = 'bkill ' 
        self.__submit_template = (
            'bsub -o jms.log -J {jobname} -n {nproc}'
        )