@@ -471,16 +471,12 @@ std::tuple<GlobalOrdinal, typename MueLu::LWGraph_kokkos<LocalOrdinal, GlobalOrd
471471 }
472472 }
473473
474- {
475- int localErrorEncountered = errorEncountered;
476- int globalErrorEncountered = localErrorEncountered;
477- auto comm = currentLevel.GetComm ();
478- Teuchos::reduceAll (*currentLevel.GetComm (), Teuchos::REDUCE_MAX, 1 , &localErrorEncountered, &globalErrorEncountered);
479- if (globalErrorEncountered > 0 ) {
480- GetOStream (Warnings0) << " Encountered error while making dropping decisions.\n "
481- << " This generally indicates that infs/NaNs were encountered in the dropping decisions.\n "
482- << " A potential fix for this is enable repartitioning and/or perform an initial rebalance.\n\n " ;
483- }
474+ if (errorEncountered) {
475+ std::ostringstream ss;
476+ ss << " Encountered error while making dropping decisions.\n "
477+ << " This generally indicates that infs/NaNs were encountered in the dropping decisions.\n "
478+ << " A potential fix for this is enable repartitioning and/or perform an initial rebalance.\n " ;
479+ Kokkos::abort (ss.str ().c_str ());
484480 }
485481
486482 GO numDropped = lclA.nnz () - nnz_filtered;
@@ -904,16 +900,12 @@ std::tuple<GlobalOrdinal, typename MueLu::LWGraph_kokkos<LocalOrdinal, GlobalOrd
904900 }
905901 }
906902
907- {
908- int localErrorEncountered = errorEncountered;
909- int globalErrorEncountered = localErrorEncountered;
910- auto comm = currentLevel.GetComm ();
911- Teuchos::reduceAll (*currentLevel.GetComm (), Teuchos::REDUCE_MAX, 1 , &localErrorEncountered, &globalErrorEncountered);
912- if (globalErrorEncountered > 0 ) {
913- GetOStream (Warnings0) << " Encountered error while making dropping decisions.\n "
914- << " This generally indicates that infs/NaNs were encountered in the dropping decisions.\n "
915- << " A potential fix for this is enable repartitioning and/or perform an initial rebalance.\n\n " ;
916- }
903+ if (errorEncountered) {
904+ std::ostringstream ss;
905+ ss << " Encountered error while making dropping decisions.\n "
906+ << " This generally indicates that infs/NaNs were encountered in the dropping decisions.\n "
907+ << " A potential fix for this is enable repartitioning and/or perform an initial rebalance.\n " ;
908+ Kokkos::abort (ss.str ().c_str ());
917909 }
918910
919911 LocalOrdinal nnz_filtered = nnz.first ;
0 commit comments