Copernicus  2.0
 All Classes Namespaces Files Functions Variables
cpc.command.runvars.RunVars Class Reference
Inheritance diagram for cpc.command.runvars.RunVars:

Public Member Functions

def add
 
def addRunVars
 
def expandStr
 

Public Attributes

 vars
 

Detailed Description

The run variables are a set of variables that are expanded on the
   command line of executables. They are defined by the worker or 
   by the platform plugin.
   The worker then calls the expandStr() method to expand all the 
   variables in the string iteratively. For example:

   runvars=RunVars()
   runvars.add("NCORES", 10)
   runvars.add("RUN_DIR", "/home/bla")
   runvars.add("NTCMD", "-nt $NCORES")
   cmdstring_in="mdrun $NTCMD -multidir ${RUN_DIR}"
   cmdstirng_out=runvars.expandStr(cmdstring_in)
   
   cmdstring_out will then read:
   mdrun -nt 10 -multidir /home/bla.

Member Function Documentation

def cpc.command.runvars.RunVars.add (   self,
  name,
  value 
)
Add a variable with name and value
def cpc.command.runvars.RunVars.addRunVars (   self,
  other 
)
Add all variables from another RunVars object.
   other = a runvars object
def cpc.command.runvars.RunVars.expandStr (   self,
  str 
)
Expand all variables in this string iteratively.
   str = the string to expand
   returns: the expanded string.

Member Data Documentation

cpc.command.runvars.RunVars.vars

The documentation for this class was generated from the following file: