MCPcopy Create free account
hub / github.com/QuEST-Kit/QuEST / comm_getNumNodes

Function comm_getNumNodes

quest/src/comm/comm_config.cpp:157–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155
156
157int comm_getNumNodes() {
158#if COMPILE_MPI
159
160 // if distribution was not runtime enabled (or a validation error was
161 // triggered), every node (if many MPI processes were launched)
162 // believes it is the one and only node
163 if (!comm_isInit())
164 return 1;
165
166 int numNodes;
167 MPI_Comm_size(MPI_COMM_WORLD, &numNodes);
168 return numNodes;
169
170#else
171
172 // if MPI isn't compiled, we're definitely non-distributed; return single node
173 return 1;
174#endif
175}
176
177
178void comm_sync() {

Calls 1

comm_isInitFunction · 0.85

Tested by

no test coverage detected