-
Notifications
You must be signed in to change notification settings - Fork 256
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
Write optional deconstructor code for more rigorous memory tests #370
Comments
Here is the output from gcc's static analyzer from a compilation:
... so these might be places to look for for leaked memory. |
It could be easier to read if you surround the log output with three backticks (`), for example:
Which will format the log content in fixed-width font instead of the default sans-serif font. |
Done, thanks for the tip. |
So, at the moment, we get all the memory needed at initialisation; the main loop code in the middle doesn't have any malloc/new type calls, and then we're not doing a deconstruct at the end, because it's (much) quicker to just exit if there's nothing else to do. It would be good (and quite boring!) if we also wrote some deconstructor code at the end that, so we could more easily detect any "unexpected" memory problems, and turn it on for some test runs. |
I managed to get the first test to run under valgrind. This was a non-openmp version.
valgrind --leak-check=full src/CovidSim "/home/tkoenig/covid-bin/src/CovidSim" "/c:1" "/BM:bmp" "/PP:/home/tkoenig/covid-sim/tests/uk-input/pre-params.txt" "/P:/home/tkoenig/covid-sim/tests/uk-input/input-noint-params.txt" "/O:/home/tkoenig/covid-bin/tests/uk-output/st-results-noint" "/D:/home/tkoenig/covid-bin/tests/uk-output/pop.txt" "/M:/home/tkoenig/covid-bin/tests/uk-output/st-pop.bin" "/A:/home/tkoenig/covid-sim/tests/uk-input/admin-params.txt" "/S:/home/tkoenig/covid-bin/tests/uk-output/st-network.bin" "/R:1.1" "98798150" "729101" "17389101" "4797132"
Here is the report total report; the memory leaks reported at the bottom are relevant.
The text was updated successfully, but these errors were encountered: