darrencroton / sage

Home of the Semi-Analytic Galaxy Evolution (SAGE) galaxy formation model
MIT License
21 stars 22 forks source link

Hdf5 reader #9

Closed jacobseiler closed 6 years ago

jacobseiler commented 6 years ago

@darrencroton This is a working version of HDF5 reader but has not been fully fleshed out. I'm still working on it/cleaning things up. Please do not merge yet. I'll let you know when it gets the final @manodeep tick of approval.

manodeep commented 6 years ago

@jacobseiler Do the sage outputs agree on lhalotree binary input and hdf5 input from something like mini-mill?

jacobseiler commented 6 years ago

@manodeep Yup. I made a small-script to convert Mini-Millennium binary to HDF5 (https://github.com/jacobseiler/short_scripts/tree/master/lhalo_to_hdf5). The binary output of master and both modes of my branch (reading either binary or HDF5 input) produce bitwise-identical output.

jacobseiler commented 6 years ago

Latest commit has cleaned up tree_hdf5.c through the use of macros. However the output of the three models (master, binary mode from my branch and hdf5 mode) are no longer bitwise identical.

Using allresults.py I have printed out all the galaxy properties for each model and the galaxies have identical properties. Unsure why they're not bitwise identical...

jacobseiler commented 6 years ago

@manodeep Please help me to understand. Changing the length of char buf from MAX_STRING_LEN to 1000 resolved the bitwise issues; the outputs of all models are now identical. I have no clue why.

manodeep commented 6 years ago

Hmm - that is strange. What happens if you change char buf[1000] back to char buf[MAX_STRING_LEN]; but redefine MAX_STRING_LEN to be 1000.

(This is after my initial reaction of unpossible)

manodeep commented 6 years ago

And does the result change with the initial char buf[1000] if you run sage multiple times? And did you diff -q all pairs of files?

darrencroton commented 6 years ago

Just merged Initialize galaxy_output but the branch (now?) has conflicts. Can you have a look at where those come from and let me know?

manodeep commented 6 years ago

Those were very strange conflicts! The conflicting lines in main.c appeared to be identical between the branches.

@jacobseiler Will you confirm that what I did was okay

jacobseiler commented 6 years ago

@manodeep I could not see the diff for the conflict-fix.

@darrencroton Will you please open a new branch and then I can change the destination for this PR to this new branch. That way, we can avoid accidentally polluting the sage master branch.

manodeep commented 6 years ago

@darrencroton Jacob and I have looked at the diff again -- looks fine now. We could not locate a couple of lines of code previously (from the conflict-fix) but now we see that in the full diff. Feel free to merge against master

darrencroton commented 6 years ago

OK, done. All good. Thanks guys!