diff options
author | Anton Khirnov <anton@khirnov.net> | 2019-05-23 11:39:59 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2019-05-23 11:41:31 +0200 |
commit | 5bd1bccffd411384b02ca772822d87fac126e67f (patch) | |
tree | 3a9494a87f93c4fa35063d47afdf294aa3b720aa /mg2d.h | |
parent | 4c972cfc352ae5ba851cae142ca6fe594d88bc04 (diff) |
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.
Diffstat (limited to 'mg2d.h')
-rw-r--r-- | mg2d.h | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -22,6 +22,8 @@ #include <stddef.h> #include <stdint.h> +#include <mpi.h> + #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. |