Skip to content

Commit

Permalink
MueLu: DO NOT COMMIT
Browse files Browse the repository at this point in the history
atrocities to make CUDA error in github issue #5179 reproducible.

now even worse
  • Loading branch information
jhux2 authored and Mark Hoemmen committed Aug 27, 2019
1 parent 2706312 commit cda0ebc
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 1 deletion.
51 changes: 50 additions & 1 deletion packages/muelu/test/scaling/Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ int main_(Teuchos::CommandLineProcessor &clp, Xpetra::UnderlyingLib& lib, int ar
#ifdef HAVE_MPI
int provideNodeComm = 0; clp.setOption("nodecomm", &provideNodeComm, "make the nodal communicator available w/ reduction factor X");
#endif
bool gdb = false; clp.setOption("gdb", "nogdb", &gdb, "pause for gdb");

clp.recogniseAllOptions(true);
switch (clp.parse(argc, argv)) {
Expand Down Expand Up @@ -563,8 +564,56 @@ MueLu::MueLu_AMGX_finalize();

//- -- --------------------------------------------------------
#define MUELU_AUTOMATIC_TEST_ETI_NAME main_
#define JHU_LOOP_FOREVER
#include "MueLu_Test_ETI.hpp"

int main(int argc, char *argv[]) {
return Automatic_Test_ETI(argc,argv);
#ifndef JHU_LOOP_FOREVER
return Automatic_Test_ETI(argc,argv);
#else
Teuchos::GlobalMPISession mpiSession(&argc, &argv, NULL);
# ifdef HAVE_MUELU_KOKKOSCORE
Kokkos::initialize(argc, argv);
# endif
Teuchos::RCP<const Teuchos::Comm<int> > comm = Teuchos::DefaultComm<int>::getComm();
/////////////////////////////////
Teuchos::CommandLineProcessor clp(false);
bool gdb = false; clp.setOption("gdb", "nogdb", &gdb, "pause for gdb");

clp.recogniseAllOptions(false);
switch (clp.parse(argc, argv, NULL)) {
case Teuchos::CommandLineProcessor::PARSE_ERROR: return EXIT_FAILURE;
case Teuchos::CommandLineProcessor::PARSE_UNRECOGNIZED_OPTION:
case Teuchos::CommandLineProcessor::PARSE_SUCCESSFUL:
case Teuchos::CommandLineProcessor::PARSE_HELP_PRINTED: break;
}
/////////////////////////////////

if (gdb) {
int myPID = comm->getRank();
int pid = getpid();
char hostname[80];
for (int i = 0; i <comm->getSize(); i++) {
if (i == myPID) {
gethostname(hostname, sizeof(hostname));
std::cout << "Host: " << hostname << "\tMPI rank: " << myPID << ",\tPID: " << pid << "\n\tattach " << pid << std::endl;
sleep(1);
}
}
if (myPID == 0) {
std::cout << "** Enter a character to continue > " << std::endl;
char go = ' ';
int r = scanf("%c", &go);
(void)r;
assert(r > 0);
}
} //if (gdb)
comm->barrier();
do
Automatic_Test_ETI(argc,argv);
while (true);
# ifdef HAVE_MUELU_KOKKOSCORE
Kokkos::finalize();
# endif
#endif //ifndef JHU_LOOP_FOREVER
}
3 changes: 3 additions & 0 deletions packages/muelu/test/scaling/sa_with_ilu.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<ParameterList name="MueLu">

<Parameter name="number of reruns" type="int" value="0"/>

<Parameter name="verbosity" type="string" value="high"/>

<Parameter name="number of equations" type="int" value="1"/>
Expand Down
2 changes: 2 additions & 0 deletions packages/muelu/test/scaling/scaling.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
For a generic symmetric scalar problem, these are the recommended settings for MueLu.
-->

<Parameter name="number of reruns" type="int" value="0"/>

<!-- =========== GENERAL ================ -->
<Parameter name="verbosity" type="string" value="high"/>

Expand Down
4 changes: 4 additions & 0 deletions packages/muelu/test/unit_tests/MueLu_Test_ETI.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ bool Automatic_Test_ETI(int argc, char *argv[]) {
using MueLu::Exceptions::RuntimeError;

// MPI initialization using Teuchos
#ifndef JHU_LOOP_FOREVER
Teuchos::GlobalMPISession mpiSession(&argc, &argv, NULL);

// Tpetra nodes call Kokkos::execution_space::initialize if the execution
Expand All @@ -93,6 +94,7 @@ bool Automatic_Test_ETI(int argc, char *argv[]) {
// processes correctly before Kokkos touches things.
#ifdef HAVE_MUELU_KOKKOSCORE
Kokkos::initialize(argc, argv);
#endif
#endif

bool success = true;
Expand Down Expand Up @@ -284,8 +286,10 @@ bool Automatic_Test_ETI(int argc, char *argv[]) {
}
TEUCHOS_STANDARD_CATCH_STATEMENTS(verbose, std::cerr, success);

#ifdef JHU_NOSKIP
#ifdef HAVE_MUELU_KOKKOSCORE
Kokkos::finalize();
#endif
#endif

return ( success ? EXIT_SUCCESS : EXIT_FAILURE );
Expand Down

0 comments on commit cda0ebc

Please sign in to comment.