Skip to content

Performance fix for ExtractDataToCoeffs

Dave Moxey requested to merge dmoxey/nektar:fix/extract-data-performance into master

This MR fixes a significant performance issue in ExpList::v_ExtractDataToCoeffs when post-processing large simulations. This function is called once for each field definition that is present in the input file. Presently, this function constructs a std::map from geometry IDs to their location inside m_exp. When post-processing large simulations, where there is generally one field definition per processor in the input file, this function therefore consumes a huge amount of extraneous CPU time.

This has been fixed by adding a new member variable to hold a boost::unordered_map which is significantly faster in lookup and population speeds. This is populated on the first call of v_ExtractDataToCoeffs. Runtime of the FieldConvert InputFld module for a 700k tet mesh reduced from ~520s to ~6s.

Merge request reports