44 #ifdef HAVE_CROSS_STATE 51 #define _INIT_FROM_MAIN 53 #undef _INIT_FROM_MAIN 71 if (ccgs_can_halt_simulation()) {
79 if (simulation_error()) {
83 if (user_requested_exit())
89 #ifdef HAVE_PREEMPTION 109 #ifdef HAVE_CROSS_STATE 110 lp_alloc_thread_init();
114 initialize_worker_thread();
123 printf(
"****************************\n" 124 "* Simulation Started *\n" 125 "****************************\n");
129 goto leave_for_error;
152 #ifdef HAVE_PREEMPTION 154 (
"TIME BARRIER %f - %d preemptions - %d in platform mode - %d would preempt\n",
160 printf(
"TIME BARRIER %f\n", my_time_barrier);
176 if (simulation_error()) {
190 int main(
int argc,
char **argv)
193 volatile int __wait = 0;
196 if ((getenv(
"WGDB")) != NULL && *(getenv(
"WGDB")) ==
'1') {
197 gethostname(hostname,
sizeof(hostname));
198 printf(
"PID %d on %s ready for attach\n", getpid(), hostname);
216 if (!simulation_error()) {
int prune_outgoing_queues(void)
Prune all outgoing queues.
void process_bottom_halves(void)
void statistics_start(void)
int verbose
Kernel verbose.
#define atomic_read(v)
Read operation on an atomic counter.
Core ROOT-Sim functionalities.
unsigned int n_cores
Total number of cores required for simulation.
simtime_t get_last_gvt(void)
simtime_t gvt_operations(void)
The ROOT-Sim scheduler main module header.
Load sharing rules across worker threads.
Generic thread management facilities.
Consistent and Committed Global State.
static void * main_simulation_loop(void *arg)
static bool end_computing(void)
double simtime_t
This defines the type with whom timestamps are represented.
simulation_configuration rootsim_config
This global variable holds the configuration for the current simulation.
void SystemInit(int argc, char **argv)
Memory Manager main header.
bool thread_barrier(barrier_t *b)
int simulation_time
Wall-clock-time based termination predicate.
barrier_t all_thread_barrier
Barrier for all worker threads.
void create_threads(unsigned short int n, void *(*start_routine)(void *), void *arg)
#define master_thread()
This macro expands to true if the current KLT is the master thread for the local kernel.
#define D_DIFFER(a, b)
Difference condition for doubles.
#define master_kernel()
This macro expands to true if the local kernel is the master kernel.
void receive_remote_msgs(void)
Receive remote messages.
void simulation_shutdown(int code)
void collect_termination(void)
Check if other kernels have reached the termination condition.
void syncronize_all(void)
Syncronize all the kernels.
bool core_binding
Bind threads to specific core (reduce context switches and cache misses)
Event & Cross State Synchornization.
bool serial
If the simulation must be run serially.
static void set_affinity(int core)
int main(int argc, char **argv)