Check ngcards agains ranks per node
This commit is contained in:
parent
7241bbe9fb
commit
76a785044d
@ -71,16 +71,18 @@ Atrip::Output Atrip::run(Atrip::Input<F> const& in) {
|
|||||||
|
|
||||||
#if defined(HAVE_CUDA)
|
#if defined(HAVE_CUDA)
|
||||||
int ngcards;
|
int ngcards;
|
||||||
|
const auto clusterInfo = getClusterInfo(Atrip::communicator);
|
||||||
cuDeviceGetCount(&ngcards);
|
cuDeviceGetCount(&ngcards);
|
||||||
LOG(0,"Atrip") << "ngcards: " << ngcards << "\n";
|
LOG(0,"Atrip") << "ngcards: " << ngcards << "\n";
|
||||||
if (np > ngcards) {
|
if (clusterInfo.ranksPerNode > ngcards) {
|
||||||
std::cerr << "ATRIP: You are running on more ranks than the number of graphic cards\n"
|
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";
|
<< "You have " << ngcards << " cards at your disposal\n";
|
||||||
throw "";
|
throw "";
|
||||||
}
|
}
|
||||||
if (np < ngcards) {
|
if (clusterInfo.ranksPerNode < ngcards) {
|
||||||
std::cerr << "You have " << ngcards << " cards at your disposal\n"
|
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";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user