From 5bd1bccffd411384b02ca772822d87fac126e67f Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 23 May 2019 11:39:59 +0200 Subject: mg2d: add support for MPI-based multi-component solves For the moment, only the finest component is distributed, any coarser levels are gathered to rank 0. That should change in the future. --- mg2d.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'mg2d.h') diff --git a/mg2d.h b/mg2d.h index fd11906..1db4ace 100644 --- a/mg2d.h +++ b/mg2d.h @@ -22,6 +22,8 @@ #include #include +#include + #include "mg2d_boundary.h" #include "mg2d_constants.h" @@ -168,6 +170,20 @@ typedef struct MG2DContext { * @return The solver context on success, NULL on failure. */ MG2DContext *mg2d_solver_alloc(size_t domain_size); + +/** + * Allocate a solver component in a multi-component MPI-based solve. + * + * @param comm The MPI communicator used to communicate with the other + * components. + * @param local_start Indices of this component's lower left corner in the full + * computational domain. + * @param local_size Size of this component in each direction. + * + * @return The solver context on success, NULL on failure. + */ +MG2DContext *mg2d_solver_alloc_mpi(MPI_Comm comm, const size_t local_start[2], + const size_t local_size[2]); /** * Solve the equation, after all the required fields have been filled by the * caller. -- cgit v1.2.3