#include <vector>
#include <string>
-
+#ifdef DEAL_II_USE_PETSC
+#include <petscvec.h>
+#endif
/**
* A namespace for utility functions that are not particularly specific to
* Return the present time as HH:MM:SS.
*/
std::string get_time ();
+
+#ifdef DEAL_II_USE_PETSC
+ /**
+ * Return the number of MPI
+ * processes there exist.
+ */
+ unsigned int get_n_mpi_processes (const MPI_Comm &mpi_communicator);
+
+ /**
+ * Return the number of the
+ * present MPI process in the
+ * space of processes. This will
+ * be a unique value for each
+ * process between zero and (less
+ * than) the number of all
+ * processes (given by
+ * get_n_mpi_processes()).
+ */
+ unsigned int get_this_mpi_process (const MPI_Comm &mpi_communicator);
+#endif // DEAL_II_USE_PETSC
}
}
return o.str();
}
+#ifdef DEAL_II_USE_PETSC
+ unsigned int get_n_mpi_processes (
+ const MPI_Comm &mpi_communicator)
+ {
+ int n_jobs=1;
+ MPI_Comm_size (mpi_communicator, &n_jobs);
+
+ return n_jobs;
+ }
+
+ unsigned int get_this_mpi_process (
+ const MPI_Comm &mpi_communicator)
+ {
+ int rank=0;
+ MPI_Comm_rank (mpi_communicator, &rank);
+
+ return rank;
+ }
+#endif
}
}