Progress Reporting

Two new classes have been introduced into MULASSIS, GRAS and SSAT to generate and update during a run a standard format progress file. The file provides the following information:

  • Number of events completed.

  • Target number of events, defined by the /run/beamOn command argument.

  • Percentage complete.

  • The application name [“MULASSIS”, “GRAS”, or “SSAT”].

  • Process ID of the application.

  • Amount of CPU seconds spent executing the run.

  • Run status [“INACTIVE”, “ACTIVE”, “KILLED”].

  • Date and time when the above information was generated.

The file formats of the output are JSON and standard text; the former is more compatible with applications, such as Python-based scripts, and the latter is more human-readable. The classes form part of the g4apps-common SVN repository, which are incorporated into MULASSIS during code checkout from SVN.

The classes from g4apps-common that are implemented include:
  • GSAppsProgressControl: This static class interacts with the Geant4 simulation at BeginOfRunAction, EndOfEventAction and EndofRunAction levels to update the progress report file. This class interacts with GSAppsProgressControlMessenger to provide user control of the progress file output.

  • GSAppsProgressControlMessenger: This class is derived from G4UImessenger and provides the user command line interface (CLI) to control the target event values and frequency with which the progress file is updated.

Included within the MULASSIS distribution are four test cases that demonstrate the generation of a progress report output file and the macro commands to control the way the file is generated. These test cases can be found in the directory test/progress_control.

The /run/progressControl macro commands specified in the Progress Control Commands table summarises the relevant macro commands, but if none of these commands are used then by default MULASSIS creates a JSON file with the name MULASSIS_commout.json for interactive sessions or <MACRO_PREFIX>_commout.json for batch sessions at the start of the run and then updates the file at the end of:

  • each batch of events simulated by the Monte Carlo run, or

  • at the end of the non-MC run.

The information included in the progress report file includes the Geant4 application name (i.e., “MULASSIS”), the date and time the file was updated, the number of processes involved in the run, the process ID (PID), CPU time and status of the process, which can be:

  • “INACTIVE”: the MULASSIS application is running and MC run or runs are about to start or are complete.

  • “ACTIVE”: a MC or non-MC run is ongoing.

  • “KILLED”: the process status is set to “KILLED” just before the MULASSIS application is terminated.

The progress control file is named accordingly (file extension depends on output type):

  • interactive session: MULASSIS_commout.json

  • batch file session: <MACRO_PREFIX>_commout.json, e.g. % mulassis test.g4mac will produce test_commout.json.

  • expliclity set via /run/progressControl/filePrefix <PREFIX>, e.g. /run/progressControl/filePrefix Testing will produce Testing_commout.json.

Example commout Files

JSON ProgressCntlTest_01_commout.json

{
  "Geant4RunProgress"     : {
    "Application"         : "MULASSIS",
    "Date"                : "2023-12-07 10:05:06",
    "Processes"           : [
      {
        "PID"             : 446931,
        "ProcessTime"     : 2.11,
        "Status"          : "KILLED"
      }
    ],
    "TargetValue"         : [ 10000],
    "CurrentValue"        : [ 10000],
    "PercentageComplete"  : 100
  }
}

Text ProgressCntlTest_02_commout.txt

===================
Geant4 Run Progress
===================

Application         : MULASSIS
Date                : 2023-12-07 10:06:58
Number of Processes : 1

     PID        Process Time      Status
----------------------------------------
  447145                3.98      KILLED
----------------------------------------

Number of runs      : 3
Target Value(s)     :  10000  20000  15000
Current Value(s)    :  10000  20000  15000
Percentage Complete : 100

Mulassis/ml-v02-00/r342