pygcam.mcs.master

API

Code author: Rich Plevin <rich@plevin.com>

pygcam.mcs.master.pidFileExists(profile, clusterId)

Check if a process-id (pid) file exists for this profile and clusterId.

Parameters:
  • profile – (str) profile name
  • clusterId – (str) cluster ID
Returns:

(bool) True if computed pid file pathname exists, else False

pygcam.mcs.master.startCluster(**kwargs)

Start an ipyparallel cluster to run numTrials, using the given profile and cluster_id, if specified, otherwise using values of config vars IPP.Profile and IPP.ClusterId, respectively. Writes out a template batch file for use with either SLURM or PBS, depending on settings in the user’s .pygcam.cfg, which is then used by the ipcluster command when launching the controller and engines. If the number of trials to run (numTrials) is greater than the value of config variable IPP.MaxEngines, this max number of engines is run but the time limit per engine is increased to allow engine each to run the required number of tasks.

Parameters:
  • clusterId – (str) an id string for the new cluster
  • numTrials – (int) the number of GCAM trials to run
  • otherArgs – (str) other arguments appended to the ipcluster command-line
  • profile – (str) the ipython profile to use
  • workDir – (str) a directory to change to before starting the cluster
Returns:

(int) exit status from the ipcluster command (zero => success)

pygcam.mcs.master.startEngines(numTrials, batchTemplate)

Uses the batch file created when the cluster was started, so it has the profile, cluster-id, and ntasks-per-node already set.