From 76a785044da55f5be4e85c68a8059f4737261de3 Mon Sep 17 00:00:00 2001 From: Gallo Alejandro Date: Sun, 14 Aug 2022 15:36:22 +0200 Subject: [PATCH] Check ngcards agains ranks per node --- src/atrip/Atrip.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/atrip/Atrip.cxx b/src/atrip/Atrip.cxx index 3822cda..39dfa29 100644 --- a/src/atrip/Atrip.cxx +++ b/src/atrip/Atrip.cxx @@ -71,16 +71,18 @@ Atrip::Output Atrip::run(Atrip::Input const& in) { #if defined(HAVE_CUDA) int ngcards; + const auto clusterInfo = getClusterInfo(Atrip::communicator); cuDeviceGetCount(&ngcards); LOG(0,"Atrip") << "ngcards: " << ngcards << "\n"; - if (np > ngcards) { - std::cerr << "ATRIP: You are running on more ranks than the number of graphic cards\n" + if (clusterInfo.ranksPerNode > ngcards) { + std::cerr << "ATRIP: You are running on more ranks per node than the number of graphic cards\n" << "You have " << ngcards << " cards at your disposal\n"; throw ""; } - if (np < ngcards) { + if (clusterInfo.ranksPerNode < ngcards) { std::cerr << "You have " << ngcards << " cards at your disposal\n" - << "You will be only using " << np << ", i.e., the nubmer of ranks.\n"; + << "You will be only using " << clusterInfo.ranksPerNode + << ", i.e., the nubmer of ranks.\n"; }