In the course of a private email discussion I found the following problem. Since this may be of general interest I repeat my findings in public. The discussion concerned possible OpenMP problems in GRHydro:
"The routine Hydro_Analysis_LocationSearch may return different results with OpenMP. If one component contains multiple maxima, then the last one is returned (without OpenMP), or a random one is returned (with OpenMP). However, if several components contain the multiple maxima, then the location of the maximum remains unset, i.e. at the value it had at the last timestep.
"I suggest to switch off OpenMP in this routine, to insert a check whether a single component contains multiple maxima and treat this the same as when several components contain multiple maxima, and to set the location of the maximum to a special error value (or to introduce an error flag) so that it is obvious when the routine fails."
-erik
Hi,
On Wed, Jun 29, 2011 at 12:45:11PM -0400, Erik Schnetter wrote:
"I suggest to switch off OpenMP in this routine, to insert a check whether a single component contains multiple maxima and treat this the same as when several components contain multiple maxima
I agree. This algorithm is expected to work poorly for multiple maxima, which is documented (but only poorly: as [long] comments in the source code).
, and to set the location of the maximum to a special error value (or to introduce an error flag) so that it is obvious when the routine fails."
This would also require code which relies on the current non-setting of the location in case of multiple maxima to be changed. In particular, this is true for neutron star trackers which use the location of the maxima as criterion for regridding, and which should not try to regrid at a special error value (and thus fail. An error flag together with not setting a new maxima would circumvent that.
Of course, a much better solution for the regridding would be an entirely different algorithm, which I think everybody agrees to. I don't know of any other application which actually uses the location of the maximum.
Frank
users@lists.einsteintoolkit.org