Skip to content
Snippets Groups Projects

Crash gracefully on start-up if the user compiled with cooling but forgot the runtime flag.

Merged Matthieu Schaller requested to merge cooling_runtime_flag into master
+ 11
4
@@ -742,12 +742,19 @@ int main(int argc, char *argv[]) {
if (myrank == 0) potential_print(&potential);
/* Initialise the cooling function properties */
bzero(&cooling_func, sizeof(struct cooling_function_data));
if (with_cooling || with_temperature) {
#ifdef COOLING_NONE
if (with_cooling)
error("ERROR: Running with cooling but compiled without it.");
if (with_cooling || with_temperature) {
error("ERROR: Running with cooling / temperature calculation"
" but compiled without it.");
}
#else
if (!with_cooling && !with_temperature) {
error("ERROR: Compiled with cooling but running without it. "
"Did you forget the --cooling or --temperature flags?");
}
#endif
bzero(&cooling_func, sizeof(struct cooling_function_data));
if (with_cooling || with_temperature) {
cooling_init(params, &us, &prog_const, &cooling_func);
}
if (myrank == 0) cooling_print(&cooling_func);
Loading