From b18f8cd03b07b84122ea9fa5436bc4f5bf51abc4 Mon Sep 17 00:00:00 2001 From: Matthieu Schaller <matthieu.schaller@durham.ac.uk> Date: Thu, 7 Jan 2016 09:37:35 +0000 Subject: [PATCH] Documentation and formatting --- src/engine.c | 4 ++-- src/part.c | 6 ++++++ src/scheduler.c | 9 ++++----- src/scheduler.h | 1 - 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/engine.c b/src/engine.c index dbb30a5d16..a35acc11b9 100644 --- a/src/engine.c +++ b/src/engine.c @@ -228,8 +228,8 @@ void engine_redistribute(struct engine *e) { } } if (k != nodeID && counts[ind_recv] > 0) { - if (MPI_Irecv(&parts_new[offset_recv], counts[ind_recv], - e->part_mpi_type, k, 2 * ind_recv + 0, MPI_COMM_WORLD, + if (MPI_Irecv(&parts_new[offset_recv], counts[ind_recv], e->part_mpi_type, + k, 2 * ind_recv + 0, MPI_COMM_WORLD, &reqs[4 * k + 2]) != MPI_SUCCESS) error("Failed to emit irecv of parts from node %i.", k); if (MPI_Irecv(&xparts_new[offset_recv], counts[ind_recv], diff --git a/src/part.c b/src/part.c index 1923e3f044..94d954d81d 100644 --- a/src/part.c +++ b/src/part.c @@ -32,6 +32,7 @@ /** * @brief Registers and returns an MPI type for the particles * + * @param part_type The type container */ void part_create_mpi_type(MPI_Datatype* part_type) { @@ -39,6 +40,8 @@ void part_create_mpi_type(MPI_Datatype* part_type) { /* One should define the structure field by field */ /* But as long as we don't do serialization via MPI-IO */ /* we don't really care. */ + /* Also we would have to modify this function everytime something */ + /* is added to the part structure. */ MPI_Type_contiguous(sizeof(struct part) / sizeof(unsigned char), MPI_BYTE, part_type); MPI_Type_commit(part_type); @@ -47,6 +50,7 @@ void part_create_mpi_type(MPI_Datatype* part_type) { /** * @brief Registers and returns an MPI type for the xparticles * + * @param xpart_type The type container */ void xpart_create_mpi_type(MPI_Datatype* xpart_type) { @@ -54,6 +58,8 @@ void xpart_create_mpi_type(MPI_Datatype* xpart_type) { /* One should define the structure field by field */ /* But as long as we don't do serialization via MPI-IO */ /* we don't really care. */ + /* Also we would have to modify this function everytime something */ + /* is added to the part structure. */ MPI_Type_contiguous(sizeof(struct xpart) / sizeof(unsigned char), MPI_BYTE, xpart_type); MPI_Type_commit(xpart_type); diff --git a/src/scheduler.c b/src/scheduler.c index 384b8070c0..0c904245b2 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -1048,8 +1048,8 @@ void scheduler_enqueue(struct scheduler *s, struct task *t) { break; case task_type_recv: #ifdef WITH_MPI - if ((err = MPI_Irecv(t->ci->parts, t->ci->count, - s->part_mpi_type, t->ci->nodeID, t->flags, MPI_COMM_WORLD, + if ((err = MPI_Irecv(t->ci->parts, t->ci->count, s->part_mpi_type, + t->ci->nodeID, t->flags, MPI_COMM_WORLD, &t->req)) != MPI_SUCCESS) { char buff[MPI_MAX_ERROR_STRING]; int len; @@ -1067,8 +1067,8 @@ void scheduler_enqueue(struct scheduler *s, struct task *t) { case task_type_send: #ifdef WITH_MPI if ((err = MPI_Isend(t->ci->parts, sizeof(struct part) * t->ci->count, - s->part_mpi_type, t->cj->nodeID, t->flags, MPI_COMM_WORLD, - &t->req)) != MPI_SUCCESS) { + s->part_mpi_type, t->cj->nodeID, t->flags, + MPI_COMM_WORLD, &t->req)) != MPI_SUCCESS) { char buff[MPI_MAX_ERROR_STRING]; int len; MPI_Error_string(err, buff, &len); @@ -1315,5 +1315,4 @@ void scheduler_init(struct scheduler *s, struct space *space, int nr_queues, part_create_mpi_type(&s->part_mpi_type); xpart_create_mpi_type(&s->xpart_mpi_type); #endif - } diff --git a/src/scheduler.h b/src/scheduler.h index 97b2e1a05d..b2cddb20d5 100644 --- a/src/scheduler.h +++ b/src/scheduler.h @@ -103,7 +103,6 @@ struct scheduler { MPI_Datatype part_mpi_type; MPI_Datatype xpart_mpi_type; #endif - }; /* Function prototypes. */ -- GitLab