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

two platforms where the system is used are added here

parent 180b6ef9
Branches
No related tags found
No related merge requests found
#!/usr/bin/env python
# jet.py
"""
Author : peters
Revision History:
File created on 06 Sep 2010.
"""
import os
import sys
import subprocess
import logging
from da.baseclasses.jobcontrol import PlatForm
class JetPlatForm(PlatForm):
def __init__(self):
self.Identifier = 'NOAA jet' # the identifier gives the platform name
self.Version = '1.0' # the platform version used
print self
def GetJobTemplate(self,joboptions={}):
""" Return the job template for a given computing system, and fill it with options from the dictionary provided as argument"""
template = """## \n"""+ \
"""## This is a set of dummy names, to be replaced by values from the dictionary \n"""+ \
"""## Please make your own platform specific template with your own keys and place it in a subfolder of the da package.\n """+ \
"""## \n"""+ \
""" \n"""+ \
"""#$ jobname \n"""+ \
"""#$ jobaccount \n"""+ \
"""#$ jobnodes \n"""+ \
"""#$ jobtime \n"""+ \
"""#$ jobshell \n """+ \
"""\n """
for k,v in joboptions.iteritems():
while k in template:
template = template.replace(k,v)
return template
def SubmitJob(self,jobfile):
""" This method submits a jobfile to the queue, and returns the queue ID """
cmd = ['qsub',jobfile]
output = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0] ; logging.info(output)
jobid = output.split()[2]
return jobid
def KillJob(self,jobid):
""" This method kills a running job """
output = subprocess.Popen(['qdel',jobid], stdout=subprocess.PIPE).communicate()[0] ; logging.info(output)
return output
def StatJob(self,jobid):
""" This method gets the status of a running job """
import subprocess
output = subprocess.Popen(['qstat',jobid], stdout=subprocess.PIPE).communicate()[0] ; logging.info(output)
return output
if __name__ == "__main__":
pass
#!/usr/bin/env python
# maunaloa.py
"""
Author : peters
Revision History:
File created on 06 Sep 2010.
"""
if __name__ == "__main__":
pass
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment