zorroSkulkManager.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:zorro 作者: C-CINA 项目源码 文件源码
def __init__(self, hostname, workerFunction, messageQueue, 
                 n_threads = None, cachepath = None, qsubHeader=None ):
        """
        def __init__(self, hostname, workerFunction, messageQueue, 
                 n_threads = None, cachepath = None, qsubHeader=None )

        hostName is any string that ID's the host uniquely

        workerFunction is one of ['local','qsub', 'rsync', 'archive'], reflecting what the host should do.

        messageQueue is the message queue from the skulkManager

        n_threads is the number of p-threads to use for the job.

        qsubHeader is a text file that contains everything but the qsub line for a .bash script.
        """
        # In case I need to re-factor to have a seperate thread for each host
        #QtCore.QThread.__init__(self)
        # self.sleepTime = 1.0

        self.hostName = hostname
        self.messageQueue = messageQueue
        self.zorroState = None
        self.submitName = None

        # CANNOT get an instantiated object here so we cannot pass in bound function handles directly, so 
        # we have to use strings instead.
        if workerFunction == 'local':
            self.workerFunction = self.submitLocalJob
        elif workerFunction == 'dummy':
            self.workerFunction = self.submitDummyJob
        elif workerFunction == 'qsub':
            self.workerFunction = self.submitQsubJob
        elif workerFunction == 'rsync':
            self.workerFunction = self.submitRsyncJob
        elif workerFunction == 'archive':
            self.workerFunction = self.submitArchiveJob
        else:
            self.workerFunction = workerFunction

        self.subprocess = None
        self.n_threads = n_threads
        self.cachePath = cachepath
        self.qsubHeaderFile = qsubHeader
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号