fastiron/
lib.rs

1//! A Rust port of the Monte-Carlo particle transport proxy-app [Quicksilver][1].
2//!
3//! Fastiron mimics Monte-Carlo particle transport code to study their behavior on
4//! various hardware architectures. The aim of this port is to evaluate Rust's
5//! capabilities and performances in the context of parallel programming and
6//! scaling problem size.
7//!
8//! # Quickstart
9//!
10//! After cloning the [repository][2], fastiron can be executed like any other Rust
11//! program using cargo. Run the following:
12//! ```shell
13//! $ cargo build --release
14//! $ cargo run --bin=fastiron
15//! ```
16//!
17//! And see the CLI's usage:
18//! ```shell
19//! $ cargo run --bin=fastiron
20//!
21//! Fastiron, a Rust port of the Quicksilver proxy-app
22//!
23//! Usage: fastiron [OPTIONS]
24//!
25//! Options:
26//!   -i, --input-file <INPUT_FILE>
27//!           name of input file
28//!   -e, --energy-spectrum <ENERGY_SPECTRUM>
29//!           name of energy spectrum output file
30//!   -S, --cross-sections <CROSS_SECTIONS_OUT>
31//!           name of cross-section output file
32//!   -D, --dt <DT>
33//!           time step in seconds
34//!   -l, --load-balance
35//!           enable load balancing if present
36//!   -c, --csv
37//!           write tallies & timer data into csv files if present
38//!   -t, --debug-threads
39//!           enable thread debugging if present
40//!   -p, --single-precision
41//!           enable single-precision float type usage if present
42//!   -X, --lx <LX>
43//!           x-size of simulation in cm
44//!   -Y, --ly <LY>
45//!           y-size of simulation in cm
46//!   -Z, --lz <LZ>
47//!           z-size of simulation in cm
48//!   -n, --n-particles <N_PARTICLES>
49//!           total number of particles
50//!   -C, --chunk-size <CHUNK_SIZE>
51//!           size of the chunks when executing in parallel -- if absent or set to 0, use dynamic chunk size
52//!   -r, --rayon <N_RAYON_THREADS>
53//!           number of rayon threads that should be used to run the simulation -- set to 0 for rayon's default config
54//!   -u, --units <N_UNITS>
55//!           number of units that should be used to run the simulation
56//!   -N, --n-steps <N_STEPS>
57//!           number of steps simulated
58//!   -x, --nx <NX>
59//!           number of mesh elements along x
60//!   -y, --ny <NY>
61//!           number of mesh elements along y
62//!   -z, --nz <NZ>
63//!           number of mesh elements along z
64//!   -s, --seed <SEED>
65//!           random number seed
66//!   -h, --help
67//!          Print help
68//!   -V, --version
69//!           Print version
70//!
71//! ```
72//!
73//! # Example
74//!
75//! You can run one of the examples available using its input file. Note that the
76//! parameters specified in the file take priority over the one specified as arguments:
77//!
78//! ```shell
79//! $ cargo run --bin=fastiron --release -- -i input_files/QS_originals/Homogeneous/homogeneousProblem_v7_ts.inp -e energy -S section -n 10000
80//! ```
81//!
82//! Fastiron will print the parameters and run the simulation. Two reports will
83//! be printed at run-time and, if file names are specified, two files will be
84//! created. These four outputs contain data such as event counts, timers value,
85//! or final state of the system. To see more about these reports:
86//! - [`Tallies::print_summary()`][crate::data::tallies::Tallies::print_summary()]
87//! - [`MCFastTimerContainer::cumulative_report()`][crate::utils::mc_fast_timer::MCFastTimerContainer::cumulative_report()]
88//! - [`EnergySpectrum`][crate::data::energy_spectrum::EnergySpectrum]
89//! - [`init::check_cross_sections()`]
90//!
91//! # Useful Links
92//!
93//! - Fastiron [GitHub repository][2]
94//! - Quicksilver [GitHub repository][1]
95//!
96//! [1]: https://github.com/LLNL/Quicksilver
97//! [2]: https://github.com/cea-hpc/fastiron
98
99#![warn(clippy::disallowed_types)]
100#![allow(clippy::doc_lazy_continuation)] // TODO: remove & fix lints
101
102pub mod constants;
103pub mod data;
104pub mod geometry;
105pub mod init;
106pub mod montecarlo;
107pub mod parameters;
108pub mod particles;
109pub mod simulation;
110pub mod utils;