15 #include "libmesh/parallel.h" 20 TIME_SECTION(
"construct", 2,
"Constructing RankMap");
37 std::vector<processor_id_type> world_ranks(num_procs);
41 std::map<unsigned int, unsigned int> world_rank_to_hardware_id;
44 unsigned int next_id = 0;
46 for (MooseIndex(world_ranks) pid = 0; pid < world_ranks.size(); pid++)
48 auto world_rank = world_ranks[pid];
50 auto it = world_rank_to_hardware_id.lower_bound(world_rank);
52 unsigned int current_id = 0;
55 if (it != world_rank_to_hardware_id.end() && it->first == world_rank)
56 current_id = it->second;
59 current_id = next_id++;
61 world_rank_to_hardware_id.emplace_hint(it, world_rank, current_id);
void allgather(const T &send_data, std::vector< T, A > &recv_data) const
std::vector< unsigned int > _rank_to_hardware_id
Each entry corresponds to the hardware_id for that PID.
std::unordered_map< unsigned int, std::vector< processor_id_type > > _hardware_id_to_ranks
Map of hardware_id -> ranks on that node.
const Parallel::Communicator & _communicator
uint8_t processor_id_type
processor_id_type n_processors() const
Interface for objects interacting with the PerfGraph.
void broadcast(T &data, const unsigned int root_id=0, const bool identical_sizes=false) const
void split_by_type(int split_type, int key, info i, Communicator &target) const
RankMap(const libMesh::Parallel::Communicator &comm, PerfGraph &perf_graph)
Constructs and fills the map.
processor_id_type processor_id() const
The PerfGraph will hold the master list of all registered performance segments and the head PerfNode...