MCPcopy Create free account
hub / github.com/OpenNMT/CTranslate2 / register_mpi

Function register_mpi

python/cpp/mpi.cc:10–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8 namespace python {
9
10 void register_mpi(py::module& m) {
11 py::class_<ScopedMPISetter>(
12 m, "MpiInfo",
13 R"pbdoc(
14 An object to manage the MPI communication between processes.
15 It provides information about MPI connexion.
16 )pbdoc")
17
18 .def_static("getNRanks", &ScopedMPISetter::getNRanks,
19 "Get the number of gpus running for the current model.")
20
21 .def_static("getCurRank", &ScopedMPISetter::getCurRank,
22 "Get the current rank of process.")
23
24 .def_static("getLocalRank", &ScopedMPISetter::getLocalRank,
25 "Get the current GPU id used by process.")
26 ;
27 }
28
29 }
30}

Callers 1

PYBIND11_MODULEFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected