diff --git a/include/fmpi_core.h b/include/fmpi_core.h index 7505c71a1d359d8d3fcee06046f81573477117fd..81fc2f63acad2d323af37e901a660d404eb566a5 100644 --- a/include/fmpi_core.h +++ b/include/fmpi_core.h @@ -114,6 +114,16 @@ _Noreturn void fmpi_abort(const struct fmpi_ctx * ctx); * } */ _Bool fmpi_is_root(const struct fmpi_ctx * ctx); +/*------------------------------------------------------------------------------ + fmpi_world_rank() +------------------------------------------------------------------------------*/ +/** + * TODO + */ +int fmpi_world_rank(const struct fmpi_ctx * ctx); +/*============================================================================== + MACRO +==============================================================================*/ /*------------------------------------------------------------------------------ fmpi_root_printf() ------------------------------------------------------------------------------*/ @@ -123,13 +133,6 @@ do { \ printf(__VA_ARGS__); \ } \ } while(0) -/*------------------------------------------------------------------------------ - fmpi_world_rank() -------------------------------------------------------------------------------*/ -/** - * TODO - */ -int fmpi_world_rank(const struct fmpi_ctx * ctx); /*============================================================================== GUARD ==============================================================================*/ diff --git a/include/fmpi_data.h b/include/fmpi_data.h index 5634d7d4d5428c9427da74d0e67ba734f3bba830..aec3739fa6d8d8a4425125a86a7687cfd3670514 100644 --- a/include/fmpi_data.h +++ b/include/fmpi_data.h @@ -27,7 +27,7 @@ INCLUDE ==============================================================================*/ // C Standard Library -#include <stddef.h> +#include <stddef.h> // size_t #include <stdint.h> // Internal #include "internal/fmpi_common.h" diff --git a/include/internal/fmpi_ctx.h b/include/internal/fmpi_ctx.h index 1ac74a1c3052223c31a7a41ebb7655ca5230ed6a..f4b3f80c95bffce8d103f665ca90c31709c2b0c2 100644 --- a/include/internal/fmpi_ctx.h +++ b/include/internal/fmpi_ctx.h @@ -32,7 +32,7 @@ #include "../fmpi_task.h" #include "fmpi_error.h" /*============================================================================== - STRUCT + TYPE ==============================================================================*/ /*------------------------------------------------------------------------------ fmpi_ctx diff --git a/include/internal/fmpi_mpi.h b/include/internal/fmpi_mpi.h index a81bc5be91a3649ee2e305d23dcd90fdf5de4824..adbd6b0b6b09ca5ffe8b774c22f7b4a17dbf5c8f 100644 --- a/include/internal/fmpi_mpi.h +++ b/include/internal/fmpi_mpi.h @@ -26,7 +26,6 @@ /*============================================================================== INCLUDE ==============================================================================*/ -// C Standard Library // External #include <mpi.h> // MPI_MAX_PROCESSOR_NAME // Internal diff --git a/src/fmpi_core.c b/src/fmpi_core.c index 0bc6ee4aff6712207f0db19c8f6949dc832c90d9..fde5d215f6bb188c87eaa1b877862ffc88a97cb9 100644 --- a/src/fmpi_core.c +++ b/src/fmpi_core.c @@ -26,7 +26,7 @@ // C Standard Library #include <assert.h> #include <stdio.h> // fprintf() -#include <stdlib.h> // NULL, +#include <stdlib.h> // NULL, abort() // External #include <mpi.h> // Internal @@ -34,10 +34,7 @@ #include "internal/fmpi_futhark.h" #include "internal/fmpi_mpi.h" /*============================================================================== - STRUCT -==============================================================================*/ -/*============================================================================== - PUBLIC FUNCTION + PUBLIC FUNCTION DEFINITION ==============================================================================*/ /*------------------------------------------------------------------------------ fmpi_init() diff --git a/src/fmpi_ctx.c b/src/fmpi_ctx.c index 03b87e6680bb942c5be0b70777a8a0fe010a4baa..58eca0e130591a99e432a590fe2eef5ce2a39794 100644 --- a/src/fmpi_ctx.c +++ b/src/fmpi_ctx.c @@ -26,8 +26,8 @@ // C Standard Library #include <assert.h> #include <stdint.h> -#include <stdio.h> -#include <stdlib.h> +#include <stdio.h> // fprintf() +#include <stdlib.h> // NULL, free(), malloc() #include <string.h> // Internal #include "internal/fmpi_error.h" @@ -93,7 +93,7 @@ struct fmpi_ctx * fmpi_ctx_create(int * argc, char ** argv[]) return ctx; } /*------------------------------------------------------------------------------ - fmpi_ctx_create() + fmpi_ctx_destroy() ------------------------------------------------------------------------------*/ int fmpi_ctx_destroy(struct fmpi_ctx ** const ctx) { diff --git a/src/fmpi_domain.c b/src/fmpi_domain.c index 79f359ce26108fcc2b3b17c261c8dae4c64d9f1d..718132383a472eaf5e042f5100e23b418e854c9a 100644 --- a/src/fmpi_domain.c +++ b/src/fmpi_domain.c @@ -25,7 +25,7 @@ #include "fmpi_domain.h" // C Standard Library #include <assert.h> -#include <stdlib.h> +#include <stdlib.h> // size_t, NULL, malloc() // Internal #include "fmpi_data.h" #include "internal/fmpi_ctx.h" diff --git a/src/fmpi_error.c b/src/fmpi_error.c index 8b8b397adc7e9e2f5de56a3821ae212f851ef0e9..707949fde7d81acac15c6a3d922022c8068a90cb 100644 --- a/src/fmpi_error.c +++ b/src/fmpi_error.c @@ -26,10 +26,10 @@ // C Standard Library #include <assert.h> #include <stdarg.h> -#include <stdio.h> // NULL, vsnprintf() -#include <time.h> // time_t, time() +#include <stdio.h> // NULL, size_t, vsnprintf() +#include <time.h> // time_t, struct tm, localtime(), strftime(), time() /*============================================================================== - PUBLIC FUNCTION + PUBLIC FUNCTION DEFINITION ==============================================================================*/ /*------------------------------------------------------------------------------ fmpi_raise_error() diff --git a/src/fmpi_futhark.c b/src/fmpi_futhark.c index c3137f4692f57942c29b9d438c62114c5eba9ef8..5d3f3c5682dd49572a950ad3ba0dd4bb58a85143 100644 --- a/src/fmpi_futhark.c +++ b/src/fmpi_futhark.c @@ -27,7 +27,7 @@ #include <assert.h> #include <stdbool.h> #include <stdint.h> // int64_t -#include <stdlib.h> +#include <stdlib.h> // NULL, size_t, free(), malloc() // Internal #include "internal/fmpi_common.h" #include "internal/fmpi_ctx.h" @@ -55,7 +55,7 @@ do { \ } \ } while(0) /*============================================================================== - PUBLIC FUNCTION + PUBLIC FUNCTION DEFINITION ==============================================================================*/ /*------------------------------------------------------------------------------ fmpi_futhark_init() diff --git a/src/fmpi_mpi.c b/src/fmpi_mpi.c index f4ea761a9b1ee7dece5d1ef71633c24c7e2fda24..1609ec47813c7385d8be136b39d4a4829d13e84f 100644 --- a/src/fmpi_mpi.c +++ b/src/fmpi_mpi.c @@ -26,8 +26,8 @@ // C Standard Library #include <assert.h> #include <stdbool.h> -#include <stdio.h> -#include <stdlib.h> +#include <stdio.h> // printf() +#include <stdlib.h> // NULL, free(), malloc() // External #include <mpi.h> // Internal @@ -46,7 +46,7 @@ do { \ } \ } while(0) /*============================================================================== - PUBLIC FUNCTION + PUBLIC FUNCTION DEFINITION ==============================================================================*/ /*------------------------------------------------------------------------------ fmpi_mpi_init() diff --git a/src/fmpi_reduce.c b/src/fmpi_reduce.c index 3c0936ec763fad1a5a177d88445802dc39fffd64..2df7f00e9737d60d08f990ac8c3ed6b8b41503a9 100644 --- a/src/fmpi_reduce.c +++ b/src/fmpi_reduce.c @@ -26,8 +26,8 @@ // C Standard Library #include <assert.h> #include <stdint.h> -#include <stdio.h> -#include <stdlib.h> +#include <stdio.h> // fprintf() +#include <stdlib.h> // NULL, size_t, free(), malloc() // Internal #include "internal/fmpi_ctx.h" #include "internal/fmpi_futhark.h" @@ -35,10 +35,7 @@ #include "internal/fmpi_mpi.h" #include "internal/generic/fmpi_generic.h" /*============================================================================== - STRUCT -==============================================================================*/ -/*============================================================================== - PUBLIC FUNCTION + PUBLIC FUNCTION DEFINITION ==============================================================================*/ #define FMPI_REDUCE_DEFINITION(T) \ T fmpi_local_reduce_prod_##T( \ diff --git a/src/fmpi_stencil.c b/src/fmpi_stencil.c index 2e466a2a73df0dd63afe8c4082517d499c205920..825bc5046005914d9e3ae81b9238c981b22de943 100644 --- a/src/fmpi_stencil.c +++ b/src/fmpi_stencil.c @@ -26,7 +26,7 @@ // C Standard Library #include <stddef.h> // size_t /*============================================================================== - PUBLIC FUNCTION + PUBLIC FUNCTION DEFINITION ==============================================================================*/ /*------------------------------------------------------------------------------ fmpi_no_stencil() diff --git a/src/fmpi_task.c b/src/fmpi_task.c index e65be4d9fb887474f2704de06032cdcbe2e73b15..6f5b799cd9328905a1fb0346d3bc73c9c8525ab7 100644 --- a/src/fmpi_task.c +++ b/src/fmpi_task.c @@ -25,7 +25,7 @@ #include "fmpi_task.h" // C Standard Library #include <assert.h> -#include <stdint.h> // int64_t +#include <stddef.h> // NULL, size_t // Internal #include "fmpi_domain.h" #include "fmpi_stencil.h" @@ -39,7 +39,7 @@ PUBLIC FUNCTION DEFINITION ==============================================================================*/ /*------------------------------------------------------------------------------ - fmpi_task_run() + fmpi_task_register() ------------------------------------------------------------------------------*/ struct fmpi_task fmpi_task_register( struct fmpi_ctx * ctx, const fmpi_task_func func, @@ -73,9 +73,12 @@ struct fmpi_task fmpi_task_register( futhark_context_sync(ctx->fut->ctx); return task; } +/*------------------------------------------------------------------------------ + fmpi_task_run() +------------------------------------------------------------------------------*/ void fmpi_task_run( - const struct fmpi_ctx * const ctx, const struct fmpi_task * const task -){ + const struct fmpi_ctx * const ctx, const struct fmpi_task * const task +) { assert(ctx != NULL); assert(task != NULL); task->func(ctx, &task->args);