Loading src/TNL/MPI/Utils.h +1 −1 Original line number Diff line number Diff line /*************************************************************************** MPI/Wrappers.h - description MPI/Utils.h - description ------------------- begin : Apr 23, 2005 copyright : (C) 2005 by Tomas Oberhuber et al. Loading src/TNL/MPI/selectGPU.h +7 −1 Original line number Diff line number Diff line /*************************************************************************** MPI/Wrappers.h - description MPI/selectGPU.h - description ------------------- begin : Apr 23, 2005 copyright : (C) 2005 by Tomas Oberhuber et al. Loading @@ -10,6 +10,8 @@ #pragma once #include <cstdlib> // std::getenv #include <TNL/Cuda/CheckDevice.h> #include "Utils.h" Loading @@ -26,6 +28,10 @@ inline void selectGPU() const int local_rank = getRankOnNode(); const int gpuNumber = local_rank % gpuCount; std::cout << "Rank " << GetRank() << ": rank on node is " << local_rank << ", using GPU id " << gpuNumber << " of " << gpuCount << ", CUDA_VISIBLE_DEVICES=" << std::getenv("CUDA_VISIBLE_DEVICES") << std::endl; cudaSetDevice(gpuNumber); TNL_CHECK_CUDA_DEVICE; Loading Loading
src/TNL/MPI/Utils.h +1 −1 Original line number Diff line number Diff line /*************************************************************************** MPI/Wrappers.h - description MPI/Utils.h - description ------------------- begin : Apr 23, 2005 copyright : (C) 2005 by Tomas Oberhuber et al. Loading
src/TNL/MPI/selectGPU.h +7 −1 Original line number Diff line number Diff line /*************************************************************************** MPI/Wrappers.h - description MPI/selectGPU.h - description ------------------- begin : Apr 23, 2005 copyright : (C) 2005 by Tomas Oberhuber et al. Loading @@ -10,6 +10,8 @@ #pragma once #include <cstdlib> // std::getenv #include <TNL/Cuda/CheckDevice.h> #include "Utils.h" Loading @@ -26,6 +28,10 @@ inline void selectGPU() const int local_rank = getRankOnNode(); const int gpuNumber = local_rank % gpuCount; std::cout << "Rank " << GetRank() << ": rank on node is " << local_rank << ", using GPU id " << gpuNumber << " of " << gpuCount << ", CUDA_VISIBLE_DEVICES=" << std::getenv("CUDA_VISIBLE_DEVICES") << std::endl; cudaSetDevice(gpuNumber); TNL_CHECK_CUDA_DEVICE; Loading