Compilation and Usage#
Compilation#
ChemNetworks requires CMake >= 3.18 and GCC >= 13.1. The igraph library is fetched automatically from GitHub during configuration. To build, create a build directory, configure with CMake, then compile:
By default, CMake searches for an MPI installation and links against it if found.
Build Types#
The build type controls optimization level and debug symbol generation. Pass -DCMAKE_BUILD_TYPE=<type> during
configuration.
Release: compiles with-O3. The default setting, recommended for production use.Debug: compiles with-O0 -pg -ggdb3and enables theDEBUG_BUILDpreprocessor definition.
Disabling MPI#
To force a serial-only build and skip MPI detection entirely, pass -DSERIAL=ON:
Running ChemNetworks#
ChemNetworks requires an input file specified with the -i flag:
When compiled with MPI support, multiple processes can be launched with mpirun:
Options#
-i <file>, specify the input file. Required.-h, display usage information and exit.-v, enable verbose (debug) logging. Cannot be used with-q.-q, enable quiet logging, suppressing all non-critical output. Cannot be used with-v.
MPI Parallelization#
When running with MPI, timesteps are distributed across ranks using round-robin assignment. Each rank independently processes its assigned timesteps and writes the corresponding output files. Because each timestep is self-contained, results are deterministic and identical regardless of the number of MPI processes used.
For example, with 4 ranks and timesteps 0 through 9, rank 0 processes timesteps 0, 4, and 8; rank 1 processes 1, 5,
and 9; and so on. All ranks read from the same input file and trajectory, but each writes only its own timestep
output files (e.g. rank 0 writes edges.0.edg, edges.4.edg, edges.8.edg).
While the timesteps themselves are deterministic, the total output order may not be deterministic, dependent on many
factors. In the previous example, the timestep completion can vary, for example: 0, 3, 1, 2, 4, 7, 5, 6, 8, 9. This has no effect
on the correctness of the results, but may cause the log to appear out of order.