------------------------------------------------------------------------------
| 17 | |
| 18 | //------------------------------------------------------------------------------ |
| 19 | PyObject* vtkMPI4PyCommunicator::ConvertToPython(vtkMPICommunicator* comm) |
| 20 | { |
| 21 | // Import mpi4py if it does not exist. |
| 22 | if (!PyMPIComm_New) |
| 23 | { |
| 24 | if (import_mpi4py() < 0) |
| 25 | { |
| 26 | Py_RETURN_NONE; |
| 27 | } |
| 28 | } |
| 29 | |
| 30 | if (!comm || !comm->GetMPIComm()) |
| 31 | { |
| 32 | Py_RETURN_NONE; |
| 33 | } |
| 34 | |
| 35 | return PyMPIComm_New(*comm->GetMPIComm()->GetHandle()); |
| 36 | } |
| 37 | |
| 38 | //------------------------------------------------------------------------------ |
| 39 | vtkMPICommunicator* vtkMPI4PyCommunicator::ConvertToVTK(PyObject* comm) |
no test coverage detected