Unverified Commit e17e6bb4 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer Committed by GitHub
Browse files

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

Fix some compilation errors
parents d09ca916 c967c095
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -208,6 +208,7 @@ KokkosLMP::KokkosLMP(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
  MPI_Comm_size(world,&nmpi);
  MPI_Comm_size(world,&nmpi);
  if (nmpi > 0) {
  if (nmpi > 0) {


#if defined(MPI_VERSION) && (MPI_VERSION > 2)
    // Check for IBM Spectrum MPI
    // Check for IBM Spectrum MPI


    int len;
    int len;
@@ -226,6 +227,7 @@ KokkosLMP::KokkosLMP(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
        if (me == 0)
        if (me == 0)
          error->warning(FLERR,"The Spectrum MPI '-gpu' flag is not set. Disabling CUDA-aware MPI");
          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 (cuda_aware_flag == 1 && have_cuda_aware == 0) {
      if (me == 0)
      if (me == 0)
@@ -234,7 +236,7 @@ KokkosLMP::KokkosLMP(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
      cuda_aware_flag = 0;
      cuda_aware_flag = 0;
    } else if (have_cuda_aware == -1) { // maybe we are dealing with MPICH, MVAPICH2 or some derivative?
    } else if (have_cuda_aware == -1) { // maybe we are dealing with MPICH, MVAPICH2 or some derivative?
    // MVAPICH2
    // MVAPICH2
#if (defined MPICH) && (defined MVAPICH2_VERSION)
#if defined(MPICH) && defined(MVAPICH2_VERSION)
      char* str;
      char* str;
      cuda_aware_flag = 0;
      cuda_aware_flag = 0;
      if (str = getenv("MV2_ENABLE_CUDA")
      if (str = getenv("MV2_ENABLE_CUDA")
@@ -245,7 +247,7 @@ KokkosLMP::KokkosLMP(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
        if (me == 0)
        if (me == 0)
          error->warning(FLERR,"MVAPICH2 'MV2_ENABLE_CUDA' environment variable is not set. Disabling CUDA-aware MPI");
          error->warning(FLERR,"MVAPICH2 'MV2_ENABLE_CUDA' environment variable is not set. Disabling CUDA-aware MPI");
    // pure MPICH or some unsupported MPICH derivative
    // pure MPICH or some unsupported MPICH derivative
#elif (defined MPICH) && !(defined MVAPICH2_VERSION)
#elif defined(MPICH) && !defined(MVAPICH2_VERSION)
      if (me == 0)
      if (me == 0)
        error->warning(FLERR,"Detected MPICH. Disabling CUDA-aware MPI");
        error->warning(FLERR,"Detected MPICH. Disabling CUDA-aware MPI");
      cuda_aware_flag = 0;
      cuda_aware_flag = 0;
+2 −2
Original line number Original line Diff line number Diff line
@@ -31,7 +31,7 @@ class ThrData {


 public:
 public:
  ThrData(int tid, class Timer *t);
  ThrData(int tid, class Timer *t);
  ~ThrData() { delete _timer; _timer = nullptr; };
  ~ThrData() { delete _timer; _timer = NULL; };


  void check_tid(int);    // thread id consistency check
  void check_tid(int);    // thread id consistency check
  int get_tid() const { return _tid; }; // our thread id.
  int get_tid() const { return _tid; }; // our thread id.
@@ -136,7 +136,7 @@ class ThrData {


 // disabled default methods
 // disabled default methods
 private:
 private:
  ThrData() : _tid(-1), _timer(nullptr) {};
  ThrData() : _tid(-1), _timer(NULL) {};
};
};


////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
+4 −0
Original line number Original line Diff line number Diff line
@@ -19,6 +19,10 @@
#include "output.h"
#include "output.h"
#include "input.h"
#include "input.h"


#if defined(LAMMPS_EXCEPTIONS)
#include "update.h"
#endif

using namespace LAMMPS_NS;
using namespace LAMMPS_NS;


// helper function to truncate a string to a segment starting with "src/";
// helper function to truncate a string to a segment starting with "src/";
+6 −1
Original line number Original line Diff line number Diff line
@@ -354,10 +354,15 @@ void Info::command(int narg, char **arg)


  if (flags & COMM) {
  if (flags & COMM) {
    int major,minor,len;
    int major,minor,len;
#if (defined(MPI_VERSION) && (MPI_VERSION > 2)) || defined(MPI_STUBS)
    char version[MPI_MAX_LIBRARY_VERSION_STRING];
    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_version(&major,&minor);
    MPI_Get_library_version(version,&len);
    if (len > 80) {
    if (len > 80) {
      char *ptr = strchr(version+80,'\n');
      char *ptr = strchr(version+80,'\n');
      if (ptr) *ptr = '\0';
      if (ptr) *ptr = '\0';
+4 −0
Original line number Original line Diff line number Diff line
@@ -23,6 +23,10 @@
#include <fftw3.h>
#include <fftw3.h>
#endif
#endif


#if defined(LAMMPS_EXCEPTIONS)
#include "exceptions.h"
#endif

using namespace LAMMPS_NS;
using namespace LAMMPS_NS;


/* ----------------------------------------------------------------------
/* ----------------------------------------------------------------------