DisCostiC v2.0.0
Distributed Cost in Cluster: a cross-architecture simulator for massively parallel MPI programs
Loading...
Searching...
No Matches
AST.hpp
Go to the documentation of this file.
1
7
8#ifndef AST_HPP
9#define AST_HPP
10
11#pragma once
12
13// #include <string>
14#include <iostream>
15#include <fstream>
16#include <mpi.h>
17#include <string>
18#include "enum.hpp"
19#include "DataStruct.hpp"
20#include "DataType.hpp"
21#include "ConfigParser.hpp"
23#include "YAMLParser.hpp"
24
26static bool kerncraftExecuted = false;
27static bool Verbose = CFG_args.getValue<DisCosTiC_Datatype>("Verbose");
28static bool kerncraftExecuted_1 = false;
29static bool kerncraftExecuted_2 = false;
30static bool kernel_1 = false;
31static bool kernel_2 = false;
32static int kerncraft_count = 0;
33static bool barrier = false;
34static bool barrier_hetero = false;
35
38
39// Global variables for setting individual system properties
40extern int virtual_rank;
41extern int system_number;
42extern int task_per_node;
43extern int node;
45extern int cores_per_socket;
46extern int cc_numa_domain;
47extern int socket;
48extern int primary_processes;
49extern int secondary_processes;
50extern int heteregeneous_mode;
53extern int primary_task_per_node;
55extern std::string arch_name;
56
57class AST
58{
59public:
60 std::vector<DisCosTiC::AST_OP *> allNodes;
61 std::vector<DisCosTiC::AST_OP *> RootNodes;
62
63 // New datastructures to store data about ranks communicating in the network. Required for network contention models.
66
67 // DisCosTiC_Datatype nodesCount, networksCount;
68
70private:
72 std::string content, filename;
73 std::fstream myfile;
75
76 std::vector<bool> ranks_init;
81
82 std::map<std::string, DisCosTiC::AST_OP *> *indicesTable = new std::map<std::string, DisCosTiC::AST_OP *>;
83 std::map<std::string, std::string> *depTable = new std::map<std::string, std::string>;
84 std::map<std::string, DisCosTiC::AST_OP_TYPE> *indicesDeserializedTable = new std::map<std::string, DisCosTiC::AST_OP_TYPE>;
85
88 //std::string func;
89
90public:
96 recvCount(0),
97 compCount(0),
98 rankCount(0),
99 depCount(0),
100 curtag(-1)
101 {
102 this->filename.clear();
103 this->filename.append(std::string(CFG_args->getValue<std::string>("filename")));
104 this->myfile.open(this->filename.c_str(),
105 std::fstream::out | std::fstream::trunc);
106 std::stringstream ss;
107 ss << "num_ranks " << numRanks << std::endl;
108 AppendString(ss.str(), content);
109 this->rankCount = numRanks;
110 this->node = CFG_args->getValue<DisCosTiC_Datatype>("node");
111 //this->func = CFG_args->getValue<std::string>("benchmark_kernel");
112 this->execsize = CFG_args->getValue<DisCosTiC_Datatype>("balance_comp_size_in_ns");
113 this->timeunit_conv = CFG_args->getValue<DisCosTiC_Datatype>("timeunit_conv");
114 // this->ranks_init.resize(numRanks);
115 // std::fill(this->ranks_init.begin(), this->ranks_init.end(), false);
116 // if(!ranks_init[rank]) {do something; ranks_init[rank] = true;}
117
118 intraAndInterNodeRanks.insert(std::pair<std::string, std::map<std::string, std::set<int>>>("system0", {}));
119 intraAndInterNodeRanks.insert(std::pair<std::string, std::map<std::string, std::set<int>>>("system1", {}));
120 }
121
126 {
128
129 /*std::cout << "\nGenerated AST: " << std::endl;
130 std::cout << "----------------------------------------------------------------"<< std::endl;
131 std::cout << "number of processes : " << rankCount << std::endl;
132 std::cout << "number of sendCount : " << sendCount << std::endl;
133 std::cout << "number of receives : " << recvCount << std::endl;
134 std::cout << "number of executions : " << compCount << std::endl;
135 std::cout << "number of dependencies : " << depCount << std::endl;
136 std::cout << "(NOTE: Number of operations = Number of rankCount * Number of timesteps * 4 (COMP+SEND+RECV+MSG))"<< std::endl;
137 if(mode== DisCosTiC::Mode_t::NONBLOCKING)
138 std::cout << "Non-blocking communication routines" << std::endl;
139 else if(mode== DisCosTiC::Mode_t::BLOCKING) {
140 std::cout << "Blocking communication routines" << std::endl;
141
142 }
143 std::cout << "----------------------------------------------------------------"<< std::endl;*/
144 }
145
149 inline void InsertSrcDest()
150 {
151 start.insert(count);
152 end.insert(count);
153 }
154
161 {
162 start.erase(src);
163 end.erase(dest);
164 }
165
169 inline void StartOp()
170 {
171 start.clear();
172 end.clear();
173 }
174
179 {
180 locop_t rstart, rend;
181 for (idSetT::iterator it = start.begin(); it != start.end(); it++)
182 {
183 rstart.push_back(std::make_pair(*it, DisCosTiC::BLOCKING));
184 }
185 for (idSetT::iterator it = end.begin(); it != end.end(); it++)
186 {
187 rend.push_back(std::make_pair(*it, DisCosTiC::BLOCKING));
188 }
189 return std::make_pair(rstart, rend);
190 }
191
196 inline void Settag(DisCosTiC_Datatype tag)
197 {
198 this->curtag = tag;
199 }
200
202 {
203 this->rank = r;
204 // std::cout << "current rank: " << rank << std::endl;
205 }
206
208 {
209 this->rankCount = nr;
210 // std::cout << "total number of processes: " << rankCount << std::endl;
211 }
212
213 inline void insertID(std::map<std::string, DisCosTiC::AST_OP *> *idTable, char *ID, DisCosTiC::AST_OP *op)
214 {
215 idTable->insert(std::make_pair(std::string(ID), op));
216 // free(ID);
217 }
218
219 inline void insertdeserialID(std::map<std::string, DisCosTiC::AST_OP_TYPE> *idTable, char *ID, DisCosTiC::AST_OP_TYPE op)
220 {
221 idTable->insert(std::make_pair(ID, op));
222 // free(ID);
223 }
224
225 inline void insertDep(std::map<std::string, std::string> *depTable, char *ID1, char *ID2)
226 {
227 depTable->insert(std::make_pair(std::string(ID1), std::string(ID2)));
228 // free(ID1);
229 // free(ID2);
230 }
231
232 inline DisCosTiC::AST_OP *retrieveID(std::map<std::string, DisCosTiC::AST_OP *> *idTable, std::string id)
233 {
234 std::map<std::string, DisCosTiC::AST_OP *>::iterator it;
235 it = idTable->find(id);
236 if (id.compare("l-1") == 0)
237 {
238 std::cerr << "INVALID IDENTIFIER: l-1 " << std::endl;
239 exit(EXIT_FAILURE);
240 }
241 if ((it == idTable->end()) && (!(id).empty()))
242 {
243 std::cerr << "ERROR: DEPENDENCY REFERENCES LABEL " << id << " UNDEFINED!" << std::endl;
244 exit(EXIT_FAILURE);
245 }
246 // free(id);
247 return it->second;
248 }
249
250 inline DisCosTiC::AST_OP_TYPE retrievedeserialID(std::map<std::string, DisCosTiC::AST_OP_TYPE> *idTable, std::string id)
251 {
252 std::map<std::string, DisCosTiC::AST_OP_TYPE>::iterator it;
253 it = idTable->find(id);
254 if (id.compare("l-1") == 0)
255 {
256 std::cerr << "INVALID IDENTIFIER: l-1 " << std::endl;
257 exit(EXIT_FAILURE);
258 }
259 if ((it == idTable->end()) && (!(id).empty()))
260 {
261 std::cerr << "ERROR: DEPENDENCY REFERENCES LABEL " << id << " UNDEFINED!" << std::endl;
262 exit(EXIT_FAILURE);
263 }
264 // free(id);
265 return it->second;
266 }
267
273 {
274 this->rankCount++;
275 this->curtag = 0;
276 this->edgesCount = 0;
277 this->labelCount = 0;
278 this->count = 0;
279 this->SetRank(rank);
280 this->allNodes.clear();
281 this->RootNodes.clear();
282 this->indicesTable->clear();
283 this->depTable->clear();
284
285 std::stringstream ss;
286 ss << "\nrank " << rank << " {\n";
287 AppendString(ss.str(), content);
288 }
289
290 /*void StartTimeSteps(DisCosTiC_Datatype timestep) {
291 this->timesteps++;
292 }*/
293
295 {
297 N->depCount = 0;
298 N->label = labelCount;
299 labelCount++;
300 allNodes.push_back(N);
301 return N;
302 }
303
305 {
306 static DisCosTiC_Datatype max_node = 0;
307 if (node > max_node)
308 max_node = node;
309 return max_node;
310 }
311
313 {
314 static DisCosTiC_Datatype max_network = 0;
315 if (network > max_network)
316 max_network = network;
317 return max_network;
318 }
319
324 {
325 return this->allNodes.size();
326 }
327
328 inline void insertInNetwork(int src, int dst)
329 {
330 int src_system = src < primary_processes ? 0 : 1;
331 int dst_system = dst < primary_processes ? 0 : 1;
332 int src_socket = src_system == 0 ? std::floor(src / primary_cores_per_socket) : std::floor((src - primary_processes) / secondary_cores_per_socket);
333 int dst_socket = dst_system == 0 ? std::floor(dst / primary_cores_per_socket) : std::floor((dst - primary_processes) / secondary_cores_per_socket);
334 int src_node = src_system == 0 ? std::floor(src / primary_task_per_node) : std::floor((src - primary_processes) / secondary_task_per_node);
335 int dst_node = dst_system == 0 ? std::floor(dst / primary_task_per_node) : std::floor((dst - primary_processes) / secondary_task_per_node);
336
337 if (src_system != dst_system)
338 {
339 // if (virtual_rank == 0 && system_number == 0)
340 // std::cout << "Starting intercluster for rank " << src << " ! " << std::endl;
341
342 if (interClusterRanks.count("intercluster") == 0)
343 {
344 interClusterRanks.insert(std::pair<std::string, std::set<int>>("intercluster", {}));
345 }
346 interClusterRanks.at("intercluster").insert(src);
347 // if (virtual_rank == 0 && system_number == 0)
348
349 // std::cout << "Done intercluster for rank " << src << " ! " << std::endl;
350 }
351 else if (src_node != dst_node)
352 {
353 // if (virtual_rank == 0 && system_number == 0)
354
355 // std::cout << "Starting internode for rank " << src << " ! " << std::endl;
356
357 if (intraAndInterNodeRanks.at("system" + std::to_string(src_system)).count("internode" + std::to_string(src_node) + std::to_string(dst_node)) == 0)
358 {
359 intraAndInterNodeRanks.at("system" + std::to_string(src_system)).insert(std::pair<std::string, std::set<int>>("internode" + std::to_string(src_node) + std::to_string(dst_node), {}));
360 }
361 intraAndInterNodeRanks.at("system" + std::to_string(src_system)).at("internode" + std::to_string(src_node) + std::to_string(dst_node)).insert(src);
362 // if (virtual_rank == 0 && system_number == 0)
363
364 // std::cout << "Done internode for rank " << src << " ! " << std::endl;
365 }
366 else if (src_socket != dst_socket)
367 {
368 // if (virtual_rank == 0 && system_number == 0)
369 // std::cout << "Starting intranode for rank " << src << " ! " << std::endl;
370
371 if (intraAndInterNodeRanks.at("system" + std::to_string(src_system)).count("intranode" + std::to_string(src_node)) == 0)
372 {
373 intraAndInterNodeRanks.at("system" + std::to_string(src_system)).insert(std::pair<std::string, std::set<int>>("intranode" + std::to_string(src_node), {}));
374 }
375 intraAndInterNodeRanks.at("system" + std::to_string(src_system)).at("intranode" + std::to_string(src_node)).insert(src);
376 // if (virtual_rank == 0 && system_number == 0)
377 // std::cout << "Done intranode for rank " << src << " ! " << std::endl;
378 }
379 else
380 {
381 // if (virtual_rank == 0 && system_number == 0)
382 // std::cout << "Starting intrasocket for rank " << src << " ! " << std::endl;
383
384 if (intraAndInterNodeRanks.at("system" + std::to_string(src_system)).count("intrasocket" + std::to_string(src_socket)) == 0)
385 {
386 intraAndInterNodeRanks.at("system" + std::to_string(src_system)).insert(std::pair<std::string, std::set<int>>("intrasocket" + std::to_string(src_socket), {}));
387 }
388 intraAndInterNodeRanks.at("system" + std::to_string(src_system)).at("intrasocket" + std::to_string(src_socket)).insert(src);
389 // if (virtual_rank == 0 && system_number == 0)
390 // std::cout << "Done intrasocket for rank " << src << " ! " << std::endl;
391 }
392 }
393
395 {
396 for (const auto &outer_pair : interClusterRanks)
397 {
398 std::cout << std::endl
399 << outer_pair.first << " : ";
400 for (const auto elem : outer_pair.second)
401 {
402 std::cout << " " << elem;
403 }
404 }
405 std::cout << std::endl;
406
407 for (const auto &outer_pair : intraAndInterNodeRanks)
408 {
409 std::cout << std::endl
410 << outer_pair.first << " : " << std::endl;
411 for (const auto &inner_pair : outer_pair.second)
412 {
413 std::cout << std::endl
414 << inner_pair.first << " : ";
415 for (const auto elem : inner_pair.second)
416 {
417 std::cout << " " << elem;
418 }
419 }
420 }
421 std::cout << std::endl;
422 }
423
430 {
431 this->sendCount++;
432 this->count++;
433
434 std::stringstream ss;
435 ss << "l" << this->count << ": send " << bufsize << "b to " << dst << " tag " << curtag << std::endl;
436 AppendString(ss.str(), content);
437
439 // return this->count;
440
442
444 n->target = dst;
445 n->tag = curtag;
446 n->node = 0 /*node*/;
447 n->network = 0 /*network*/;
448 n->bufSize = bufsize;
449
450 MaxCPU(0 /*node*/);
451 Maxnetwork(0 /*network*/);
452
453 if (bufsize != 0)
454 {
455 insertInNetwork(this->rank, dst);
456 bytes_to_send = bufsize;
457 }
458
460 blockingDep(std::make_pair(this->count, n), depOP);
461
462 return std::make_pair(this->count, n);
463 }
464
470 inline DisCosTiC::Event Send(const void *buf, DisCosTiC_Datatype bufsize, MPI_Datatype datatype, DisCosTiC_Datatype dst, int tag,
471 MPI_Comm comm, MPI_Request *request, DisCosTiC::Event depOP)
472 {
473 this->sendCount++;
474 this->count++;
475
476 std::stringstream ss;
477 ss << "l" << this->count << ": send " << bufsize << "b to " << dst << " tag " << curtag << std::endl;
478 AppendString(ss.str(), content);
479
481 // return this->count;
482
484
486 n->target = dst;
487 n->tag = curtag;
488 n->node = 0 /*node*/;
489 n->network = 0 /*network*/;
490 n->algorithm = 0; //no algorithm for P2P operations
491 n->collectiveType = 0;
492 n->collectiveRoot = 0;
493 n->collectiveNumRanks = 0;
494 n->bufSize = bufsize;
495
496 MaxCPU(0 /*node*/);
497 Maxnetwork(0 /*network*/);
498
499 if (bufsize != 0)
500 {
501 insertInNetwork(this->rank, dst);
502 bytes_to_send = bufsize;
503 }
505 blockingDep(std::make_pair(this->count, n), depOP);
506
507 return std::make_pair(this->count, n);
508 }
509
516 {
517 this->sendCount++;
518 this->count++;
519
520 std::stringstream ss;
521 ss << "l" << this->count << ": send " << bufsize << "b to " << dst << " tag " << curtag << std::endl;
522 AppendString(ss.str(), content);
523
525 // return this->count;
526
528
530 n->target = dst;
531 n->tag = curtag;
532 n->node = 0 /*node*/;
533 n->network = 0 /*network*/;
534 n->bufSize = bufsize;
535
536 if (bufsize != 0)
537 {
538 insertInNetwork(this->rank, dst);
539 bytes_to_send = bufsize;
540 }
541 MaxCPU(0 /*node*/);
542 Maxnetwork(0 /*network*/);
543
545 nonBlockingDep(std::make_pair(this->count, n), depOP);
546
547 return std::make_pair(this->count, n);
548 }
549
556 inline DisCosTiC::Event Isend(const void *buf, DisCosTiC_Datatype bufsize, MPI_Datatype datatype, DisCosTiC_Datatype dst, int tag,
557 MPI_Comm comm, MPI_Request *request, DisCosTiC::Event depOP)
558 {
559 this->sendCount++;
560 this->count++;
561 std::stringstream ss;
562 ss << "l" << this->count << ": send " << bufsize << "b to " << dst << " tag " << tag << std::endl;
563 AppendString(ss.str(), content);
564 // std::cout << ss.str() << std::endl;
566 // return this->count;
567
569
571 n->target = dst;
572 n->tag = tag;
573 n->node = 0 /*node*/;
574 n->network = 0 /*network*/;
575 n->algorithm = 0; //no algorithm for P2P operations
576 n->collectiveType = 0;
577 n->collectiveRoot = 0;
578 n->collectiveNumRanks = 0;
579 n->bufSize = bufsize;
580
581 if (bufsize != 0)
582 {
583 insertInNetwork(this->rank, dst);
584 bytes_to_send = bufsize;
585 }
586 MaxCPU(0 /*node*/);
587 Maxnetwork(0 /*network*/);
588
590 nonBlockingDep(std::make_pair(this->count, n), depOP);
591
592 return std::make_pair(this->count, n);
593 }
594
601 {
602 this->recvCount++;
603 this->count++;
604
605 std::stringstream ss;
606 ss << "l" << this->count << ": recv " << bufsize << "b from " << src << " tag " << curtag << std::endl;
607 AppendString(ss.str(), content);
608
610 // return this->count;
612
614 n->target = src;
615 n->tag = curtag;
616 n->node = 0 /*node*/;
617 n->network = 0 /*network*/;
618 n->algorithm = 0; //no algorithm for P2P operations
619 n->collectiveType = 0;
620 n->collectiveRoot = 0;
621 n->collectiveNumRanks = 0;
622 n->bufSize = bufsize;
623
624 MaxCPU(0 /*node*/);
625 Maxnetwork(0 /*network*/);
626
628 blockingDep(std::make_pair(this->count, n), depOP);
629
630 return std::make_pair(this->count, n);
631 }
632
638 inline DisCosTiC::Event Recv(const void *buf, DisCosTiC_Datatype bufsize, MPI_Datatype datatype, DisCosTiC_Datatype src, int tag,
639 MPI_Comm comm, MPI_Request *request, DisCosTiC::Event depOP)
640 {
641 this->recvCount++;
642 this->count++;
643
644 std::stringstream ss;
645 ss << "l" << this->count << ": recv " << bufsize << "b from " << src << " tag " << curtag << std::endl;
646 AppendString(ss.str(), content);
647
649 // return this->count;
651
653 n->target = src;
654 n->tag = curtag;
655 n->node = 0 /*node*/;
656 n->network = 0 /*network*/;
657 n->algorithm = 0; //no algorithm for P2P operations
658 n->collectiveType = 0;
659 n->collectiveRoot = 0;
660 n->collectiveNumRanks = 0;
661 n->bufSize = bufsize;
662
663 MaxCPU(0 /*node*/);
664 Maxnetwork(0 /*network*/);
665
667 blockingDep(std::make_pair(this->count, n), depOP);
668
669 return std::make_pair(this->count, n);
670 }
671
678 {
679 this->recvCount++;
680 this->count++;
681
682 std::stringstream ss;
683 ss << "l" << this->count << ": recv " << bufsize << "b from " << src << " tag " << curtag << std::endl;
684 AppendString(ss.str(), content);
685
687 // return this->count;
689
691 n->target = src;
692 n->tag = curtag;
693 n->node = 0 /*node*/;
694 n->network = 0 /*network*/;
695 n->algorithm = 0; //no algorithm for P2P operations
696 n->collectiveType = 0;
697 n->collectiveRoot = 0;
698 n->collectiveNumRanks = 0;
699 n->bufSize = bufsize;
700
701 MaxCPU(0 /*node*/);
702 Maxnetwork(0 /*network*/);
703
705 nonBlockingDep(std::make_pair(this->count, n), depOP);
706
707 return std::make_pair(this->count, n);
708 }
709
715 inline DisCosTiC::Event Irecv(const void *buf, DisCosTiC_Datatype bufsize, MPI_Datatype datatype, DisCosTiC_Datatype src, int tag,
716 MPI_Comm comm, MPI_Request *request, DisCosTiC::Event depOP)
717 {
718 this->recvCount++;
719 this->count++;
720
721 std::stringstream ss;
722 ss << "l" << this->count << ": recv " << bufsize << "b from " << src << " tag " << tag << std::endl;
723 AppendString(ss.str(), content);
724 // std::cout << ss.str() << std::endl;
726 // return this->count;
728
730 n->target = src;
731 n->tag = tag;
732 n->node = 0 /*node*/;
733 n->network = 0 /*network*/;
734 n->algorithm = 0; //no algorithm for P2P operations
735 n->collectiveType = 0;
736 n->collectiveRoot = 0;
737 n->collectiveNumRanks = 0;
738 n->bufSize = bufsize;
739
740 MaxCPU(0 /*node*/);
741 Maxnetwork(0 /*network*/);
742
744 nonBlockingDep(std::make_pair(this->count, n), depOP);
745
746 return std::make_pair(this->count, n);
747 }
748
755 inline DisCosTiC::Event Exec(std::string opname, DisCosTiC::Event depOP1, UserInterface::YAMLParser YAML_args, DisCosTiC_Datatype process_Rank, DisCosTiC_Datatype N_size_Of_Cluster, MPI_Comm comm)
756 {
757 DisCosTiC_Timetype runTime = 0;
758 // std::cout<<process_Rank<<" : "<<opname<<std::endl;
759 execNodeLVL(opname, YAML_args, &runTime, process_Rank, N_size_Of_Cluster, comm);
760 // std::cout<<"Runtime : "<<runTime<<std::endl;
761 // TODO What shall I do with this drunken Sailor!
762 // if(this->func != opname)
763 // throw std::runtime_error("computation operation NOT YET IMPLEMENTED\n");
764
765 this->compCount++;
766 this->count++;
767 this->execsize = runTime;
768 // std::cout << "Execsize : " << execsize << std::endl;
769
770 std::stringstream ss;
771 ss << "l" << this->count << ": calc " << execsize * timeunit_conv /* bufSize*/ << " node " << node << std::endl;
772 AppendString(ss.str(), content);
773
774 // return this->count;
776 if (opname.find(CFG_args.getValue<std::string>("part1")) != std::string::npos)
778 if (CFG_args.getValue<std::string>("part2") != "0" && opname.find(CFG_args.getValue<std::string>("part2")) != std::string::npos)
780 n->target = 0;
781 n->tag = 0;
782 n->node = 0; // node;
783 n->network = 0 /*network*/;
784 n->algorithm = 0; //no algorithm for P2P operations
785 n->collectiveType = 0;
786 n->collectiveRoot = 0;
787 n->collectiveNumRanks = 0;
788 n->bufSize = execsize * timeunit_conv; // bufSize;
789
790 MaxCPU(0 /*node*/);
791 Maxnetwork(0 /*network*/);
792
794 blockingDep(std::make_pair(this->count, n), depOP1);
795
796 return std::make_pair(this->count, n);
797 }
798
805 inline DisCosTiC::Event Iexec(std::string opname, UserInterface::YAMLParser YAML_args, DisCosTiC::Event depOP1, DisCosTiC_Datatype process_Rank, DisCosTiC_Datatype N_size_Of_Cluster, MPI_Comm comm)
806 {
807 DisCosTiC_Timetype runTime = 0;
808 execNodeLVL(opname, YAML_args, &runTime, process_Rank, N_size_Of_Cluster, comm);
809 // TODO What shall I do with this drunken Sailor!
810 // if(this->func != opname)
811 // throw std::runtime_error("computation operation NOT YET IMPLEMENTED\n");
812 this->compCount++;
813 this->count++;
814 this->execsize = runTime;
815
816 std::stringstream ss;
817 ss << "l" << this->count << ": calc " << execsize * timeunit_conv /*bufSize*/ << " node " << node << std::endl;
818 AppendString(ss.str(), content);
819
820 // return this->count;
822
824 n->target = 0;
825 n->tag = 0;
826 n->node = 0; // node;
827 n->network = 0 /*network*/;
828 n->algorithm = 0; //no algorithm for COMP operations
829 n->collectiveType = 0;
830 n->collectiveRoot = 0;
831 n->collectiveNumRanks = 0;
832 n->bufSize = execsize * timeunit_conv; // bufSize;
833
834 MaxCPU(0 /*node*/);
835 Maxnetwork(0 /*network*/);
836
838 nonBlockingDep(std::make_pair(this->count, n), depOP1);
839 // nonBlockingDep(std::make_pair (this->count,n), depOP2);
840
841 return std::make_pair(this->count, n);
842 }
843
844
847 DisCosTiC_Datatype myRank, DisCosTiC_Datatype numRanks,
848 DisCosTiC::Event depOP,
849 uint8_t algorithm = 0)
850 {
851 this->count++;
852
853 // string for collective types
854 std::stringstream ss;
855 ss << "l" << this->count << ": ";
856 switch(collectiveType) {
858 ss << "bcast " << bufsize << "b from root " << root;
859 break;
861 ss << "reduce " << bufsize << "b to root " << root;
862 break;
864 ss << "allreduce " << bufsize << "b";
865 break;
866 }
867 ss << " rank " << myRank << " of " << numRanks << std::endl;
868 AppendString(ss.str(), content);
869
872 //store collective info in fields
873 n->collectiveType = static_cast<uint8_t>(collectiveType);
874 n->collectiveRoot = root;
875 n->collectiveNumRanks = numRanks;
876 n->algorithm = algorithm;
877 //reset P2P fields to defaults
878 n->target = 0;
879 n->tag = 0;
880 n->node = 0; //CPU 0 for viz
881 n->network = 0;
882 n->bufSize = bufsize;
883 n->mode = DisCosTiC::Mode_t::BLOCKING; //collectives are all blocking
884
885 blockingDep(std::make_pair(this->count, n), depOP);
886 return std::make_pair(this->count, n);
887 }
888
889
890
891 inline void execNodeLVL(std::string &opname, UserInterface::YAMLParser YAML_args, DisCosTiC_Timetype *rt, DisCosTiC_Datatype process_Rank, DisCosTiC_Datatype N_size_Of_Cluster, MPI_Comm comm)
892 {
893 DisCosTiC_Timetype perf_est;
894 DisCosTiC_Timetype runtime = 0;
895 std::string::size_type n = opname.find(":");
896 if (opname.substr(0, n) == "LBL")
897 {
898 //std::cout << "Check: " << opname << std::endl;
899 opname.erase(0, n + 1);
900 //std::cout << "opname: " << opname << std::endl;
901 std::string::size_type opos = opname.find(":");
902 std::string::size_type extrasPos = opname.find("//");
903
904 std::string extras = "-extras" + opname.substr(extrasPos + 2, opname.length());
905 //std::cout << "extras: " << extras << std::endl;
906
907 std::string ECM_core = extras.erase(0, 7);
908 //std::cout << "ecm_core: " << ECM_core << std::endl;
909 ECM_core = extras.substr(0, extras.find("+"));
910 //std::cout << "ecm_core: " << ECM_core << std::endl;
911
912 //if (this->func != opname.substr(opos + 1, extrasPos - opos - 1))
913 //throw std::runtime_error("computation operation NOT YET IMPLEMENTED\n");
914
915 std::string str_part1 = CFG_args.getValue<std::string>("part1");
916 std::string str_part2 = CFG_args.getValue<std::string>("part2");
917
918 // Copy per-rank ECM cfgs once per kernel, not once per modeled rank.
919 bool already_copied = false;
920 if (opname.find(str_part1) != std::string::npos)
921 already_copied = kernel_1;
922 else if (str_part2 != "0" && opname.find(str_part2) != std::string::npos)
923 already_copied = kernel_2;
924 else
925 already_copied = kernel_1;
926
927 if (!already_copied && process_Rank == 0)
928 {
929 if (opname.find(str_part1) != std::string::npos)
930 kernel_1 = true;
931 if (str_part2 == "0" || opname.find(str_part2) != std::string::npos)
932 kernel_2 = true;
933 if (opname.find(str_part1) == std::string::npos &&
934 !(str_part2 != "0" && opname.find(str_part2) != std::string::npos))
935 kernel_1 = true;
936
937 system(("for num in {0.." + std::to_string(N_size_Of_Cluster) + "}; do cp config.cfg config$num.cfg; done").c_str());
938 system(("for num in {0.." + std::to_string(N_size_Of_Cluster) + "}; do cp ./nodelevel/configs/" + opname.substr(opos + 1, extrasPos - opos - 1) + ".cfg ./nodelevel/configs/" + opname.substr(opos + 1, extrasPos - opos - 1) + "$num.cfg; done").c_str());
939 }
940
941 // Sync after each LBL cfg copy so all ranks see the files.
942 MPI_Barrier(comm);
943 barrier = true;
944
945 UserInterface::ConfigParser NodeCFG("./nodelevel/configs/" + opname.substr(opos + 1, extrasPos - opos - 1) + std::to_string(process_Rank) + ".cfg");
946 UserInterface::ConfigParser config("./config" + std::to_string(process_Rank) + ".cfg");
947
948 NodeModel NM(&config, YAML_args, &NodeCFG, ECM_core);
949
950 estimation(NM, &perf_est, &runtime);
951 }
952 else if (opname.substr(0, n) == "COMP")
953 {
954
955 opname = opname.substr(n + 1, opname.length());
956
957 std::string extras = "-extras" + opname.substr(opname.find("//") + 2, opname.length());
958
959 std::string ECM_core = extras.erase(0, 7);
960 ECM_core = extras.substr(0, extras.find("+"));
961
962 if (process_Rank == 0 && !barrier)
963 {
964 system(("for num in {0.." + std::to_string(N_size_Of_Cluster) + "}; do cp config.cfg config$num.cfg; done").c_str());
965 }
966 if (!barrier)
967 {
968 MPI_Barrier(comm);
969 barrier = true;
970 }
971
972 UserInterface::ConfigParser NodeCFG("./config" + std::to_string(process_Rank) + ".cfg");
973
974 std::string::size_type begin = system_number == 0 ? opname.find("TOL") + 4 : opname.find("TOLSecondary") + 13;
975 std::string::size_type end = opname.find("||", begin);
976 DisCosTiC_Timetype T_OL = std::stod(opname.substr(begin, end - begin));
977
978 begin = system_number == 0 ? opname.find("TnOL") + 5 : opname.find("TnOLSecondary") + 14;
979 end = opname.find("|", begin);
980 DisCosTiC_Timetype T_nOL = std::stod(opname.substr(begin, end - begin));
981
982 begin = system_number == 0 ? opname.find("TL1L2") + 6 : opname.find("TL1L2Secondary") + 15;
983 end = opname.find("|", begin);
984 DisCosTiC_Timetype T_L1L2 = std::stod(opname.substr(begin, end - begin));
985
986 begin = system_number == 0 ? opname.find("TL2L3") + 6 : opname.find("TL2L3Secondary") + 15;
987 end = opname.find("|", begin);
988 DisCosTiC_Timetype T_L2L3 = std::stod(opname.substr(begin, end - begin));
989
990 begin = system_number == 0 ? opname.find("TL3Mem") + 7 : opname.find("TL3MemSecondary") + 16;
991 end = opname.find("|", begin);
992 DisCosTiC_Timetype T_L3Mem = std::stod(opname.substr(begin, end - begin));
993
994 DisCosTiC_Timetype T_ECM = std::max(T_OL, T_nOL + T_L1L2 + T_L2L3 + T_L3Mem);
995 NodeModel NM(&NodeCFG, YAML_args, T_OL, T_nOL, T_L1L2, T_L2L3, T_L3Mem, T_ECM, std::stod(ECM_core));
996
997 DisCosTiC_Timetype *scaling_performance = (double *)malloc(NM.getMachine().cores_per_socket_ * sizeof(double));
998 DisCosTiC_Timetype *scaling_numa = (double *)malloc(NM.getMachine().cores_per_socket_ * sizeof(double));
999
1001
1002 NM.setMultiCore(scaling_performance[std::stoi(ECM_core) - 1]);
1003
1004 estimation(NM, &perf_est, &runtime);
1005 }
1006 else if (opname.substr(0, n) == "SRC")
1007 {
1008 opname.erase(0, n + 1);
1009 std::string::size_type opos = opname.find(":");
1010 std::string::size_type machinePos = opname.find("//", opos);
1011
1012 //if (this->func != opname.substr(opos + 1, machinePos - opos - 1))
1013 //throw std::runtime_error("computation operation NOT YET IMPLEMENTED\n");
1014
1015 std::string output = "nodelevel/configs/" + opname.substr(opos + 1, machinePos - opos - 1) + std::to_string(process_Rank) + ".cfg";
1016
1017 std::string::size_type corePos = opname.find("//", machinePos + 2);
1018 std::string::size_type definePos = opname.find("//", corePos + 2);
1019
1020 std::string extras = "-extras" + opname.substr(corePos + 2, definePos - corePos - 2);
1021
1022 std::string ECM_core = extras.erase(0, 7);
1023 ECM_core = extras.substr(0, extras.find("+"));
1024
1025 if (!kerncraftExecuted && process_Rank == 0)
1026 {
1027 kerncraftExecuted = true;
1028 std::string output = "nodelevel/configs/" + opname.substr(opos + 1, machinePos - opos - 1) + ".cfg";
1029
1030 system(("rm " + output).c_str());
1031
1032 std::string::size_type pos = opname.find("//BREAK:");
1033 std::string source = "nodelevel/kernels/" + opname.substr(opos + 1, machinePos - opos - 1) + ".c";
1034 std::transform(source.begin(), source.end(), source.begin(), ::tolower);
1035
1036 std::string::size_type opos = opname.find(":");
1037 std::string::size_type machinePos = opname.find("//", opos);
1038 std::string::size_type corePos = opname.find("//", machinePos + 2);
1039 std::string::size_type definePos = opname.find("//", corePos + 2);
1040
1041 std::string script("python3 ./kerncraftintegration/diskern.py");
1042 std::string outputPath = "-o" + output;
1043 std::string machine = "-m" + opname.substr(machinePos + 2, corePos - machinePos - 2);
1044 std::string extras = "-extras" + opname.substr(corePos + 2, definePos - corePos - 2);
1045 std::string cores = "-c" + std::to_string(cores_per_socket);
1046 std::string defines = opname.substr(definePos + 2, opname.length());
1047 std::string system_no = "-systemNo" + std::to_string(system_number);
1048 std::string compiler_flag = "--compiler-flags=\"" + CFG_args.getValue<std::string>("compiler_flags") + "\"";
1049 std::string verbose_flag = "-vvv";
1050 std::string pmodel = "-p" + CFG_args.getValue<std::string>("pmodel");
1051 std::string cache_predictor = "-P" + CFG_args.getValue<std::string>("cache_predictor");
1052
1053 std::ofstream sF;
1054 sF.open(source);
1055 sF << opname.substr(0, pos) << std::endl;
1056 sF.close();
1057 char scriptPath[script.length() + 1];
1058 char outputFile[outputPath.length() + 1];
1059 char machineFile[machine.length() + 1];
1060 char coreNumber[cores.length() + 1];
1061 char keyValues[defines.length() + 1];
1062 char sourceFile[source.length() + 1];
1063 char extrasVal[extras.length() + 1];
1064 char system_number_val[system_no.length() + 1];
1065 char compilerFlags[compiler_flag.length() + 1];
1066 char pModel[pmodel.length() + 1];
1067 char versboseFlag[verbose_flag.length() + 1];
1068 char cachePredictor[cache_predictor.length() + 1];
1069
1070 std::strcpy(scriptPath, script.c_str());
1071 std::strcpy(outputFile, outputPath.c_str());
1072 std::strcpy(machineFile, machine.c_str());
1073 std::strcpy(coreNumber, cores.c_str());
1074 std::strcpy(keyValues, defines.c_str());
1075 std::strcpy(sourceFile, source.c_str());
1076 std::strcpy(extrasVal, extras.c_str());
1077 std::strcpy(system_number_val, system_no.c_str());
1078 std::strcpy(compilerFlags, compiler_flag.c_str());
1079 std::strcpy(pModel, pmodel.c_str());
1080 std::strcpy(versboseFlag, verbose_flag.c_str());
1081 std::strcpy(cachePredictor, cache_predictor.c_str());
1082
1083 std::vector<char *> argVek{scriptPath, machineFile, coreNumber, outputFile, extrasVal, system_number_val, pModel, cachePredictor};
1084
1085 if (CFG_args.getValue<DisCosTiC_Datatype>("vvv") == 1)
1086 {
1087 argVek.insert(argVek.end(), versboseFlag);
1088 }
1089 if (!CFG_args.getValue<std::string>("compiler_flags").empty())
1090 {
1091 argVek.insert(argVek.end(), compilerFlags);
1092 }
1093
1094 char *token = std::strtok(keyValues, " ");
1095 while (token != NULL)
1096 {
1097 argVek.push_back(token);
1098 token = std::strtok(NULL, " ");
1099 }
1100 argVek.push_back(sourceFile);
1101 char *argV[argVek.size() + 1];
1102 for (std::size_t i = 0; i < argVek.size(); ++i)
1103 {
1104 argV[i] = argVek[i];
1105 }
1106 argV[argVek.size()] = NULL;
1107 executeKerncraft(argV, argVek.size());
1108
1109 system(("for num in {0.." + std::to_string(N_size_Of_Cluster) + "}; do cp config.cfg config$num.cfg; done").c_str());
1110 system(("for num in {0.." + std::to_string(N_size_Of_Cluster) + "}; do cp ./nodelevel/configs/" + opname.substr(opos + 1, machinePos - opos - 1) + ".cfg ./nodelevel/configs/" + opname.substr(opos + 1, machinePos - opos - 1) + "$num.cfg; done").c_str());
1111 }
1112
1113 if (!barrier)
1114 {
1115 MPI_Barrier(comm);
1116 }
1117
1118 if (!kerncraftExecuted &&
1119 process_Rank == (CFG_args.getValue<DisCosTiC_Datatype>("number_of_processes") + 2) &&
1120 (CFG_args.getValue<DisCosTiC_Datatype>("heteregeneous") == 1))
1121 {
1122 kerncraftExecuted = true;
1123 std::string output = "nodelevel/configs/" + opname.substr(opos + 1, machinePos - opos - 1) + ".cfg";
1124
1125 system(("rm " + output).c_str());
1126
1127 std::string::size_type pos = opname.find("//BREAK:");
1128 std::string source = "nodelevel/kernels/" + opname.substr(opos + 1, machinePos - opos - 1) + ".c";
1129 std::transform(source.begin(), source.end(), source.begin(), ::tolower);
1130
1131 std::string::size_type opos = opname.find(":");
1132 std::string::size_type machinePos = opname.find("//", opos);
1133 std::string::size_type corePos = opname.find("//", machinePos + 2);
1134 std::string::size_type definePos = opname.find("//", corePos + 2);
1135
1136 std::string script("python3 ./kerncraftintegration/diskern.py");
1137 std::string outputPath = "-o" + output;
1138 std::string machine = "-m" + opname.substr(machinePos + 2, corePos - machinePos - 2);
1139 std::string extras = "-extras" + opname.substr(corePos + 2, definePos - corePos - 2);
1140 std::string cores = "-c" + std::to_string(cores_per_socket);
1141 std::string defines = opname.substr(definePos + 2, opname.length());
1142 std::string system_no = "-systemNo" + std::to_string(system_number);
1143 std::string compiler_flag = "--compiler-flags=\"" + CFG_args.getValue<std::string>("secondary_compiler_flags") + "\"";
1144 std::string verbose_flag = "-vvv";
1145 std::string pmodel = "-p" + CFG_args.getValue<std::string>("secondary_pmodel");
1146 std::string cache_predictor = "-P" + CFG_args.getValue<std::string>("secondary_cache_predictor");
1147
1148 std::ofstream sF;
1149 sF.open(source);
1150 sF << opname.substr(0, pos) << std::endl;
1151 sF.close();
1152 char scriptPath[script.length() + 1];
1153 char outputFile[outputPath.length() + 1];
1154 char machineFile[machine.length() + 1];
1155 char coreNumber[cores.length() + 1];
1156 char keyValues[defines.length() + 1];
1157 char sourceFile[source.length() + 1];
1158 char extrasVal[extras.length() + 1];
1159 char system_number_val[system_no.length() + 1];
1160 char compilerFlags[compiler_flag.length() + 1];
1161 char pModel[pmodel.length() + 1];
1162 char versboseFlag[verbose_flag.length() + 1];
1163 char cachePredictor[cache_predictor.length() + 1];
1164
1165 std::strcpy(scriptPath, script.c_str());
1166 std::strcpy(outputFile, outputPath.c_str());
1167 std::strcpy(machineFile, machine.c_str());
1168 std::strcpy(coreNumber, cores.c_str());
1169 std::strcpy(keyValues, defines.c_str());
1170 std::strcpy(sourceFile, source.c_str());
1171 std::strcpy(extrasVal, extras.c_str());
1172 std::strcpy(system_number_val, system_no.c_str());
1173 std::strcpy(compilerFlags, compiler_flag.c_str());
1174 std::strcpy(pModel, pmodel.c_str());
1175 std::strcpy(versboseFlag, verbose_flag.c_str());
1176 std::strcpy(cachePredictor, cache_predictor.c_str());
1177
1178 std::vector<char *> argVek{scriptPath, machineFile, coreNumber, outputFile, extrasVal, system_number_val, pModel, cachePredictor};
1179
1180 if (CFG_args.getValue<DisCosTiC_Datatype>("secondary_vvv") == 1)
1181 {
1182 argVek.insert(argVek.end(), versboseFlag);
1183 }
1184 if (!CFG_args.getValue<std::string>("secondary_compiler_flags").empty())
1185 {
1186 argVek.insert(argVek.end(), compilerFlags);
1187 }
1188
1189 char *token = std::strtok(keyValues, " ");
1190 while (token != NULL)
1191 {
1192 argVek.push_back(token);
1193 token = std::strtok(NULL, " ");
1194 }
1195 argVek.push_back(sourceFile);
1196 char *argV[argVek.size() + 1];
1197 for (std::size_t i = 0; i < argVek.size(); ++i)
1198 {
1199 argV[i] = argVek[i];
1200 }
1201 argV[argVek.size()] = NULL;
1202 executeKerncraft(argV, argVek.size());
1203
1204 system(("for num in {0.." + std::to_string(N_size_Of_Cluster) + "}; do cp config.cfg config$num.cfg; done").c_str());
1205 system(("for num in {0.." + std::to_string(N_size_Of_Cluster) + "}; do cp ./nodelevel/configs/" + opname.substr(opos + 1, machinePos - opos - 1) + ".cfg ./nodelevel/configs/" + opname.substr(opos + 1, machinePos - opos - 1) + "$num.cfg; done").c_str());
1206 }
1207
1209 {
1210 MPI_Barrier(comm);
1211 barrier_hetero = true;
1212 }
1213
1214 UserInterface::ConfigParser config("./config" + std::to_string(process_Rank) + ".cfg");
1215 UserInterface::ConfigParser NodeCFG(output);
1216
1217 // scaling_cores = NodeCFG.getValue<DisCosTiC_Datatype>("Scaling_cores");
1218
1219 NodeModel NM(&config, YAML_args, &NodeCFG, ECM_core);
1220 // std::cout<<process_Rank<<" "<<NM.getECM().T_MECM_<<std::endl;
1221 estimation(NM, &perf_est, &runtime);
1222 }
1223 else if (opname.substr(0, n) == "FILE")
1224 {
1225
1226 //std::cout << "FILE Check opname: " << opname << std::endl;
1227 opname.erase(0, n + 1);
1228 //std::cout << "Check opname: " << opname << std::endl;
1229 std::string::size_type opos = opname.find(":");
1230 std::string::size_type machinePos = opname.find("//", opos);
1231
1232 //if (this->func != opname.substr(opos + 1, machinePos - opos - 1))
1233 //throw std::runtime_error("computation operation NOT YET IMPLEMENTED\n");
1234
1235 std::string output = "nodelevel/configs/" + opname.substr(opos + 1, machinePos - opos - 1) + std::to_string(process_Rank) + ".cfg";
1236
1237 //std::cout << "cfg: " << output << std::endl;
1238 std::string::size_type corePos = opname.find("//", machinePos + 2);
1239 std::string::size_type definePos = opname.find("//", corePos + 2);
1240
1241 std::string extras = "-extras" + opname.substr(corePos + 2, definePos - corePos - 2);
1242 //std::cout << "extras: " << extras << std::endl;
1243
1244 std::string ECM_core = extras.erase(0, 7);
1245 ECM_core = extras.substr(0, extras.find("+"));
1246
1247 std::string::size_type pos = opname.find("//BREAK:");
1248
1249 std::string source = "nodelevel/kernels/" + opname.substr(0, pos);
1250
1251 std::ifstream file;
1252
1253 file.open(source);
1254
1255 if (!file)
1256 {
1257 if (process_Rank == 0)
1258 std::cout << "File does not exists ! " << source;
1259
1260 file.close();
1261 MPI_Finalize();
1262 exit(0);
1263 }
1264 file.close();
1265
1266
1267 std::string str_part1 = CFG_args.getValue<std::string>("part1");
1268 std::string str_part2 = CFG_args.getValue<std::string>("part2");
1269
1270 // Run Kerncraft once per kernel, not once per modeled rank.
1271 bool already_done = false;
1272 if (opname.find(str_part1) != std::string::npos)
1273 already_done = kerncraftExecuted_1;
1274 else if (str_part2 != "0" && opname.find(str_part2) != std::string::npos)
1275 already_done = kerncraftExecuted_2;
1276 else
1277 already_done = kerncraftExecuted;
1278
1279 if (!already_done && process_Rank == 0)
1280 {
1281 if (opname.find(str_part1) != std::string::npos)
1282 kerncraftExecuted_1 = true;
1283 if (str_part2 == "0" || opname.find(str_part2) != std::string::npos)
1284 kerncraftExecuted_2 = true;
1285 kerncraftExecuted = true;
1286 std::string output = "nodelevel/configs/" + opname.substr(opos + 1, machinePos - opos - 1) + ".cfg";
1287
1288 system(("rm nodelevel/configs/" + opname.substr(opos + 1, machinePos - opos - 1) + ".cfg").c_str());
1289
1290 std::string::size_type opos = opname.find(":");
1291 std::string::size_type machinePos = opname.find("//", opos);
1292 std::string::size_type corePos = opname.find("//", machinePos + 2);
1293 std::string::size_type definePos = opname.find("//", corePos + 2);
1294
1295 std::string script("python3 ./kerncraftintegration/diskern.py");
1296 std::string outputPath = "-o" + output;
1297 std::string machine = "-m" + opname.substr(machinePos + 2, corePos - machinePos - 2);
1298 std::string extras = "-extras" + opname.substr(corePos + 2, definePos - corePos - 2);
1299 std::string cores = "-c" + std::to_string(cores_per_socket);
1300 std::string defines = opname.substr(definePos + 2, opname.length());
1301 //std::cout << "defines: " << defines << std::endl;
1302 std::string system_no = "-systemNo" + std::to_string(system_number);
1303 std::string compiler_flag = "--compiler-flags=\"" + CFG_args.getValue<std::string>("compiler_flags") + "\"";
1304 std::string verbose_flag = "-vvv";
1305 std::string pmodel = "-p" + CFG_args.getValue<std::string>("pmodel");
1306 std::string cache_predictor = "-P" + CFG_args.getValue<std::string>("cache_predictor");
1307
1308 char scriptPath[script.length() + 1];
1309 char outputFile[outputPath.length() + 1];
1310 char machineFile[machine.length() + 1];
1311 char coreNumber[cores.length() + 1];
1312 char keyValues[defines.length() + 1];
1313 char sourceFile[source.length() + 1];
1314 char extrasVal[extras.length() + 1];
1315 char system_number_val[system_no.length() + 1];
1316 char compilerFlags[compiler_flag.length() + 1];
1317 char pModel[pmodel.length() + 1];
1318 char versboseFlag[verbose_flag.length() + 1];
1319 char cachePredictor[cache_predictor.length() + 1];
1320
1321 std::strcpy(scriptPath, script.c_str());
1322 std::strcpy(outputFile, outputPath.c_str());
1323 std::strcpy(machineFile, machine.c_str());
1324 std::strcpy(coreNumber, cores.c_str());
1325 std::strcpy(keyValues, defines.c_str());
1326 //std::cout << "keyValues: " << keyValues << std::endl;
1327 std::strcpy(sourceFile, source.c_str());
1328 std::strcpy(extrasVal, extras.c_str());
1329 std::strcpy(system_number_val, system_no.c_str());
1330 std::strcpy(compilerFlags, compiler_flag.c_str());
1331 std::strcpy(pModel, pmodel.c_str());
1332 std::strcpy(versboseFlag, verbose_flag.c_str());
1333 std::strcpy(cachePredictor, cache_predictor.c_str());
1334
1335 std::vector<char *> argVek{scriptPath, machineFile, coreNumber, outputFile, extrasVal, system_number_val, pModel, cachePredictor};
1336
1337 if (CFG_args.getValue<DisCosTiC_Datatype>("vvv") == 1)
1338 {
1339 argVek.insert(argVek.end(), versboseFlag);
1340 }
1341 if (!CFG_args.getValue<std::string>("compiler_flags").empty())
1342 {
1343 argVek.insert(argVek.end(), compilerFlags);
1344 }
1345
1346 char *token = std::strtok(keyValues, " ");
1347 while (token != NULL)
1348 {
1349 argVek.push_back(token);
1350 token = std::strtok(NULL, " ");
1351 }
1352 argVek.push_back(sourceFile);
1353 char *argV[argVek.size() + 1];
1354 for (std::size_t i = 0; i < argVek.size(); ++i)
1355 {
1356 //std::cout << "argVek:- idx: " << i << ",Value: " << argVek[i] << std::endl;
1357 argV[i] = argVek[i];
1358 }
1359 argV[argVek.size()] = NULL;
1360
1361 executeKerncraft(argV, argVek.size());
1362
1363 system(("for num in {0.." + std::to_string(N_size_Of_Cluster) + "}; do cp config.cfg config$num.cfg; done").c_str());
1364 system(("for num in {0.." + std::to_string(N_size_Of_Cluster) + "}; do cp ./nodelevel/configs/" + opname.substr(opos + 1, machinePos - opos - 1) + ".cfg ./nodelevel/configs/" + opname.substr(opos + 1, machinePos - opos - 1) + "$num.cfg; done").c_str());
1365 }
1366 // std::cout << "process_Rank: " << process_Rank << ", opname: " << opname.substr(opos + 1, machinePos - opos - 1) + ".cfg ./nodelevel/configs/" + opname.substr(opos + 1, machinePos - opos - 1) << std::endl;
1367
1368 if (!barrier)
1369 {
1370 MPI_Barrier(comm);
1371 barrier = true;
1372 }
1373
1374 if (!kerncraftExecuted &&
1375 process_Rank == (CFG_args.getValue<DisCosTiC_Datatype>("number_of_processes") + 2) &&
1376 (CFG_args.getValue<DisCosTiC_Datatype>("heteregeneous") == 1))
1377 {
1378 kerncraftExecuted = true;
1379 std::string output = "nodelevel/configs/" + opname.substr(opos + 1, machinePos - opos - 1) + ".cfg";
1380
1381 std::string::size_type pos = opname.find("//BREAK:");
1382 std::string source = "nodelevel/kernels/" + opname.substr(0, pos);
1383
1384 std::string::size_type opos = opname.find(":");
1385 std::string::size_type machinePos = opname.find("//", opos);
1386 std::string::size_type corePos = opname.find("//", machinePos + 2);
1387 std::string::size_type definePos = opname.find("//", corePos + 2);
1388
1389 std::string script("python3 ./kerncraftintegration/diskern.py");
1390 std::string outputPath = "-o" + output;
1391 std::string machine = "-m" + opname.substr(machinePos + 2, corePos - machinePos - 2);
1392 std::string extras = "-extras" + opname.substr(corePos + 2, definePos - corePos - 2);
1393 std::string cores = "-c" + std::to_string(cores_per_socket);
1394 std::string defines = opname.substr(definePos + 2, opname.length());
1395 std::string system_no = "-systemNo" + std::to_string(system_number);
1396 std::string compiler_flag = "--compiler-flags=\"" + CFG_args.getValue<std::string>("secondary_compiler_flags") + "\"";
1397 std::string verbose_flag = "-vvv";
1398 std::string pmodel = "-p" + CFG_args.getValue<std::string>("secondary_pmodel");
1399 std::string cache_predictor = "-P" + CFG_args.getValue<std::string>("secondary_cache_predictor");
1400
1401 char scriptPath[script.length() + 1];
1402 char outputFile[outputPath.length() + 1];
1403 char machineFile[machine.length() + 1];
1404 char coreNumber[cores.length() + 1];
1405 char keyValues[defines.length() + 1];
1406 char sourceFile[source.length() + 1];
1407 char extrasVal[extras.length() + 1];
1408 char system_number_val[system_no.length() + 1];
1409 char compilerFlags[compiler_flag.length() + 1];
1410 char pModel[pmodel.length() + 1];
1411 char versboseFlag[verbose_flag.length() + 1];
1412 char cachePredictor[cache_predictor.length() + 1];
1413
1414 std::strcpy(scriptPath, script.c_str());
1415 std::strcpy(outputFile, outputPath.c_str());
1416 std::strcpy(machineFile, machine.c_str());
1417 std::strcpy(coreNumber, cores.c_str());
1418 std::strcpy(keyValues, defines.c_str());
1419 std::strcpy(sourceFile, source.c_str());
1420 std::strcpy(extrasVal, extras.c_str());
1421 std::strcpy(system_number_val, system_no.c_str());
1422 std::strcpy(compilerFlags, compiler_flag.c_str());
1423 std::strcpy(pModel, pmodel.c_str());
1424 std::strcpy(versboseFlag, verbose_flag.c_str());
1425 std::strcpy(cachePredictor, cache_predictor.c_str());
1426
1427 std::vector<char *> argVek{scriptPath, machineFile, coreNumber, outputFile, extrasVal, system_number_val, pModel, cachePredictor};
1428
1429 if (CFG_args.getValue<DisCosTiC_Datatype>("secondary_vvv") == 1)
1430 {
1431 argVek.insert(argVek.end(), versboseFlag);
1432 }
1433 if (!CFG_args.getValue<std::string>("secondary_compiler_flags").empty())
1434 {
1435 argVek.insert(argVek.end(), compilerFlags);
1436 }
1437
1438 char *token = std::strtok(keyValues, " ");
1439
1440 while (token != NULL)
1441 {
1442 argVek.push_back(token);
1443 token = std::strtok(NULL, " ");
1444 }
1445 argVek.push_back(sourceFile);
1446 char *argV[argVek.size() + 1];
1447 for (std::size_t i = 0; i < argVek.size(); ++i)
1448 {
1449 argV[i] = argVek[i];
1450 }
1451 argV[argVek.size()] = NULL;
1452
1453 executeKerncraft(argV, argVek.size());
1454
1455 system(("for num in {0.." + std::to_string(N_size_Of_Cluster) + "}; do cp config.cfg config$num.cfg; done").c_str());
1456 system(("for num in {0.." + std::to_string(N_size_Of_Cluster) + "}; do cp ./nodelevel/configs/" + opname.substr(opos + 1, machinePos - opos - 1) + ".cfg ./nodelevel/configs/" + opname.substr(opos + 1, machinePos - opos - 1) + "$num.cfg; done").c_str());
1457 }
1458
1460 {
1461 MPI_Barrier(comm);
1462 barrier_hetero = true;
1463 }
1464
1465 UserInterface::ConfigParser config("./config" + std::to_string(process_Rank) + ".cfg");
1466 UserInterface::ConfigParser NodeCFG(output);
1467
1468 // scaling_cores = NodeCFG.getValue<DisCosTiC_Datatype>("Scaling_cores");
1469
1470 NodeModel NM(&config, YAML_args, &NodeCFG, ECM_core);
1471
1472 estimation(NM, &perf_est, &runtime);
1473 }
1474 else
1475 {
1476 // TODO Add error message
1477 abort();
1478 }
1479 *rt = runtime * 1e9;
1480 return;
1481 }
1487 /* inline DisCosTiC_Indextype Exec(std::string opname, DisCosTiC_Timetype bufSize) {
1488 std::vector<vec3T> buf;
1489 vec3T elem = vec3T(1, 1, bufSize);
1490 buf.push_back(elem);
1491
1492 this->compCount++;
1493 this->count++;
1494
1495 std::stringstream ss;
1496 ss << "l" << this->count << ": calc ";
1497 DisCosTiC_Datatype bufSize=0;
1498 for (unsigned DisCosTiC_Datatype i = 0; i < buf.bufSize(); i++) {
1499 bufSize += buf[i].bufSize;
1500 }
1501 ss << bufSize << std::endl;
1502 AppendString(ss.str(),content);
1503
1504 return this->count;
1505 }*/
1506
1514 {
1515 this->depCount++;
1516
1517 std::stringstream ss;
1518 ss << "l" << src << " requires l" << dest << std::endl;
1519
1520 EraseSrcDest(src, dest);
1521 AppendString(ss.str(), content);
1522
1523 // std::cout << dest << "\t" << +toCharPointer(dest) << std::endl;
1524 this->insertDep(depTable, toCharPointer(src), toCharPointer(dest));
1525 DisCosTiC::AST_OP *a = this->retrieveID(indicesTable, toCharPointer(src));
1526 DisCosTiC::AST_OP *b = this->retrieveID(indicesTable, toCharPointer(dest));
1527 /*std::cout << "src: " ;
1528 print_DeserialNodeT(src);
1529 std::cout << "dst: " ;
1530 print_DeserialNodeT(dest);*/
1531 b->DepOperations.push_back(a);
1532 a->depCount++;
1533 edgesCount++;
1534 }
1535
1537 {
1538
1539 // std::cout << "this->count : " << this->count << " a.first = " << a.first << " b.first = " << b.first << std::endl;
1540
1541 if (a.first != INVALID_ID)
1542 {
1543 this->insertID(indicesTable, toCharPointer(a.first), a.second);
1544 }
1545 if (b.first != INVALID_ID)
1546 {
1547 this->blocking(a.first, b.first); // if(DisCosTiC::Mode_t::NONBLOCKING)
1548 }
1549 }
1550
1558 {
1559 this->depCount++;
1560
1561 std::stringstream ss;
1562 ss << "l" << src << " irequires l" << dest << std::endl;
1563
1564 EraseSrcDest(src, dest);
1565 AppendString(ss.str(), content);
1566
1567 // std::cout << dest << "\t" << +toCharPointer(dest) << std::endl;
1568 this->insertDep(depTable, toCharPointer(src), toCharPointer(dest));
1569 DisCosTiC::AST_OP *a = this->retrieveID(indicesTable, toCharPointer(src));
1570 DisCosTiC::AST_OP *b = this->retrieveID(indicesTable, toCharPointer(dest));
1571 /*std::cout << "src: " ;
1572 print_DeserialNodeT(src);
1573 std::cout << "dst: " ;
1574 print_DeserialNodeT(dest);*/
1575 b->IdepOperations.push_back(a);
1576 a->depCount++;
1577 edgesCount++;
1578 }
1579
1581 {
1582 if (a.first != INVALID_ID)
1583 {
1584 this->insertID(indicesTable, toCharPointer(a.first), a.second);
1585 }
1586 if (b.first != INVALID_ID)
1587 {
1588 this->nonBlocking(a.first, b.first); // if(DisCosTiC::Mode_t::NONBLOCKING)
1589 }
1590 }
1591
1596 {
1597 for (auto rank : DisCosTiC::getRange(rankCount))
1598 {
1599 for (std::map<std::string, DisCosTiC::AST_OP *>::iterator itr = indicesTable->begin(); itr != indicesTable->end(); ++itr)
1600 {
1601 std::cout << '\t' << itr->first << '\t';
1602 print_DeserialNodeT(+itr->second);
1603 }
1604 }
1605 }
1606
1608 {
1609 for (auto rank : DisCosTiC::getRange(rankCount))
1610 {
1611 for (std::map<std::string, DisCosTiC::AST_OP_TYPE>::iterator itr = indicesDeserializedTable->begin(); itr != indicesDeserializedTable->end(); ++itr)
1612 {
1613 std::cout << '\t' << itr->first << '\t';
1614 print_DeserialNodeNonPointerT(+itr->second);
1615 }
1616 }
1617 }
1618
1622 inline void print_depTable()
1623 {
1624 for (auto rank : DisCosTiC::getRange(rankCount))
1625 {
1626 for (std::map<std::string, std::string>::iterator itr = depTable->begin(); itr != depTable->end(); ++itr)
1627 {
1628 std::cout << '\t' << itr->first << '\t' << itr->second << '\n';
1629 // char *cstr1 = new char[itr->first.length() + 1];
1630 // strcpy(cstr1, itr->first.c_str());
1631 // char *cstr2 = new char[itr->second.length() + 1];
1632 // strcpy(cstr2, itr->second.c_str());
1633 // std::map<std::string, DisCosTiC::AST_OP*>::iterator srcit = indicesTable->find(itr->first);
1634 // std::map<std::string, DisCosTiC::AST_OP*>::iterator dstit = indicesTable->find(itr->second);
1635 // this->Dependency( this->retrieveID(indicesTable, itr->first ), this->retrieveID(indicesTable, itr->second) );
1636 // delete [] cstr1;
1637 // delete [] cstr2;
1638 }
1639 }
1640 }
1641
1645 inline void Rank_Finalize()
1646 {
1647 for (std::vector<DisCosTiC::AST_OP *>::iterator it = this->allNodes.begin(); it != this->allNodes.end(); it++)
1648 { // TODO: added to AST destructor
1649 delete *it;
1650 }
1651 AppendString("}\n", content);
1652 }
1653
1657 inline void File_Write()
1658 {
1659 if (myfile.is_open())
1660 {
1661 myfile << this->content;
1662 this->content.clear();
1663 myfile.sync();
1664 }
1665 else
1666 {
1667 std::cerr << "ERROR: missing result file definition of " << this->filename << " for writing" << std::endl;
1668 }
1669 }
1670};
1671
1672#endif
int virtual_rank
Definition DisCosTiC.cpp:62
static bool kernel_2
Definition AST.hpp:31
int secondary_processes
Definition DisCosTiC.cpp:71
int secondary_cores_per_socket
Definition DisCosTiC.cpp:74
int socket
Definition DisCosTiC.cpp:69
int scaling_cores
Definition AST.hpp:36
int heteregeneous_mode
Definition DisCosTiC.cpp:72
static bool Verbose
Definition AST.hpp:27
static bool kerncraftExecuted_2
Definition AST.hpp:29
static bool kernel_1
Definition AST.hpp:30
UserInterface::ConfigParser CFG_args("config.cfg")
< configuration file parser
int primary_cores_per_socket
Definition DisCosTiC.cpp:73
static bool barrier_hetero
Definition AST.hpp:34
static bool kerncraftExecuted
Definition AST.hpp:26
int secondary_task_per_node
Definition DisCosTiC.cpp:76
int system_number
Definition DisCosTiC.cpp:63
int primary_processes
Definition DisCosTiC.cpp:70
int cores_per_socket
Definition DisCosTiC.cpp:67
static bool barrier
Definition AST.hpp:33
int bytes_to_send
Definition AST.hpp:37
int task_per_node
Definition DisCosTiC.cpp:64
int cc_numa_domain_per_socket
Definition DisCosTiC.cpp:66
static bool kerncraftExecuted_1
Definition AST.hpp:28
std::string arch_name
Definition DisCosTiC.cpp:77
int cc_numa_domain
Definition DisCosTiC.cpp:68
int primary_task_per_node
Definition DisCosTiC.cpp:75
int node
Definition DisCosTiC.cpp:65
static int kerncraft_count
Definition AST.hpp:32
std::size_t DisCosTiC_Indextype
Definition DataType.hpp:53
std::pair< locop_t, locop_t > locopPair_t
Definition DataType.hpp:64
std::size_t DisCosTiC_Datatype
Definition DataType.hpp:52
std::vector< std::pair< DisCosTiC_Indextype, DisCosTiC::Mode_t > > locop_t
identify local operations for dependencies
Definition DataType.hpp:63
double DisCosTiC_Timetype
Definition DataType.hpp:51
std::set< DisCosTiC_Indextype > idSetT
Definition DataType.hpp:54
DisCosTiC_Timetype * scaling_performance
DisCosTiC_Timetype DisCosTiC_Timetype * scaling_numa
void estimation(NodeModel &NM, DisCosTiC_Timetype *perf_est, DisCosTiC_Timetype *runtime)
void scaling(NodeModel &NM, DisCosTiC_Timetype *scaling_performance, DisCosTiC_Timetype *scaling_numa)
void executeKerncraft(char *argV[], int size)
end AST_HPP
Definition AST.hpp:58
void Rank_Init(DisCosTiC_Datatype rank)
start a rank
Definition AST.hpp:272
DisCosTiC_Datatype sendCount
Definition AST.hpp:79
DisCosTiC::Event Isend(const void *buf, DisCosTiC_Datatype bufsize, MPI_Datatype datatype, DisCosTiC_Datatype dst, int tag, MPI_Comm comm, MPI_Request *request, DisCosTiC::Event depOP)
perform a non-blocking message sending operation
Definition AST.hpp:556
std::string content
Definition AST.hpp:72
DisCosTiC::Event Irecv(DisCosTiC_Datatype bufsize, DisCosTiC_Datatype src, DisCosTiC::Event depOP)
perform a non-blocking message receiving operation
Definition AST.hpp:677
DisCosTiC_Datatype getNumOps()
get the number of operations for each rank
Definition AST.hpp:323
void execNodeLVL(std::string &opname, UserInterface::YAMLParser YAML_args, DisCosTiC_Timetype *rt, DisCosTiC_Datatype process_Rank, DisCosTiC_Datatype N_size_Of_Cluster, MPI_Comm comm)
Definition AST.hpp:891
void print_indicesDeserializedTable()
Definition AST.hpp:1607
void InsertSrcDest()
append to independent set
Definition AST.hpp:149
void EraseSrcDest(DisCosTiC_Indextype src, DisCosTiC_Indextype dest)
EraseSrcDest from independent set.
Definition AST.hpp:160
DisCosTiC_Datatype curtag
Definition AST.hpp:79
DisCosTiC::AST_OP_TYPE retrievedeserialID(std::map< std::string, DisCosTiC::AST_OP_TYPE > *idTable, std::string id)
Definition AST.hpp:250
DisCosTiC::NCMIntraAndInterNodeData intraAndInterNodeRanks
Definition AST.hpp:64
DisCosTiC::AST_OP * retrieveID(std::map< std::string, DisCosTiC::AST_OP * > *idTable, std::string id)
Definition AST.hpp:232
DisCosTiC::Event Send(const void *buf, DisCosTiC_Datatype bufsize, MPI_Datatype datatype, DisCosTiC_Datatype dst, int tag, MPI_Comm comm, MPI_Request *request, DisCosTiC::Event depOP)
perform a message sending operation
Definition AST.hpp:470
std::map< std::string, DisCosTiC::AST_OP_TYPE > * indicesDeserializedTable
Definition AST.hpp:84
DisCosTiC::Event Exec(std::string opname, DisCosTiC::Event depOP1, UserInterface::YAMLParser YAML_args, DisCosTiC_Datatype process_Rank, DisCosTiC_Datatype N_size_Of_Cluster, MPI_Comm comm)
perform computation operation with blocking communication routines
Definition AST.hpp:755
locopPair_t EndOp()
complete an operation
Definition AST.hpp:178
void blocking(DisCosTiC_Indextype src, DisCosTiC_Indextype dest)
perform computation operation
Definition AST.hpp:1513
DisCosTiC::Event Recv(const void *buf, DisCosTiC_Datatype bufsize, MPI_Datatype datatype, DisCosTiC_Datatype src, int tag, MPI_Comm comm, MPI_Request *request, DisCosTiC::Event depOP)
perform a message receiving operation
Definition AST.hpp:638
void insertInNetwork(int src, int dst)
Definition AST.hpp:328
void StartOp()
start an operation
Definition AST.hpp:169
DisCosTiC::AST_OP * addNode()
Definition AST.hpp:294
DisCosTiC::Event Send(DisCosTiC_Datatype bufsize, DisCosTiC_Datatype dst, DisCosTiC::Event depOP)
perform a message sending operation
Definition AST.hpp:429
idSetT start
private variables required for nonblocking calls
Definition AST.hpp:71
DisCosTiC_Datatype compCount
Definition AST.hpp:79
DisCosTiC::Event Recv(DisCosTiC_Datatype bufsize, DisCosTiC_Datatype src, DisCosTiC::Event depOP)
perform a message receiving operation
Definition AST.hpp:600
DisCosTiC_Datatype timeunit_conv
Definition AST.hpp:80
DisCosTiC_Datatype Maxnetwork(DisCosTiC_Datatype network=0)
Definition AST.hpp:312
DisCosTiC_Timetype execsize
Definition AST.hpp:87
void printNCMRanks()
Definition AST.hpp:394
DisCosTiC_Indextype count
Definition AST.hpp:77
void insertID(std::map< std::string, DisCosTiC::AST_OP * > *idTable, char *ID, DisCosTiC::AST_OP *op)
Definition AST.hpp:213
DisCosTiC::Event Iexec(std::string opname, UserInterface::YAMLParser YAML_args, DisCosTiC::Event depOP1, DisCosTiC_Datatype process_Rank, DisCosTiC_Datatype N_size_Of_Cluster, MPI_Comm comm)
perform computation operation with non-blocking communication routines
Definition AST.hpp:805
std::vector< DisCosTiC::AST_OP * > allNodes
Definition AST.hpp:60
DisCosTiC_Indextype labelCount
Definition AST.hpp:74
DisCosTiC_Datatype node
Definition AST.hpp:78
std::vector< DisCosTiC::AST_OP * > RootNodes
Definition AST.hpp:61
DisCosTiC_Datatype mode
Definition AST.hpp:86
DisCosTiC::Event Isend(DisCosTiC_Datatype bufsize, DisCosTiC_Datatype dst, DisCosTiC::Event depOP)
perform a non-blocking message sending operation
Definition AST.hpp:515
void nonBlocking(DisCosTiC_Indextype src, DisCosTiC_Indextype dest)
dependency on non-blocking send/recv operation that satisfied with start of an operation while link t...
Definition AST.hpp:1557
DisCosTiC::Event Irecv(const void *buf, DisCosTiC_Datatype bufsize, MPI_Datatype datatype, DisCosTiC_Datatype src, int tag, MPI_Comm comm, MPI_Request *request, DisCosTiC::Event depOP)
perform a non-blocking message receiving operation
Definition AST.hpp:715
DisCosTiC_Datatype MaxCPU(DisCosTiC_Datatype node=0)
Definition AST.hpp:304
void insertdeserialID(std::map< std::string, DisCosTiC::AST_OP_TYPE > *idTable, char *ID, DisCosTiC::AST_OP_TYPE op)
Definition AST.hpp:219
void nonBlockingDep(DisCosTiC::Event a, DisCosTiC::Event b)
Definition AST.hpp:1580
idSetT end
the operations which are independent at start and end
Definition AST.hpp:71
DisCosTiC_Datatype depCount
Definition AST.hpp:79
void File_Write()
write to output file
Definition AST.hpp:1657
std::fstream myfile
Definition AST.hpp:73
std::string filename
Definition AST.hpp:72
AST(UserInterface::ConfigParser *CFG_args, DisCosTiC_Datatype numRanks)
constructor that initializes the coordinates for sendCount, recvCount, compCount, rankCount,...
Definition AST.hpp:95
DisCosTiC_Datatype recvCount
Definition AST.hpp:79
std::vector< bool > ranks_init
Definition AST.hpp:76
void blockingDep(DisCosTiC::Event a, DisCosTiC::Event b)
Definition AST.hpp:1536
DisCosTiC_Datatype dummyNode
Definition AST.hpp:78
DisCosTiC::NCMInterClusterData interClusterRanks
Definition AST.hpp:65
DisCosTiC_Indextype edgesCount
Definition AST.hpp:74
DisCosTiC_Datatype rank
Definition AST.hpp:80
std::map< std::string, DisCosTiC::AST_OP * > * indicesTable
Definition AST.hpp:82
void SetNumRanks(DisCosTiC_Datatype nr)
Definition AST.hpp:207
void Settag(DisCosTiC_Datatype tag)
set a tag
Definition AST.hpp:196
~AST()
destructor
Definition AST.hpp:125
std::map< std::string, std::string > * depTable
Definition AST.hpp:83
DisCosTiC_Datatype rankCount
Definition AST.hpp:79
DisCosTiC::Event Collective(DisCosTiC::CollectiveType collectiveType, DisCosTiC_Datatype root, DisCosTiC_Datatype bufsize, DisCosTiC_Datatype myRank, DisCosTiC_Datatype numRanks, DisCosTiC::Event depOP, uint8_t algorithm=0)
Definition AST.hpp:845
void Rank_Finalize()
end of each process runtime with closing loop
Definition AST.hpp:1645
void print_indicesTable()
DEBUG: printing table that consists of node id with node type.
Definition AST.hpp:1595
void insertDep(std::map< std::string, std::string > *depTable, char *ID1, char *ID2)
Definition AST.hpp:225
void print_depTable()
DEBUG: printing table that consist of respective node dependencies.
Definition AST.hpp:1622
void SetRank(DisCosTiC_Datatype r)
Definition AST.hpp:201
end NodeModel_HPP
Definition NodeModel.hpp:63
void setMultiCore(DisCosTiC_Timetype T_MECM)
Machine & getMachine()
a wrapper class which contains functions for parsing the configuration file end class configParser
scalarT getValue(const std::string &key, scalarT const &defaultValue=scalarT()) const
a function that retrieves the value of a specific key
end class YAMLParser
@ BLOCKING
send and recv MPI routines, blocking: next operation not be executed before finishing of previous ope...
Definition enum.hpp:33
@ NONBLOCKING
isend and irecv MPI routines, non-blocking: next operation not be executed before starting of previou...
Definition enum.hpp:32
@ COMP
compuation operation type
Definition enum.hpp:19
@ SEND
send operation type
Definition enum.hpp:17
@ COMPADD
Definition enum.hpp:21
@ COLLECTIVE
Definition enum.hpp:22
@ RECV
recv operation type
Definition enum.hpp:18
#define print_DeserialNodeT(op)
Definition macro.hpp:177
static const DisCosTiC_Indextype INVALID_ID
< data types
Definition macro.hpp:15
#define toCharPointer(content)
append content to a string with label l
Definition macro.hpp:280
#define fileclose(myfile, filename)
close an open file
Definition macro.hpp:251
#define print_DeserialNodeNonPointerT(op)
Definition macro.hpp:195
#define AppendString(str, content)
append a string
Definition macro.hpp:271
std::map< std::string, std::set< int > > NCMInterClusterData
std::pair< DisCosTiC_Indextype, DisCosTiC::AST_OP * > Event
CollectiveType
Definition enum.hpp:38
@ COLL_BCAST
Definition enum.hpp:39
@ COLL_ALLREDUCE
Definition enum.hpp:41
@ COLL_REDUCE
Definition enum.hpp:40
iteratorRange< scalarT > getRange(scalarT begin, scalarT end)
Definition DataType.hpp:161
std::map< std::string, std::map< std::string, std::set< int > > > NCMIntraAndInterNodeData
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
DisCosTiC_Datatype cores_per_socket_
Definition NodeModel.hpp:39