 |
The ROme OpTimistic Simulator
3.0.0
A General-Purpose Multithreaded Parallel/Distributed Simulation Platform
|
Go to the documentation of this file.
23 #ifndef ROOTSIM_VERSION
24 #define ROOTSIM_VERSION "debugging_version"
45 {
"lp", OPT_NPRC,
"VALUE",
"Total number of Logical Processes being launched at simulation startup"},
46 {
"log-level", OPT_LOG,
"TYPE",
"Logging level"},
47 {
"time", OPT_SIMT,
"VALUE",
"Logical time at which the simulation will be considered completed"},
48 {
"gvt-period", OPT_GVT,
"VALUE",
"Time between two GVT reductions (in milliseconds)"},
49 {
"serial", OPT_SERIAL, NULL,
"Runs a simulation with the serial runtime"},
50 {
"wt", OPT_NP,
"VALUE",
"Number of total cores being used by the simulation"},
51 {
"no-bind", OPT_BIND, NULL,
"Disables thread to core binding"},
52 {
"seed", OPT_SEED,
"VALUE",
"The seed value for the PRNG"},
73 unsigned long long low,
unsigned long long high,
bool *err_chk)
76 unsigned long long ret = strtoull(str, &end_p, 10);
77 *err_chk = *str ==
'\0' || *end_p !=
'\0' || ret < low || ret > high;
90 long double high,
bool *err_chk)
93 long double ret = strtold(str, &end_p);
94 *err_chk = *str ==
'\0' || *end_p !=
'\0' || ret < low || ret > high;
107 bool parse_err =
false;
142 UINT64_MAX, &parse_err);
170 arg_parse_error(
"requested a simulation with %u threads and %" PRIu64
" LPs",
173 arg_parse_error(
"demanding %u cores, which are more than available (%u)",
192 __attribute__((weak))
struct ap_option model_options[] = {0};
193 __attribute__((weak))
void model_parse(
int key,
const char *
arg){(void)
key; (void)
arg;}
198 {
"Model specific options", model_options, model_parse},
206 "rootsim@googlegroups.com",
const char * arg
The argument name for this option, shown in the --usage text.
lp_id_t n_lps
The total number of LPs in the simulation.
A single parsable command line option.
option_key
This is the list of arg_parse.h mnemonics for command line arguments.
bool core_binding
If set, worker threads are bound to physical cores.
simtime_t termination_time
The target termination logical time.
unsigned gvt_period
The gvt period expressed in microseconds.
@ AP_KEY_INIT
Signals the start of the parsing process.
rid_t n_threads
The total number of MPI nodes in the simulation.
struct ap_settings ap_sets
The struct ap_settings with the ROOT-Sim command line parsing configuration.
A set of options organized and parsed together.
static void print_config(void)
Pretty prints ROOT-Sim current configuration.
void log_logo_print(void)
Prints a fancy ROOT-Sim logo on the terminal.
#define SIMTIME_MAX
The maximum value of the logical simulation time, semantically never.
int key
The key passed to the parsing function when encountering this option.
@ AP_KEY_FINI
Signals the end of the parsing process.
bool is_serial
If set, the simulation will run on the serial runtime.
struct ap_section ap_sects[]
The struct ap_section containing ROOT-Sim internal parser and the model one.
bool log_colored
If set, uses color codes to color the log outputs.
A complete command line option parsing setup.
void arg_parse_run(struct ap_settings *ap_s, char **argv)
Parses the command line options.
static long double parse_ldouble_limits(const char *str, long double low, long double high, bool *err_chk)
Parses a string into a long double value with bounds checks.
static unsigned long long parse_ullong_limits(const char *str, unsigned long long low, unsigned long long high, bool *err_chk)
Parses a string into a unsigned long long value with bounds checks.
A set of configurable values used by other modules.
bool io_terminal_can_colorize(void)
Determines if stdout supports colored text.
static void parse_opt(int key, const char *arg)
Parses a single ROOT-Sim option, also handles parsing events.
unsigned thread_cores_count(void)
Computes the count of available cores on the machine.
Generic input-output facilities.
Command line option parser.
Core ROOT-Sim functionalities.
#define unlikely(exp)
Optimize the branch as likely not taken.
const char * name
The long option name.
struct simulation_configuration global_config
The configuration filled in by init_args_parse()
void init_args_parse(int argc, char **argv)
Parses ROOT-Sim command line arguments.
void arg_parse_error(const char *fmt,...)
Prints a parsing related error message and exits with a bad exit code.
Generic architecture management facilities.
int verbosity
The log verbosity level.
static struct ap_option ap_options[]
The array of ROOT-Sim supported command line options.
uint64_t prng_seed
The seed used to initialize the pseudo random numbers.