-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VR crashes when computing black hole subgrid masses #15
Comments
The problem seems to be that the dynamic list of open datasets is not correctly used when reading. Specifically, I think A temporary very very dirty fix for the case of EAGLE/COLIBRE in SWIFT is to do this: (don't do this at home!) It forces the code to read the correct dataset. It will of course only work for the specific configuration file used by XL and friends. |
@MatthieuSchaller just before leaving for our break we had also been looking around these lines with @cdplagos, trying to understand where the indexing goes wrong. Of course the patch above is fragile, so a more robust solution (which we'll try to get done this week) is needed. |
Glad we all think the issue is around these lines. The patch is definitely not for public consumption but I listed it here for our colleagues in EAGLE using exactly the same configuration file. If it helps with the debugging, I noticed that you also run into trouble if you add extra star properties. Only the gas seems to be OK. |
An update on this: I have identified the problem that is causing this crash. As we had guessed it was an indexing issue, although in a different point of the code. In #15 (comment) @MatthieuSchaller correctly indicates that the indexing into the arrays is different between the first loop (which opens datasets and dataspaces) and the second one (where they are actually read). However, the first loop indexes past the size of the arrays (writing outside the vector's allocated memory), while the second indexes within the array boundaries. This makes it seem that the correct indexing scheme is the second one, so I fixed the first rather than adjusting the second. After this VR runs almost to completion, until a new access into these arrays in a different part of the code produces again a crash (when using -O2 or higher, maybe also with -O1). I'm currently looking at this and I hope I'll have something working soon. |
Thanks for the update. Maybe adding extra star properties to the config file can also help identify problems. |
When HDF5 datasets and dataspaces for the extra properties indicated by the user (gas/bh/star) are opened, their IDs are stored in two corresponding vectors that are previously sized to hold exactly the number of extra properties that are required. However, the code incorrectly added some offsets to the indices used when storing the IDs in the vectors, writing past the vectors' end. This commit fixes the calculation of the indices, removing the additional offsets added when certain conditions are not met, yielding index values within the vectors' size boundaries. Note that when these IDs were accessed later on, the indices used for that access operation were correctly calculated. This gave a wrong initial impression that *those* indices were wrong, while in reality it was the "opening" indices that were wrong. This should address the problem reported in #15. Signed-off-by: Rodrigo Tobar <rtobar@icrar.org>
This problem has been fixed now, and the fix is on the latest However note that, as outlined in #15 (comment), a further problem appears down the road now that prevents VR from successfully finishing. I could at least confirm that this newly found problem is not caused by the fixes introduced for this issue, and as such I'll be opening a new issue to keep track of it. |
The new issue described in #18 (and first mentioned in #15 (comment)) is now also fixed (via #19). |
Oh excellent news! Thanks for tackling these. |
I can confirm that things work correctly. |
Great, I'm closing this issue then. |
Hi all, recently I have been running VR on SWIFT output containing black hole particles with subgrid properties. VR crashes while it is computing the BH subgrid properties. The VR output with the crash looks as follows:
If I comment out the lines
in the VR config file, the bug dissapperas and VR runs smoothly.
cmake -DVR_USE_HYDRO=ON
gsl/2.4, intel_mpi/2018, cmake/3.18.1, intel_comp/2018, parallel_hdf5/1.10.3
/cosma7/data/dp004/dc-chai1/vrconfig_3dfof_subhalos_SO_hydro.cfg
/snap7/scratch/dp004/dc-chai1/my_cosmological_box/AGN_L006N188_00_iso/colibre_2729.hdf5
SubgridMasses
field.The text was updated successfully, but these errors were encountered: