1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
2 /*
3  * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
4  *                         University Research and Technology
5  *                         Corporation.  All rights reserved.
6  * Copyright (c) 2004-2005 The University of Tennessee and The University
7  *                         of Tennessee Research Foundation.  All rights
8  *                         reserved.
9  * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
10  *                         University of Stuttgart.  All rights reserved.
11  * Copyright (c) 2004-2005 The Regents of the University of California.
12  *                         All rights reserved.
13  * Copyright (c) 2011-2012 Cisco Systems, Inc.  All rights reserved.
14  * Copyright (c) 2015      Los Alamos National Security, LLC. All rights
15  *                         reserved.
16  * Copyright (c) 2015      Research Organization for Information Science
17  *                         and Technology (RIST). All rights reserved.
18  * $COPYRIGHT$
19  *
20  * Additional copyrights may follow
21  *
22  * $HEADER$
23  */
24 
25 #include "ompi_config.h"
26 
27 #include "ompi/mpi/fortran/mpif-h/bindings.h"
28 
29 /* The OMPI_GENERATE_F77_BINDINGS work only for the most common F77 bindings, the
30  * one that does not return any value. There are 4 exceptions MPI_Wtick, MPI_Wtime,
31  * MPI_Aint_add, and MPI_Aint_diff. For these 4 we can insert the bindings
32  * manually.
33  */
34 #if OMPI_BUILD_MPI_PROFILING
35 #if OPAL_HAVE_WEAK_SYMBOLS
36 #pragma weak PMPI_AINT_ADD = ompi_aint_add_f
37 #pragma weak pmpi_aint_add = ompi_aint_add_f
38 #pragma weak pmpi_aint_add_ = ompi_aint_add_f
39 #pragma weak pmpi_aint_add__ = ompi_aint_add_f
40 
41 #pragma weak PMPI_Aint_add_f = ompi_aint_add_f
42 #pragma weak PMPI_Aint_add_f08 = ompi_aint_add_f
43 #else
PMPI_AINT_ADD(MPI_Aint * base,MPI_Aint * diff)44 MPI_Aint PMPI_AINT_ADD(MPI_Aint *base, MPI_Aint *diff) { return pompi_aint_add_f(base, diff); }
pmpi_aint_add(MPI_Aint * base,MPI_Aint * diff)45 MPI_Aint pmpi_aint_add(MPI_Aint *base, MPI_Aint *diff) { return pompi_aint_add_f(base, diff); }
pmpi_aint_add_(MPI_Aint * base,MPI_Aint * diff)46 MPI_Aint pmpi_aint_add_(MPI_Aint *base, MPI_Aint *diff) { return pompi_aint_add_f(base, diff); }
pmpi_aint_add__(MPI_Aint * base,MPI_Aint * diff)47 MPI_Aint pmpi_aint_add__(MPI_Aint *base, MPI_Aint *diff) { return pompi_aint_add_f(base, diff); }
48 #endif
49 #endif
50 
51 #if OPAL_HAVE_WEAK_SYMBOLS
52 #pragma weak MPI_AINT_ADD = ompi_aint_add_f
53 #pragma weak mpi_aint_add = ompi_aint_add_f
54 #pragma weak mpi_aint_add_ = ompi_aint_add_f
55 #pragma weak mpi_aint_add__ = ompi_aint_add_f
56 
57 #pragma weak MPI_Aint_add_f = ompi_aint_add_f
58 #pragma weak MPI_Aint_add_f08 = ompi_aint_add_f
59 #else
60 #if ! OMPI_BUILD_MPI_PROFILING
MPI_AINT_ADD(MPI_Aint * base,MPI_Aint * diff)61 MPI_Aint MPI_AINT_ADD(MPI_Aint *base, MPI_Aint *diff) { return ompi_aint_add_f(base, diff); }
mpi_aint_add(MPI_Aint * base,MPI_Aint * diff)62 MPI_Aint mpi_aint_add(MPI_Aint *base, MPI_Aint *diff) { return ompi_aint_add_f(base, diff); }
mpi_aint_add_(MPI_Aint * base,MPI_Aint * diff)63 MPI_Aint mpi_aint_add_(MPI_Aint *base, MPI_Aint *diff) { return ompi_aint_add_f(base, diff); }
mpi_aint_add__(MPI_Aint * base,MPI_Aint * diff)64 MPI_Aint mpi_aint_add__(MPI_Aint *base, MPI_Aint *diff) { return ompi_aint_add_f(base, diff); }
65 #else
66 #define ompi_aint_add_f pompi_aint_add_f
67 #endif
68 #endif
69 
ompi_aint_add_f(MPI_Aint * base,MPI_Aint * diff)70 MPI_Aint ompi_aint_add_f(MPI_Aint *base, MPI_Aint *diff)
71 {
72     return MPI_Aint_add (*base, *diff);
73 }
74