| 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 | } |