This has been resolved in commit 8fe1dc12cca4cc6321c7272b6a15eac481d1e234.
However, an important note here. The multi-thread reading of NetCDF files is actually not in parallel. Since netCDF C API is not thread-safe, function calls to the library to read from files are serialized using pragma omp critical. Otherwise, function calls from different threads will cause assertion failures.
I still keep this implementation and it is tested with the hope that in the near future netCDF library will provide thread-safe APIs natively.
This has been resolved in commit 8fe1dc12cca4cc6321c7272b6a15eac481d1e234.
However, an important note here. The multi-thread reading of NetCDF files is actually not in parallel. Since netCDF C API is not thread-safe, function calls to the library to read from files are serialized using
pragma omp critical
. Otherwise, function calls from different threads will cause assertion failures.I still keep this implementation and it is tested with the hope that in the near future netCDF library will provide thread-safe APIs natively.