def getSubprocessArguments(self, env, port, subprocessName="RunJob"): """ Argument list needed to launch the subprocess by the pilot/Monitor """ # The pilot/Monitor is forking a subprocess which will be monitored for work dir size, hanging processes etc # This method returns the arguments needed to execute the subprocess (python <subprocess name> <arguments>) # By default the pilot has implementations for RunJob.py (standard job) and RunJobEvent.py (event server job) # If a new subprocess module is added, it startup arguments need to be specified here jobargs = None tolog("Will set up subprocess arguments for type: %s" % (subprocessName)) url = '%s:%s/server/panda' % (env['pshttpurl'], str(env['psport'])) if subprocessName == "RunJobEvent": jobargs = [env['pyexe'], "RunJobEvent.py", "-a", env['thisSite'].appdir, "-b", env['queuename'], "-d", env['jobDic']["prod"][1].workdir, "-g", env['inputDir'], "-i", env['jobDic']["prod"][1].tarFileGuid, "-k", getPilotlogFilename(), "-l", env['pilot_initdir'], "-m", env['outputDir'], "-o", env['thisSite'].workdir, "-p", str(port), "-s", env['thisSite'].sitename, "-t", str(env['proxycheckFlag']), "-x", str(env['stageinretry']), "-E", str(env['stageoutretry']), "-F", env['experiment'], "-H", env['cache'], "-W", url] else: jobargs = [env['pyexe'], "%s.py" % (subprocessName), "-a", env['thisSite'].appdir, "-b", env['queuename'], "-d", env['jobDic']["prod"][1].workdir, "-g", env['inputDir'], "-i", env['jobDic']["prod"][1].tarFileGuid, "-k", getPilotlogFilename(), "-l", env['pilot_initdir'], "-m", env['outputDir'], "-o", env['thisSite'].workdir, "-p", str(port), "-s", env['thisSite'].sitename, "-t", str(env['proxycheckFlag']), "-x", str(env['stageinretry']), "-E", str(env['stageoutretry']), "-F", env['experiment'], "-H", env['cache'], "-W", url] if 'yodaNodes' in env and subprocessName == "RunJobHpcEvent": jobargs.append("-N") jobargs.append(str(env['yodaNodes'])) if 'yodaQueue' in env and subprocessName == "RunJobHpcEvent": jobargs.append("-Q") jobargs.append(str(env['yodaQueue'])) tolog("Will use arguments: %s" % str(jobargs)) return jobargs
def __enter__(self): global log_useful self.__old_name = pUtil.getPilotlogFilename() if not self.__name or self.__name == self.__old_name: self.same = True else: log("Staging up log file, new log file is %s" % self.__name) self.__global_old = os.path.abspath(self.__old_name) self.__global = os.path.abspath(self.__name) pUtil.setPilotlogFilename(self.__global) self.__old_useful = log_useful log_useful = False return self
def getSubprocessArguments(self, env, port, subprocessName="RunJob"): """ Argument list needed to launch the subprocess by the pilot/Monitor """ # The pilot/Monitor is forking a subprocess which will be monitored for work dir size, hanging processes etc # This method returns the arguments needed to execute the subprocess (python <subprocess name> <arguments>) # By default the pilot has implementations for RunJob.py (standard job) and RunJobEvent.py (event server job) # If a new subprocess module is added, it startup arguments need to be specified here jobargs = None tolog("Will set up subprocess arguments for type: %s" % (subprocessName)) if subprocessName == "RunJobEvent": jobargs = [ env["pyexe"], "RunJobEvent.py", "-a", env["thisSite"].appdir, "-b", env["queuename"], "-d", env["jobDic"]["prod"][1].workdir, "-g", env["inputDir"], "-i", env["jobDic"]["prod"][1].tarFileGuid, "-k", getPilotlogFilename(), "-l", env["pilot_initdir"], "-m", env["outputDir"], "-o", env["thisSite"].workdir, "-p", str(port), "-s", env["thisSite"].sitename, "-t", str(env["proxycheckFlag"]), "-x", str(env["stageinretry"]), "-E", str(env["stageoutretry"]), "-F", env["experiment"], "-H", env["cache"], ] else: jobargs = [ env["pyexe"], "%s.py" % (subprocessName), "-a", env["thisSite"].appdir, "-b", env["queuename"], "-d", env["jobDic"]["prod"][1].workdir, "-g", env["inputDir"], "-i", env["jobDic"]["prod"][1].tarFileGuid, "-k", getPilotlogFilename(), "-l", env["pilot_initdir"], "-m", env["outputDir"], "-o", env["thisSite"].workdir, "-p", str(port), "-s", env["thisSite"].sitename, "-t", str(env["proxycheckFlag"]), "-x", str(env["stageinretry"]), "-E", str(env["stageoutretry"]), "-F", env["experiment"], "-H", env["cache"], ] tolog("Will use arguments: %s" % str(jobargs)) return jobargs