Skip to content

Commit

Permalink
Merge Pull Request #6453 from trilinos/Trilinos/master_merge_20191214…
Browse files Browse the repository at this point in the history
…_000614

Automatically Merged using Trilinos Master Merge AutoTester
PR Title: Trilinos Master Merge PR Generator: Auto PR created to promote from master_merge_20191214_000614 branch to master
PR Author: trilinos-autotester
  • Loading branch information
trilinos-autotester authored Dec 14, 2019
2 parents 439278d + f325e2a commit bf6167c
Show file tree
Hide file tree
Showing 99 changed files with 5,923 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -521,13 +521,7 @@ class GraphColoringHandle
vector_size,
nv, ne);

team_policy_t tmp_policy(nv, Kokkos::AUTO, vector_size);
int max_allowed_team_size = tmp_policy.team_size_max( clt, Kokkos::ParallelForTag() );

KokkosKernels::Impl::get_suggested_team_size<HandleExecSpace>(
max_allowed_team_size,
vector_size,
teamSizeMax);
teamSizeMax = KokkosKernels::Impl::get_suggested_team_size<team_policy_t>(clt, vector_size);
#endif

Kokkos::parallel_for("KokkosGraph::CountLowerTriangleTeam",
Expand Down
20 changes: 17 additions & 3 deletions packages/kokkos-kernels/unit_test/blas/Test_Blas3_gemm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,23 @@ namespace Test {
Kokkos::Random_XorShift64_Pool<execution_space> rand_pool(seed);

// (SA 11 Dec 2019) Max (previously: 10) increased to detect the bug in Trilinos issue #6418
Kokkos::fill_random(A,rand_pool, Kokkos::rand<typename Kokkos::Random_XorShift64_Pool<execution_space>::generator_type,ScalarA>::max());
Kokkos::fill_random(B,rand_pool, Kokkos::rand<typename Kokkos::Random_XorShift64_Pool<execution_space>::generator_type,ScalarB>::max());
Kokkos::fill_random(C,rand_pool, Kokkos::rand<typename Kokkos::Random_XorShift64_Pool<execution_space>::generator_type,ScalarC>::max());
// Revisit this to address issues with complex types
/*
#ifdef KOKKOS_ENABLE_CUDA
if (std::is_same<execution_space,Kokkos::Cuda>::value)
{
Kokkos::fill_random(A,rand_pool, Kokkos::rand<typename Kokkos::Random_XorShift64_Pool<execution_space>::generator_type,ScalarA>::max());
Kokkos::fill_random(B,rand_pool, Kokkos::rand<typename Kokkos::Random_XorShift64_Pool<execution_space>::generator_type,ScalarB>::max());
Kokkos::fill_random(C,rand_pool, Kokkos::rand<typename Kokkos::Random_XorShift64_Pool<execution_space>::generator_type,ScalarC>::max());
}
else
#endif
*/
{
Kokkos::fill_random(A,rand_pool,ScalarA(10));
Kokkos::fill_random(B,rand_pool,ScalarB(10));
Kokkos::fill_random(C,rand_pool,ScalarC(10));
}

Kokkos::deep_copy(C2,C);

Expand Down
40 changes: 24 additions & 16 deletions packages/muelu/test/interface/ParameterListInterpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,13 +221,10 @@ int main_(Teuchos::CommandLineProcessor &clp, Xpetra::UnderlyingLib& lib, int ar
continue;
}

std::filebuf buffer;
std::stringbuf buffer;
std::streambuf* oldbuffer = NULL;
if (myRank == 0) {
// Redirect output
buffer.open((baseFile + ".out").c_str(), std::ios::out);
oldbuffer = std::cout.rdbuf(&buffer);
}
// // Redirect output
oldbuffer = std::cout.rdbuf(&buffer);

// NOTE: we cannot use ParameterListInterpreter(xmlFile, comm), because we want to update the ParameterList
// first to include "test" verbosity
Expand Down Expand Up @@ -295,18 +292,14 @@ int main_(Teuchos::CommandLineProcessor &clp, Xpetra::UnderlyingLib& lib, int ar
}

timer.stop();

} catch (Teuchos::ExceptionBase& e) {
std::string msg = e.what();
msg = msg.substr(msg.find_last_of('\n')+1);

if (myRank == 0) {
if (myRank == 0)
std::cout << "Caught exception: " << msg << std::endl;

// Redirect output back
std::cout.rdbuf(oldbuffer);
buffer.close();
}

if (msg == "Zoltan interface is not available" ||
msg == "Zoltan2 interface is not available" ||
msg == "MueLu::FactoryFactory:BuildFactory(): Cannot create a Zoltan2Interface object: Zoltan2 is disabled: HAVE_MUELU_ZOLTAN2 && HAVE_MPI == false.") {
Expand All @@ -318,12 +311,27 @@ int main_(Teuchos::CommandLineProcessor &clp, Xpetra::UnderlyingLib& lib, int ar
}
}

// Redirect output back
std::cout.rdbuf(oldbuffer);
#ifdef HAVE_MPI
std::string logStr = buffer.str();
RCP<const Teuchos::OpaqueWrapper<MPI_Comm> > mpiComm = Teuchos::rcp_dynamic_cast<const Teuchos::MpiComm<int> >(comm)->getRawMpiComm();
MPI_File logfile;
MPI_File_open((*mpiComm)(), (baseFile + ".out").c_str(), MPI_MODE_WRONLY | MPI_MODE_CREATE, MPI_INFO_NULL, &logfile);
MPI_File_set_atomicity(logfile, true);
const char* msg = logStr.c_str();
int err = MPI_File_write_ordered(logfile, msg, logStr.size(), MPI_CHAR, MPI_STATUS_IGNORE);
TEUCHOS_ASSERT(err == MPI_SUCCESS);
MPI_File_close(&logfile);
#else
std::ofstream outStream;
outStream.open((baseFile + ".out").c_str(), std::ofstream::out);
outStream << buffer.str();
outStream.close();
#endif

std::string cmd;
if (myRank == 0) {
// Redirect output back
std::cout.rdbuf(oldbuffer);
buffer.close();

// Create a copy of outputs
cmd = "cp -f ";
system((cmd + baseFile + ".gold " + baseFile + ".gold_filtered").c_str());
Expand Down
Loading

0 comments on commit bf6167c

Please sign in to comment.