Ignore:
Timestamp:
11/15/17 12:14:34 (6 years ago)
Author:
yushan
Message:

dev_omp

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  
    11/* ************************************************************************** * 
    2  *      Copyright © IPSL/LSCE, xios, Avril 2010 - Octobre 2011         * 
     2 *      Copyright IPSL/LSCE, xios, Avril 2010 - Octobre 2011         * 
    33 * ************************************************************************** */ 
    44 
     
    99#include <iostream> 
    1010 
    11  
     11#include "mpi_std.hpp" 
    1212#include "xios.hpp" 
    1313//#include "oasis_cinterface.hpp" 
     
    2323#include "context.hpp" 
    2424#include "context_client.hpp" 
    25 #include "mpi_std.hpp" 
     25 
    2626#include "timer.hpp" 
    27 #include "array_new.hpp" 
    28  
    2927 
    3028extern "C" 
    3129{ 
    32 // /////////////////////////////// Définitions ////////////////////////////// // 
    33  
    34    // ----------------------- Redéfinition de types ---------------------------- 
     30// /////////////////////////////// Dfinitions ////////////////////////////// // 
     31 
     32   // ----------------------- Redfinition de types ---------------------------- 
    3533 
    3634   typedef enum { NETCDF4 = 0 } XFileType; 
     
    3836   typedef xios::CContext* XContextPtr; 
    3937 
    40    // -------------------- Traitement des données ------------------------------ 
     38   // -------------------- Traitement des donnes ------------------------------ 
    4139 
    4240   // This function is not exported to the public Fortran interface, 
     
    6462      int initialized; 
    6563      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 
    7165      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; 
    7371      #endif 
    7472       
    75       
     73 
    7674 
    7775      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); 
    8380      #endif 
    84  
    8581      CTimer::get("XIOS init").suspend(); 
    8682      CTimer::get("XIOS").suspend(); 
     
    9591     CTimer::get("XIOS").resume(); 
    9692     CTimer::get("XIOS init context").resume(); 
     93     #ifdef _usingMPI 
     94     comm=MPI_Comm_f2c(*f_comm); 
     95     #elif _usingEP 
    9796     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); 
    10199     CTimer::get("XIOS init context").suspend(); 
    102100     CTimer::get("XIOS").suspend(); 
     
    382380 
    383381 
    384    // ---------------------- Ecriture des données ------------------------------ 
     382   // ---------------------- Ecriture des donnes ------------------------------ 
    385383 
    386384   void cxios_write_data_k80(const char* fieldid, int fieldid_size, double* data_k8, int data_Xsize) 
     
    448446      CContext* context = CContext::getCurrent(); 
    449447      if (!context->hasServer && !context->client->isAttachedModeEnabled()) 
    450       { 
    451         context->checkBuffersAndListen(); 
    452       }   
     448        context->checkBuffersAndListen(); 
    453449 
    454450      CArray<double, 3>data(data_k8, shape(data_Xsize, data_Ysize, data_Zsize), neverDeleteData); 
     
    717713    } 
    718714 
    719    // ---------------------- Lecture des données ------------------------------ 
     715   // ---------------------- Lecture des donnes ------------------------------ 
    720716 
    721717   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  
    11#include "oasis_cinterface.hpp" 
    22#include <string> 
    3 //#include "mpi_std.hpp" 
     3using namespace ep_lib; 
    44 
    55namespace xios 
     
    2626     
    2727    fxios_oasis_get_localcomm(&f_comm) ; 
    28     #ifdef _usingEP 
    2928    comm=EP_Comm_f2c(f_comm.mpi_fint) ; 
    30     #else 
    31     comm=MPI_Comm_f2c(f_comm) ; 
    32     #endif 
    3329  } 
    3430  
     
    3834     
    3935    fxios_oasis_get_intracomm(&f_comm,server_id.data(),server_id.size()) ; 
    40     #ifdef _usingEP 
    4136    comm_client_server=EP_Comm_f2c(f_comm.mpi_fint) ; 
    42     #else 
    43     comm_client_server=MPI_Comm_f2c(f_comm) ; 
    44     #endif 
    4537  } 
    4638  
     
    5042     
    5143    fxios_oasis_get_intercomm(&f_comm,server_id.data(),server_id.size()) ; 
    52     #ifdef _usingEP 
    5344    comm_client_server=EP_Comm_f2c(f_comm.mpi_fint) ; 
    54     #else 
    55     comm_client_server=MPI_Comm_f2c(f_comm) ; 
    56     #endif 
    5745  } 
    5846} 
  • XIOS/dev/branch_openmp/src/interface/c/oasis_cinterface.hpp

    r501 r1328  
    1010  void fxios_oasis_enddef(void) ; 
    1111  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) ; 
    1515} 
    1616  
     
    2020  void oasis_enddef(void) ; 
    2121  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) ; 
    2525} 
    2626#endif 
Note: See TracChangeset for help on using the changeset viewer.