Skip to content
Snippets Groups Projects
Commit 4be68deb authored by Peters, Wouter's avatar Peters, Wouter
Browse files

updated platform for interactive runs

parent 8228d2b1
No related branches found
No related tags found
No related merge requests found
...@@ -65,15 +65,14 @@ class PlatForm(object): ...@@ -65,15 +65,14 @@ class PlatForm(object):
return os.environ['JOB_ID'] return os.environ['JOB_ID']
def UnsuspendCommand(self): def UnsuspendCommand(self):
return 'qmod -usj %s'%(self.GetMyID()) """ Provide shell command to resume this job, or nothing if there is no suspension of the current job while a child process executes """
return 'exit 0'
def SuspendJob(self): def SuspendJob(self):
""" Method suspends the running job""" """ Method suspends the running job"""
cmd = ['qmod','-sj',self.GetMyID()] return None
output = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0] ; logging.info(output)
def WriteJob(self,DaCycle,template, jobid): def WriteJob(self,DaCycle,template, jobid):
""" This method writes a jobfile to the exec dir""" """ This method writes a jobfile to the exec dir"""
...@@ -96,17 +95,17 @@ class PlatForm(object): ...@@ -96,17 +95,17 @@ class PlatForm(object):
""" This method submits a jobfile to the queue, and returns the queue ID """ """ This method submits a jobfile to the queue, and returns the queue ID """
cmd = ['sh',jobfile] cmd = ['sh',jobfile]
msg = "A new job will be submitted (%s)\n\n\n"%cmd ; logging.debug(msg) msg = "A new task will be started (%s)\n\n\n"%cmd ; logging.debug(msg)
jobid = subprocess.call(cmd) process = subprocess.Popen(cmd)
jobid = subprocess.Popen(cmd).pid
dummy = subprocess.Popen(cmd).wait()
return jobid return jobid
def KillJob(self,jobid): def KillJob(self,jobid):
""" This method kills a running job """ """ This method kills a running job """
output = subprocess.Popen(['qdel',jobid], stdout=subprocess.PIPE).communicate()[0] ; logging.info(output) return None
return output
def StatJob(self,jobid): def StatJob(self,jobid):
""" This method gets the status of a running job """ """ This method gets the status of a running job """
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment