compdyn / partmc

Particle-resolved stochastic atmospheric aerosol model
http://lagrange.mechse.illinois.edu/partmc/
GNU General Public License v2.0
28 stars 16 forks source link

Clean up debugging code #110

Open mattldawson opened 5 years ago

mattldawson commented 5 years ago

There's a lot of debugging code, particularly in the camp_solver.c file. Most of it I wrote and used for diagnosing solver issues, and it was helpful for that, but now I wonder if we need to keep it, or if we can just remove it to make the code easier to read. We can always get it back if we need it.

mattldawson commented 5 years ago

@cguzman95 - do you have any preference?

cguzman95 commented 5 years ago

Move it into a file called camp_debug.c or something like that. Code to debug/stats in his own file or even in his own folder won't hurt in any way

mattldawson commented 5 years ago

ok, will do!

mattldawson commented 5 years ago

I'm going to work on this and #108 together

cguzman95 commented 4 years ago

Hi @mattldawson

Related to debug code, I tried to print a instance of the deriv, but the reset_timers is located on each solve step, so it prints me a lot of results. I think I can improve the camp_debug structures by adding the one instance deriv print or something like that. Also, I don't totally like the .h format mixing declarations with code of print_jacobians

So, I want to reopen this issue (or create another one, whatever) to work on a camp_debug folder with his .c and .h. This can include move more prints code like print_statistics or something like that

mattldawson commented 4 years ago

Hi @cguzman95 - that's cool. I would suggest for the solver_stats values we leave the printing to the specific test or end user application. That way people can accumulate statistics and do what they want with them (print, analyze, etc.) For the debug print functions, splitting the functions to a .c file is fine and however you want to modify the print functions is fine with me (these are really just for our use, not for end users, unlike the solver_stats).