Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
2a07bae
add const to applyMinimumImage
PDoakORNL Oct 17, 2023
f8ad5f7
actually non required except for osx.
PDoakORNL Oct 20, 2023
8658d35
removed all ValueType in VariableSet and fixed tests
camelto2 Nov 7, 2023
cf0c220
clang formatting
camelto2 Nov 7, 2023
21ee357
Fix non batched code path. Also caught mixed precision issue in batched
rcclay Nov 8, 2023
864c22d
Merge pull request #4819 from camelto2/change_VariableSet_to_RealType
ye-luo Nov 8, 2023
284c7ff
Merge branch 'develop' into complex_opt_fix
ye-luo Nov 8, 2023
1cad792
Change APP_ABORT to throw.
ye-luo Nov 8, 2023
ed26599
Add a Communicate::allreduce specialization for vector<complex<float>>
ye-luo Nov 8, 2023
ce59cf7
Merge branch 'develop' into const_particle_set
PDoakORNL Nov 8, 2023
43a1889
Merge pull request #4822 from ye-luo/use-throw
ye-luo Nov 8, 2023
00c3dfc
Merge branch 'develop' into complex_opt_fix
ye-luo Nov 8, 2023
dd121a2
Merge pull request #4821 from rcclay/complex_opt_fix
ye-luo Nov 8, 2023
e4da19a
Merge branch 'develop' into const_particle_set
ye-luo Nov 8, 2023
e39a653
Remove legacy _CRAYMPI barriers
prckent Nov 8, 2023
f947b3f
Merge pull request #4788 from PDoakORNL/const_particle_set
ye-luo Nov 9, 2023
4ba79a1
Merge branch 'develop' into less_cruft
prckent Nov 9, 2023
0856bdc
Merge pull request #4823 from prckent/less_cruft
ye-luo Nov 9, 2023
aa951ef
Merge remote-tracking branch 'rcclay/complex_orbopt_exp_branch' into …
jptowns Nov 9, 2023
cbdd6e0
made VariableSet real.
jptowns Nov 9, 2023
114f2b5
Merge branch 'QMCPACK:develop' into make_variableset_real_for_ray
jptowns Nov 9, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 30 additions & 96 deletions src/Message/CommOperatorsMPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,130 +16,131 @@
#ifndef OHMMS_COMMUNICATION_OPERATORS_MPI_H
#define OHMMS_COMMUNICATION_OPERATORS_MPI_H
#include "Pools/PooledData.h"
#include <stdint.h>
#include <cstdint>
#include <stdexcept>
///dummy declarations to be specialized
template<typename T>
inline void gsum(T&, int)
{
APP_ABORT("Need specialization for gsum(T&, int)");
throw std::runtime_error("Need specialization for gsum(T&, int)");
}

template<typename T>
inline void Communicate::allreduce(T&)
{
APP_ABORT("Need specialization for allreduce(T&)");
throw std::runtime_error("Need specialization for allreduce(T&)");
}

template<typename T>
inline void Communicate::reduce(T&)
{
APP_ABORT("Need specialization for reduce(T&)");
throw std::runtime_error("Need specialization for reduce(T&)");
}

template<typename T>
inline void Communicate::reduce(T* restrict, T* restrict, int n)
{
APP_ABORT("Need specialization for reduce(T* restrict , T* restrict, int n)");
throw std::runtime_error("Need specialization for reduce(T* restrict , T* restrict, int n)");
}

template<typename T>
inline void Communicate::reduce_in_place(T* restrict, int n)
{
APP_ABORT("Need specialization for reduce_in_place(T* restrict, int n)");
throw std::runtime_error("Need specialization for reduce_in_place(T* restrict, int n)");
}

template<typename T>
inline void Communicate::bcast(T&)
{
APP_ABORT("Need specialization for bcast(T&)");
throw std::runtime_error("Need specialization for bcast(T&)");
}

template<typename T>
inline void Communicate::bcast(T* restrict, int n)
{
APP_ABORT("Need specialization for bcast(T* restrict ,int n)");
throw std::runtime_error("Need specialization for bcast(T* restrict ,int n)");
}

template<typename T>
inline void Communicate::send(int dest, int tag, T&)
{
APP_ABORT("Need specialization for send(int, int, T& )");
throw std::runtime_error("Need specialization for send(int, int, T& )");
}

template<typename T>
inline void Communicate::gather(T& sb, T& rb, int dest)
{
APP_ABORT("Need specialization for gather(T&, T&, int)");
throw std::runtime_error("Need specialization for gather(T&, T&, int)");
}

template<typename T>
inline void Communicate::allgather(T& sb, T& rb, int count)
{
APP_ABORT("Need specialization for allgather(T&, T&, int)");
throw std::runtime_error("Need specialization for allgather(T&, T&, int)");
}

template<typename T, typename IT>
inline void Communicate::gatherv(T& sb, T& rb, IT&, IT&, int dest)
{
APP_ABORT("Need specialization for gatherv(T&, T&, IT&, IT&, int)");
throw std::runtime_error("Need specialization for gatherv(T&, T&, IT&, IT&, int)");
}

template<typename T>
inline void Communicate::scatter(T& sb, T& rb, int dest)
{
APP_ABORT("Need specialization for scatter(T&, T&, int)");
throw std::runtime_error("Need specialization for scatter(T&, T&, int)");
}

template<typename T, typename IT>
inline void Communicate::scatterv(T& sb, T& rb, IT&, IT&, int source)
{
APP_ABORT("Need specialization for scatterv(T&, T&, IT&, IT&, int)");
throw std::runtime_error("Need specialization for scatterv(T&, T&, IT&, IT&, int)");
}

template<typename T>
inline Communicate::request Communicate::irecv(int source, int tag, T&)
{
APP_ABORT("Need specialization for irecv(int source, int tag, T& )");
throw std::runtime_error("Need specialization for irecv(int source, int tag, T& )");
return MPI_REQUEST_NULL;
}

template<typename T>
inline Communicate::request Communicate::isend(int dest, int tag, T&)
{
APP_ABORT("Need specialization for isend(int source, int tag, T& )");
throw std::runtime_error("Need specialization for isend(int source, int tag, T& )");
return MPI_REQUEST_NULL;
}

template<typename T>
inline Communicate::request Communicate::irecv(int source, int tag, T*, int n)
{
APP_ABORT("Need specialization for irecv(int source, int tag, T*, int )");
throw std::runtime_error("Need specialization for irecv(int source, int tag, T*, int )");
return MPI_REQUEST_NULL;
}

template<typename T>
inline Communicate::request Communicate::isend(int dest, int tag, T*, int n)
{
APP_ABORT("Need specialization for isend(int source, int tag, T*, int )");
throw std::runtime_error("Need specialization for isend(int source, int tag, T*, int )");
return MPI_REQUEST_NULL;
}

template<typename T>
inline void Communicate::allgather(T* sb, T* rb, int count)
{
APP_ABORT("Need specialization for allgather(T*, T*, int)");
throw std::runtime_error("Need specialization for allgather(T*, T*, int)");
}

template<typename T, typename IT>
inline void Communicate::gatherv(T* sb, T* rb, int n, IT&, IT&, int dest)
{
APP_ABORT("Need specialization for gatherv(T*, T*, int, IT&, IT&, int)");
throw std::runtime_error("Need specialization for gatherv(T*, T*, int, IT&, IT&, int)");
}

template<typename T>
inline void Communicate::gsum(T&)
{
APP_ABORT("Need specialization for Communicate::::gsum(T&)");
throw std::runtime_error("Need specialization for Communicate::::gsum(T&)");
}

template<>
Expand Down Expand Up @@ -324,6 +325,14 @@ inline void Communicate::allreduce(std::vector<double>& g)
g = gt;
}

template<>
inline void Communicate::allreduce(std::vector<std::complex<float>>& g)
{
std::vector<std::complex<float>> gt(g.size(), std::complex<float>(0.0));
MPI_Allreduce(&(g[0]), &(gt[0]), 2 * g.size(), MPI_FLOAT, MPI_SUM, myMPI);
g = gt;
}

template<>
inline void Communicate::allreduce(std::vector<std::complex<double>>& g)
{
Expand Down Expand Up @@ -773,11 +782,6 @@ inline void Communicate::gatherv(std::vector<char>& l,
std::vector<int>& displ,
int dest)
{
#if defined(_CRAYMPI)
const int cray_short_msg_size = 128000;
if (l.size() * sizeof(char) < cray_short_msg_size)
this->barrier();
#endif
int ierr = MPI_Gatherv(&l[0], l.size(), MPI_CHAR, &g[0], &counts[0], &displ[0], MPI_CHAR, dest, myMPI);
}

Expand All @@ -789,11 +793,6 @@ inline void Communicate::gatherv(std::vector<double>& l,
std::vector<int>& displ,
int dest)
{
#if defined(_CRAYMPI)
const int cray_short_msg_size = 128000;
if (l.size() * sizeof(double) < cray_short_msg_size)
this->barrier();
#endif
int ierr = MPI_Gatherv(&l[0], l.size(), MPI_DOUBLE, &g[0], &counts[0], &displ[0], MPI_DOUBLE, dest, myMPI);
}

Expand All @@ -804,11 +803,6 @@ inline void Communicate::gatherv(std::vector<float>& l,
std::vector<int>& displ,
int dest)
{
#if defined(_CRAYMPI)
const int cray_short_msg_size = 128000;
if (l.size() * sizeof(float) < cray_short_msg_size)
this->barrier();
#endif
int ierr = MPI_Gatherv(&l[0], l.size(), MPI_FLOAT, &g[0], &counts[0], &displ[0], MPI_FLOAT, dest, myMPI);
}

Expand All @@ -819,33 +813,18 @@ inline void Communicate::gatherv(std::vector<int>& l,
std::vector<int>& displ,
int dest)
{
#if defined(_CRAYMPI)
const int cray_short_msg_size = 128000;
if (l.size() * sizeof(int) < cray_short_msg_size)
this->barrier();
#endif
int ierr = MPI_Gatherv(&l[0], l.size(), MPI_INT, &g[0], &counts[0], &displ[0], MPI_INT, dest, myMPI);
}

template<>
inline void Communicate::allgather(std::vector<char>& sb, std::vector<char>& rb, int count)
{
#if defined(_CRAYMPI)
const int cray_short_msg_size = 128000;
if (sb.size() * sizeof(double) < cray_short_msg_size)
this->barrier();
#endif
MPI_Allgather(&sb[0], count, MPI_CHAR, &rb[0], count, MPI_CHAR, myMPI);
}

template<>
inline void Communicate::allgather(std::vector<int>& sb, std::vector<int>& rb, int count)
{
#if defined(_CRAYMPI)
const int cray_short_msg_size = 128000;
if (sb.size() * sizeof(int) < cray_short_msg_size)
this->barrier();
#endif
MPI_Allgather(&sb[0], count, MPI_INT, &rb[0], count, MPI_INT, myMPI);
}

Expand All @@ -856,11 +835,6 @@ inline void Communicate::allgatherv(std::vector<int>& l,
std::vector<int>& counts,
std::vector<int>& displ)
{
#if defined(_CRAYMPI)
const int cray_short_msg_size = 128000;
if (l.size() * sizeof(int) < cray_short_msg_size)
this->barrier();
#endif
int ierr = MPI_Allgatherv(&l[0], l.size(), MPI_INT, &g[0], &counts[0], &displ[0], MPI_INT, myMPI);
}

Expand All @@ -871,44 +845,24 @@ inline void Communicate::gatherv(std::vector<long>& l,
std::vector<int>& displ,
int dest)
{
#if defined(_CRAYMPI)
const int cray_short_msg_size = 128000;
if (l.size() * sizeof(long) < cray_short_msg_size)
this->barrier();
#endif
int ierr = MPI_Gatherv(&l[0], l.size(), MPI_LONG, &g[0], &counts[0], &displ[0], MPI_LONG, dest, myMPI);
}

template<>
inline void Communicate::gather(std::vector<double>& l, std::vector<double>& g, int dest)
{
#if defined(_CRAYMPI)
const int cray_short_msg_size = 128000;
if (l.size() * sizeof(double) < cray_short_msg_size)
this->barrier();
#endif
int ierr = MPI_Gather(&l[0], l.size(), MPI_DOUBLE, &g[0], l.size(), MPI_DOUBLE, dest, myMPI);
}

template<>
inline void Communicate::gather(std::vector<char>& l, std::vector<char>& g, int dest)
{
#if defined(_CRAYMPI)
const int cray_short_msg_size = 128000;
if (l.size() * sizeof(char) < cray_short_msg_size)
this->barrier();
#endif
int ierr = MPI_Gather(&l[0], l.size(), MPI_CHAR, &g[0], l.size(), MPI_CHAR, dest, myMPI);
}

template<>
inline void Communicate::gather(std::vector<int>& l, std::vector<int>& g, int dest)
{
#if defined(_CRAYMPI)
const int cray_short_msg_size = 128000;
if (l.size() * sizeof(int) < cray_short_msg_size)
this->barrier();
#endif
int ierr = MPI_Gather(&l[0], l.size(), MPI_INT, &g[0], l.size(), MPI_INT, dest, myMPI);
}

Expand All @@ -919,22 +873,12 @@ inline void Communicate::gatherv(PooledData<double>& l,
std::vector<int>& displ,
int dest)
{
#if defined(_CRAYMPI)
const int cray_short_msg_size = 128000;
if (l.size() * sizeof(double) < cray_short_msg_size)
this->barrier();
#endif
int ierr = MPI_Gatherv(l.data(), l.size(), MPI_DOUBLE, g.data(), &counts[0], &displ[0], MPI_DOUBLE, dest, myMPI);
}

template<>
inline void Communicate::gather(PooledData<double>& l, PooledData<double>& g, int dest)
{
#if defined(_CRAYMPI)
const int cray_short_msg_size = 128000;
if (l.size() * sizeof(double) < cray_short_msg_size)
this->barrier();
#endif
int ierr = MPI_Gather(l.data(), l.size(), MPI_DOUBLE, g.data(), l.size(), MPI_DOUBLE, dest, myMPI);
}

Expand Down Expand Up @@ -973,22 +917,12 @@ inline void Communicate::gsum(std::vector<std::complex<double>>& g)
template<>
inline void Communicate::gatherv(char* l, char* g, int n, std::vector<int>& counts, std::vector<int>& displ, int dest)
{
#if defined(_CRAYMPI)
const int cray_short_msg_size = 128000;
if (n * sizeof(char) < cray_short_msg_size)
this->barrier();
#endif
int ierr = MPI_Gatherv(l, n, MPI_CHAR, g, &counts[0], &displ[0], MPI_CHAR, dest, myMPI);
}

template<>
inline void Communicate::allgather(char* sb, char* rb, int count)
{
#if defined(_CRAYMPI)
const int cray_short_msg_size = 128000;
if (count * sizeof(char) < cray_short_msg_size)
this->barrier();
#endif
MPI_Allgather(sb, count, MPI_CHAR, rb, count, MPI_CHAR, myMPI);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Optimize/OptimizeBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class CostFunctionBase

virtual int getNumParams() const = 0;

virtual Return_t& Params(int i) = 0;
virtual Return_rt& Params(int i) = 0;

virtual Return_t Params(int i) const = 0;

Expand Down
2 changes: 1 addition & 1 deletion src/Particle/ParticleSet.BC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ void ParticleSet::applyBC(ParticlePos& pos)
}
}

void ParticleSet::applyMinimumImage(ParticlePos& pinout)
void ParticleSet::applyMinimumImage(ParticlePos& pinout) const
{
if (getLattice().SuperCellEnum == SUPERCELL_OPEN)
return;
Expand Down
2 changes: 1 addition & 1 deletion src/Particle/ParticleSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ class ParticleSet : public QMCTraits, public OhmmsElementBase, public PtclOnLatt
void applyBC(const ParticlePos& pin, ParticlePos& pout);
void applyBC(ParticlePos& pos);
void applyBC(const ParticlePos& pin, ParticlePos& pout, int first, int last);
void applyMinimumImage(ParticlePos& pinout);
void applyMinimumImage(ParticlePos& pinout) const;

/** load a Walker_t to the current ParticleSet
* @param awalker the reference to the walker to be loaded
Expand Down
11 changes: 0 additions & 11 deletions src/Platforms/Host/sysutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,6 @@
#include <iostream>
using std::string;
#include <time.h>

// Dummy version of getHostName, in case its needed
#if 0
#if defined(_CRAYMPI) || defined(XT_CATAMOUNT)
string getHostName()
{
return "jaguar";
}
#endif
#endif

#include <sys/utsname.h>

string getHostName()
Expand Down
Loading