15 : _mur_communicator(moose_object->comm()),
16 _my_rank(_mur_communicator.rank()),
17 _nrank(_mur_communicator.size()),
18 _hardware_id(moose_object->getMooseApp().rankMap().rankHardwareIds())
23 mooseWarning(
"Unable to query hardware memory size in ", moose_object->
name());
26 std::vector<unsigned long long> memory_totals(
_nrank);
32 for (std::size_t i = 0; i <
_nrank; ++i)
41 mooseWarning(
"Inconsistent total memory reported by ranks on the same hardware node in ",
42 moose_object->
name());
const Parallel::Communicator & _mur_communicator
communicator for this object
void mooseWarning(Args &&... args)
Emit a warning message with the given stringified, concatenated args.
virtual const std::string & name() const
Get the name of the class.
std::vector< unsigned long long > _hardware_memory_total
total RAM for each hardware ID (node) (valid on rank zero only)
Every object that can be built by the factory should be derived from this class.
unsigned long long _memory_total
total RAM installed in the local node
MemoryUsageReporter(const MooseObject *moose_object)
std::size_t getTotalRAM()
get the total amount of physical RAM available
processor_id_type _nrank
number of ranks in the object's communicator
processor_id_type _my_rank
this objects rank
const std::vector< unsigned int > & _hardware_id
hardware IDs for each MPI rank (valid on rank zero only)