AdjoinableMPI
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
support.h
Go to the documentation of this file.
1 /*
2 ##########################################################
3 # This file is part of the AdjoinableMPI library #
4 # released under the MIT License. #
5 # The full COPYRIGHT notice can be found in the top #
6 # level directory of the AdjoinableMPI distribution. #
7 ##########################################################
8 */
9 #ifndef _AMPI_ADTOOL_SUPPORT_H_
10 #define _AMPI_ADTOOL_SUPPORT_H_
11 
12 #include <mpi.h>
13 #if defined(__cplusplus)
14 extern "C" {
15 #endif
16 
17 #include "ampi/userIF/request.h"
18 #include "ampi/userIF/activity.h"
19 #include "ampi/userIF/modified.h"
20 
30 void ADTOOL_AMPI_pushBcastInfo(void* buf,
31  int count,
32  MPI_Datatype datatype,
33  int root,
34  MPI_Comm comm);
35 typedef void (ADTOOL_AMPI_pushBcastInfoF) (void*,int, MPI_Datatype, int, MPI_Comm);
36 
37 
41 void ADTOOL_AMPI_popBcastInfo(void** buf,
42  int* count,
43  MPI_Datatype* datatype,
44  int* root,
45  MPI_Comm* comm,
46  void **idx);
47 typedef void (ADTOOL_AMPI_popBcastInfoF) (void**, int*, MPI_Datatype*, int*, MPI_Comm*, void**);
48 
49 
53 void ADTOOL_AMPI_pushDoubleArray(void* buf,
54  int count);
55 typedef void (ADTOOL_AMPI_pushDoubleArrayF) (void*, int);
56 
57 void ADTOOL_AMPI_popDoubleArray(double* buf,
58  int* count);
59 typedef void (ADTOOL_AMPI_popDoubleArrayF) (double*, int*);
60 
67 void ADTOOL_AMPI_pushReduceInfo(void* sbuf,
68  void* rbuf,
69  void* resultData,
70  int pushResultData,
71  int count,
72  MPI_Datatype datatype,
73  MPI_Op op,
74  int root,
75  MPI_Comm comm);
76 typedef void (ADTOOL_AMPI_pushReduceInfoF) (void*, void*, void*, int, int, MPI_Datatype, MPI_Op, int, MPI_Comm);
77 
81 void ADTOOL_AMPI_popReduceCountAndType(int* count,
82  MPI_Datatype* datatype);
83 typedef void (ADTOOL_AMPI_popReduceCountAndTypeF) (int*, MPI_Datatype*);
84 
85 void ADTOOL_AMPI_popReduceInfo(void** sbuf,
86  void** rbuf,
87  void** prevData,
88  void** resultData,
89  int* count,
90  MPI_Op* op,
91  int* root,
92  MPI_Comm* comm,
93  void **idx);
94 typedef void (ADTOOL_AMPI_popReduceInfoF) (void**, void**, void**, void**, int*, MPI_Op*, int*, MPI_Comm*, void **);
95 
96 
105 void ADTOOL_AMPI_pushSRinfo(void* buf,
106  int count,
107  MPI_Datatype datatype,
108  int src,
109  int tag,
110  AMPI_PairedWith pairedWith,
111  MPI_Comm comm);
112 typedef void (ADTOOL_AMPI_pushSRinfoF) (void*, int, MPI_Datatype, int, int, AMPI_PairedWith, MPI_Comm);
113 
119 void ADTOOL_AMPI_popSRinfo(void** buf,
120  int* count,
121  MPI_Datatype* datatype,
122  int* src,
123  int* tag,
124  AMPI_PairedWith* pairedWith,
125  MPI_Comm* comm,
126  void **idx);
127 typedef void (ADTOOL_AMPI_popSRinfoF) (void**, int*, MPI_Datatype*, int*, int*, AMPI_PairedWith*, MPI_Comm*, void**);
128 
138 void ADTOOL_AMPI_pushOSinfo(void* buf,
139  int count,
140  MPI_Datatype datatype,
141  int src,
142  int tag,
143  AMPI_PairedWith pairedWith,
144  MPI_Comm comm);
145 typedef void (ADTOOL_AMPI_pushOSinfoF) (void*, int, MPI_Datatype, int, int, AMPI_PairedWith, MPI_Comm);
146 
153 void ADTOOL_AMPI_popOSinfo(void** buf,
154  int* count,
155  MPI_Datatype* datatype,
156  int* src,
157  int* tag,
158  AMPI_PairedWith* pairedWith,
159  MPI_Comm* comm,
160  void **idx);
161 typedef void (ADTOOL_AMPI_popOSinfoF) (void**, int*, MPI_Datatype*, int*, int*, AMPI_PairedWith*, MPI_Comm*, void**);
162 
180 void ADTOOL_AMPI_pushGSinfo(int commSizeForRootOrNull,
181  void *rbuf,
182  int rcnt,
183  MPI_Datatype rtype,
184  void *buf,
185  int count,
186  MPI_Datatype type,
187  int root,
188  MPI_Comm comm);
189 typedef void (ADTOOL_AMPI_pushGSinfoF) (int, void*, int, MPI_Datatype, void*, int, MPI_Datatype, int, MPI_Comm);
190 
196 void ADTOOL_AMPI_popGScommSizeForRootOrNull(int *commSizeForRootOrNull);
198 
215 void ADTOOL_AMPI_popGSinfo(int commSizeForRootOrNull,
216  void **rbuf,
217  int *rcnt,
218  MPI_Datatype *rtype,
219  void **buf,
220  int *count,
221  MPI_Datatype *type,
222  int *root,
223  MPI_Comm *comm);
224 typedef void (ADTOOL_AMPI_popGSinfoF) (int, void**, int*, MPI_Datatype*, void**, int*, MPI_Datatype*, int*, MPI_Comm*);
225 
244 void ADTOOL_AMPI_pushGSVinfo(int commSizeForRootOrNull,
245  void *rbuf,
246  int *rcnts,
247  int *displs,
248  MPI_Datatype rtype,
249  void *buf,
250  int count,
251  MPI_Datatype type,
252  int root,
253  MPI_Comm comm);
254 typedef void (ADTOOL_AMPI_pushGSVinfoF) (int, void*, int*, int*, MPI_Datatype, void*, int, MPI_Datatype, int, MPI_Comm);
255 
273 void ADTOOL_AMPI_popGSVinfo(int commSizeForRootOrNull,
274  void **rbuf,
275  int *rcnts,
276  int *displs,
277  MPI_Datatype *rtype,
278  void **buf,
279  int *count,
280  MPI_Datatype *type,
281  int *root,
282  MPI_Comm *comm);
283 typedef void (ADTOOL_AMPI_popGSVinfoF) (int, void**, int*, int*, MPI_Datatype*, void**, int*, MPI_Datatype*, int*, MPI_Comm*);
284 
292 void ADTOOL_AMPI_push_CallCode(enum AMPI_CallCode_E thisCall);
294 
304 void ADTOOL_AMPI_push_CallCodeReserve(enum AMPI_CallCode_E thisCall, unsigned int);
305 typedef void (ADTOOL_AMPI_push_CallCodeReserveF) (enum AMPI_CallCode_E, unsigned int);
306 
315 void ADTOOL_AMPI_pop_CallCode(enum AMPI_CallCode_E *thisCall);
316 typedef void (ADTOOL_AMPI_pop_CallCodeF) (enum AMPI_CallCode_E*);
317 
318 
319 
324 void ADTOOL_AMPI_push_AMPI_Request(struct AMPI_Request_S *ampiRequest);
326 
331 void ADTOOL_AMPI_pop_AMPI_Request(struct AMPI_Request_S *ampiRequest);
333 
334 
344 void ADTOOL_AMPI_push_request(MPI_Request request);
345 typedef void (ADTOOL_AMPI_push_requestF) (MPI_Request);
346 
347 
353 
359 
365 
371 
376 MPI_Request ADTOOL_AMPI_pop_request();
377 typedef MPI_Request (ADTOOL_AMPI_pop_requestF) ();
378 
379 void ADTOOL_AMPI_push_comm(MPI_Comm comm);
380 typedef void (ADTOOL_AMPI_push_commF) (MPI_Comm);
381 
385 MPI_Comm ADTOOL_AMPI_pop_comm();
386 typedef MPI_Comm (ADTOOL_AMPI_pop_commF) ();
387 
393 void * ADTOOL_AMPI_rawData(void* activeData, int *size);
394 typedef void* (ADTOOL_AMPI_rawDataF) (void*, int*);
395 
401 void * ADTOOL_AMPI_rawDataV(void* activeData, int commSize, int *counts, int* displs);
402 typedef void * (ADTOOL_AMPI_rawDataVF) (void*, int, int*, int*);
403 
408 void * ADTOOL_AMPI_packDType(void* indata, void* outdata, int count, int idx);
409 typedef void * (ADTOOL_AMPI_packDTypeF) (void*, void*, int, int);
410 
414 void * ADTOOL_AMPI_unpackDType(void* indata, void* outdata, int count, int idx);
415 typedef void * (ADTOOL_AMPI_unpackDTypeF) (void*, void*, int, int);
416 
420 void ADTOOL_AMPI_writeData(void* activeData, int *size);
421 typedef void (ADTOOL_AMPI_writeDataF) (void*, int*);
422 
426 void ADTOOL_AMPI_writeDataV(void* activeData, int *counts, int* displs);
427 typedef void (ADTOOL_AMPI_writeDataVF) (void*, int*, int*);
428 
434 void * ADTOOL_AMPI_rawAdjointData(void* activeData);
435 typedef void * (ADTOOL_AMPI_rawAdjointDataF) (void*);
436 
445 void ADTOOL_AMPI_Turn(void* buf, void* adjointBuf) ;
446 typedef void (ADTOOL_AMPI_TurnF) (void*, void*) ;
447 
453 void ADTOOL_AMPI_mapBufForAdjoint(struct AMPI_Request_S *ampiRequest,
454  void* buf);
455 typedef void (ADTOOL_AMPI_mapBufForAdjointF) (struct AMPI_Request_S*, void*);
456 
462  void* buf);
464 
472 void ADTOOL_AMPI_setBufForAdjoint(struct AMPI_Request_S *ampiRequest,
473  void* buf);
474 typedef void (ADTOOL_AMPI_setBufForAdjointF) (struct AMPI_Request_S *, void*);
475 
483  MPI_Datatype datatype);
484 typedef void (ADTOOL_AMPI_getAdjointCountF) (int*, MPI_Datatype);
485 
489 void ADTOOL_AMPI_setAdjointCount(struct AMPI_Request_S *ampiRequest);
491 
496 void ADTOOL_AMPI_setAdjointCountAndTempBuf(struct AMPI_Request_S *ampiRequest);
498 
502 void ADTOOL_AMPI_setWinAdjointCount(AMPI_WinRequest *winRequest);
503 typedef void (ADTOOL_AMPI_setWinAdjointCountF) (AMPI_WinRequest *);
504 
509 void ADTOOL_AMPI_setWinAdjointCountAndTempBuf(AMPI_WinRequest *winRequest);
510 typedef void (ADTOOL_AMPI_setWinAdjointCountAndTempBufF) (AMPI_WinRequest *);
511 
520 
525 void* ADTOOL_AMPI_allocateTempBuf(int adjointCount, MPI_Datatype dataType, MPI_Comm comm) ;
526 typedef void* (ADTOOL_AMPI_allocateTempBufF) (int, MPI_Datatype, MPI_Comm) ;
527 
531 void ADTOOL_AMPI_releaseAdjointTempBuf(void *tempBuf);
532 typedef void (ADTOOL_AMPI_releaseAdjointTempBufF) (void *);
533 
537 void* ADTOOL_AMPI_allocateTempActiveBuf(int count, MPI_Datatype datatype, MPI_Comm comm);
538 typedef void* (ADTOOL_AMPI_allocateTempActiveBufF) (int, MPI_Datatype, MPI_Comm);
539 
543 void ADTOOL_AMPI_releaseTempActiveBuf(void *buf, int count, MPI_Datatype datatype);
544 typedef void (ADTOOL_AMPI_releaseTempActiveBufF) (void *, int, MPI_Datatype);
545 
549 void * ADTOOL_AMPI_copyActiveBuf(void* source, void* target, int count, MPI_Datatype datatype, MPI_Comm comm);
550 typedef void* (ADTOOL_AMPI_copyActiveBufF) (void*, void*, int, MPI_Datatype, MPI_Comm);
551 
555 void ADTOOL_AMPI_adjointMultiply(int count, MPI_Datatype datatype, MPI_Comm comm,
556  void *source, void *adjointSource,
557  void* target, void* adjointTarget) ;
558 typedef void (ADTOOL_AMPI_adjointMultiplyF) (int, MPI_Datatype, MPI_Comm, void*, void*, void*, void*);
559 
563 void ADTOOL_AMPI_adjointMin(int count, MPI_Datatype datatype, MPI_Comm comm,
564  void *source, void *adjointSource,
565  void* target, void* adjointTarget) ;
566 typedef void (ADTOOL_AMPI_adjointMinF) (int, MPI_Datatype, MPI_Comm, void*, void*, void*, void*);
567 
571 void ADTOOL_AMPI_adjointMax(int count, MPI_Datatype datatype, MPI_Comm comm,
572  void *source, void *adjointSource,
573  void* target, void* adjointTarget) ;
574 typedef void (ADTOOL_AMPI_adjointMaxF) (int, MPI_Datatype, MPI_Comm, void*, void*, void*, void*);
575 
585 void ADTOOL_AMPI_multiplyAdjoint(int adjointCount, MPI_Datatype datatype, MPI_Comm comm, void* target, void *source, void* idx);
586 typedef void (ADTOOL_AMPI_multiplyAdjointF)(int, MPI_Datatype, MPI_Comm, void*, void*, void*);
587 
597 void ADTOOL_AMPI_divideAdjoint(int adjointCount, MPI_Datatype datatype, MPI_Comm comm, void* target, void *source, void* idx);
598 typedef void (ADTOOL_AMPI_divideAdjointF) (int, MPI_Datatype, MPI_Comm, void*, void*, void*);
599 
611 void ADTOOL_AMPI_equalAdjoints(int adjointCount, MPI_Datatype datatype, MPI_Comm comm, void* target, void *source1, void *source2, void* idx);
612 typedef void (ADTOOL_AMPI_equalAdjointsF) (int, MPI_Datatype, MPI_Comm, void*, void*, void*, void*);
613 
624  void ADTOOL_AMPI_incrementAdjoint(int adjointCount, MPI_Datatype datatype, MPI_Comm comm, void* target, void *source, void* idx);
625  typedef void (ADTOOL_AMPI_incrementAdjointF) (int, MPI_Datatype, MPI_Comm, void*, void*, void*);
626 
634 void ADTOOL_AMPI_nullifyAdjoint(int adjointCount, MPI_Datatype datatype, MPI_Comm comm, void* target);
635 typedef void (ADTOOL_AMPI_nullifyAdjointF) (int, MPI_Datatype, MPI_Comm, void*);
636 
641 typedef void (ADTOOL_AMPI_setupTypesF)();
642 
647 typedef void (ADTOOL_AMPI_cleanupTypesF)();
648 
649 #ifdef AMPI_FORTRANCOMPATIBLE
650 
655 void adtool_ampi_fortransetuptypes_(MPI_Fint* adouble, MPI_Fint* areal);
656 typedef void (adtool_ampi_fortransetuptypes_F) (MPI_Fint*, MPI_Fint*);
657 
658 void adtool_ampi_fortrancleanuptypes_(MPI_Fint* adouble, MPI_Fint* areal);
659 typedef void (adtool_ampi_fortrancleanuptypes_F) (MPI_Fint*, MPI_Fint*);
660 
661 #endif
662 
666 MPI_Datatype ADTOOL_AMPI_FW_rawType(MPI_Datatype datatype);
667 typedef MPI_Datatype (ADTOOL_AMPI_FW_rawTypeF) (MPI_Datatype);
668 
672 MPI_Datatype ADTOOL_AMPI_BW_rawType(MPI_Datatype datatype);
673 typedef MPI_Datatype (ADTOOL_AMPI_BW_rawTypeF) (MPI_Datatype);
674 
675 
682 typedef AMPI_Activity (ADTOOL_AMPI_isActiveTypeF) (MPI_Datatype);
683 
685 extern MPI_Comm ADTOOL_AMPI_COMM_WORLD_SHADOW;
688 MPI_Comm ADTOOL_AMPI_getShadowComm(MPI_Comm comm) ;
689 typedef MPI_Comm (ADTOOL_AMPI_getShadowCommF) (MPI_Comm) ;
694 void *ADTOOL_AMPI_createWinMap(void *active_buf, MPI_Aint size);
695 typedef void *(ADTOOL_AMPI_createWinMapF) (void *active_buf, MPI_Aint size);
696 
701 void ADTOOL_AMPI_writeWinData(void *map, void *buf, MPI_Aint size);
702 typedef void (ADTOOL_AMPI_writeWinDataF) (void *map, void *buf, MPI_Aint size);
703 
710 MPI_Aint ADTOOL_AMPI_getWinSize(MPI_Aint size);
711 typedef MPI_Aint (ADTOOL_AMPI_getWinSizeF) (MPI_Aint size);
713 void ADTOOL_AMPI_tangentMultiply(int count, MPI_Datatype datatype, MPI_Comm comm,
714  void* target, void* tangentTarget,
715  void *source, void *tangentSource) ;
716 typedef void (ADTOOL_AMPI_tangentMultiplyF) (int, MPI_Datatype, MPI_Comm, void*, void*, void*, void*) ;
717 void ADTOOL_AMPI_tangentMin(int count, MPI_Datatype datatype, MPI_Comm comm,
718  void* target, void* tangentTarget,
719  void *source, void *tangentSource) ;
720 typedef void (ADTOOL_AMPI_tangentMinF) (int, MPI_Datatype, MPI_Comm, void*, void*, void*, void*) ;
721 void ADTOOL_AMPI_tangentMax(int count, MPI_Datatype datatype, MPI_Comm comm,
722  void* target, void* tangentTarget,
723  void *source, void *tangentSource) ;
724 typedef void (ADTOOL_AMPI_tangentMaxF) (int, MPI_Datatype, MPI_Comm, void*, void*, void*, void*) ;
725 
729 void ADTOOL_AMPI_pushBuffer(int count, MPI_Datatype datatype, MPI_Comm comm, void* buffer) ;
730 typedef void (ADTOOL_AMPI_pushBufferF) (int, MPI_Datatype, MPI_Comm, void*) ;
731 void ADTOOL_AMPI_popBuffer(int count, MPI_Datatype datatype, MPI_Comm comm, void* buffer) ;
732 typedef void (ADTOOL_AMPI_popBufferF) (int, MPI_Datatype, MPI_Comm, void*) ;
733 
801 #ifdef AMPI_FORTRANCOMPATIBLE
802  adtool_ampi_fortransetuptypes_F *fortransetuptypes__fp;
803  adtool_ampi_fortrancleanuptypes_F *fortrancleanuptypes__fp;
804 #endif
812 };
813 
818 
821 typedef void (TLM_userFunctionF) (void*, void*, void*, void*, int*, MPI_Datatype*, MPI_Datatype*) ;
822 
825 typedef void (ADJ_userFunctionF) (void*, void*, void*, void*, int*, MPI_Datatype*, MPI_Datatype*) ;
826 
827 
828 #if defined(__cplusplus)
829 }
830 #endif
831 
832 #endif
833