#ifdef _usingEP #include "ep_lib.hpp" #include #include "ep_declaration.hpp" #include #include #include "ep_mpi.hpp" using namespace std; std::list< ep_lib::MPI_Request* > * EP_PendingRequests = 0; #pragma omp threadprivate(EP_PendingRequests) std::map, MPI_Group* > * tag_group_map = 0; std::map > > * tag_comm_map = 0; MPI_Group MPI_GROUP_WORLD; namespace ep_lib { int tag_combine(int real_tag, int src, int dest) { int a = real_tag << 16; int b = src << 8; int c = dest; return a+b+c; } int get_ep_rank(MPI_Comm comm, int ep_rank_loc, int mpi_rank) { for(std::map >::iterator it = comm->ep_rank_map->begin(); it != comm->ep_rank_map->end(); it++) { if( ( it->second.first == ep_rank_loc ) && ( it->second.second == mpi_rank ) ) { return it->first; } } printf("rank not find for EP_intracomm\n"); return MPI_Abort(comm, 0); } int MPI_Get_count(const MPI_Status *status, MPI_Datatype datatype, int *count) { return ::MPI_Get_count(to_mpi_status_ptr(*status), to_mpi_type(datatype), count); } double MPI_Wtime() { return ::MPI_Wtime(); } int MPI_Comm_test_inter(MPI_Comm comm, int *flag) { if(comm->is_ep) return *flag = comm->is_intercomm; else return ::MPI_Comm_test_inter(to_mpi_comm(comm->mpi_comm), flag); } void check_sum_send(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, int type) { int src_rank; int int_count; ::MPI_Aint datasize, intsize, charsize, lb; ::MPI_Type_get_extent(*(static_cast< ::MPI_Datatype*>(datatype)), &lb, &datasize); ::MPI_Type_get_extent(*(static_cast< ::MPI_Datatype*>(MPI_CHAR)), &lb, &intsize); int_count = count * datasize / intsize ; char *buffer = static_cast< char* >(const_cast< void*> (buf)); unsigned long sum = 0; for(int i = 0; i(datatype)), &lb, &datasize); ::MPI_Type_get_extent(*(static_cast< ::MPI_Datatype*>(MPI_CHAR)), &lb, &intsize); int_count = count * datasize / intsize ; char *buffer = static_cast< char* >(buf); unsigned long sum = 0; for(int i = 0; i