www.mooseframework.org
WorkBalance.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
13 
20 {
21 public:
23 
25 
27  {
28  // Ordered this way because NL is always system 0 and Aux is 1
29  ALL = -1,
30  NL,
31  AUX,
32  };
33 
34  virtual void initialize() override;
35  virtual void execute() override;
36  virtual void finalize() override;
37  void gather(int balance_id, VectorPostprocessorValue & vppv);
38 
39 protected:
41  int _system;
42 
44  const RankMap & _rank_map;
45 
46  unsigned int _my_hardware_id;
47 
49 
55 
56  // These are measuring the size of inter-nodal (compute nodes) communication
59 
61 
64 
66  std::map<std::string, VectorPostprocessorValue *> _balance_vectors;
67 };
MultiMooseEnum _balances
The chosen balance metrics to compute.
Definition: WorkBalance.h:63
dof_id_type _local_num_elems
Definition: WorkBalance.h:50
dof_id_type _local_num_dofs
Definition: WorkBalance.h:52
VectorPostprocessorValue & _pid
Definition: WorkBalance.h:60
Real _local_partition_surface_area
Definition: WorkBalance.h:54
dof_id_type _local_num_nodes
Definition: WorkBalance.h:51
This class is here to combine the VectorPostprocessor interface and the base class VectorPostprocesso...
Builds lists and maps that help in knowing which physical hardware nodes each rank is on...
Definition: RankMap.h:23
static InputParameters validParams()
Definition: WorkBalance.C:27
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
Definition: WorkBalance.C:78
const RankMap & _rank_map
Helpful in determining the physical layout of the ranks.
Definition: WorkBalance.h:44
virtual void finalize() override
Finalize.
Definition: WorkBalance.C:392
bool _sync_to_all_procs
Definition: WorkBalance.h:48
int _system
The system to count DoFs from.
Definition: WorkBalance.h:41
dof_id_type _local_num_partition_sides
Definition: WorkBalance.h:53
std::map< std::string, VectorPostprocessorValue * > _balance_vectors
The VPP vectors that will hold the balance metrics.
Definition: WorkBalance.h:66
virtual void execute() override
Execute method.
Definition: WorkBalance.C:303
dof_id_type _local_num_partition_hardware_id_sides
Definition: WorkBalance.h:57
std::vector< Real > VectorPostprocessorValue
Definition: MooseTypes.h:192
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
unsigned int _my_hardware_id
Definition: WorkBalance.h:46
WorkBalance(const InputParameters &parameters)
Definition: WorkBalance.C:56
void gather(int balance_id, VectorPostprocessorValue &vppv)
Definition: WorkBalance.C:329
const InputParameters & parameters() const
Get the parameters of the object.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Compute several metrics for each MPI process.
Definition: WorkBalance.h:19
Real _local_partition_hardware_id_surface_area
Definition: WorkBalance.h:58
uint8_t dof_id_type