Add support for HPE MPI to Kokkos package
This commit is contained in:
@ -113,23 +113,37 @@ KokkosLMP::KokkosLMP(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
|
||||
}
|
||||
iarg += 2;
|
||||
|
||||
int set_flag = 0;
|
||||
char *str;
|
||||
if ((str = getenv("SLURM_LOCALID"))) {
|
||||
int local_rank = atoi(str);
|
||||
device = local_rank % ngpus;
|
||||
if (device >= skip_gpu) device++;
|
||||
set_flag = 1;
|
||||
}
|
||||
if ((str = getenv("MPT_LRANK"))) {
|
||||
int local_rank = atoi(str);
|
||||
device = local_rank % ngpus;
|
||||
if (device >= skip_gpu) device++;
|
||||
set_flag = 1;
|
||||
}
|
||||
if ((str = getenv("MV2_COMM_WORLD_LOCAL_RANK"))) {
|
||||
int local_rank = atoi(str);
|
||||
device = local_rank % ngpus;
|
||||
if (device >= skip_gpu) device++;
|
||||
set_flag = 1;
|
||||
}
|
||||
if ((str = getenv("OMPI_COMM_WORLD_LOCAL_RANK"))) {
|
||||
int local_rank = atoi(str);
|
||||
device = local_rank % ngpus;
|
||||
if (device >= skip_gpu) device++;
|
||||
set_flag = 1;
|
||||
}
|
||||
|
||||
if (ngpus > 1 && !set_flag)
|
||||
error->all(FLERR,"Could not determine local MPI rank for multiple "
|
||||
"GPUs with Kokkos CUDA because MPI library not recognized");
|
||||
|
||||
} else if (strcmp(arg[iarg],"t") == 0 ||
|
||||
strcmp(arg[iarg],"threads") == 0) {
|
||||
nthreads = atoi(arg[iarg+1]);
|
||||
|
||||
Reference in New Issue
Block a user