Changeset 1328 for XIOS/dev/branch_openmp/src/interface
- Timestamp:
- 11/15/17 12:14:34 (6 years ago)
- Location:
- XIOS/dev/branch_openmp/src/interface/c
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/branch_openmp/src/interface/c/icdata.cpp
r1205 r1328 1 1 /* ************************************************************************** * 2 * Copyright ©IPSL/LSCE, xios, Avril 2010 - Octobre 2011 *2 * Copyright IPSL/LSCE, xios, Avril 2010 - Octobre 2011 * 3 3 * ************************************************************************** */ 4 4 … … 9 9 #include <iostream> 10 10 11 11 #include "mpi_std.hpp" 12 12 #include "xios.hpp" 13 13 //#include "oasis_cinterface.hpp" … … 23 23 #include "context.hpp" 24 24 #include "context_client.hpp" 25 #include "mpi_std.hpp" 25 26 26 #include "timer.hpp" 27 #include "array_new.hpp"28 29 27 30 28 extern "C" 31 29 { 32 // /////////////////////////////// D éfinitions ////////////////////////////// //33 34 // ----------------------- Red éfinition de types ----------------------------30 // /////////////////////////////// Dfinitions ////////////////////////////// // 31 32 // ----------------------- Redfinition de types ---------------------------- 35 33 36 34 typedef enum { NETCDF4 = 0 } XFileType; … … 38 36 typedef xios::CContext* XContextPtr; 39 37 40 // -------------------- Traitement des donn ées ------------------------------38 // -------------------- Traitement des donnes ------------------------------ 41 39 42 40 // This function is not exported to the public Fortran interface, … … 64 62 int initialized; 65 63 MPI_Initialized(&initialized); 66 67 #ifdef _usingEP 68 if (initialized) local_comm = ep_lib::EP_Comm_f2c(static_cast< int >(*f_local_comm)); 69 else local_comm = MPI_COMM_NULL; 70 #else 64 #ifdef _usingMPI 71 65 if (initialized) local_comm=MPI_Comm_f2c(*f_local_comm); 72 else local_comm = MPI_COMM_NULL; 66 else local_comm=MPI_COMM_NULL; 67 #elif _usingEP 68 ep_lib::fc_comm_map.clear(); 69 if (initialized) local_comm=ep_lib::EP_Comm_f2c(static_cast<int>(*f_local_comm)); 70 else local_comm=MPI_COMM_NULL; 73 71 #endif 74 72 75 73 76 74 77 75 CXios::initClientSide(str, local_comm, return_comm); 78 79 #ifdef _usingEP 80 *f_return_comm = ep_lib::EP_Comm_c2f(return_comm); 81 #else 82 *f_return_comm = MPI_Comm_c2f(return_comm); 76 #ifdef _usingMPI 77 *f_return_comm=MPI_Comm_c2f(return_comm); 78 #elif _usingEP 79 *f_return_comm=ep_lib::EP_Comm_c2f(return_comm); 83 80 #endif 84 85 81 CTimer::get("XIOS init").suspend(); 86 82 CTimer::get("XIOS").suspend(); … … 95 91 CTimer::get("XIOS").resume(); 96 92 CTimer::get("XIOS init context").resume(); 93 #ifdef _usingMPI 94 comm=MPI_Comm_f2c(*f_comm); 95 #elif _usingEP 97 96 comm = ep_lib::EP_Comm_f2c(static_cast< int >(*f_comm)); 98 99 CClient::registerContext(str,comm); 100 97 #endif 98 CClient::registerContext(str, comm); 101 99 CTimer::get("XIOS init context").suspend(); 102 100 CTimer::get("XIOS").suspend(); … … 382 380 383 381 384 // ---------------------- Ecriture des donn ées ------------------------------382 // ---------------------- Ecriture des donnes ------------------------------ 385 383 386 384 void cxios_write_data_k80(const char* fieldid, int fieldid_size, double* data_k8, int data_Xsize) … … 448 446 CContext* context = CContext::getCurrent(); 449 447 if (!context->hasServer && !context->client->isAttachedModeEnabled()) 450 { 451 context->checkBuffersAndListen(); 452 } 448 context->checkBuffersAndListen(); 453 449 454 450 CArray<double, 3>data(data_k8, shape(data_Xsize, data_Ysize, data_Zsize), neverDeleteData); … … 717 713 } 718 714 719 // ---------------------- Lecture des donn ées ------------------------------715 // ---------------------- Lecture des donnes ------------------------------ 720 716 721 717 void cxios_read_data_k80(const char* fieldid, int fieldid_size, double* data_k8, int data_Xsize) -
XIOS/dev/branch_openmp/src/interface/c/oasis_cinterface.cpp
r1134 r1328 1 1 #include "oasis_cinterface.hpp" 2 2 #include <string> 3 //#include "mpi_std.hpp" 3 using namespace ep_lib; 4 4 5 5 namespace xios … … 26 26 27 27 fxios_oasis_get_localcomm(&f_comm) ; 28 #ifdef _usingEP29 28 comm=EP_Comm_f2c(f_comm.mpi_fint) ; 30 #else31 comm=MPI_Comm_f2c(f_comm) ;32 #endif33 29 } 34 30 … … 38 34 39 35 fxios_oasis_get_intracomm(&f_comm,server_id.data(),server_id.size()) ; 40 #ifdef _usingEP41 36 comm_client_server=EP_Comm_f2c(f_comm.mpi_fint) ; 42 #else43 comm_client_server=MPI_Comm_f2c(f_comm) ;44 #endif45 37 } 46 38 … … 50 42 51 43 fxios_oasis_get_intercomm(&f_comm,server_id.data(),server_id.size()) ; 52 #ifdef _usingEP53 44 comm_client_server=EP_Comm_f2c(f_comm.mpi_fint) ; 54 #else55 comm_client_server=MPI_Comm_f2c(f_comm) ;56 #endif57 45 } 58 46 } -
XIOS/dev/branch_openmp/src/interface/c/oasis_cinterface.hpp
r501 r1328 10 10 void fxios_oasis_enddef(void) ; 11 11 void fxios_oasis_finalize(void) ; 12 void fxios_oasis_get_localcomm( MPI_Fint* f_comm) ;13 void fxios_oasis_get_intracomm( MPI_Fint* f_comm_client_server,const char* client_id,int str_len) ;14 void fxios_oasis_get_intercomm( MPI_Fint* f_comm_client_server,const char* client_id,int str_len) ;12 void fxios_oasis_get_localcomm(ep_lib::MPI_Fint* f_comm) ; 13 void fxios_oasis_get_intracomm(ep_lib::MPI_Fint* f_comm_client_server,const char* client_id,int str_len) ; 14 void fxios_oasis_get_intercomm(ep_lib::MPI_Fint* f_comm_client_server,const char* client_id,int str_len) ; 15 15 } 16 16 … … 20 20 void oasis_enddef(void) ; 21 21 void oasis_finalize(void) ; 22 void oasis_get_localcomm( MPI_Comm& comm) ;23 void oasis_get_intracomm( MPI_Comm& comm_client_server,const std::string& server_id) ;24 void oasis_get_intercomm( MPI_Comm& comm_client_server,const std::string& server_id) ;22 void oasis_get_localcomm(ep_lib::MPI_Comm& comm) ; 23 void oasis_get_intracomm(ep_lib::MPI_Comm& comm_client_server,const std::string& server_id) ; 24 void oasis_get_intercomm(ep_lib::MPI_Comm& comm_client_server,const std::string& server_id) ; 25 25 } 26 26 #endif
Note: See TracChangeset
for help on using the changeset viewer.