Commit 88a0de94 authored by Mladen Ivkovic's avatar Mladen Ivkovic
Browse files

added radiation cmdline flags and rt engine policy

parent 66c0370b
......@@ -177,6 +177,7 @@ int main(int argc, char *argv[]) {
int with_eagle = 0;
int with_gear = 0;
int with_line_of_sight = 0;
int with_rt = 0;
int verbose = 0;
int nr_threads = 1;
int with_verbose_timers = 0;
......@@ -241,6 +242,8 @@ int main(int argc, char *argv[]) {
NULL, 0, 0),
OPT_BOOLEAN(0, "logger", &with_logger, "Run with the particle logger.",
NULL, 0, 0),
OPT_BOOLEAN('R', "radiation", &with_rt, "Run with radiative transfer",
NULL, 0, 0),
OPT_GROUP(" Simulation meta-options:\n"),
OPT_BOOLEAN(0, "quick-lyman-alpha", &with_qla,
......@@ -558,6 +561,23 @@ int main(int argc, char *argv[]) {
return 1;
}
#ifdef RT_NONE
if (with_rt) {
error("Running with radiative transfer but compiled without it!");
}
#else
if (with_rt && !with_hydro) {
error(
"Error: Cannot use radiative transfer without gas, --hydro must be "
"chosen\n");
}
if (with_rt && !with_stars) {
error(
"Error: Cannot use radiative transfer without stars, --stars must be "
"chosen\n");
}
#endif
/* Let's pin the main thread, now we know if affinity will be used. */
#if defined(HAVE_SETAFFINITY) && defined(HAVE_LIBNUMA) && defined(_GNU_SOURCE)
if (with_aff &&
......@@ -1277,6 +1297,8 @@ int main(int argc, char *argv[]) {
if (with_logger) engine_policies |= engine_policy_logger;
if (with_line_of_sight) engine_policies |= engine_policy_line_of_sight;
if (with_sink) engine_policies |= engine_policy_sink;
if (with_rt) engine_policies |= engine_policy_rt;
printf("ENGINE POLICY: %d\n", engine_policy_rt);
/* Initialize the engine with the space and policies. */
if (myrank == 0) clocks_gettime(&tic);
......
......@@ -129,7 +129,8 @@ const char *engine_policy_names[] = {"none",
"time-step sync",
"logger",
"line of sight",
"sink"};
"sink",
"rt"};
/** The rank of the engine as a global variable (for messages). */
int engine_rank;
......
......@@ -82,8 +82,9 @@ enum engine_policy {
engine_policy_logger = (1 << 23),
engine_policy_line_of_sight = (1 << 24),
engine_policy_sink = (1 << 25),
engine_policy_rt = (1 << 26),
};
#define engine_maxpolicy 26
#define engine_maxpolicy 27
extern const char *engine_policy_names[engine_maxpolicy + 1];
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment