From c438118fd719b5fd908dc72dcd6ff3d6db83923c Mon Sep 17 00:00:00 2001 From: Daniel Richtmann Date: Tue, 8 Dec 2020 14:42:11 +0100 Subject: [PATCH 1/4] Change access specifier of clover fields in order to allow deriving classes to access these --- Grid/qcd/action/fermion/WilsonCloverFermion.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Grid/qcd/action/fermion/WilsonCloverFermion.h b/Grid/qcd/action/fermion/WilsonCloverFermion.h index 91ad6d6d..92af7111 100644 --- a/Grid/qcd/action/fermion/WilsonCloverFermion.h +++ b/Grid/qcd/action/fermion/WilsonCloverFermion.h @@ -245,7 +245,7 @@ public: return out; } -private: +protected: // here fixing the 4 dimensions, make it more general? RealD csw_r; // Clover coefficient - spatial From 019ffe17d4f1ba9d167cb45f62ea7a0df0c19adc Mon Sep 17 00:00:00 2001 From: Christoph Lehner Date: Tue, 2 Feb 2021 11:32:23 +0100 Subject: [PATCH 2/4] Allow for GPU vector width beyond 64 --- Grid/util/Coordinate.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Grid/util/Coordinate.h b/Grid/util/Coordinate.h index 004fbc72..89f73264 100644 --- a/Grid/util/Coordinate.h +++ b/Grid/util/Coordinate.h @@ -88,7 +88,7 @@ public: // Coordinate class, maxdims = 8 for now. //////////////////////////////////////////////////////////////// #define GRID_MAX_LATTICE_DIMENSION (8) -#define GRID_MAX_SIMD (16) +#define GRID_MAX_SIMD (sizeof(vInteger)/sizeof(Integer)) static constexpr int MaxDims = GRID_MAX_LATTICE_DIMENSION; From 4705aa541d62e16b070452e4a3f329d9f9565afa Mon Sep 17 00:00:00 2001 From: Christoph Lehner Date: Thu, 4 Feb 2021 14:25:55 +0100 Subject: [PATCH 3/4] Allow user to configure ShmDims via environment variables --- Grid/communicator/SharedMemoryMPI.cc | 18 ++++++++++++++++++ Grid/util/Init.cc | 2 +- Grid/util/Init.h | 2 +- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/Grid/communicator/SharedMemoryMPI.cc b/Grid/communicator/SharedMemoryMPI.cc index a12418e6..466f6a1e 100644 --- a/Grid/communicator/SharedMemoryMPI.cc +++ b/Grid/communicator/SharedMemoryMPI.cc @@ -7,6 +7,7 @@ Copyright (C) 2015 Author: Peter Boyle +Author: Christoph Lehner This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -169,6 +170,23 @@ static inline int divides(int a,int b) } void GlobalSharedMemory::GetShmDims(const Coordinate &WorldDims,Coordinate &ShmDims) { + //////////////////////////////////////////////////////////////// + // Allow user to configure through environment variable + //////////////////////////////////////////////////////////////// + char* str = getenv(("GRID_SHM_DIMS_" + std::to_string(ShmDims.size())).c_str()); + if ( str ) { + std::vector IntShmDims; + GridCmdOptionIntVector(std::string(str),IntShmDims); + assert(IntShmDims.size() == WorldDims.size()); + long ShmSize = 1; + for (int dim=0;dim & vec) } template -void GridCmdOptionIntVector(std::string &str,VectorInt & vec) +void GridCmdOptionIntVector(const std::string &str,VectorInt & vec) { vec.resize(0); std::stringstream ss(str); diff --git a/Grid/util/Init.h b/Grid/util/Init.h index dad963a0..4eb8f06c 100644 --- a/Grid/util/Init.h +++ b/Grid/util/Init.h @@ -55,7 +55,7 @@ template std::string GridCmdVectorIntToString(const VectorInt & vec); void GridCmdOptionCSL(std::string str,std::vector & vec); template -void GridCmdOptionIntVector(std::string &str,VectorInt & vec); +void GridCmdOptionIntVector(const std::string &str,VectorInt & vec); void GridCmdOptionInt(std::string &str,int & val); From b24181aa4f21a59e601237947c5ea465d0e1ecaf Mon Sep 17 00:00:00 2001 From: Christoph Lehner Date: Fri, 5 Mar 2021 16:56:58 +0100 Subject: [PATCH 4/4] Update Coordinate.h Revert GRID_MAX_SIMD change --- Grid/util/Coordinate.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Grid/util/Coordinate.h b/Grid/util/Coordinate.h index 89f73264..004fbc72 100644 --- a/Grid/util/Coordinate.h +++ b/Grid/util/Coordinate.h @@ -88,7 +88,7 @@ public: // Coordinate class, maxdims = 8 for now. //////////////////////////////////////////////////////////////// #define GRID_MAX_LATTICE_DIMENSION (8) -#define GRID_MAX_SIMD (sizeof(vInteger)/sizeof(Integer)) +#define GRID_MAX_SIMD (16) static constexpr int MaxDims = GRID_MAX_LATTICE_DIMENSION;