From ec8e060ec7e64986cdbef77402252349aeac67b6 Mon Sep 17 00:00:00 2001 From: Peter Boyle Date: Thu, 31 Oct 2019 11:46:09 -0400 Subject: [PATCH] Summit jsrun GPU mapping updates. Conffigure with --enable-jsrun --- Grid/communicator/SharedMemory.h | 4 +- Grid/communicator/SharedMemoryMPI.cc | 67 ++++++++++++++++++---------- Grid/util/Init.cc | 20 +++------ configure.ac | 32 ++++++------- 4 files changed, 63 insertions(+), 60 deletions(-) diff --git a/Grid/communicator/SharedMemory.h b/Grid/communicator/SharedMemory.h index 2f89f571..6c6e3953 100644 --- a/Grid/communicator/SharedMemory.h +++ b/Grid/communicator/SharedMemory.h @@ -41,9 +41,6 @@ Author: Peter Boyle #include #include #include -#ifdef HAVE_NUMAIF_H -#include -#endif NAMESPACE_BEGIN(Grid); @@ -99,6 +96,7 @@ public: static void OptimalCommunicator (const Coordinate &processors,Grid_MPI_Comm & optimal_comm); // Turns MPI_COMM_WORLD into right layout for Cartesian static void OptimalCommunicatorHypercube (const Coordinate &processors,Grid_MPI_Comm & optimal_comm); // Turns MPI_COMM_WORLD into right layout for Cartesian static void OptimalCommunicatorSharedMemory(const Coordinate &processors,Grid_MPI_Comm & optimal_comm); // Turns MPI_COMM_WORLD into right layout for Cartesian + static void GetShmDims(const Coordinate &WorldDims,Coordinate &ShmDims); /////////////////////////////////////////////////// // Provide shared memory facilities off comm world /////////////////////////////////////////////////// diff --git a/Grid/communicator/SharedMemoryMPI.cc b/Grid/communicator/SharedMemoryMPI.cc index b2896bda..4af7c402 100644 --- a/Grid/communicator/SharedMemoryMPI.cc +++ b/Grid/communicator/SharedMemoryMPI.cc @@ -155,6 +155,37 @@ void GlobalSharedMemory::OptimalCommunicator(const Coordinate &processors,Grid_M if(nscan==3 && HPEhypercube ) OptimalCommunicatorHypercube(processors,optimal_comm); else OptimalCommunicatorSharedMemory(processors,optimal_comm); } +static inline int divides(int a,int b) +{ + return ( b == ( (b/a)*a ) ); +} +void GlobalSharedMemory::GetShmDims(const Coordinate &WorldDims,Coordinate &ShmDims) +{ + //////////////////////////////////////////////////////////////// + // Assert power of two shm_size. + //////////////////////////////////////////////////////////////// + int log2size = Log2Size(WorldShmSize,MAXLOG2RANKSPERNODE); + assert(log2size != -1); + + int ndimension = WorldDims.size(); + ShmDims=Coordinate(ndimension,1); + + std::vector primes({2,3,5}); + + int dim = 0; + int AutoShmSize = 1; + while(AutoShmSize != WorldShmSize) { + for(int p=0;p processor_coor(ndimension); - std::vector WorldDims = processors.toVector(); - std::vector ShmDims (ndimension,1); std::vector NodeDims (ndimension); - std::vector ShmCoor (ndimension); std::vector NodeCoor (ndimension); std::vector WorldCoor(ndimension); - std::vector HyperCoor(ndimension); - int dim = 0; - for(int l2=0;l2]]) AC_CHECK_DECLS([be64toh],[], [], [[#include ]]) @@ -136,6 +135,18 @@ case ${ac_SFW_FP16} in AC_MSG_ERROR(["SFW FP16 option not supported ${ac_SFW_FP16}"]);; esac +############### SUMMIT JSRUN +AC_ARG_ENABLE([jsrun], + [AC_HELP_STRING([--enable-jsrun=yes|no], [enable IBMs jsrun resource manager for SUMMIT])], + [ac_JSRUN=${enable_jsrun}], [ac_JSRUN=no]) +case ${ac_JSRUN} in + yes) + AC_DEFINE([GRID_IBM_SUMMIT],[1],[Let JSRUN manage the GPU device allocation]);; + no);; + *) + AC_MSG_ERROR(["JSRUN option not supported ${ac_JSRUN}"]);; +esac + ############### Intel libraries AC_ARG_ENABLE([mkl], [AC_HELP_STRING([--enable-mkl=yes|no|prefix], [enable Intel MKL for LAPACK & FFTW])], @@ -173,19 +184,6 @@ AC_ARG_WITH([hdf5], [AM_CXXFLAGS="-I$with_hdf5/include $AM_CXXFLAGS"] [AM_LDFLAGS="-L$with_hdf5/lib $AM_LDFLAGS"]) -############### first-touch -AC_ARG_ENABLE([numa], - [AC_HELP_STRING([--enable-numa=yes|no|prefix], [enable first touch numa opt])], - [ac_NUMA=${enable_NUMA}],[ac_NUMA=no]) - -case ${ac_NUMA} in - no) - ;; - yes) - AC_DEFINE([GRID_NUMA],[1],[First touch numa locality]);; - *) - AC_DEFINE([GRID_NUMA],[1],[First touch numa locality]);; -esac ############### Checks for library functions CXXFLAGS_CPY=$CXXFLAGS @@ -241,10 +239,6 @@ AC_SEARCH_LIBS([crc32], [z], [have_zlib=true] [LIBS="${LIBS} -lz"], [AC_MSG_ERROR(zlib library was not found in your system.)]) -AC_SEARCH_LIBS([move_pages], [numa], - [AC_DEFINE([HAVE_LIBNUMA], [1], [Define to 1 if you have the `LIBNUMA' library])] - [have_libnuma=true] [LIBS="${LIBS} -lnuma"], - [AC_MSG_WARN(libnuma library was not found in your system. Some optimisations will not apply)]) AC_SEARCH_LIBS([H5Fopen], [hdf5_cpp], [AC_DEFINE([HAVE_HDF5], [1], [Define to 1 if you have the `HDF5' library])] @@ -263,7 +257,7 @@ AC_ARG_ENABLE([gen-simd-width], [AS_HELP_STRING([--enable-gen-simd-width=size], [size (in bytes) of the generic SIMD vectors (default: 32)])], [ac_gen_simd_width=$enable_gen_simd_width], - [ac_gen_simd_width=32]) + [ac_gen_simd_width=64]) AC_ARG_ENABLE([gen-scalar], [AS_HELP_STRING([--enable-gen-scalar=yes|no],