![]() |
OpenPFC
0.1.4
Phase Field Crystal simulation framework
|
Memory usage reporting utilities for parallel simulations. More...
#include "openpfc/core/world.hpp"#include "openpfc/core/world_queries.hpp"#include "openpfc/logging.hpp"#include "openpfc/mpi.hpp"#include "openpfc/utils.hpp"#include <cstddef>#include <fstream>#include <iomanip>#include <mpi.h>#include <sstream>#include <string>

Go to the source code of this file.
Classes | |
| struct | pfc::utils::MemoryUsage |
| Memory usage statistics for a single MPI rank. More... | |
Functions | |
| size_t | pfc::utils::get_system_memory_bytes () noexcept |
| Attempt to read total system memory from /proc/meminfo. | |
| std::string | pfc::utils::format_bytes (size_t bytes) |
| Format bytes as human-readable string (KB, MB, GB, TB) | |
| template<typename WorldType > | |
| void | pfc::utils::report_memory_usage (const MemoryUsage &usage, const WorldType &world, const Logger &logger, MPI_Comm comm=MPI_COMM_WORLD) |
Memory usage reporting utilities for parallel simulations.
This header provides utilities for reporting memory allocation in MPI-parallel phase-field simulations. It helps track and analyze memory usage across:
The reporter provides per-rank, total, and per-voxel memory metrics, helping users understand memory scaling and optimize domain decomposition.
|
inline |
Format bytes as human-readable string (KB, MB, GB, TB)
| bytes | Memory size in bytes |


|
inlinenoexcept |
Attempt to read total system memory from /proc/meminfo.
Reads the MemTotal field from /proc/meminfo (Linux systems). Returns 0 if file cannot be read or parsed.

