Ignore:
Timestamp:
11/21/17 10:47:57 (6 years ago)
Author:
yushan
Message:

dev_omp

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/branch_openmp/src/io/netCdfInterface.cpp

    r1334 r1338  
    128128int CNetCdfInterface::close(int ncId) 
    129129{ 
    130   int status = nc_close(ncId); 
    131   if (NC_NOERR != status) 
    132   { 
    133     StdString errormsg(nc_strerror(status)); 
    134     StdStringStream sstr; 
    135     sstr << "Error when calling function nc_close(ncId)" << std::endl 
    136          << errormsg << std::endl 
    137          << "Unable to close file, given its id: " << ncId << std::endl; 
    138     StdString e = sstr.str(); 
    139     throw CNetCdfException(e); 
    140   } 
    141  
     130  int status = NC_NOERR; 
     131  #pragma omp master 
     132  { 
     133    status = nc_close(ncId); 
     134    if (NC_NOERR != status) 
     135    { 
     136      StdString errormsg(nc_strerror(status)); 
     137      StdStringStream sstr; 
     138      sstr << "Error when calling function nc_close(ncId)" << std::endl 
     139           << errormsg << std::endl 
     140           << "Unable to close file, given its id: " << ncId << std::endl; 
     141      StdString e = sstr.str(); 
     142      throw CNetCdfException(e); 
     143    } 
     144  } 
    142145  return status; 
    143146} 
Note: See TracChangeset for help on using the changeset viewer.