1 /*----------------------------------------------------------------------------
2  ADOL-C -- Automatic Differentiation by Overloading in C++
3  File:     ampisupportAdolc.cpp
4  Revision: $Id$
5 
6  Copyright (c) Jean Utke
7 
8  This file is part of ADOL-C. This software is provided as open source.
9  Any use, reproduction, or distribution of the software constitutes
10  recipient's acceptance of the terms of the accompanying license file.
11 
12 ----------------------------------------------------------------------------*/
13 
14 #if !defined(ADOLC_AMPISUPPORTADOLC_H)
15 #define ADOLC_AMPISUPPORTADOLC_H 1
16 
17 #ifdef ADOLC_AMPI_SUPPORT
18 #include "ampi/ampi.h"
19 #include "ampi/libCommon/modified.h"
20 
21 #if defined(__cplusplus)
22 extern "C" {
23 #endif
24 
25 void ADOLC_TLM_init();
26 
27 int ADOLC_TLM_AMPI_Send(void* buf,
28                         int count,
29                         MPI_Datatype datatype,
30                         int src,
31                         int tag,
32                         AMPI_PairedWith pairedWith,
33                         MPI_Comm comm);
34 
35 int ADOLC_TLM_AMPI_Recv(void* buf,
36                         int count,
37                         MPI_Datatype datatype,
38                         int src,
39                         int tag,
40                         AMPI_PairedWith pairedWith,
41                         MPI_Comm comm,
42                         MPI_Status* status);
43 
44 int ADOLC_TLM_AMPI_Isend (void* buf,
45                           int count,
46                           MPI_Datatype datatype,
47                           int dest,
48                           int tag,
49                           AMPI_PairedWith pairedWith,
50                           MPI_Comm comm,
51                           AMPI_Request* request);
52 
53 int ADOLC_TLM_AMPI_Irecv (void* buf,
54                           int count,
55                           MPI_Datatype datatype,
56                           int src,
57                           int tag,
58                           AMPI_PairedWith pairedWith,
59                           MPI_Comm comm,
60                           AMPI_Request* request);
61 
62 int ADOLC_TLM_AMPI_Wait(AMPI_Request *request,
63                         MPI_Status *status);
64 
65 int ADOLC_TLM_AMPI_Barrier(MPI_Comm comm);
66 
67 int ADOLC_TLM_AMPI_Gather(void *sendbuf,
68                           int sendcnt,
69                           MPI_Datatype sendtype,
70                           void *recvbuf,
71                           int recvcnt,
72                           MPI_Datatype recvtype,
73                           int root,
74                           MPI_Comm comm);
75 
76 int ADOLC_TLM_AMPI_Scatter(void *sendbuf,
77                            int sendcnt,
78                            MPI_Datatype sendtype,
79                            void *recvbuf,
80                            int recvcnt,
81                            MPI_Datatype recvtype,
82                            int root, MPI_Comm comm);
83 
84 int ADOLC_TLM_AMPI_Allgather(void *sendbuf,
85                              int sendcnt,
86                              MPI_Datatype sendtype,
87                              void *recvbuf,
88                              int recvcnt,
89                              MPI_Datatype recvtype,
90                              MPI_Comm comm);
91 
92 int ADOLC_TLM_AMPI_Gatherv(void *sendbuf,
93                            int sendcnt,
94                            MPI_Datatype sendtype,
95                            void *recvbuf,
96                            int *recvcnts,
97                            int *displs,
98                            MPI_Datatype recvtype,
99                            int root,
100                            MPI_Comm comm);
101 
102 int ADOLC_TLM_AMPI_Scatterv(void *sendbuf,
103                             int *sendcnts,
104                             int *displs,
105                             MPI_Datatype sendtype,
106                             void *recvbuf,
107                             int recvcnt,
108                             MPI_Datatype recvtype,
109                             int root, MPI_Comm comm);
110 
111 int ADOLC_TLM_AMPI_Allgatherv(void *sendbuf,
112                               int sendcnt,
113                               MPI_Datatype sendtype,
114                               void *recvbuf,
115                               int *recvcnts,
116                               int *displs,
117                               MPI_Datatype recvtype,
118                               MPI_Comm comm);
119 
120 int ADOLC_TLM_AMPI_Bcast(void* buf,
121                          int count,
122                          MPI_Datatype datatype,
123                          int root,
124                          MPI_Comm comm);
125 
126 int ADOLC_TLM_AMPI_Reduce(void* sbuf,
127                           void* rbuf,
128                           int count,
129                           MPI_Datatype datatype,
130                           MPI_Op op,
131                           int root,
132                           MPI_Comm comm);
133 
134 int ADOLC_TLM_AMPI_Allreduce(void* sbuf,
135                              void* rbuf,
136                              int count,
137                              MPI_Datatype datatype,
138                              MPI_Op op,
139                              MPI_Comm comm);
140 
141 #if defined(__cplusplus)
142 }
143 #endif
144 #endif
145 #endif
146