Merge pull request #1605 from akohlmey/fix-compilation-errors

Fix some compilation errors
This commit is contained in:
Axel Kohlmeyer 2019-08-01 11:24:30 -04:00 committed by GitHub
commit e17e6bb45d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 20 additions and 5 deletions

View File

@ -208,6 +208,7 @@ KokkosLMP::KokkosLMP(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
MPI_Comm_size(world,&nmpi);
if (nmpi > 0) {
#if defined(MPI_VERSION) && (MPI_VERSION > 2)
// Check for IBM Spectrum MPI
int len;
@ -226,6 +227,7 @@ KokkosLMP::KokkosLMP(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
if (me == 0)
error->warning(FLERR,"The Spectrum MPI '-gpu' flag is not set. Disabling CUDA-aware MPI");
}
#endif
if (cuda_aware_flag == 1 && have_cuda_aware == 0) {
if (me == 0)
@ -234,7 +236,7 @@ KokkosLMP::KokkosLMP(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
cuda_aware_flag = 0;
} else if (have_cuda_aware == -1) { // maybe we are dealing with MPICH, MVAPICH2 or some derivative?
// MVAPICH2
#if (defined MPICH) && (defined MVAPICH2_VERSION)
#if defined(MPICH) && defined(MVAPICH2_VERSION)
char* str;
cuda_aware_flag = 0;
if (str = getenv("MV2_ENABLE_CUDA")
@ -245,7 +247,7 @@ KokkosLMP::KokkosLMP(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
if (me == 0)
error->warning(FLERR,"MVAPICH2 'MV2_ENABLE_CUDA' environment variable is not set. Disabling CUDA-aware MPI");
// pure MPICH or some unsupported MPICH derivative
#elif (defined MPICH) && !(defined MVAPICH2_VERSION)
#elif defined(MPICH) && !defined(MVAPICH2_VERSION)
if (me == 0)
error->warning(FLERR,"Detected MPICH. Disabling CUDA-aware MPI");
cuda_aware_flag = 0;

View File

@ -31,7 +31,7 @@ class ThrData {
public:
ThrData(int tid, class Timer *t);
~ThrData() { delete _timer; _timer = nullptr; };
~ThrData() { delete _timer; _timer = NULL; };
void check_tid(int); // thread id consistency check
int get_tid() const { return _tid; }; // our thread id.
@ -136,7 +136,7 @@ class ThrData {
// disabled default methods
private:
ThrData() : _tid(-1), _timer(nullptr) {};
ThrData() : _tid(-1), _timer(NULL) {};
};
////////////////////////////////////////////////////////////////////////

View File

@ -19,6 +19,10 @@
#include "output.h"
#include "input.h"
#if defined(LAMMPS_EXCEPTIONS)
#include "update.h"
#endif
using namespace LAMMPS_NS;
// helper function to truncate a string to a segment starting with "src/";

View File

@ -354,10 +354,15 @@ void Info::command(int narg, char **arg)
if (flags & COMM) {
int major,minor,len;
#if (defined(MPI_VERSION) && (MPI_VERSION > 2)) || defined(MPI_STUBS)
char version[MPI_MAX_LIBRARY_VERSION_STRING];
MPI_Get_library_version(version,&len);
#else
char version[] = "Undetected MPI implementation";
len = strlen(version);
#endif
MPI_Get_version(&major,&minor);
MPI_Get_library_version(version,&len);
if (len > 80) {
char *ptr = strchr(version+80,'\n');
if (ptr) *ptr = '\0';

View File

@ -23,6 +23,10 @@
#include <fftw3.h>
#endif
#if defined(LAMMPS_EXCEPTIONS)
#include "exceptions.h"
#endif
using namespace LAMMPS_NS;
/* ----------------------------------------------------------------------