Commit c67bb658 authored by Uwe Schulzweida's avatar Uwe Schulzweida

Added warning message if a non-thread-safe NetCDF4/HDF5 library is used.

parent 91a487d9
......@@ -2,6 +2,10 @@
* Version 1.9.10 release
2020-12-17 Uwe Schulzweida
* Added warning message if a non-thread-safe NetCDF4/HDF5 library is used
2020-12-15 Uwe Schulzweida
* Exprf: added support for same variable name with different number of levels
......
......@@ -28,6 +28,7 @@
#include "cdo_output.h"
#include "cdo_default_values.h"
#include "cdo_history.h"
#include "process.h"
#include "timer.h"
#include "commandline.h"
......@@ -75,16 +76,16 @@ FileStream::openWrite(int p_filetype)
if (rstatus != -1) query_user_exit(m_name.c_str());
}
if (p_filetype == CDI_UNDEFID) p_filetype = CDI_FILETYPE_GRB;
/*
#ifndef HAVE_NC4HDF5_THREADSAFE
bool outputFileTypeIsNetCDF4 = (p_filetype == CDI_FILETYPE_NC4 || p_filetype == CDI_FILETYPE_NC4C);
if (inputFileTypeIsNetCDF4 && outputFileTypeIsNetCDF4 && processNums() > 1)
if (inputFileTypeIsNetCDF4 && outputFileTypeIsNetCDF4 && getProcessNum() > 1 && Threading::cdoLockIO == false)
{
cdoWarning("Using a non-thread-safe NetCDF4/HDF5 library in a multi-threaded environment may lead to erroneous results!");
cdoWarning("Use a thread-safe NetCDF4/HDF5 library or the CDO option -L to avoid such errors.");
}
#endif
*/
// TODO FIX THIS: if (FileStream::timersEnabled()) timer_start(timer_write);
openLock();
......
......@@ -41,6 +41,12 @@
static int processNum = 0;
int
getProcessNum()
{
return processNum;
}
void
setProcessNum(int p_num)
{
......
......@@ -172,6 +172,7 @@ private:
void setOperatorArgv(const char *operatorArguments);
};
int getProcessNum();
void setProcessNum(int p_num);
#endif /* PROCESS_H */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment