[ncl-talk] readAsciiTable not thread safe

Daniel.Leuenberger at meteoswiss.ch Daniel.Leuenberger at meteoswiss.ch
Tue Mar 10 08:46:07 MDT 2015


Dear NCL Team,

When running a large number of parallel NCL jobs using the readAsciiTable function (contributed.ncl) I realized that the function is not thread safe, e.g. may fail. The reason is that it writes a temporary ascii file and deletes it again at the end of the function. If now two parallel jobs want to write to the temporary file at exactly the same time, one is not allowed and will crash. One method to circumvent the problem would be to use a random number and/or the process ID in the file name of the temporary file.

Best regards

Daniel Leuenberger

Federal Department of Home Affairs FDHA
Federal Office of Meteorology and Climatology MeteoSwiss

All about weather and climate, please visit our new website
www.meteoswiss.ch<http://www.meteoschweiz.admin.ch/web/en.html> and MeteoSwiss App<http://www.meteoswiss.admin.ch/home/services-and-publications/beratung-und-service/meteoswiss-app.html>


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150310/fe0f77d1/attachment.html 


More information about the ncl-talk mailing list