Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
bdbaa98f4c0100f11e05d6ab888b1e6232edafa5
[simgrid.git] / include / smpi / sampi.h
1 /* Copyright (c) 2007-2018. The SimGrid Team. All rights reserved.          */
2
3 /* This program is free software; you can redistribute it and/or modify it
4  * under the terms of the license (GNU LGPL) which comes with this package. */
5
6 #ifndef SAMPI_H_
7 #define SAMPI_H_
8
9 #include "malloc.h"
10 #include <smpi/smpi.h>
11
12 #define AMPI_CALL(type, name, args)                                                                                    \
13   type A##name args __attribute__((weak));                                                                             \
14   type AP##name args;
15
16 #ifndef HAVE_SMPI
17 #define malloc(nbytes) _sampi_malloc(nbytes)
18 #define free(ptr) _sampi_free(ptr)
19 #endif
20
21 SG_BEGIN_DECL()
22
23 XBT_PUBLIC void* _sampi_malloc(size_t size);
24 XBT_PUBLIC void _sampi_free(void* ptr);
25
26 AMPI_CALL(XBT_PUBLIC int, MPI_Iteration_in, (MPI_Comm comm))
27 AMPI_CALL(XBT_PUBLIC int, MPI_Iteration_out, (MPI_Comm comm))
28 AMPI_CALL(XBT_PUBLIC void, MPI_Migrate, (MPI_Comm comm))
29
30 SG_END_DECL()
31
32 #endif