You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be a really big time-saver for someone encountering these codes for the first time if every code is written as a test that reports success or failure so that a newcomer doesn't have to digest the entire algorithm and then read verbose output to determine whether a particular run succeeded or failed. End each program with something along the lines of
block
logical, parameter :: testing=.true.
if (testing) call verify(calculation_result) ! error terminate if the calculation failed
print *, "Poisson test passed."
end block
where making testing a compile-time constant allows an optimizing compiler to completely eliminate the verification code during a dead-code removal phase when you want to do runs to measure performance. You could use a preprocessor macro to switch the value to false when so desired.
Even better would be to adopt a unit-testing framework that automates the execution of all the tests. I recommend Vegetables.
The text was updated successfully, but these errors were encountered:
It would be a really big time-saver for someone encountering these codes for the first time if every code is written as a test that reports success or failure so that a newcomer doesn't have to digest the entire algorithm and then read verbose output to determine whether a particular run succeeded or failed. End each program with something along the lines of
where making
testing
a compile-time constant allows an optimizing compiler to completely eliminate the verification code during a dead-code removal phase when you want to do runs to measure performance. You could use a preprocessor macro to switch the value to false when so desired.Even better would be to adopt a unit-testing framework that automates the execution of all the tests. I recommend Vegetables.
The text was updated successfully, but these errors were encountered: