DisCostiC v2.0.0
Distributed Cost in Cluster: a cross-architecture simulator for massively parallel MPI programs
Loading...
Searching...
No Matches
DataStruct.hpp
Go to the documentation of this file.
1
7
8#ifndef Node_t_HPP
9#define Node_t_HPP
10
11#pragma once
12
13#include "DataType.hpp"
14#include "macro.hpp"
15#include <list>
16#include <queue>
17#include <array>
18
19namespace DisCosTiC
20{
21
40
61
80
101
110
115 {
117 {
118 if (a.time > b.time)
119 return true;
120 if (a.time == b.time && a.numOpsInQueue > b.numOpsInQueue)
121 return true;
122 return false;
123 }
124 };
125
126 using VecDeserialNode = std::vector<AST_OP_TYPE>;
127 using Operations = std::vector<DisCosTiC_OP>;
128 using ListqueueOp = std::list<DisCosTiC_queueOP>;
129 using VecListqueueOp = std::vector<ListqueueOp>;
130 using PriorityQueue_t = std::priority_queue<DisCosTiC_OP, Operations, OpTimeComparator>;
131 using Event = std::pair<DisCosTiC_Indextype, DisCosTiC::AST_OP *>;
132 using idNodeTypePairT = std::pair<DisCosTiC_Indextype, DisCosTiC::AST_OP_>;
133 using idNodePair = std::vector<std::vector<Event>>;
134 using idNodeTypePair = std::vector<std::vector<idNodeTypePairT>>;
135 using tupleIdNodePair = std::tuple<idNodePair, idNodePair, idNodePair>;
136 // using Networktype = std::tuple<DisCosTiC_Timetype,DisCosTiC_Timetype,DisCosTiC_Timetype>;
137 using Networktype = std::array<DisCosTiC_Timetype, 4>;
138 using NCMIntraAndInterNodeData = std::map<std::string, std::map<std::string, std::set<int>>>;
139 using NCMInterClusterData = std::map<std::string, std::set<int>>;
144 {
145 static inline bool listmatch(const DisCosTiC::DisCosTiC_OP &OP,
147 DisCosTiC::DisCosTiC_queueOP *matchedOP_ = NULL)
148 {
149 for (DisCosTiC::ListqueueOp::iterator it = Q->begin(); it != Q->end(); ++it)
150 {
151 if ((OP.target == MPI_ANY_SOURC || it->src == MPI_ANY_SOURC || it->src == OP.target) && (OP.tag == MPI_ANY_TA || it->tag == MPI_ANY_TA || it->tag == OP.tag))
152 {
153 if (matchedOP_)
154 *matchedOP_ = *it;
155 Q->erase(it);
156 return true;
157 }
158 }
159 return false;
160 }
161 };
162
163 template <typename... T>
164 auto make_vector(T &&...args)
165 {
166 using first_type = typename std::tuple_element<0, std::tuple<T...>>::type;
167 return std::vector<first_type>{std::forward<T>(args)...};
168 }
169
170 /*struct Bench {
171 DisCosTiC_Datatype systemsize;
172 DisCosTiC_Datatype datasize;
173 DisCosTiC_Datatype execsize;
174 DisCosTiC_Datatype timeunit_conv;
175 DisCosTiC_Datatype numTimesteps;
176 DisCosTiC_Datatype numOperations;
177 };*/
178
179}
180
181#endif
std::size_t DisCosTiC_Indextype
Definition DataType.hpp:53
std::size_t DisCosTiC_Datatype
Definition DataType.hpp:52
double DisCosTiC_Timetype
Definition DataType.hpp:51
static const DisCosTiC_Indextype MPI_ANY_SOURC
Definition macro.hpp:16
static const DisCosTiC_Indextype MPI_ANY_TA
Definition macro.hpp:17
< benchmark test cases
std::list< DisCosTiC_queueOP > ListqueueOp
auto make_vector(T &&...args)
std::priority_queue< DisCosTiC_OP, Operations, OpTimeComparator > PriorityQueue_t
std::map< std::string, std::set< int > > NCMInterClusterData
std::pair< DisCosTiC_Indextype, DisCosTiC::AST_OP * > Event
std::pair< DisCosTiC_Indextype, DisCosTiC::AST_OP_ > idNodeTypePairT
std::vector< std::vector< idNodeTypePairT > > idNodeTypePair
std::vector< std::vector< Event > > idNodePair
std::array< DisCosTiC_Timetype, 4 > Networktype
std::vector< AST_OP_TYPE > VecDeserialNode
std::vector< DisCosTiC_OP > Operations
std::map< std::string, std::map< std::string, std::set< int > > > NCMIntraAndInterNodeData
std::tuple< idNodePair, idNodePair, idNodePair > tupleIdNodePair
std::vector< ListqueueOp > VecListqueueOp
DisCosTiC_Indextype collectiveNumRanks
nubmer of ranks participating in collective
char mode
TODO: add blocking/non-blocking mode.
uint8_t algorithm
algo choice for collective
DisCosTiC_Indextype node
DisCosTiC_Indextype network
std::vector< DisCosTiC_Indextype > IdepOperations
DisCosTiC_Indextype depCount
std::vector< DisCosTiC_Indextype > DepOperations
DisCosTiC_Indextype tag
uint8_t collectiveType
collective operation type
DisCosTiC_Indextype label
DisCosTiC_Indextype collectiveRoot
root rank for collectives which have root (-1 if no root)
DisCosTiC_Indextype target
DisCosTiC_Datatype bufSize
DisCosTiC_Indextype depCount
DisCosTiC_Indextype depApdxStartLabel
DisCosTiC_Datatype bufSize
DisCosTiC_Indextype collectiveNumRanks
nubmer of ranks participating in collective
DisCosTiC_Indextype network
DisCosTiC_Indextype idepsCount
DisCosTiC_Indextype idepApdxStartLabel
DisCosTiC_Indextype label
DisCosTiC_Indextype target
uint8_t collectiveType
collective operation type
DisCosTiC_Indextype tag
char mode
TODO: add blocking/non-blocking mode.
DisCosTiC_Indextype collectiveRoot
root rank for collectives which have root (-1 if no root)
DisCosTiC_Indextype depsCount
uint8_t algorithm
algo choice for collective
DisCosTiC_Indextype node
DisCosTiC_Indextype collectiveRoot
root rank for collectives which have root (-1 if no root)
DisCosTiC_Timetype bufSize
number of bytes (data size) of this operation
char mode
TODO: add blocking/non-blocking mode.
std::vector< AST_OP * > DepOperations
dependencies for blocking routines, i.e., other operations that depend on this current operation
DisCosTiC_Indextype collectiveNumRanks
nubmer of ranks participating in collective
DisCosTiC_Indextype depCount
DisCosTiC_Indextype label
index/identifier of this operation for each rack
DisCosTiC_Indextype node
node or proceessing element for this operation
DisCosTiC_Indextype network
type of network for this operation
uint8_t collectiveType
collective operation type
DisCosTiC_Indextype target
rank of target/partner (source for recv / dest for send / no real target for comp,...
DisCosTiC_Indextype tag
tag of AST_OP (no real tag for comp, just added for completeness)
char type
type of AST_OP send, receive or computation
uint8_t algorithm
algo choice for collective
std::vector< AST_OP * > IdepOperations
dependencies for non-blocking routines, i.e., other operations that depend on current operation
char mode
TODO: add blocking/non-blocking mode.
DisCosTiC_Indextype network
uint8_t algorithm
algo choice for collective
uint8_t collectiveType
collective operation type
DisCosTiC_Indextype tag
DisCosTiC_Timetype syncstart
ifdef RANKSYNC
DisCosTiC_Timetype numOpsInQueue
STRICT_ORDER a timestamp that determines the (original) insertion order of elemenqueueOp in the queue...
DisCosTiC_Indextype node
DisCosTiC_Timetype time
DisCosTiC_Datatype bufSize
DisCosTiC_Indextype label
DisCosTiC_Indextype collectiveNumRanks
nubmer of ranks participating in collective
DisCosTiC_Indextype collectiveRoot
root rank for collectives which have root (-1 if no root)
DisCosTiC_Timetype starttime
only used for MSGs to identify start times
DisCosTiC_Indextype target
DisCosTiC_Indextype rank
owning rank of this operation
DisCosTiC_Indextype tag
TODO: tag can go, if matching.
DisCosTiC_Indextype src
TODO: src can go, if matching.
DisCosTiC_Timetype starttime
for visualization
DisCosTiC_Datatype bufSize
DisCosTiC_Indextype label
this matches and removes operations from list if found, otherwise returns false
static bool listmatch(const DisCosTiC::DisCosTiC_OP &OP, DisCosTiC::ListqueueOp *Q, DisCosTiC::DisCosTiC_queueOP *matchedOP_=NULL)
this is a comparison functor that can be used to compare and sort DisCosTiC_OP by time
bool operator()(DisCosTiC_OP a, DisCosTiC_OP b)