Speedup .cube generation by ~260x
What has been done:
-
write_vector_to_cube_visualizationroutine has been changed to write to a buffer instead of directly to the output file. This gains about a factor 10 in speed compared to the current version. - For some reason, using the fortran
writestatement is still very slow compared to the C functionsprintf. Making a small wrapper to use sprintf instead gived a huge speedup. - Additionally using sprintf makes the code omp parallelizable. For some reason adding omp to the loop using
writemakes it slower. - In total, a small test I ran that took development 228 seconds to produce the .cube file, takes 0.88 seconds with this version.
ToDo-list
The boxes below need to be checked before merge review will start
- Testing
-
All tests pass -rcheckflag enabled insetup.py -
All tests pass -fbatchflag enabled insetup.py
-
- Versioning
-
Changelog.mdis up to date -
If merge into master: The patch number in parameters.F90andchangelog.mdis up to date
-
- Website (Needs to be done before merge)
-
Updates (if any) to the website have been added
-
- Compliance with style guide
Edited by Marcus Takvam Lexander