Commit 528eedbe authored by Ingrid Luijkx's avatar Ingrid Luijkx
Browse files

Added platform file for capegrim server

parent 3907b86e
#!/usr/bin/env python
Author : peters
Revision History:
File created on 06 Sep 2010.
import sys
import os
import logging
import subprocess
from da.baseclasses.platform import PlatForm, std_joboptions
class CapeGrimPlatForm(PlatForm):
def __init__(self):
self.Identifier = 'WU capegrim' # the identifier gives the platform name
self.Version = '1.0' # the platform version used
def ReturnBlockingFlag(self):
return ""
def ReturnQueueType(self):
return "foreground"
def get_job_template(self,joboptions={},block=False):
Returns the job template for a given computing system, and fill it with options from the dictionary provided as argument.
The job template should return the preamble of a job that can be submitted to a queue on your platform,
examples of popular queuing systems are:
- XGrid
A list of job options can be passed through a dictionary, which are then filled in on the proper line,
an example is for instance passing the dictionary {'account':'co2'} which will be placed
after the ``-A`` flag in a ``qsub`` environment.
An extra option ``block`` has been added that allows the job template to be configured to block the current
job until the submitted job in this template has been completed fully.
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"""+ \
"""source /usr/local/Modules/3.2.8/init/sh\n"""+ \
"""module load python\n"""+ \
if 'depends' in joboptions:
template += """#$ -hold_jid depends \n"""
# First replace from passed dictionary
for k,v in joboptions.iteritems():
while k in template:
template = template.replace(k,v)
# Fill remaining values with std_options
for k,v in std_joboptions.iteritems():
while k in template:
template = template.replace(k,v)
return template
msg1 = 'Platform initialized: %s'%self.Identifier ;
#msg2 = '%s version: %s'%(self.Identifier,self.Version) ;
if __name__ == "__main__":
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment