manodeep / Corrfunc

⚡️⚡️⚡️Blazing fast correlation functions on the CPU.
https://corrfunc.readthedocs.io
MIT License
165 stars 50 forks source link

Bug in test framework #149

Open manodeep opened 6 years ago

manodeep commented 6 years ago

The test framework uses static global variables to minimize unnecessarily reading the input datasets. However, there is an underlying assumption that all tests involving the mocks datasets are done sequentially (i.e. all DD type tests are done before any DR or RR tests). This assumption was not made explicit or checked within the tests_*.c codes. Now, the current implementation bug has now been exposed by PR #132 and this issue should be fixed before #132 can be merged into master.

Best way to fix the issue would be to setup an init_read_positions with a list of input files and their file formats and read them all in into a variables. Then an additional function takes in the list of files required for any particular test and assigns the correct datasets into (ND1/X1/Y1/Z1, ND2/X2/Y2/Z2) and (ND1/RA1/DEC1/CZ1, ND2/RA2/DEC2/CZ2). Also needs a new free_positions function to free up the memory allocated in init_read_positions.

manodeep commented 6 years ago

Might be more prudent to first merge in #132 and fix this bug separately. Otherwise, #132 will have to wait even longer.