Skip to content

Commit

Permalink
fix breakage in non adios2 build
Browse files Browse the repository at this point in the history
  • Loading branch information
PDoakORNL committed Mar 27, 2024
1 parent ac9f617 commit 0950a47
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 28 deletions.
2 changes: 1 addition & 1 deletion applications/dca/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ if (DCA_BUILD_DCA)
target_link_libraries(main_dca PRIVATE ${DCA_KERNEL_LIBS})
endif()

target_link_libraries(main_dca PUBLIC FFTW::Double signals ${DCA_LIBS} dca_io dca_adios2)
target_link_libraries(main_dca PUBLIC FFTW::Double signals ${DCA_LIBS} dca_io)
endif()
2 changes: 2 additions & 0 deletions src/parallel/no_concurrency/no_concurrency.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ namespace parallel {

#ifdef DCA_HAVE_ADIOS2
NoConcurrency::NoConcurrency(int argc, char** argv) : adios_(std::make_unique<adios2::ADIOS>("", MPI_COMM_SELF)) {}
#else
NoConcurrency::NoConcurrency(int argc, char** argv) {}
#endif

void NoConcurrency::abort() const {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/math/function_transform/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# unit/math/function_transform
dca_add_gtest(function_transform_test
INCLUDE_DIRS ${DCA_INCLUDES};${PROJECT_SOURCE_DIR};${FFTW_INCLUDE_DIR}
LIBS FFTW::Double ${DCA_LIBS} parallel_no_concurrency)
LIBS FFTW::Double parallel_no_concurrency ${DCA_LIBS} )

dca_add_gtest(space_transform_2D_test
INCLUDE_DIRS ${DCA_INCLUDES};${PROJECT_SOURCE_DIR};${FFTW_INCLUDE_DIR}
Expand Down
23 changes: 0 additions & 23 deletions test/unit/math/function_transform/function_transform_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,6 @@ using McOptions = MockMcOptions<double>;
#include "dca/parallel/no_concurrency/no_concurrency.hpp"
#include "dca/parallel/no_threading/no_threading.hpp"
#include "dca/profiling/null_profiler.hpp"
#ifdef DCA_HAVE_ADIOS2
adios2::ADIOS* adios_ptr;
#endif
#ifdef DCA_HAVE_MPI
#include "dca/parallel/mpi_concurrency/mpi_concurrency.hpp"
dca::parallel::MPIConcurrency* concurrency_ptr;
#else
#include "dca/parallel/no_concurrency/no_concurrency.hpp"
dca::parallel::NoConcurrency* concurrency_ptr;
#endif

using Model =
dca::phys::models::TightBindingModel<dca::phys::models::RashbaHubbard<dca::phys::domains::D4>>;
Expand Down Expand Up @@ -160,19 +150,6 @@ TEST(FunctionTransformTest, MomentumToSpaceCmplx) {
}

int main(int argc, char** argv) {
#ifdef DCA_HAVE_MPI
dca::parallel::MPIConcurrency concurrency(argc, argv);
concurrency_ptr = &concurrency;
#else
dca::parallel::NoConcurrency concurrency(argc, argv);
concurrency_ptr = &concurrency;
#endif

#ifdef DCA_HAVE_ADIOS2
//ADIOS expects MPI_COMM pointer or nullptr
adios2::ADIOS adios("", concurrency_ptr->get(), "C++");
adios_ptr = &adios;
#endif
::testing::InitGoogleTest(&argc, argv);

// ::testing::TestEventListeners& listeners = ::testing::UnitTest::GetInstance()->listeners();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ inline std::vector<double>& getFirstRandomNumbersDefaultSeed<std::mt19937_64>()
0.79004886762619775, 0.73670732232143421};
return vec;
}
template <>
#if defined (__clang__)
template <>
inline std::vector<double>& getFirstRandomNumbersDefaultSeed<std::ranlux48_base>() {
static std::vector<double> vec{0.67052872832964927, 0.89987293212401465, 0.48383422722711483,0.28699620000273923,0.37575706648963081};
return vec;
Expand Down
9 changes: 7 additions & 2 deletions test/unit/phys/dca_algorithms/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# DCA algorithms unit tests

set(gtest_main_flag GTEST_MAIN)
if(DCA_HAVE_ADIOS2)
set(gtest_main_flag GTEST_MPI_MAIN)
endif(DCA_HAVE_ADIOS2)

dca_add_gtest(compute_band_structure_test
GTEST_MPI_MAIN
INCLUDE_DIRS ${PROJECT_SOURCE_DIR}
Expand All @@ -12,10 +17,10 @@ endif()

# \todo I think this should be able to run without GPU
dca_add_gtest(compute_free_greens_function_test
GTEST_MPI_MAIN
${gtest_main_flag}
CUDA
LIBS function FFTW::Double ${DCA_THREADING_LIBS} ${LAPACK_LIBRARIES} ${UTIL_LIBS} ${DCA_GPU_LIBS} ${optional_io_lib} parallel_util parallel_no_concurrency)

dca_add_gtest(compute_greens_function_test
GTEST_MPI_MAIN
${gtest_main_flag}
LIBS function FFTW::Double ${DCA_THREADING_LIBS} ${LAPACK_LIBRARIES} ${UTIL_LIBS} ${DCA_GPU_LIBS} ${optional_io_lib} parallel_util parallel_no_concurrency)

0 comments on commit 0950a47

Please sign in to comment.