Fix parallel profiling
In parallel mode, profiling mixes up fittedresults.txt_set_????
output files due to the fact that they are created via intermediate fittedresults.txt
which is further renamed using the corresponding tag, and so different threads might write to the same file.
It is a temporary solution by blocking the critical code section.
A better solution would be to modify storePdfFiles
and further writefittedpoints
to write directly fittedresults.txt_set_????
, but I did not check how deep changes are required in the FORTRAN code and other places.