1313#ifndef TEST_MPI_INTERCEPTOR_INTERCEPTORFUNCTIONS_H_
1414#define TEST_MPI_INTERCEPTOR_INTERCEPTORFUNCTIONS_H_
1515
16- #include "runtime/RuntimeInterface.h"
16+ #include "RuntimeExport.h"
17+ #include "RuntimeInterface.h"
1718
1819#include <mpi.h>
1920#include <stdatomic.h>
2223#include <sys/resource.h>
2324#include <sys/time.h>
2425
25- int ta_check_buffer (const char * mpi_name , const void * called_from , const void * buf , int mpi_count , int const_adr );
26- void ta_print_loc (const void * call_adr );
26+ TYPEART_NO_EXPORT int ta_check_buffer (const char * mpi_name , const void * called_from , const void * buf , int mpi_count ,
27+ int const_adr );
28+ TYPEART_NO_EXPORT void ta_print_loc (const void * call_adr );
2729
2830typedef struct CallCounter {
2931 _Atomic size_t send ;
@@ -42,31 +44,34 @@ typedef struct MPISemCounter {
4244
4345static MPICounter mcounter = {0 , 0 , 0 };
4446
45- void ta_check_send (const char * name , const void * called_from , const void * sendbuf , int count , MPI_Datatype dtype ) {
47+ TYPEART_NO_EXPORT void ta_check_send (const char * name , const void * called_from , const void * sendbuf , int count ,
48+ MPI_Datatype dtype ) {
4649 ++ counter .send ;
4750 ta_check_buffer (name , called_from , sendbuf , count , 1 );
4851}
4952
50- void ta_check_recv (const char * name , const void * called_from , void * recvbuf , int count , MPI_Datatype dtype ) {
53+ TYPEART_NO_EXPORT void ta_check_recv (const char * name , const void * called_from , void * recvbuf , int count ,
54+ MPI_Datatype dtype ) {
5155 ++ counter .recv ;
5256 ta_check_buffer (name , called_from , recvbuf , count , 0 );
5357}
5458
55- void ta_check_send_and_recv (const char * name , const void * called_from , const void * sendbuf , int sendcount ,
56- MPI_Datatype sendtype , void * recvbuf , int recvcount , MPI_Datatype recvtype ) {
59+ TYPEART_NO_EXPORT void ta_check_send_and_recv (const char * name , const void * called_from , const void * sendbuf ,
60+ int sendcount , MPI_Datatype sendtype , void * recvbuf , int recvcount ,
61+ MPI_Datatype recvtype ) {
5762 ++ counter .send_recv ;
5863 ta_check_send (name , called_from , sendbuf , sendcount , sendtype );
5964 ta_check_recv (name , called_from , recvbuf , recvcount , recvtype );
6065}
6166
62- void ta_unsupported_mpi_call (const char * name , const void * called_from ) {
67+ TYPEART_NO_EXPORT void ta_unsupported_mpi_call (const char * name , const void * called_from ) {
6368 ++ counter .unsupported ;
6469 fprintf (stderr , "[Error] The MPI function %s is currently not checked by TypeArt" , name );
6570 ta_print_loc (called_from );
6671 // exit(0);
6772}
6873
69- const char * ta_get_error_message (typeart_status status ) {
74+ TYPEART_NO_EXPORT const char * ta_get_error_message (typeart_status status ) {
7075 switch (status ) {
7176 case TYPEART_OK :
7277 return "No errors" ;
@@ -85,7 +90,8 @@ const char* ta_get_error_message(typeart_status status) {
8590 }
8691}
8792
88- int ta_check_buffer (const char * mpi_name , const void * called_from , const void * buf , int mpi_count , int const_adr ) {
93+ TYPEART_NO_EXPORT int ta_check_buffer (const char * mpi_name , const void * called_from , const void * buf , int mpi_count ,
94+ int const_adr ) {
8995 if (mpi_count <= 0 ) {
9096 ++ mcounter .null_count ;
9197 return 1 ;
@@ -119,7 +125,7 @@ int ta_check_buffer(const char* mpi_name, const void* called_from, const void* b
119125 return 1 ;
120126}
121127
122- void ta_print_loc (const void * call_adr ) {
128+ TYPEART_NO_EXPORT void ta_print_loc (const void * call_adr ) {
123129 const char * exe = getenv ("TYPEART_EXE_TARGET" );
124130 if (exe == NULL || exe [0 ] == '\0' ) {
125131 return ;
@@ -138,7 +144,7 @@ void ta_print_loc(const void* call_adr) {
138144 }
139145}
140146
141- void ta_exit () {
147+ TYPEART_NO_EXPORT void ta_exit () {
142148 // Called at MPI_Finalize time
143149 int rank = 0 ;
144150 MPI_Comm_rank (MPI_COMM_WORLD , & rank );
0 commit comments