Changeset 1369 for XIOS/dev/branch_openmp/extern
- Timestamp:
- 12/08/17 14:16:16 (7 years ago)
- Location:
- XIOS/dev/branch_openmp/extern/src_ep_dev
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/branch_openmp/extern/src_ep_dev/ep_declaration.cpp
r1368 r1369 1 2 3 1 #include "ep_lib.hpp" 4 2 … … 45 43 46 44 47 #undef MPI_INT45 /*#undef MPI_INT 48 46 #undef MPI_FLOAT 49 47 #undef MPI_DOUBLE … … 63 61 #undef MPI_REQUEST_NULL 64 62 #undef MPI_INFO_NULL 65 63 */ 66 64 67 65 -
XIOS/dev/branch_openmp/extern/src_ep_dev/ep_declaration.hpp
r1287 r1369 1 1 #ifndef EP_DECLARATION_HPP_INCLUDED 2 2 #define EP_DECLARATION_HPP_INCLUDED 3 /*4 extern ::MPI_Datatype MPI_INT_STD;5 extern ::MPI_Datatype MPI_FLOAT_STD;6 extern ::MPI_Datatype MPI_DOUBLE_STD;7 extern ::MPI_Datatype MPI_LONG_STD;8 extern ::MPI_Datatype MPI_CHAR_STD;9 extern ::MPI_Datatype MPI_UNSIGNED_LONG_STD;10 extern ::MPI_Datatype MPI_UNSIGNED_CHAR_STD;11 3 12 extern ::MPI_Op MPI_SUM_STD;13 extern ::MPI_Op MPI_MAX_STD;14 extern ::MPI_Op MPI_MIN_STD;15 16 extern ::MPI_Comm MPI_COMM_WORLD_STD;17 extern ::MPI_Comm MPI_COMM_NULL_STD;18 19 extern ::MPI_Status MPI_STATUS_IGNORE_STD;20 extern ::MPI_Request MPI_REQUEST_NULL_STD;21 extern ::MPI_Info MPI_INFO_NULL_STD;22 */23 4 #undef MPI_INT 24 5 #undef MPI_FLOAT -
XIOS/dev/branch_openmp/extern/src_ep_dev/ep_fortran.cpp
r1355 r1369 7 7 #include "ep_mpi.hpp" 8 8 9 // #ifdef _openmpi10 // //#undef MPI_Fint11 // #endif12 9 13 10 namespace ep_lib 14 11 { 15 12 16 intEP_Comm_c2f(MPI_Comm comm)13 void* EP_Comm_c2f(MPI_Comm comm) 17 14 { 18 15 Debug("MPI_Comm_c2f"); 19 int fint;20 //#ifdef _intelmpi21 fint= (::MPI_Fint)(to_mpi_comm(comm.mpi_comm));22 //#elif _openmpi23 //fint = ::MPI_Comm_c2f(to_mpi_comm(comm.mpi_comm));24 //#endif16 void* fint = new ::MPI_Fint; 17 #ifdef _intelmpi 18 *static_cast< ::MPI_Fint*>(fint) = (::MPI_Fint)(to_mpi_comm(comm.mpi_comm)); 19 #elif _openmpi 20 *static_cast< ::MPI_Fint*>(fint) = MPI_Comm_c2f(to_mpi_comm(comm.mpi_comm)); 21 #endif 25 22 26 std::map<std::pair< int, int>, MPI_Comm > ::iterator it;23 std::map<std::pair< ::MPI_Fint, int>, MPI_Comm > ::iterator it; 27 24 28 25 #pragma omp critical (fc_comm_map) 29 26 { 30 it = fc_comm_map.find(std::make_pair( fint, omp_get_thread_num()));27 it = fc_comm_map.find(std::make_pair(*static_cast< ::MPI_Fint*>(fint), omp_get_thread_num())); 31 28 if(it == fc_comm_map.end()) 32 29 { 33 fc_comm_map.insert(std::make_pair( std::make_pair( fint, omp_get_thread_num()) , comm));34 printf("EP_Comm_c2f : MAP %p insert: %d, %d, %p\n", &fc_comm_map, fint, omp_get_thread_num(), comm.ep_comm_ptr);30 fc_comm_map.insert(std::make_pair( std::make_pair( *static_cast< ::MPI_Fint*>(fint), omp_get_thread_num()) , comm)); 31 printf("EP_Comm_c2f : MAP %p insert: %d, %d, %p\n", &fc_comm_map, *static_cast< ::MPI_Fint*>(fint), omp_get_thread_num(), comm.ep_comm_ptr); 35 32 } 36 33 } … … 41 38 } 42 39 43 MPI_Comm EP_Comm_f2c( intcomm)40 MPI_Comm EP_Comm_f2c(void* comm) 44 41 { 45 42 Debug("MPI_Comm_f2c"); 46 43 47 44 48 std::map<std::pair< int, int>, MPI_Comm > ::iterator it;45 std::map<std::pair< ::MPI_Fint, int>, MPI_Comm > ::iterator it; 49 46 50 47 #pragma omp critical (fc_comm_map) 51 it = fc_comm_map.find(std::make_pair( comm, omp_get_thread_num()));48 it = fc_comm_map.find(std::make_pair(*static_cast< ::MPI_Fint*>(comm), omp_get_thread_num())); 52 49 53 50 if(it != fc_comm_map.end()) … … 60 57 61 58 62 //#ifdef _openmpi 63 //::MPI_Comm base_comm = ::MPI_Comm_f2c(comm); 64 //#elif _intelmpi 59 60 #ifdef _intelmpi 65 61 ::MPI_Comm *base_comm = new ::MPI_Comm; 66 *base_comm = (::MPI_Comm)(comm); 67 //#endif 62 *base_comm = (::MPI_Comm)(*static_cast< ::MPI_Fint*>(comm)); 63 #elif _openmpi 64 ::MPI_Comm *base_comm = ::MPI_Comm_f2c(*static_cast< ::MPI_Fint*>(comm)); 65 #endif 68 66 69 67 if(*base_comm != to_mpi_comm(MPI_COMM_NULL.mpi_comm)) -
XIOS/dev/branch_openmp/extern/src_ep_dev/ep_lib_fortran.hpp
r1295 r1369 7 7 { 8 8 9 intEP_Comm_c2f(MPI_Comm comm);10 MPI_Comm EP_Comm_f2c( intcomm);9 void* EP_Comm_c2f(MPI_Comm comm); 10 MPI_Comm EP_Comm_f2c(void* comm); 11 11 } 12 12 -
XIOS/dev/branch_openmp/extern/src_ep_dev/ep_type.cpp
r1366 r1369 76 76 mpi_aint = new ::MPI_Aint; 77 77 *(static_cast< ::MPI_Aint*>(mpi_aint)) = *(static_cast< ::MPI_Aint*>(aint)); 78 } 79 80 MPI_Fint::MPI_Fint(void* fint) 81 { 82 mpi_fint = new ::MPI_Fint; 83 *(static_cast< ::MPI_Fint*>(mpi_fint)) = *(static_cast< ::MPI_Fint*>(fint)); 78 84 } 79 85 -
XIOS/dev/branch_openmp/extern/src_ep_dev/ep_type.hpp
r1366 r1369 263 263 public: 264 264 265 intmpi_fint;265 void* mpi_fint; 266 266 267 267 MPI_Fint() {} 268 MPI_Fint(int f): mpi_fint(f) {} 268 MPI_Fint(void* fint); 269 //MPI_Fint(int f): mpi_fint(f) {} 269 270 270 271 }; … … 279 280 static std::map<std::pair<int, int>, MPI_Comm > fc_comm_map; 280 281 281 static std::map<std::pair<int, int>, MPI_Comm > *fc_comm_map_ptr;282 #pragma omp threadprivate(fc_comm_map_ptr)283 // <MPI_Fint,thread_num> EP_Comm282 // static std::map<std::pair<int, int>, MPI_Comm > *fc_comm_map_ptr; 283 // #pragma omp threadprivate(fc_comm_map_ptr) 284 // // <MPI_Fint,thread_num> EP_Comm 284 285 285 286 }
Note: See TracChangeset
for help on using the changeset viewer.