Ignore:
Timestamp:
11/19/18 15:52:54 (6 years ago)
Author:
yushan
Message:

branch_openmp merged with trunk r1597

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_trunk_omp/src/io/netcdf.hpp

    r685 r1601  
    11#ifndef __XIOS_NETCDF_HPP__ 
    22#define __XIOS_NETCDF_HPP__ 
    3 #include "mpi.hpp" 
     3#include "mpi_std.hpp" 
    44#define MPI_INCLUDED 
    55#include <netcdf.h> 
     
    3333  { 
    3434#if defined(USING_NETCDF_PAR) 
    35     return ::nc_create_par(path, cmode, comm, info, ncidp) ; 
     35    int status; 
     36    #pragma omp critical (_netcdf) 
     37    { 
     38      status = ::nc_create_par(path, cmode, comm, info, ncidp) ; 
     39    } 
     40    return status; 
    3641#else 
    3742    ERROR("int nc_create_par(const char *path, int cmode, MPI_Comm comm, MPI_Info info,int *ncidp)", 
     
    4449  { 
    4550#if defined(USING_NETCDF_PAR) 
    46     return ::nc_open_par(path, mode, comm, info, ncidp) ; 
     51    int status; 
     52    #pragma omp critical (_netcdf) 
     53    { 
     54      status = ::nc_open_par(path, mode, comm, info, ncidp) ; 
     55    } 
     56    return status; 
    4757#else 
    4858    ERROR("int nc_open_par(const char *path, int mode, MPI_Comm comm, MPI_Info info,int *ncidp)", 
     
    5565  { 
    5666#if defined(USING_NETCDF_PAR) 
    57     return ::nc_var_par_access(ncid, varid, par_access) ; 
     67    int status = ::nc_var_par_access(ncid, varid, par_access) ; 
     68     
     69    return status; 
    5870#else 
    5971    ERROR("int nc_var_par_access(int ncid, int varid, int par_access)", 
Note: See TracChangeset for help on using the changeset viewer.