DisCostiC v2.0.0
Distributed Cost in Cluster: a cross-architecture simulator for massively parallel MPI programs
Loading...
Searching...
No Matches
macro.hpp File Reference
#include "DataType.hpp"
#include <iostream>
+ Include dependency graph for macro.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define print_vec1T(vec)
 
#define print_vec2T(vec)
 
#define print_pairedVec2T(vec)
 
#define print_pairedVecNonPointer2T(vec)
 
#define print_pairedVec_NonPointer2T(vec)
 
#define itFirst_Vec2T(vec)
 
#define iqueueOpecond_Vec2T(vec)
 
#define print_vec3T(vec)
 
#define print_OpPropertiesT(op)
 
#define print_OpPropertiesNonPointerT(op)
 
#define print_DeserialNodeT(op)
 
#define print_DeserialNodeNonPointerT(op)
 
#define print_AST_OP_NonPointerT(op)
 
#define fileopen(myfile, filename)
 open an open file
 
#define fileclose(myfile, filename)
 close an open file
 
#define AppendString(str, content)
 append a string
 
#define toCharPointer(content)
 append content to a string with label l
 
#define max_vec1T(vec)
 find max value of a vector
 
#define progessPrint(progress, qCounter, q1, q2, q3)
 print progress
 
#define queues_empty_check(check, q)
 check if all queues are empty
 
#define allRanksTime(numRanks, nexto)
 print final time for all ranks
 
#define slowRankTime(numRanks, nexto)
 print final maximum time for only rank taking maximum time
 
#define verboseCompInitPrint(rank, operation)
 print verbose output for computational phases
 
#define verboseCompFinalPrint(rank, operation)
 
#define verboseSendInitPrint(rank, operation)
 
#define verboseSendFinalPrint(rank, operation)
 
#define verboseRecvInitPrint(rank, operation)
 
#define verboseRecvFinalPrint(rank, operation)
 
#define verboseCompPrint(operation)
 
#define verboseSendPrint(operation)
 
#define verboseSendIrequiresPrint(operation)
 
#define verboseEagerSendPrint(o, operation)
 
#define verboseRendezvousSendPrint(operation)
 
#define verboseRecvPrint(operation)
 
#define verboseRendezvousRecvPrint(operation)
 
#define verboseMsgPrint(operation, oSuccessor, grSuccessor)
 
#define help()
 
#define version()
 end P2P_HPP
 

Variables

static const DisCosTiC_Indextype INVALID_ID = -1
 < data types
 
static const DisCosTiC_Indextype MPI_ANY_SOURC = ~0
 
static const DisCosTiC_Indextype MPI_ANY_TA = ~0
 

Detailed Description

MACRO_HPP

\author : Ayesha Afzal ayesh.nosp@m.a.af.nosp@m.zal@f.nosp@m.au.d.nosp@m.e \copyright © 2024 HPC, FAU Erlangen-Nuremberg. All rights reserved.

Definition in file macro.hpp.

Macro Definition Documentation

◆ allRanksTime

#define allRanksTime ( numRanks,
nexto )
Value:
std::cout << "\nFULL APPLICATION PERFORMANCE (for all ranks):" << std::endl; \
std::cout << "----------------------------------------------------------------" << std::endl; \
std::cout << "rank runtime [ns] runtime [s]" << std::endl; \
std::cout << "----------------------------------------------------------------" << std::endl; \
for (auto rank : DisCosTiC::getRange(numRanks)) \
{ \
DisCosTiC_Timetype maxo = *(std::max_element(nexto[rank].begin(), nexto[rank].end())); \
std::cout << rank << " " << maxo << " " << maxo / 1e9 << std::endl; \
}
double DisCosTiC_Timetype
Definition DataType.hpp:51
iteratorRange< scalarT > getRange(scalarT begin, scalarT end)
Definition DataType.hpp:161

print final time for all ranks

Definition at line 332 of file macro.hpp.

Referenced by main().

◆ AppendString

◆ fileclose

#define fileclose ( myfile,
filename )
Value:
{ \
if (myfile.is_open()) \
{ \
try \
{ \
myfile.close(); \
} \
catch (std::ofstream::failure const &e) \
{ \
std::cerr << "error: closing file definition of " << this->filename << " for writing" << std::endl; \
std::exit(EXIT_FAILURE); \
} \
} \
}

close an open file

Definition at line 251 of file macro.hpp.

Referenced by UserInterface::ConfigParser::ConfigParser(), UserInterface::NetworkConfigParser::NetworkConfigParser(), UserInterface::NetworkConfigParser::readData(), UserInterface::YAMLParser::YAMLParser(), and AST::~AST().

◆ fileopen

#define fileopen ( myfile,
filename )
Value:
{ \
try \
{ \
myfile.open(filename); \
} \
catch (std::ifstream::failure const &e) \
{ \
std::cerr << "error: opening file definition of " \
<< this->filename << " for reading, with message '" \
<< e.what() << std::endl; \
std::exit(EXIT_FAILURE); \
} \
}

open an open file

Definition at line 233 of file macro.hpp.

Referenced by UserInterface::ConfigParser::ConfigParser(), UserInterface::NetworkConfigParser::NetworkConfigParser(), UserInterface::NetworkConfigParser::readData(), and UserInterface::YAMLParser::YAMLParser().

◆ help

#define help ( )

Definition at line 482 of file macro.hpp.

Referenced by main().

◆ iqueueOpecond_Vec2T

#define iqueueOpecond_Vec2T ( vec)
Value:
{ \
for (auto &row : vec) \
{ \
for (auto &col : row) \
col.second; \
} \
}

Definition at line 108 of file macro.hpp.

◆ itFirst_Vec2T

#define itFirst_Vec2T ( vec)
Value:
{ \
for (auto &row : vec) \
{ \
for (auto &col : row) \
std::cout << col.first << std::endl; \
} \
}

Definition at line 91 of file macro.hpp.

◆ max_vec1T

#define max_vec1T ( vec)
Value:
{ \
DisCosTiC_Datatype max = 0; \
for (auto i : DisCosTiC::getRange(vec.size())) \
max = std::max(max, vec[i].size()); \
std::cout << max; \
}
std::size_t DisCosTiC_Datatype
Definition DataType.hpp:52

find max value of a vector

Definition at line 288 of file macro.hpp.

◆ print_AST_OP_NonPointerT

#define print_AST_OP_NonPointerT ( op)
Value:
{ \
std::cout << "num_deps: " << op.num_deps \
<< " deps_startlabel_in_apdx: " << op.deps_startlabel_in_apdx \
<< " num_startdeps.bufSize(): " << op.num_startdeps \
<< " startdeps_startlabel_in_apdx: " << op.startdeps_startlabel_in_apdx \
<< " depCount: " << op.depCount \
<< " target: " << op.target \
<< " label: " << op.label \
<< " tag: " << op.tag \
<< " node: " << +op.node \
<< " network: " << +op.network \
<< " type: " << +op.type \
<< " bufSize: " << op.bufSize \
<< std::endl; \
}

Definition at line 213 of file macro.hpp.

◆ print_DeserialNodeNonPointerT

#define print_DeserialNodeNonPointerT ( op)
Value:
{ \
std::cout << "DepOperations.size(): " << op.DepOperations.size() \
<< " IdepOperations.size(): " << op.IdepOperations.size() \
<< " depCount: " << op.depCount \
<< " target: " << op.target \
<< " label: " << op.label \
<< " tag: " << op.tag \
<< " node: " << +op.node \
<< " network: " << +op.network \
<< " type: " << +op.type \
<< " bufSize: " << op.bufSize \
<< std::endl; \
}

Definition at line 195 of file macro.hpp.

Referenced by AST::print_indicesDeserializedTable().

◆ print_DeserialNodeT

#define print_DeserialNodeT ( op)
Value:
{ \
std::cout << "DepOperations: " << op->DepOperations.size() \
<< " IdepOperations: " << op->IdepOperations.size() \
<< " depCount: " << op->depCount \
<< " target: " << op->target \
<< " label: " << op->label \
<< " tag: " << op->tag \
<< " node: " << +op->node \
<< " network: " << +op->network \
<< " type: " << +op->type \
<< " bufSize: " << op->bufSize \
<< std::endl; \
}

Definition at line 177 of file macro.hpp.

Referenced by AST::print_indicesTable().

◆ print_OpPropertiesNonPointerT

#define print_OpPropertiesNonPointerT ( op)
Value:
{ \
std::cout << " rank: " << op.rank \
<< " time: " << op.time \
<< " starttime: " << op.starttime \
<< " syncstart: " << op.syncstart \
<< " numOpsInQueue: " << op.numOpsInQueue \
<< " bufSize: " << op.bufSize \
<< " target: " << op.target << " label: " << op.label \
<< " tag: " << op.tag \
<< " node: " << +op.node \
<< " network: " << +op.network \
<< " type: " << +op.type \
<< " mode : " << +op.mode << std::endl; \
}

Definition at line 158 of file macro.hpp.

Referenced by main().

◆ print_OpPropertiesT

#define print_OpPropertiesT ( op)
Value:
{ \
std::cout << "time: " << op->time \
<< " starttime: " << op->starttime \
<< " syncstart: " << op->syncstart \
<< " numOpsInQueue: " << op->numOpsInQueue \
<< " bufSize: " << op->bufSize \
<< " target: " << op->target \
<< " rank: " << op->rank \
<< " label: " << op->label \
<< " tag: " << op->tag \
<< " node: " << +op->node \
<< " network: " << +op->network \
<< " type: " << +op->type << std::endl; \
}

Definition at line 139 of file macro.hpp.

◆ print_pairedVec2T

#define print_pairedVec2T ( vec)
Value:
{ \
for (auto i : DisCosTiC::getRange(vec.size())) \
{ \
for (auto j : DisCosTiC::getRange(vec[i].size())) \
{ \
std::cout << "[" << i << "][" << j << "]:" \
<< "\t label = " << vec[i][j].first << "\t AST_OP info : "; \
print_DeserialNodeT(+vec[i][j].second); \
} \
} \
}

Definition at line 50 of file macro.hpp.

◆ print_pairedVec_NonPointer2T

#define print_pairedVec_NonPointer2T ( vec)
Value:
{ \
for (auto i : DisCosTiC::getRange(vec.size())) \
{ \
for (auto j : DisCosTiC::getRange(vec[i].size())) \
{ \
std::cout << "[" << i << "][" << j << "]:" \
<< "\t label = " << vec[i][j].first << "\t AST_OP info : "; \
print_AST_OP_NonPointerT(+vec[i][j].second); \
} \
} \
}

Definition at line 74 of file macro.hpp.

◆ print_pairedVecNonPointer2T

#define print_pairedVecNonPointer2T ( vec)
Value:
{ \
for (auto i : DisCosTiC::getRange(vec.size())) \
for (auto j : DisCosTiC::getRange(vec[i].size())) \
std::cout << "[" << i << "][" << j << "]:" \
<< "\t label = " << vec[i][j].first << "\t AST_OP info : "; \
print_DeserialNodeNonPointerT(+vec[i][j].second); \
} \
} \
}

Definition at line 63 of file macro.hpp.

◆ print_vec1T

#define print_vec1T ( vec)
Value:
{ \
std::cout << "{"; \
for (auto i : DisCosTiC::getRange(vec.size())) \
std::cout << (i ? " , " : "") << vec[i]; \
std::cout << " }" << std::endl; \
}

Definition at line 23 of file macro.hpp.

Referenced by DisCosTiC::CompModel::CompModel().

◆ print_vec2T

#define print_vec2T ( vec)
Value:
{ \
for (auto i : DisCosTiC::getRange(vec[0].size())) \
{ \
for (auto j : DisCosTiC::getRange(vec[i].size())) \
{ \
std::cout << "[" << i << "][" << j << "]=" << vec[i][j] << std::endl; \
} \
} \
}

Definition at line 35 of file macro.hpp.

◆ print_vec3T

#define print_vec3T ( vec)
Value:
{ \
for (auto i : DisCosTiC::getRange(vec[0].size())) \
{ \
for (auto j : DisCosTiC::getRange(vec[i].size())) \
{ \
for (auto k : DisCosTiC::getRange(vec[j].size())) \
{ \
std::cout << "[" << i << "][" << j << "][" << k << "]=" << vec[i][j][k] << std::endl; \
} \
} \
} \
}

Definition at line 121 of file macro.hpp.

◆ progessPrint

#define progessPrint ( progress,
qCounter,
q1,
q2,
q3 )
Value:
{ \
std::cout << "Discostic Progress: " << progress \
<< " % (queue counter: " << qCounter << ") "; \
std::cout << "[Queue bufSize: " << q1.size() << " Max Receive Queue bufSize: "; \
max_vec1T(q2); \
std::cout << " Max Unexpected Message Queue bufSize: "; \
max_vec1T(q3); \
std::cout << "]" << std::endl; \
}

print progress

Definition at line 299 of file macro.hpp.

◆ queues_empty_check

#define queues_empty_check ( check,
q )
Value:
for (auto rank : DisCosTiC::getRange(numRanks)) \
{ \
if (!q[rank].empty()) \
{ \
std::cerr << " queue on rank " << rank \
<< " contains " << q[rank].size() \
<< " operations!"; \
for (DisCosTiC::ListqueueOp::iterator iter = q[rank].begin(); iter != q[rank].end(); ++iter) \
std::cerr << "\t [ source ==> " << iter->src \
<< ", tag ==> " << iter->tag \
<< "]" << std::endl; \
check = false; \
} \
}

check if all queues are empty

end of for loop

Definition at line 313 of file macro.hpp.

◆ slowRankTime

#define slowRankTime ( numRanks,
nexto )
Value:
std::cout << "\nFULL APPLICATION PERFORMANCE (for slowest rank):" << std::endl; \
DisCosTiC_Timetype max = 0; \
DisCosTiC_Datatype rank = 0; \
for (auto rank : DisCosTiC::getRange(numRanks)) \
{ \
DisCosTiC_Timetype maxo = *(std::max_element(nexto[rank].begin(), nexto[rank].end())); \
DisCosTiC_Timetype cur = maxo; \
if (cur > max) \
{ \
rank = rank; \
max = cur; \
} \
} \
std::cout << "----------------------------------------------------------------" << std::endl; \
std::cout << "rank runtime [ns] runtime [s]" << std::endl; \
std::cout << "----------------------------------------------------------------" << std::endl; \
std::cout << rank << " \t\t " << max << " \t\t " << max / 1e9 << std::endl;

print final maximum time for only rank taking maximum time

Definition at line 346 of file macro.hpp.

Referenced by main().

◆ toCharPointer

#define toCharPointer ( content)
Value:
{ \
const_cast<char *>(("l" + std::to_string(content)).c_str()) \
}

append content to a string with label l

Parameters
DisCosTiC_Indextype

Definition at line 280 of file macro.hpp.

Referenced by AST::blocking(), AST::blockingDep(), AST::nonBlocking(), and AST::nonBlockingDep().

◆ verboseCompFinalPrint

#define verboseCompFinalPrint ( rank,
operation )
Value:
std::cout << "rank: " << rank \
<< " [ node: " << +operation.node \
<< ", network: " << +operation.network \
<< "] computation: " << operation.bufSize \
<< ", time: " << operation.time \
<< ", label: " << operation.label << std::endl;

Definition at line 374 of file macro.hpp.

Referenced by main().

◆ verboseCompInitPrint

#define verboseCompInitPrint ( rank,
operation )
Value:
std::cout << "initialize rank: " << rank \
<< " [ node: " << +operation.node \
<< ", network: " << +operation.network \
<< "] computation: " << operation.bufSize << std::endl;

print verbose output for computational phases

Definition at line 368 of file macro.hpp.

Referenced by main().

◆ verboseCompPrint

#define verboseCompPrint ( operation)
Value:
{ \
std::cout << "\n[rank: " << operation.rank \
<< ", node: " << +operation.node \
<< "]:" << std::endl; \
std::cout << "local operation bufSize= " << operation.bufSize \
<< " ns, total time= " << operation.time \
<< " ns" << std::endl; \
}

Definition at line 418 of file macro.hpp.

Referenced by main().

◆ verboseEagerSendPrint

#define verboseEagerSendPrint ( o,
operation )
Value:
std::cout << "eager satisfy local requires at total time = " << operation.starttime + o \
<< " ns" << std::endl;

Definition at line 445 of file macro.hpp.

◆ verboseMsgPrint

#define verboseMsgPrint ( operation,
oSuccessor,
grSuccessor )
Value:
{ \
std::cout << "\n[rank: " << operation.rank \
<< ", node: " << +operation.node \
<< "]:" << std::endl; \
std::cout << "receive msg from rank " << operation.target \
<< ", total time= " << operation.time \
<< " ns" << std::endl; \
std::cout << "o= " << oSuccessor[operation.rank][operation.node] \
<< " ns, successor gr= " << grSuccessor[operation.rank][operation.network] \
<< " ns" << std::endl; \
}

Definition at line 469 of file macro.hpp.

◆ verboseRecvFinalPrint

#define verboseRecvFinalPrint ( rank,
operation )
Value:
std::cout << "rank: " << rank \
<< " [ node: " << +operation.node \
<< ", network: " << +operation.network \
<< "] receive from: " << operation.target \
<< ", tag: " << operation.tag \
<< ", bufSize: " << operation.bufSize \
<< ", time: " << operation.time \
<< ", label: " << operation.label << std::endl;

Definition at line 408 of file macro.hpp.

Referenced by main().

◆ verboseRecvInitPrint

#define verboseRecvInitPrint ( rank,
operation )
Value:
std::cout << "initialize rank: " << rank \
<< " [ node: " << +operation.node \
<< ", network: " << +operation.network \
<< "] receive from: " << operation.target \
<< "tag: " << operation.tag \
<< " bufSize: " << operation.bufSize << std::endl;

Definition at line 400 of file macro.hpp.

Referenced by main().

◆ verboseRecvPrint

#define verboseRecvPrint ( operation)
Value:
{ \
std::cout << "\n[rank: " << operation.rank \
<< ", node: " << +operation.node \
<< "]:" << std::endl; \
std::cout << "receive from rank " << operation.target \
<< " , total time= " << operation.time \
<< " ns" << std::endl; \
}

Definition at line 454 of file macro.hpp.

◆ verboseRendezvousRecvPrint

#define verboseRendezvousRecvPrint ( operation)
Value:
std::cout << "satisfy remote requires at rank " << operation.target \
<< " (label: " << operation.label \
<< ")" << std::endl;

Definition at line 464 of file macro.hpp.

◆ verboseRendezvousSendPrint

#define verboseRendezvousSendPrint ( operation)
Value:
std::cout << "start rendezvous message to: " << operation.rank \
<< " (label: " << operation.label \
<< ")" << std::endl;

Definition at line 449 of file macro.hpp.

◆ verboseSendFinalPrint

#define verboseSendFinalPrint ( rank,
operation )
Value:
std::cout << "rank: " << rank \
<< " [ node: " << +operation.node \
<< ", network: " << +operation.network \
<< "] send to: " << operation.target \
<< ", tag: " << operation.tag \
<< ", bufSize: " << operation.bufSize \
<< ", time: " << operation.time \
<< ", label: " << operation.label << std::endl;

Definition at line 390 of file macro.hpp.

Referenced by main().

◆ verboseSendInitPrint

#define verboseSendInitPrint ( rank,
operation )
Value:
std::cout << "initialize rank: " << rank \
<< " [ node: " << +operation.node \
<< ", network: " << +operation.network \
<< "] send to: " << operation.target \
<< "tag: " << operation.tag \
<< " bufSize: " << operation.bufSize << std::endl;

Definition at line 382 of file macro.hpp.

Referenced by main().

◆ verboseSendIrequiresPrint

#define verboseSendIrequiresPrint ( operation)
Value:
{ \
std::cout << "satisfy local non-blocking dependencies" << std::endl; \
std::cout << "send inserting msg to rank " << operation.rank \
<< ", total time= " << operation.time << " ns" << std::endl; \
}

Definition at line 438 of file macro.hpp.

◆ verboseSendPrint

#define verboseSendPrint ( operation)
Value:
{ \
std::cout << "\n[rank: " << operation.rank \
<< ", node: " << +operation.node \
<< "]:" << std::endl; \
std::cout << "send to rank " << operation.target \
<< ", total time= " << operation.time \
<< " ns" << std::endl; \
}

Definition at line 428 of file macro.hpp.

◆ version

#define version ( )
Value:
{ \
std::cout << "\nDistributed CosT in Cluster ( DisCosTiC )" << std::endl; \
std::cout << "Version : v2.0.0 (second release)" << std::endl; \
std::cout << "Author : Ayesha Afzal <ayesha.afzal@fau.de>" << std::endl; \
std::cout << "Copyright : 2023 HPC, FAU Erlangen-Nuremberg. All rights reserved" << std::endl; \
}

end P2P_HPP

Definition at line 569 of file macro.hpp.

Referenced by main().

Variable Documentation

◆ INVALID_ID

const DisCosTiC_Indextype INVALID_ID = -1
static

< data types

Definition at line 15 of file macro.hpp.

Referenced by AST::blockingDep(), AST::nonBlockingDep(), and DisCosTiC::Benchmark::Oneway_PositiveDisplacement().

◆ MPI_ANY_SOURC

const DisCosTiC_Indextype MPI_ANY_SOURC = ~0
static

Definition at line 16 of file macro.hpp.

Referenced by DisCosTiC::OpMatcher::listmatch().

◆ MPI_ANY_TA

const DisCosTiC_Indextype MPI_ANY_TA = ~0
static

Definition at line 17 of file macro.hpp.

Referenced by DisCosTiC::OpMatcher::listmatch().