diff --git a/da/platform/jet.py b/da/platform/jet.py new file mode 100755 index 0000000000000000000000000000000000000000..43f6fac182bd0739cf747200166615919f33ead6 --- /dev/null +++ b/da/platform/jet.py @@ -0,0 +1,71 @@ +#!/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 diff --git a/da/platform/maunaloa.py b/da/platform/maunaloa.py new file mode 100755 index 0000000000000000000000000000000000000000..e5bab6bdb1344fc248a60dd1114e7a6297d761f5 --- /dev/null +++ b/da/platform/maunaloa.py @@ -0,0 +1,16 @@ +#!/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