diff --git a/MathLib/LinAlg/PETSc/PETScLinearSolver.cpp b/MathLib/LinAlg/PETSc/PETScLinearSolver.cpp index cf3a8cee7151a00e729e27a87019c98961133516..e280ef38e9f305b2723184e6733a277fbee630df 100644 --- a/MathLib/LinAlg/PETSc/PETScLinearSolver.cpp +++ b/MathLib/LinAlg/PETSc/PETScLinearSolver.cpp @@ -25,7 +25,11 @@ PETScLinearSolver::PETScLinearSolver(PETScMatrix &A, const std::string &prefix) KSPGetPC(_solver, &_pc); // - KSPSetOptionsPrefix(_solver, prefix.c_str()); + if ( !prefix.empty() ) + { + KSPSetOptionsPrefix(_solver, prefix.c_str()); + } + KSPSetFromOptions(_solver); // set running time option } diff --git a/Tests/FileIO/TestBoostXmlCndInterface.cpp b/Tests/FileIO/TestBoostXmlCndInterface.cpp index 27c4db89d726017bdfdecb495330797e5e3c42b0..f863e3db862da870cae05b19aa1f1b9b41678b71 100644 --- a/Tests/FileIO/TestBoostXmlCndInterface.cpp +++ b/Tests/FileIO/TestBoostXmlCndInterface.cpp @@ -27,6 +27,13 @@ TEST(FileIO, TestBoostXmlCndInterfaceUsingBoundaryCondition) { +#if defined(USE_PETSC) || defined(USE_MPI) + int mrank; + MPI_Comm_rank(PETSC_COMM_WORLD, &mrank); + if(mrank == 0) + { +#endif + // setup test data std::string geometry_name("GeometryForBC"); const std::string bc_pnt_name("bc_pnt"); @@ -116,4 +123,8 @@ TEST(FileIO, TestBoostXmlCndInterfaceUsingBoundaryCondition) conds[1]->getProcessDistributionType()); ASSERT_EQ(conds[0]->getDisValues().size(), conds[1]->getDisValues().size()); ASSERT_NEAR(conds[0]->getDisValues()[0], conds[1]->getDisValues()[0], std::numeric_limits<double>::epsilon()); + +#if defined(USE_PETSC) || defined(USE_MPI) + } +#endif } diff --git a/Tests/FileIO/TestXmlGmlReader.cpp b/Tests/FileIO/TestXmlGmlReader.cpp index 5f3ee0f91e37a6c69d98f7d6e5bc75d39727ada8..458e0a5bcdc986c3c3c50aa5abac78fb3a1d5bfa 100644 --- a/Tests/FileIO/TestXmlGmlReader.cpp +++ b/Tests/FileIO/TestXmlGmlReader.cpp @@ -26,10 +26,16 @@ // GeoLib #include "Polyline.h" - TEST(FileIO, XmlGmlWriterReaderTest) { - // Writer test +#if defined(USE_PETSC) || defined(USE_MPI) + int mrank; + MPI_Comm_rank(PETSC_COMM_WORLD, &mrank); + if(mrank == 0) + { +#endif + + // Writer test std::string test_data_file(std::string(SOURCEPATH).append("/Tests/FileIO/xmlgmltestdata.gml")); ProjectData project; @@ -121,4 +127,10 @@ TEST(FileIO, XmlGmlWriterReaderTest) boost::filesystem::remove(test_data_file); test_data_file += ".md5"; boost::filesystem::remove(test_data_file); + +#if defined(USE_PETSC) || defined(USE_MPI) + } +#endif + } +#endif