Changeset 1068 for XIOS/dev/branch_yushan/extern
- Timestamp:
- 03/09/17 12:19:33 (7 years ago)
- Location:
- XIOS/dev/branch_yushan/extern/src_ep_dev
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/branch_yushan/extern/src_ep_dev/ep_declaration.cpp
r1053 r1068 4 4 5 5 #include <mpi.h> 6 //#include "ep_declaration.hpp"7 6 8 7 #undef MPI_INT … … 22 21 23 22 #undef MPI_STATUS_IGNORE 24 //#undef MPI_INFO_NULL25 23 #undef MPI_REQUEST_NULL 24 #undef MPI_INFO_NULL 26 25 27 #ifdef _openmpi 28 //#undef MPI_Fint 29 #endif 26 30 27 31 28 // _STD defined in ep_type.cpp … … 47 44 48 45 extern ::MPI_Status MPI_STATUS_IGNORE_STD; 49 //extern ::MPI_Info MPI_INFO_NULL_STD;50 46 extern ::MPI_Request MPI_REQUEST_NULL_STD; 47 extern ::MPI_Info MPI_INFO_NULL_STD; 51 48 52 49 ep_lib::MPI_Datatype MPI_INT = MPI_INT_STD; … … 65 62 ep_lib::MPI_Comm MPI_COMM_NULL(MPI_COMM_NULL_STD); 66 63 67 //ep_lib::MPI_Info MPI_INFO_NULL(MPI_INFO_NULL_STD);68 64 ep_lib::MPI_Request MPI_REQUEST_NULL(MPI_REQUEST_NULL_STD); 69 70 //ep_lib::MPI_Status MPI_STATUS_IGNORE_STD = MPI_STATUS_IGNORE_STD; 71 72 //ep_lib::MPI_Comm EP_COMM_WORLD; 73 //ep_lib::MPI_Comm EP_COMM_NULL; 65 ep_lib::MPI_Info MPI_INFO_NULL(MPI_INFO_NULL_STD); 74 66 75 67 76 68 69 -
XIOS/dev/branch_yushan/extern/src_ep_dev/ep_declaration.hpp
r1053 r1068 18 18 19 19 extern ::MPI_Status MPI_STATUS_IGNORE_STD; 20 //extern ::MPI_Info MPI_INFO_NULL_STD;21 20 extern ::MPI_Request MPI_REQUEST_NULL_STD; 21 extern ::MPI_Info MPI_INFO_NULL_STD; 22 22 23 23 #undef MPI_INT … … 36 36 #undef MPI_COMM_NULL 37 37 38 //#undef MPI_INFO_NULL39 38 #undef MPI_REQUEST_NULL 40 39 41 #ifdef _openmpi 42 //#undef MPI_Fint 43 #endif 40 44 41 45 42 #undef MPI_STATUS_IGNORE … … 61 58 62 59 extern ep_lib::MPI_Status MPI_STATUS_IGNORE; 60 extern ep_lib::MPI_Request MPI_REQUEST_NULL; 63 61 //extern ep_lib::MPI_Info MPI_INFO_NULL; 64 extern ep_lib::MPI_Request MPI_REQUEST_NULL;65 62 66 63 #endif // EP_DECLARATION_HPP_INCLUDED -
XIOS/dev/branch_yushan/extern/src_ep_dev/ep_fortran.cpp
r1067 r1068 6 6 #include "ep_declaration.hpp" 7 7 8 #ifdef _intelmpi9 #undef MPI_Comm_f2c(comm)10 #undef MPI_Comm_c2f(comm)11 #endif12 13 #ifdef _openmpi14 //#undef MPI_Fint15 #endif16 8 17 9 namespace ep_lib … … 61 53 if(omp_get_thread_num() == 0) 62 54 { 55 #ifdef _openmpi 63 56 ::MPI_Comm base_comm = ::MPI_Comm_f2c(comm); 57 #elif _intelmpi 58 ::MPI_Comm base_comm = (::MPI_Comm)(comm); 59 #endif 60 64 61 if(base_comm != MPI_COMM_NULL_STD) 65 62 { … … 78 75 } 79 76 80 #ifdef _intelmpi77 // #ifdef _intelmpi 81 78 82 MPI_Fint MPI_Comm_c2f(MPI_Comm comm)83 {84 Debug("MPI_Comm_c2f");85 int fint;86 fint = (::MPI_Fint)(comm.mpi_comm);79 // MPI_Fint MPI_Comm_c2f(MPI_Comm comm) 80 // { 81 // Debug("MPI_Comm_c2f"); 82 // int fint; 83 // fint = (::MPI_Fint)(comm.mpi_comm); 87 84 88 std::map<std::pair<int, int>, MPI_Comm > ::iterator it;85 // std::map<std::pair<int, int>, MPI_Comm > ::iterator it; 89 86 90 it = fc_comm_map.find(std::make_pair(fint, omp_get_thread_num()));91 if(it == fc_comm_map.end())92 {93 fc_comm_map.insert(std::make_pair( std::make_pair( fint, omp_get_thread_num()) , comm));94 printf("MAP insert: %d, %d, %p\n", fint, omp_get_thread_num(), &comm);95 }87 // it = fc_comm_map.find(std::make_pair(fint, omp_get_thread_num())); 88 // if(it == fc_comm_map.end()) 89 // { 90 // fc_comm_map.insert(std::make_pair( std::make_pair( fint, omp_get_thread_num()) , comm)); 91 // printf("MAP insert: %d, %d, %p\n", fint, omp_get_thread_num(), &comm); 92 // } 96 93 97 MPI_Fint Fint;98 Fint.mpi_fint = fint;99 return Fint;94 // MPI_Fint Fint; 95 // Fint.mpi_fint = fint; 96 // return Fint; 100 97 101 }98 // } 102 99 103 100 104 101 105 102 106 MPI_Comm MPI_Comm_f2c(MPI_Fint comm)107 {108 Debug("MPI_Comm_f2c");103 // MPI_Comm MPI_Comm_f2c(MPI_Fint comm) 104 // { 105 // Debug("MPI_Comm_f2c"); 109 106 110 107 111 std::map<std::pair<int, int>, MPI_Comm > ::iterator it;108 // std::map<std::pair<int, int>, MPI_Comm > ::iterator it; 112 109 113 it = fc_comm_map.find(std::make_pair(comm.mpi_fint, omp_get_thread_num()));114 if(it != fc_comm_map.end())115 {116 MPI_Comm comm_ptr;117 comm_ptr = it->second;118 printf("MAP find: %d, %d, %p\n", it->first.first, it->first.second, &comm_ptr);119 return comm_ptr;120 }121 else122 {123 MPI_Comm return_comm;124 return_comm.mpi_comm = (::MPI_Comm)(comm.mpi_fint);125 return return_comm;126 }127 }110 // it = fc_comm_map.find(std::make_pair(comm.mpi_fint, omp_get_thread_num())); 111 // if(it != fc_comm_map.end()) 112 // { 113 // MPI_Comm comm_ptr; 114 // comm_ptr = it->second; 115 // printf("MAP find: %d, %d, %p\n", it->first.first, it->first.second, &comm_ptr); 116 // return comm_ptr; 117 // } 118 // else 119 // { 120 // MPI_Comm return_comm; 121 // return_comm.mpi_comm = (::MPI_Comm)(comm.mpi_fint); 122 // return return_comm; 123 // } 124 // } 128 125 129 126 130 127 131 #elif _openmpi128 // #elif _openmpi 132 129 133 int MPI_Comm_c2f(MPI_Comm comm)134 {135 Debug("MPI_Comm_c2f");136 int fint;137 fint = ::MPI_Comm_c2f(static_cast< ::MPI_Comm>(comm.mpi_comm));130 // int MPI_Comm_c2f(MPI_Comm comm) 131 // { 132 // Debug("MPI_Comm_c2f"); 133 // int fint; 134 // fint = ::MPI_Comm_c2f(static_cast< ::MPI_Comm>(comm.mpi_comm)); 138 135 139 std::map<std::pair<int, int>, MPI_Comm > ::iterator it;136 // std::map<std::pair<int, int>, MPI_Comm > ::iterator it; 140 137 141 it = fc_comm_map.find(std::make_pair(fint, omp_get_thread_num()));142 if(it == fc_comm_map.end())143 {144 fc_comm_map.insert(std::make_pair( std::make_pair( fint, omp_get_thread_num()) , comm));145 printf("MAP insert: %d, %d, %p\n", fint, omp_get_thread_num(), &comm);146 }138 // it = fc_comm_map.find(std::make_pair(fint, omp_get_thread_num())); 139 // if(it == fc_comm_map.end()) 140 // { 141 // fc_comm_map.insert(std::make_pair( std::make_pair( fint, omp_get_thread_num()) , comm)); 142 // printf("MAP insert: %d, %d, %p\n", fint, omp_get_thread_num(), &comm); 143 // } 147 144 148 return fint;145 // return fint; 149 146 150 }147 // } 151 148 152 ep_lib::MPI_Comm MPI_Comm_f2c(MPI_Fint comm)153 {154 Debug("MPI_Comm_f2c");149 // ep_lib::MPI_Comm MPI_Comm_f2c(MPI_Fint comm) 150 // { 151 // Debug("MPI_Comm_f2c"); 155 152 156 153 157 std::map<std::pair<int, int>, MPI_Comm > ::iterator it;154 // std::map<std::pair<int, int>, MPI_Comm > ::iterator it; 158 155 159 it = fc_comm_map.find(std::make_pair(comm, omp_get_thread_num()));160 if(it != fc_comm_map.end())161 {162 MPI_Comm comm_ptr;163 comm_ptr = it->second;164 printf("MAP find: %d, %d, %p\n", it->first.first, it->first.second,comm_ptr);165 return comm_ptr;166 }167 else168 {169 MPI_Comm return_comm;170 return_comm.mpi_comm = (::MPI_Comm)(comm);171 return return_comm;172 }173 }174 #endif156 // it = fc_comm_map.find(std::make_pair(comm, omp_get_thread_num())); 157 // if(it != fc_comm_map.end()) 158 // { 159 // MPI_Comm comm_ptr; 160 // comm_ptr = it->second; 161 // printf("MAP find: %d, %d, %p\n", it->first.first, it->first.second, &comm_ptr); 162 // return comm_ptr; 163 // } 164 // else 165 // { 166 // MPI_Comm return_comm; 167 // return_comm.mpi_comm = (::MPI_Comm)(comm); 168 // return return_comm; 169 // } 170 // } 171 // #endif 175 172 176 173 } -
XIOS/dev/branch_yushan/extern/src_ep_dev/ep_intercomm_kernel.cpp
r1067 r1068 351 351 #pragma omp critical (write_to_tag_list) 352 352 tag_list.push_back(make_pair( make_pair(tag, min(leader_info[0], leader_info[1])) , ep_intercomm)); 353 printf("tag_list size = %lu\n", tag_list.size());353 //printf("tag_list size = %lu\n", tag_list.size()); 354 354 } 355 355 -
XIOS/dev/branch_yushan/extern/src_ep_dev/ep_lib.hpp
r1053 r1068 15 15 typedef int MPI_Datatype; 16 16 typedef int MPI_Op; 17 #define MPI_ANY_SOURCE -2 18 #define MPI_ANY_TAG -1 17 19 #elif _openmpi 18 20 typedef void* MPI_Datatype; 19 21 typedef void* MPI_Op; 20 #endif21 22 #ifdef _intelmpi23 #define MPI_ANY_SOURCE -224 #define MPI_ANY_TAG -125 #elif _openmpi26 22 #define MPI_ANY_SOURCE -1 27 23 #define MPI_ANY_TAG -1 -
XIOS/dev/branch_yushan/extern/src_ep_dev/ep_lib_fortran.hpp
r1053 r1068 7 7 { 8 8 9 #ifdef _intelmpi9 // #ifdef _intelmpi 10 10 11 MPI_Fint MPI_Comm_c2f(MPI_Comm comm);12 MPI_Comm MPI_Comm_f2c(MPI_Fint comm);11 // MPI_Fint MPI_Comm_c2f(MPI_Comm comm); 12 // MPI_Comm MPI_Comm_f2c(MPI_Fint comm); 13 13 14 #elif _openmpi14 // #elif _openmpi 15 15 16 int MPI_Comm_c2f(MPI_Comm comm);17 ep_lib::MPI_Comm MPI_Comm_f2c(MPI_Fint comm);16 // int MPI_Comm_c2f(MPI_Comm comm); 17 // ep_lib::MPI_Comm MPI_Comm_f2c(MPI_Fint comm); 18 18 19 #endif19 // #endif 20 20 21 21 int EP_Comm_c2f(MPI_Comm comm); -
XIOS/dev/branch_yushan/extern/src_ep_dev/ep_message.cpp
r1067 r1068 20 20 MPI_Comm_rank(comm, &myRank); 21 21 22 //printf("myRank = %d, comm.is_ep = %d, comm.is_intercomm = %d\n", myRank, comm.is_ep, comm.is_intercomm);23 22 if(!comm.is_ep) return 0; 24 23 … … 53 52 //::MPI_Improbe(MPI_ANY_SOURCE, MPI_ANY_TAG, mpi_comm, &flag, &message, &status); 54 53 ::MPI_Improbe(-2, -1, mpi_comm, &flag, &message, &status); 55 //printf("myRank = %d, ::MPI_Improbe flag = %d\n", myRank, flag);56 54 #endif 57 55 … … 159 157 #pragma omp flush 160 158 ptr_comm_target->ep_comm_ptr->message_queue->push_back(*msg_block); 161 //printf("probed one message, ep_src = %d, ep_dest = %d, tag = %d, queue = %p, message = %d\n", msg_block->ep_src, msg_block->ep_dest, msg_block->ep_tag, ptr_comm_target->ep_comm_ptr->message_queue, msg_block->mpi_message);162 159 #pragma omp flush 163 160 } -
XIOS/dev/branch_yushan/extern/src_ep_dev/ep_type.cpp
r1053 r1068 12 12 #undef MPI_COMM_NULL 13 13 14 //::MPI_Info MPI_INFO_NULL_STD = MPI_INFO_NULL;15 //#undef MPI_INFO_NULL16 14 17 15 ::MPI_Request MPI_REQUEST_NULL_STD = MPI_REQUEST_NULL; 18 16 #undef MPI_REQUEST_NULL 17 18 ::MPI_Info MPI_INFO_NULL_STD = MPI_INFO_NULL; 19 #undef MPI_INFO_NULL 19 20 20 21 ::MPI_Datatype MPI_INT_STD = MPI_INT; … … 43 44 #undef MPI_MIN 44 45 45 #ifdef _openmpi46 //#undef MPI_Fint47 #endif48 46 49 47 -
XIOS/dev/branch_yushan/extern/src_ep_dev/ep_type.hpp
r1067 r1068 42 42 { 43 43 #define MPI_UNDEFINED -32766 44 //#define MPI_STATUS_IGNORE NULL45 //#define MPI_INFO_NULL MPI_Info(MPI_INFO_NULL_STD)46 44 47 45 class ep_communicator; … … 85 83 86 84 MPI_Message() {} 85 87 86 #ifdef _intelmpi 88 87 MPI_Message(int message): mpi_message(message) {} … … 354 353 #endif 355 354 356 MPI_Info() {}355 MPI_Info(){ } 357 356 358 357 #ifdef _intelmpi
Note: See TracChangeset
for help on using the changeset viewer.