Commit a7d1f046 authored by gbalduzz's avatar gbalduzz
Browse files

Merge branch 'autocorrelation' into write_config_timestamps

parents afc18ed5 097a0d04
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -14,10 +14,10 @@ mark_as_advanced(DCA_ESSL_INCLUDES)

# Use jsrun for executing the tests.
set(TEST_RUNNER "jsrun" CACHE STRING "Command for executing (MPI) programs.")
set(MPIEXEC_NUMPROC_FLAG "-a" CACHE STRING
set(MPIEXEC_NUMPROC_FLAG "-n" CACHE STRING
  "Flag used by TEST_RUNNER to specify the number of processes.")
# Use 1 resource set with 1 GPU and 8 cores for executing the tests.
set(MPIEXEC_PREFLAGS "-n 1 -g 1 -c 8" CACHE STRING
# Use 1 resource set with 1 GPU and 5 cores for executing the tests.
set(MPIEXEC_PREFLAGS "-a 1 -g 1 -c 5" CACHE STRING
  "Flags to pass to TEST_RUNNER directly before the executable to run.")
# The flag "--smpiargs=none" is needed to execute tests with no MPI functionalities.
set(SMPIARGS_FLAG_NOMPI "--smpiargs=none" CACHE STRING
+15 −14
Original line number Diff line number Diff line
@@ -235,16 +235,6 @@ if (DCA_WITH_QMC_BIT)
  dca_add_config_define(DCA_WITH_QMC_BIT)
endif()

################################################################################
# Single precision measurements
# TODO: maybe change to ON by default.
option(DCA_WITH_SINGLE_PRECISION_TP_MEASUREMENTS "Measure in single precision." OFF)
mark_as_advanced(DCA_WITH_SINGLE_PRECISION_TP_MEASUREMENTS)

if (DCA_WITH_SINGLE_PRECISION_TP_MEASUREMENTS)
  dca_add_config_define(DCA_WITH_SINGLE_PRECISION_TP_MEASUREMENTS)
endif()

################################################################################
# Gnuplot
option(DCA_WITH_GNUPLOT "Enable Gnuplot." OFF)
@@ -267,7 +257,7 @@ else()
endif()

################################################################################
# Accumulation options.
# MC 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)
@@ -277,12 +267,23 @@ else()
  set(MEMORY_SAVINGS false)
endif()

if (DCA_WITH_SINGLE_PRECISION_MEASUREMENTS)
option(DCA_WITH_SINGLE_PRECISION_MC "Perform Monte Carlo and measurements in single precision." OFF)
option(DCA_WITH_SINGLE_PRECISION_TP_MEASUREMENTS "Measure two particle function in single precision." OFF)

if (DCA_WITH_SINGLE_PRECISION_MC)
  set(DCA_WITH_SINGLE_PRECISION_TP_MEASUREMENTS ON CACHE BOOL "Measure two particle function in single precision." FORCE)
  set(MC_SCALAR float)
else()
  set(MC_SCALAR double)
endif()

if (DCA_WITH_SINGLE_PRECISION_TP_MEASUREMENTS)
  set(TP_ACCUMULATION_SCALAR float)
else()
  set(TP_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)
@@ -291,8 +292,8 @@ 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)
configure_file("${PROJECT_SOURCE_DIR}/include/dca/config/mc_options.hpp.in"
        "${CMAKE_BINARY_DIR}/include/dca/config/mc_options.hpp" @ONLY)


################################################################################
+1 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ struct CMakeOptions {
  static const std::string dca_profiler;
  static const std::string dca_with_autotuning;
  static const std::string dca_with_gnuplot;
  static const std::string dca_with_single_precision_mc;
  static const std::string dca_with_single_precision_tp_measurements;
  static const std::string dca_with_memory_savings;
  static const std::string dca_with_managed_memory;
+8 −7
Original line number Diff line number Diff line
@@ -9,20 +9,21 @@
//
// This class stores compile time options for the MC accumulation.

#ifndef DCA_CONFIG_ACCUMULATION_OPTIONS_HPP
#define DCA_CONFIG_ACCUMULATION_OPTIONS_HPP
#ifndef DCA_CONFIG_MC_OPTIONS_HPP
#define DCA_CONFIG_MC_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::

struct AccumulationOptions {
struct McOptions {
  using MCScalar = @MC_SCALAR@;

  using TPAccumulationScalar = @TP_ACCUMULATION_SCALAR@;

  static constexpr bool memory_savings = @MEMORY_SAVINGS@;
@@ -33,7 +34,7 @@ struct AccumulationOptions {
#endif  // DCA_HAVE_CUDA
};

}  // config
}  // dca
}  // namespace config
}  // namespace dca

#endif  // DCA_CONFIG_ACCUMULATION_OPTIONS_HPP
#endif  // DCA_CONFIG_MC_OPTIONS_HPP
+14 −0
Original line number Diff line number Diff line
@@ -77,6 +77,8 @@ public:
  //               the other function's construction.
  // Postcondition: The function's name is unchanged.
  function<scalartype, domain>& operator=(const function<scalartype, domain>& other);
  template <typename Scalar2>
  function<scalartype, domain>& operator=(const function<Scalar2, domain>& other);

  // Move assignment operator
  // Replaces the function's elements with those of other using move semantics.
@@ -345,6 +347,18 @@ function<scalartype, domain>& function<scalartype, domain>::operator=(
  return *this;
}

template <typename Scalar, class domain>
template <typename Scalar2>
function<Scalar, domain>& function<Scalar, domain>::operator=(const function<Scalar2, domain>& other) {
  if (size() != other.size()) {
    throw(std::logic_error("Function size does not match."));
  }

  std::copy_n(other.values(), Nb_elements, fnc_values);

  return *this;
}

template <typename scalartype, class domain>
function<scalartype, domain>& function<scalartype, domain>::operator=(
    function<scalartype, domain>&& other) {
Loading