All Projects → HSF → prmon

HSF / prmon

Licence: Apache-2.0 license
Standalone monitor for process resource consumption

Programming Languages

C++
36643 projects - #6 most used programming language
python
139335 projects - #7 most used programming language
CMake
9771 projects
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to prmon

mmtf-spark
Methods for the parallel and distributed analysis and mining of the Protein Data Bank using MMTF and Apache Spark.
Stars: ✭ 20 (-45.95%)
Mutual labels:  scientific-computing
Corpuscles.jl
Julia package for particle physics
Stars: ✭ 25 (-32.43%)
Mutual labels:  high-energy-physics
SciLean
Scientific computing in Lean 4
Stars: ✭ 86 (+132.43%)
Mutual labels:  scientific-computing
Benzina
Benzina is an image-loader package that greatly accelerates image loading onto GPUs using their built-in hardware codecs.
Stars: ✭ 36 (-2.7%)
Mutual labels:  scientific-computing
yt astro analysis
yt astrophysical analysis modules
Stars: ✭ 18 (-51.35%)
Mutual labels:  scientific-computing
Statistics-Notes
Personal notes on statistics with a focus on applications to experimental high energy physics
Stars: ✭ 19 (-48.65%)
Mutual labels:  high-energy-physics
axle
Axle Domain Specific Language for Scientific Cloud Computing and Visualization
Stars: ✭ 65 (+75.68%)
Mutual labels:  scientific-computing
bandicoot-code
Bandicoot: GPU accelerator add-on for the Armadillo C++ linear algebra library
Stars: ✭ 21 (-43.24%)
Mutual labels:  scientific-computing
sunrise
NumPy, SciPy, MRI and Music | Presented at ISMRM 2021 Sunrise Educational Session
Stars: ✭ 20 (-45.95%)
Mutual labels:  scientific-computing
getfem
Mirror of GetFEM repository
Stars: ✭ 23 (-37.84%)
Mutual labels:  scientific-computing
hiperc
High Performance Computing Strategies for Boundary Value Problems
Stars: ✭ 36 (-2.7%)
Mutual labels:  scientific-computing
ForTrilinos
ForTrilinos provides portable object-oriented Fortran interfaces to Trilinos C++ packages.
Stars: ✭ 24 (-35.14%)
Mutual labels:  scientific-computing
Julia-data-science
Data science and numerical computing with Julia
Stars: ✭ 54 (+45.95%)
Mutual labels:  scientific-computing
Prevent Process Creation
Record & prevent process creation in kernel mode
Stars: ✭ 31 (-16.22%)
Mutual labels:  process-monitor
thread-pool
BS::thread_pool: a fast, lightweight, and easy-to-use C++17 thread pool library
Stars: ✭ 1,043 (+2718.92%)
Mutual labels:  scientific-computing
NAGPythonExamples
Examples and demos showing how to call functions from the NAG Library for Python
Stars: ✭ 46 (+24.32%)
Mutual labels:  scientific-computing
jigsaw-matlab
MATLAB bindings for JIGSAW: a Delaunay-based unstructured mesh generator.
Stars: ✭ 57 (+54.05%)
Mutual labels:  scientific-computing
adorad
Fast, Expressive, & High-Performance Programming Language for those who dare
Stars: ✭ 54 (+45.95%)
Mutual labels:  scientific-computing
OpFlow
EDSL for PDE solver composing
Stars: ✭ 46 (+24.32%)
Mutual labels:  scientific-computing
sparse
Sparse matrix formats for linear algebra supporting scientific and machine learning applications
Stars: ✭ 136 (+267.57%)
Mutual labels:  scientific-computing

Process Monitor (prmon)

Build Status License Codefactor

DOI

The PRocess MONitor is a small stand alone program that can monitor the resource consumption of a process and its children. This is useful in the context of the WLCG/HSF working group to evaluate the costs and performance of HEP workflows in WLCG. In a previous incarnation (MemoryMonitor) it has been used by ATLAS for some time to gather data on resource consumption by production jobs. One of its most useful features is to use smaps to correctly calculate the Proportional Set Size in the group of processes monitored, which is a much better indication of the true memory consumption of a group of processes where children share many pages.

prmon currently runs on Linux machines as it requires access to the /proc interface to process statistics.

Build and Deployment

Cloning the project

As prmon has dependencies on submodules, clone the project as

git clone --recurse-submodules https://github.com/HSF/prmon.git

Building the project

Building prmon requires a C++ compiler that fully supports C++11, and CMake version 3.3 or higher. It also has dependencies on:

and can use either external system-supplied versions or internal copies provided by submodules.

Building is usually as simple as:

mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=<installdir> <path to sources>
make -j<number of cores on your machine>
make install

Unless otherwise specified, the default behavior for dependencies is to first try to find an external version and fall back to the internal submodule copy if not found. To explicitly force the use of either add any of the following configure options:

  • -DUSE_EXTERNAL_NLOHMANN_JSON={TRUE,FALSE,AUTO}
    • ON, TRUE: Force an external version and fail if not found.
    • OFF, FALSE: Require the internal copy be used.
    • AUTO: Search for an external version and fall back to the internal copy if not found.
  • -Dnlohmann_json_DIR=/path/to/config
    • The path to the directory containing nlohmann_jsonConfig.cmake. Necessary if nlohmann_json is not installed into CMake's search path.
  • -DUSE_EXTERNAL_SPDLOG={TRUE,FALSE,AUTO}
    • ON, TRUE: Force an external version and fail if not found.
    • OFF, FALSE: Require the internal copy be used.
    • AUTO: Search for an external version and fall back to the internal copy if not found.
  • -Dspdlog_DIR=/path/to/config
    • The path to the directory containing spdlogConfig.cmake. Necessary if spdlog is not installed into CMake's search path.

The option -DCMAKE_BUILD_TYPE can switch between all of the standard build types. The default is Release; use RelWithDebInfo if you want debug symbols.

To build a statically linked version of prmon, set the BUILD_STATIC CMake variable to ON (e.g., adding -DBUILD_STATIC=ON to the command line).

Note that in a build environment with CVMFS available the C++ compiler and CMake can be taken by setting up a recent LCG release.

To enable pulling and building the gtest framework as well as tests dependent on gtest, build with -DBUILD_GTESTS=ON.

Creating a package with CPack

A cpack based package can be created by invoking

make package

Running the tests

To run the tests of the project, first build it and then invoke

make test

Running the tests requires Python version 3.6 or higher.

Running

The prmon binary is invoked with the following arguments:

prmon [--pid PPP] [--filename prmon.txt] [--json-summary prmon.json] \
      [--interval 30] [--suppress-hw-info] [--units] [--netdev DEV] \
      [--disable MON1] [--level LEV] [--level MON:LEV]\
      [-- prog arg arg ...]
  • --pid the 'mother' PID to monitor (all children in the same process tree are monitored as well)
  • --filename output file for time-stamped monitored values
  • --json-summmary output file for summary data written in JSON format
  • --interval time, in seconds, between monitoring snapshots
  • --suppress-hw-info flag that turns-off hardware information collection
  • --units add information on units for each metric to JSON file
  • --netdev restricts network statistics to one (or more) network devices
  • --disable is used to disable specific monitors (and can be specified multiple times); the default is that prmon monitors everything that it can
    • Note that the wallmon monitor is the only monitor that cannot be disabled
  • --level is used to set the logging level for monitors
    • --level LEV sets the level for all monitors to LEV
    • --level MON:LEV sets the level for monitor MON to LEV
    • The valid levels are trace, debug, info, warn, error, critical
  • -- after this argument the following arguments are treated as a program to invoke and remaining arguments are passed to it; prmon will then monitor this process instead of being given a PID via --pid

prmon will exit with 1 if there is a problem with inconsistent or incomplete arguments. If prmon starts a program itself (using --) then prmon will exit with the exit code of the child process.

When invoked with -h or --help usage information is printed, as well as a list of all available monitoring components.

Environment Variables

The PRMON_DISABLE_MONITOR environment variable can be used to specify a comma separated list of monitor names that will be disabled. This is useful when prmon is being invoked by some other part of a job or workflow, so the user does not have direct access to the command line options used. e.g.

export PRMON_DISABLE_MONITOR=nvidiamon
other_code_that_invokes_prmon
...

Disables the nvidiamon monitor.

Outputs

In the filename output file, plain text with statistics written every interval seconds are written. The first line gives the column names.

In the json-summary file values for the maximum and average statistics are given in JSON format. This file is rewritten every interval seconds with the current summary values. Use the --units option to see exactly which units are used for each metric (the value of 1 for a unit means it is a pure number).

Monitoring of CPU, I/O and memory is reliably accurate, at least to within the sampling time. Monitoring of network I/O is not reliable unless the monitored process is isolated from other processes performing network I/O (it gives an upper bound on the network activity, but the monitoring is per network device as Linux does not give per-process network data by default).

Visualisation

The prmon_plot.py script (Python3) can be used to plot the outputs of prmon from the timestamped output file (usually prmon.txt). Some examples include:

  • Memory usage as a function of wall-time:
prmon_plot.py --input prmon.txt --xvar wtime --yvar vmem,pss,rss,swap --yunit GB

  • Rate of change in memory usage as a function of wall-time:
prmon_plot.py --input prmon.txt --xvar wtime --yvar vmem,pss,rss,swap --diff --yunit MB

  • Rate of change in CPU usage as a function of wall-time with stacked user and system utilizations:
prmon_plot.py --input prmon.txt --xvar wtime --yvar utime,stime --yunit SEC --diff --stacked

The plots above, as well as the input prmon.txt file that is used to produce them, can be found under the example-plots folder.

The script allows the user to specify variables, their units, plotting style (stacked vs overlaid), as well as the format of the output image. Use -h for more information.

Data Compression

The prmon_compress_output.py script (Python3) can be used to compress the output file while keeping the most relevant information.

The compression algorithm works as follows:

  • For the number of processes, threads, and GPUs, only the measurements that are different with respect to the previous ones are kept.
  • For all other metrics, only the measurements that satisfy an interpolation condition are kept.

This latter condition can be summarized as:

  • For any three neighboring (and time-ordered) measurements, A, B, and C, B is deleted if the linear interpolation between A and C is consistent with B ± threshold. Otherwise, it's retained. The threshold can be configured via the --precision parameter (default: 0.05, i.e. 5%)

The time index of the final output will be the union of the algorithm outputs of the single time series. Each series will have NA values where a point was deleted at a kept index and, unless otherwise specified by the --skip-interpolate parameter, will be linearly interpolated to maintain a consistent number of data points and the result will be rounded to the nearest integer for consistency with the original input.

If the --skip-interpolate parameter is passed, deleted values will be written as empty strings in the output file, and will be interpreted as NA values when imported into Pandas.

Example:

prmon_compress_output.py --input prmon.txt --precision 0.3 --skip-interpolate

Feedback and Contributions

We're very happy to get feedback on prmon as well as suggestions for future development. Please have a look at our Contribution Guide.

Profiling

To build prmon with profiling, set one of the CMake variables PROFILE_GPROF or PROFILE_GPERFTOOLS to ON. This enables GNU prof profiling or gperftools profiling, respectively. If your gperftools are in a non-standard place, pass a hint to CMake using Gperftools_ROOT_DIR.

Copyright

Copyright (c) 2018-2022 CERN.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].