Loading applications/cluster_solver_check/cluster_solver_check.cpp +15 −10 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ int main(int argc, char** argv) { if (argc < 2) { std::cerr << "Usage: " << argv[0] << " input_file.json" << std::endl; std::cerr << "Usage: " << argv[0] << " input_file.json [skip ed]" << std::endl; return -1; } Loading @@ -43,8 +43,8 @@ int main(int argc, char** argv) { try { std::string input_file(argv[1]); const bool perform_statistical_test = concurrency.number_of_processors() >= 8; const bool skip_ed = argc > 2 ? std::atoi(argv[2]) : false; const bool perform_statistical_test = concurrency.number_of_processors() >= 8 && !skip_ed; Profiler::start(); Loading Loading @@ -94,21 +94,26 @@ int main(int argc, char** argv) { // ED solver EdSolver ed_solver(parameters, dca_data_imag, dca_data_real); if (!skip_ed) { ed_solver.initialize(0); ed_solver.execute(); ed_solver.finalize(dca_loop_data); const auto Sigma_ed(dca_data_imag.Sigma); const int tested_frequencies = 10; const auto G_ed(dca::math::util::cutFrequency(dca_data_imag.G_k_w, tested_frequencies)); if (concurrency.id() == concurrency.first()) { ed_solver.write(data_file_ed); } } const auto Sigma_ed(dca_data_imag.Sigma); const int tested_frequencies = 10; const auto G_ed(dca::math::util::cutFrequency(dca_data_imag.G_k_w, tested_frequencies)); // QMC solver // The QMC solver uses the free Greens function G0 computed by the ED solver. // It is passed via the dca_data_imag object. if (skip_ed) dca_data_imag.initialize(); ClusterSolver qmc_solver(parameters, dca_data_imag); qmc_solver.initialize(1); // 1 = dummy iteration number qmc_solver.integrate(); Loading cmake/dca_config.cmake +22 −2 Original line number Diff line number Diff line Loading @@ -68,7 +68,8 @@ else() endif() # Lattice type set(DCA_LATTICE "square" CACHE STRING "Lattice type, options are: bilayer | square | triangular.") set(DCA_LATTICE "square" CACHE STRING "Lattice type, options are: bilayer | square | triangular | twoband_chain | singleband_chain .") set_property(CACHE DCA_LATTICE PROPERTY STRINGS bilayer square triangular) if (DCA_LATTICE STREQUAL "bilayer") Loading @@ -86,8 +87,18 @@ elseif (DCA_LATTICE STREQUAL "triangular") set(DCA_LATTICE_INCLUDE "dca/phys/models/analytic_hamiltonians/triangular_lattice.hpp") elseif (DCA_LATTICE STREQUAL "twoband_chain") set(DCA_LATTICE_TYPE dca::phys::models::twoband_chain<dca::phys::domains::no_symmetry<1>>) set(DCA_LATTICE_INCLUDE "dca/phys/models/analytic_hamiltonians/twoband_chain.hpp") elseif (DCA_LATTICE STREQUAL "singleband_chain") set(DCA_LATTICE_TYPE dca::phys::models::singleband_chain<dca::phys::domains::no_symmetry<1>>) set(DCA_LATTICE_INCLUDE "dca/phys/models/analytic_hamiltonians/singleband_chain.hpp") else() message(FATAL_ERROR "Please set DCA_LATTICE to a valid option: bilayer | square | triangular.") message(FATAL_ERROR "Please set DCA_LATTICE to a valid option: bilayer | square | triangular | twoband_chain | singleband_chain .") endif() # Model type Loading Loading @@ -259,6 +270,7 @@ endif() # Accumulation options. option(DCA_WITH_MEMORY_SAVINGS "Save memory in the two particle accumulation at a slight performance cost." OFF) mark_as_advanced(DCA_WITH_MEMORY_SAVINGS) if (DCA_WITH_MEMORY_SAVINGS) set(MEMORY_SAVINGS true) else() Loading @@ -271,6 +283,14 @@ else() set(MC_ACCUMULATION_SCALAR double) endif() option(DCA_WITH_MANAGED_MEMORY "Use managed memory allocator." OFF) mark_as_advanced(DCA_WITH_MANAGED_MEMORY) if (DCA_WITH_MANAGED_MEMORY) set(TWO_PARTICLE_ALLOCATOR "dca::linalg::util::ManagedAllocator<T>") else() set(TWO_PARTICLE_ALLOCATOR "dca::linalg::util::DeviceAllocator<T>") endif() configure_file("${PROJECT_SOURCE_DIR}/include/dca/config/accumulation_options.hpp.in" "${CMAKE_BINARY_DIR}/include/dca/config/accumulation_options.hpp" @ONLY) Loading cmake/dca_cuda.cmake +1 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ if (CUDA_FOUND) # dca_add_haves_define(DCA_HAVE_CUDA) list(APPEND DCA_CUDA_LIBS ${CUDA_LIBRARIES} ${CUDA_cusparse_LIBRARY} ${CUDA_cublas_LIBRARY}) CUDA_INCLUDE_DIRECTORIES(${CUDA_INCLUDE_DIRS}) set(CUDA_SEPARABLE_COMPILATION ON) endif() # Find MAGMA. Loading include/dca/config/accumulation_options.hpp.in +11 −0 Original line number Diff line number Diff line Loading @@ -12,6 +12,12 @@ #ifndef DCA_CONFIG_ACCUMULATON_OPTIONS_HPP #define DCA_CONFIG_ACCUMULATON_OPTIONS_HPP #ifdef DCA_HAVE_CUDA #include "dca/linalg/util/allocators/device_allocator.hpp" #include "dca/linalg/util/allocators/managed_allocator.hpp" #endif // DCA_HAVE_CUDA namespace dca { namespace config { // dca::config:: Loading @@ -20,6 +26,11 @@ struct AccumulationOptions { using MCAccumulationScalar = @MC_ACCUMULATION_SCALAR@; static constexpr bool memory_savings = @MEMORY_SAVINGS@; #ifdef DCA_HAVE_CUDA template <typename T> using TpAllocator = @TWO_PARTICLE_ALLOCATOR@; #endif // DCA_HAVE_CUDA }; } // config Loading include/dca/config/cmake_options.hpp +1 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ struct CMakeOptions { static const std::string dca_with_reduced_vertex_function; static const std::string dca_with_single_precision_measurements; static const std::string dca_with_memory_savings; static const std::string dca_with_managed_memory; static const std::string dca_with_qmc_bit; Loading Loading
applications/cluster_solver_check/cluster_solver_check.cpp +15 −10 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ int main(int argc, char** argv) { if (argc < 2) { std::cerr << "Usage: " << argv[0] << " input_file.json" << std::endl; std::cerr << "Usage: " << argv[0] << " input_file.json [skip ed]" << std::endl; return -1; } Loading @@ -43,8 +43,8 @@ int main(int argc, char** argv) { try { std::string input_file(argv[1]); const bool perform_statistical_test = concurrency.number_of_processors() >= 8; const bool skip_ed = argc > 2 ? std::atoi(argv[2]) : false; const bool perform_statistical_test = concurrency.number_of_processors() >= 8 && !skip_ed; Profiler::start(); Loading Loading @@ -94,21 +94,26 @@ int main(int argc, char** argv) { // ED solver EdSolver ed_solver(parameters, dca_data_imag, dca_data_real); if (!skip_ed) { ed_solver.initialize(0); ed_solver.execute(); ed_solver.finalize(dca_loop_data); const auto Sigma_ed(dca_data_imag.Sigma); const int tested_frequencies = 10; const auto G_ed(dca::math::util::cutFrequency(dca_data_imag.G_k_w, tested_frequencies)); if (concurrency.id() == concurrency.first()) { ed_solver.write(data_file_ed); } } const auto Sigma_ed(dca_data_imag.Sigma); const int tested_frequencies = 10; const auto G_ed(dca::math::util::cutFrequency(dca_data_imag.G_k_w, tested_frequencies)); // QMC solver // The QMC solver uses the free Greens function G0 computed by the ED solver. // It is passed via the dca_data_imag object. if (skip_ed) dca_data_imag.initialize(); ClusterSolver qmc_solver(parameters, dca_data_imag); qmc_solver.initialize(1); // 1 = dummy iteration number qmc_solver.integrate(); Loading
cmake/dca_config.cmake +22 −2 Original line number Diff line number Diff line Loading @@ -68,7 +68,8 @@ else() endif() # Lattice type set(DCA_LATTICE "square" CACHE STRING "Lattice type, options are: bilayer | square | triangular.") set(DCA_LATTICE "square" CACHE STRING "Lattice type, options are: bilayer | square | triangular | twoband_chain | singleband_chain .") set_property(CACHE DCA_LATTICE PROPERTY STRINGS bilayer square triangular) if (DCA_LATTICE STREQUAL "bilayer") Loading @@ -86,8 +87,18 @@ elseif (DCA_LATTICE STREQUAL "triangular") set(DCA_LATTICE_INCLUDE "dca/phys/models/analytic_hamiltonians/triangular_lattice.hpp") elseif (DCA_LATTICE STREQUAL "twoband_chain") set(DCA_LATTICE_TYPE dca::phys::models::twoband_chain<dca::phys::domains::no_symmetry<1>>) set(DCA_LATTICE_INCLUDE "dca/phys/models/analytic_hamiltonians/twoband_chain.hpp") elseif (DCA_LATTICE STREQUAL "singleband_chain") set(DCA_LATTICE_TYPE dca::phys::models::singleband_chain<dca::phys::domains::no_symmetry<1>>) set(DCA_LATTICE_INCLUDE "dca/phys/models/analytic_hamiltonians/singleband_chain.hpp") else() message(FATAL_ERROR "Please set DCA_LATTICE to a valid option: bilayer | square | triangular.") message(FATAL_ERROR "Please set DCA_LATTICE to a valid option: bilayer | square | triangular | twoband_chain | singleband_chain .") endif() # Model type Loading Loading @@ -259,6 +270,7 @@ endif() # Accumulation options. option(DCA_WITH_MEMORY_SAVINGS "Save memory in the two particle accumulation at a slight performance cost." OFF) mark_as_advanced(DCA_WITH_MEMORY_SAVINGS) if (DCA_WITH_MEMORY_SAVINGS) set(MEMORY_SAVINGS true) else() Loading @@ -271,6 +283,14 @@ else() set(MC_ACCUMULATION_SCALAR double) endif() option(DCA_WITH_MANAGED_MEMORY "Use managed memory allocator." OFF) mark_as_advanced(DCA_WITH_MANAGED_MEMORY) if (DCA_WITH_MANAGED_MEMORY) set(TWO_PARTICLE_ALLOCATOR "dca::linalg::util::ManagedAllocator<T>") else() set(TWO_PARTICLE_ALLOCATOR "dca::linalg::util::DeviceAllocator<T>") endif() configure_file("${PROJECT_SOURCE_DIR}/include/dca/config/accumulation_options.hpp.in" "${CMAKE_BINARY_DIR}/include/dca/config/accumulation_options.hpp" @ONLY) Loading
cmake/dca_cuda.cmake +1 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ if (CUDA_FOUND) # dca_add_haves_define(DCA_HAVE_CUDA) list(APPEND DCA_CUDA_LIBS ${CUDA_LIBRARIES} ${CUDA_cusparse_LIBRARY} ${CUDA_cublas_LIBRARY}) CUDA_INCLUDE_DIRECTORIES(${CUDA_INCLUDE_DIRS}) set(CUDA_SEPARABLE_COMPILATION ON) endif() # Find MAGMA. Loading
include/dca/config/accumulation_options.hpp.in +11 −0 Original line number Diff line number Diff line Loading @@ -12,6 +12,12 @@ #ifndef DCA_CONFIG_ACCUMULATON_OPTIONS_HPP #define DCA_CONFIG_ACCUMULATON_OPTIONS_HPP #ifdef DCA_HAVE_CUDA #include "dca/linalg/util/allocators/device_allocator.hpp" #include "dca/linalg/util/allocators/managed_allocator.hpp" #endif // DCA_HAVE_CUDA namespace dca { namespace config { // dca::config:: Loading @@ -20,6 +26,11 @@ struct AccumulationOptions { using MCAccumulationScalar = @MC_ACCUMULATION_SCALAR@; static constexpr bool memory_savings = @MEMORY_SAVINGS@; #ifdef DCA_HAVE_CUDA template <typename T> using TpAllocator = @TWO_PARTICLE_ALLOCATOR@; #endif // DCA_HAVE_CUDA }; } // config Loading
include/dca/config/cmake_options.hpp +1 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ struct CMakeOptions { static const std::string dca_with_reduced_vertex_function; static const std::string dca_with_single_precision_measurements; static const std::string dca_with_memory_savings; static const std::string dca_with_managed_memory; static const std::string dca_with_qmc_bit; Loading