3#ifndef vtkMPIUtilities_h
4#define vtkMPIUtilities_h
15VTK_ABI_NAMESPACE_BEGIN
25template <
typename... T>
28 assert(comm !=
nullptr);
31 vtk::print(format, std::forward<T>(args)...);
36template <
typename... T>
41 assert(comm !=
nullptr);
53template <
typename... T>
56 assert(comm !=
nullptr);
61 int* nullmsg =
nullptr;
66 vtk::print(
"[{:d}]: ", rank);
69 vtk::print(format, std::forward<T>(args)...);
78 else if (rank == numRanks - 1)
81 comm->
Receive(nullmsg, 0, rank - 1, 0);
84 vtk::print(
"[{:d}]: ", rank);
86 vtk::print(format, std::forward<T>(args)...);
92 comm->
Receive(nullmsg, 0, rank - 1, 0);
95 vtk::print(
"[{:d}]: ", rank);
97 vtk::print(format, std::forward<T>(args)...);
106template <
typename... T>
111 assert(comm !=
nullptr);
Process communication using MPI.
int NoBlockSend(const int *data, int length, int remoteProcessId, int tag, vtkMPICommunicator::Request &req)
This method sends data to another process (non-blocking).
int GetNumberOfProcesses()
Set the number of processes you will be using.
void Barrier()
This method can be used to synchronize processes.
int GetLocalProcessId()
Tells you which process [0, NumProcess) you are in.
int Receive(int *data, vtkIdType maxlength, int remoteProcessId, int tag)
This method receives data from a corresponding send.
void SynchronizedPrint(vtkMPIController *comm, const char *format, T &&... args)
Each rank, r_0 to r_{N-1}, prints the formatted message to stdout in rank order.
void Printf(vtkMPIController *comm, const char *formatArg, T &&... args)
Rank 0 prints the user-supplied formatted message to stdout.
void Print(vtkMPIController *comm, const char *format, T &&... args)
Rank 0 prints the user-supplied formatted message to stdout.
void SynchronizedPrintf(vtkMPIController *comm, const char *formatArg, T &&... args)
Each rank, r_0 to r_{N-1}, prints the formatted message to stdout in rank order.
VTKCOMMONCORE_EXPORT std::string to_std_format(const std::string &format)
Convert printf and std::format style format strings.
#define VTK_DEPRECATED_IN_9_6_0(reason)