Commit e816f0e7 authored by Stan Moore's avatar Stan Moore
Browse files

Cleanup of CUDA-aware MPI code

parent 0ba854b4
Loading
Loading
Loading
Loading
+9 −14
Original line number Diff line number Diff line
@@ -214,20 +214,17 @@ KokkosLMP::KokkosLMP(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
    char mpi_version[MPI_MAX_LIBRARY_VERSION_STRING];
    MPI_Get_library_version(mpi_version, &len);
    if (strstr(&mpi_version[0], "Spectrum") != NULL) {
      int gpu_flag = 0;
      cuda_aware_flag = 0;
      char* str;
      if (str = getenv("OMPI_MCA_pml_pami_enable_cuda")) {
        if(!(strcmp(str,"1") == 0)) {
      if (str = getenv("OMPI_MCA_pml_pami_enable_cuda"))
        if((strcmp(str,"1") == 0)) {
          have_cuda_aware = 1;
          cuda_aware_flag = 1;
          gpu_flag = 1;
        }
        }

      if (!gpu_flag) {
      if (!cuda_aware_flag)
        if (me == 0)
          error->warning(FLERR,"The Spectrum MPI '-gpu' flag is not set. Disabling CUDA-aware MPI");
        cuda_aware_flag = 0;
      }
    }

    if (cuda_aware_flag == 1 && have_cuda_aware == 0) {
@@ -239,16 +236,14 @@ KokkosLMP::KokkosLMP(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
    // MVAPICH2
#if (defined MPICH) && (defined MVAPICH2_VERSION)
      char* str;
      int gpu_flag = 0;
      cuda_aware_flag = 0;
      if (str = getenv("MV2_ENABLE_CUDA")
        if (!(strcmp(str,"1") == 0))
          gpu_flag = 1;
        if ((strcmp(str,"1") == 0))
          cuda_aware_flag = 1;

      if (!gpu_flag) {
      if (!cuda_aware_flag)
        if (me == 0)
          error->warning(FLERR,"MVAPICH2 'MV2_ENABLE_CUDA' environment variable is not set. Disabling CUDA-aware MPI");
        cuda_aware_flag = 0;
      }
    // pure MPICH or some unsupported MPICH derivative
#elif (defined MPICH) && !(defined MVAPICH2_VERSION)
      if (me == 0)
+1 −1
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ LMP_INC = -DLAMMPS_GZIP
# PATH = path for MPI library
# LIB = name of MPI library

MPI_INC = -DSPECTRUM_MPI -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -I/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-gcc-7.3.1/include
MPI_INC = -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -I/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-gcc-7.3.1/include
MPI_PATH = 
MPI_LIB = -L/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-gcc-7.3.1/lib -lmpi_ibm