The SKIRT project
advanced radiative transfer for astrophysics
Public Member Functions | Private Attributes | List of all members
pts.simulation.skirt.Skirt Class Reference

An instance of the Skirt class represents a particular SKIRT executable, and allows invoking it with given command line arguments for execution on the local host. More...

Public Member Functions

def __init__ (self, path=None)
 The constructor accepts an optional argument specifying the file path to the SKIRT executable to be used. More...
 
def execute (self, skiFilePath, *inDirPath="", outDirPath="", skiRelative=False, numThreadsPerProcess=0, numProcesses=1, verbose=False, wait=True, console='regular')
 This function invokes the SKIRT executable with the simulation and command line options corresponding to the values of the function arguments, as described below. More...
 
def isRunning (self)
 This function returns True if the simulation started with the most recent call to the execute() function is still running, and False otherwise. More...
 
def path (self)
 This function returns the absolute file path of the SKIRT executable used by this instance. More...
 
def version (self)
 This function returns a string with version information on the SKIRT executable represented by this object. More...
 

Private Attributes

 _path
 
 _process
 

Detailed Description

An instance of the Skirt class represents a particular SKIRT executable, and allows invoking it with given command line arguments for execution on the local host.

Constructor & Destructor Documentation

◆ __init__()

def pts.simulation.skirt.Skirt.__init__ (   self,
  path = None 
)

The constructor accepts an optional argument specifying the file path to the SKIRT executable to be used.

If the path is specified, it should include the "skirt" filename of the executable. Otherwise the path is interpreted as described for the pts.utils.absPath() function. If the path is not specified, the constructor looks for a SKIRT executable in the project structure including this PTS source file, assuming that SKIRT is built under a ~/SKIRT9 or SKIRT directory residing next to the PTS9 or PTS directory.

Member Function Documentation

◆ execute()

def pts.simulation.skirt.Skirt.execute (   self,
  skiFilePath,
inDirPath = "",
  outDirPath = "",
  skiRelative = False,
  numThreadsPerProcess = 0,
  numProcesses = 1,
  verbose = False,
  wait = True,
  console = 'regular' 
)

This function invokes the SKIRT executable with the simulation and command line options corresponding to the values of the function arguments, as described below.

The function returns a pts.simulation.simulation.Simulation instance corresponding to the simulation being performed (or attempted, in case of failure). The function supports asynchronous execution, allowing the caller to perform other tasks while the simulation is running.

  • skiFilePath: the file path for the configuration file (ski file) to be executed, interpreted as as described for the pts.utils.absPath() function.
  • inDirPath: a string specifying the absolute or relative directory path for simulation input files.
  • outDirPath: a string specifying the absolute or relative directory path for simulation output files.
  • skiRelative: if True, the simulation input/output directory paths are relative to the directory of the ski file being executed; if False or missing, they are relative to the current directory.
  • numThreadsPerProcess: a positive integer specifying the number of parallel threads per process for the simulation. If zero or missing the number of logical cores on the host computer is used.
  • numProcesses: a positive integer specifying the number of parallel MPI processes to be launched, or a string indicating that the number of processes and other aspects of the MPI configuration should be obtained at run time from the corresponding multi-node batch queueing system. Supported string values include 'lsf' for the LSF queueing system and 'srun' for the SLURM queueing system. If the option is missing or has a value of zero or one, MPI is not used and just a single SKIRT process is launched.
  • verbose: this option has effect only if the number of processes is larger than one. If set to True, each process creates its own complete log file. If missing or set to False, only the root process creates a full log file, and the other processes only create a log file when there are errors or warnings.
  • wait: if True or missing, the function waits until SKIRT execution completes; if False the function returns immediately after launching SKIRT without waiting for it.
  • console: a string controlling console logging in synchronous execution mode: 'regular' means all SKIRT messages are logged to the console; 'brief' means only summary messages are logged to the console, and 'silent' means no SKIRT messages are logged to the console. If wait is True or missing, the default logging mode is 'regular'. If wait is False, the logging mode is always 'silent'.

◆ isRunning()

def pts.simulation.skirt.Skirt.isRunning (   self)

This function returns True if the simulation started with the most recent call to the execute() function is still running, and False otherwise.

◆ path()

def pts.simulation.skirt.Skirt.path (   self)

This function returns the absolute file path of the SKIRT executable used by this instance.

◆ version()

def pts.simulation.skirt.Skirt.version (   self)

This function returns a string with version information on the SKIRT executable represented by this object.

The function invokes SKIRT with an incorrect command line argument to obtain this information.


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