Skip to content
Snippets Groups Projects
Verified Commit 35484f46 authored by raphael.bach's avatar raphael.bach
Browse files

Add `FMPI_TASK_OP_GATHER`

parent 84cbefbf
Branches
No related tags found
No related merge requests found
...@@ -55,7 +55,8 @@ ...@@ -55,7 +55,8 @@
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
typedef enum fmpi_task_op { typedef enum fmpi_task_op {
FMPI_TASK_OP_NONE = 0, FMPI_TASK_OP_NONE = 0,
FMPI_TASK_OP_SUM FMPI_TASK_OP_SUM,
FMPI_TASK_OP_GATHER
} fmpi_task_op; } fmpi_task_op;
/*------------------------------------------------------------------------------ /*------------------------------------------------------------------------------
fmpi_task_args fmpi_task_args
......
...@@ -194,5 +194,18 @@ int fmpi_task_finalize( ...@@ -194,5 +194,18 @@ int fmpi_task_finalize(
} }
return err; return err;
} }
if(op == FMPI_TASK_OP_GATHER) {
const size_t cnt = task->domains[0].parts[ctx->mpi->rank].inner.cnt;
MPI_Datatype type = fmpi_mpi_type(task->args.out.type.base);
const int err = fmpi_mpi_world_gather_in_place(
ctx->mpi, task->args.out.raw, type, cnt, cnt
);
if(err != FMPI_SUCCESS) {
FMPI_RAISE_ERROR(ctx->err_handler, "FMPI",
"fmpi_mpi_world_gather_in_place() failed!"
);
}
return err;
}
return FMPI_SUCCESS; return FMPI_SUCCESS;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment