@@ -79,8 +79,12 @@ int main(int argc, char *argv[]) {
7979 continue ;
8080 }
8181
82- std::cout << " Warning: assuming all node types can be scheduled on all processor types!\n " ;
83- bspInstance.SetAllOnesCompatibilityMatrix ();
82+ if (bspInstance.GetComputationalDag ().NumVertexTypes () == bspInstance.GetArchitecture ().GetNumberOfProcessorTypes ()) {
83+ bspInstance.SetDiagonalCompatibilityMatrix (bspInstance.GetComputationalDag ().NumVertexTypes ());
84+ } else {
85+ std::cout << " Warning: Mismatch in number of node & processor types - assuming full compatibility instead!\n " ;
86+ bspInstance.SetAllOnesCompatibilityMatrix ();
87+ }
8488
8589 std::vector<std::string> schedulersName (parser.scheduler_ .size (), " " );
8690 std::vector<bool > schedulersFailed (parser.scheduler_ .size (), false );
@@ -93,6 +97,14 @@ int main(int argc, char *argv[]) {
9397 for (auto &algorithm : parser.scheduler_ ) {
9498 schedulersName[algorithmCounter] = algorithm.second .get_child (" name" ).get_value <std::string>();
9599
100+ if (schedulersName[algorithmCounter].find (" GrowLocal" ) != std::string::npos && bspInstance.HasAnyTypeRestrictions ()) {
101+ schedulersFailed[algorithmCounter] = true ;
102+ std::cerr << " Error: Algorithm" + algorithm.second .get_child (" name" ).get_value <std::string>()
103+ + " skipped, since GrowLocal cannot handle heterogeneous problem instances." << std::endl;
104+ algorithmCounter++;
105+ continue ;
106+ }
107+
96108 const auto startTime = std::chrono::high_resolution_clock::now ();
97109
98110 ReturnStatus returnStatus;
@@ -105,6 +117,7 @@ int main(int argc, char *argv[]) {
105117 std::cerr << " Error during execution of Scheduler " + algorithm.second .get_child (" name" ).get_value <std::string>()
106118 + " ."
107119 << std::endl;
120+ algorithmCounter++;
108121 continue ;
109122 }
110123
@@ -198,13 +211,12 @@ int main(int argc, char *argv[]) {
198211 std::cout << " Number of Vertices: " + std::to_string (bspInstance.GetComputationalDag ().NumVertices ())
199212 + " Number of Edges: " + std::to_string (bspInstance.GetComputationalDag ().NumEdges ())
200213 << std::endl;
214+ std::vector<std::string> listOfFailed;
201215 for (size_t j = 0 ; j < parser.scheduler_ .size (); j++) {
202- size_t i = j;
203-
204- i = ordering[j];
216+ size_t i = ordering[j];
205217
206218 if (schedulersFailed[i]) {
207- std::cout << " scheduler " << schedulersName[i] << " failed. " << std::endl ;
219+ listOfFailed. push_back ( schedulersName[i]) ;
208220 } else {
209221 std::cout << " total costs: " << std::right << std::setw (tw) << schedulersCosts[i]
210222 << " work costs: " << std::right << std::setw (ww) << schedulersWorkCosts[i]
@@ -214,6 +226,13 @@ int main(int argc, char *argv[]) {
214226 << " scheduler: " << schedulersName[i] << std::endl;
215227 }
216228 }
229+ if (listOfFailed.size () > 0 ) {
230+ std::cout << " The following schedulers failed: " ;
231+ for (unsigned i = 0 ; i < listOfFailed.size (); ++i) {
232+ std::cout << ((i > 0 ) ? " , " : " " ) << listOfFailed[i];
233+ }
234+ std::cout << std::endl;
235+ }
217236 }
218237
219238 return 0 ;
0 commit comments