The ROme OpTimistic Simulator  2.0.0
A General-Purpose Multithreaded Parallel/Distributed Simulation Platform
main.c File Reference

This module contains the entry point for the simulator, and some core functions. More...

#include <unistd.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <setjmp.h>
#include <core/core.h>
#include <arch/thread.h>
#include <statistics/statistics.h>
#include <gvt/ccgs.h>
#include <scheduler/binding.h>
#include <scheduler/scheduler.h>
#include <scheduler/process.h>
#include <gvt/gvt.h>
#include <mm/mm.h>
#include <mm/ecs.h>
#include <serial/serial.h>
#include <communication/mpi.h>
#include <core/init.h>
+ Include dependency graph for main.c:

Go to the source code of this file.

Functions

static bool end_computing (void)
 
static void * main_simulation_loop (void *arg)
 
int main (int argc, char **argv)
 

Variables

jmp_buf exit_jmp
 
atomic_t preempt_count
 
atomic_t overtick_platform
 
atomic_t would_preempt
 

Detailed Description

This module contains the entry point for the simulator, and some core functions.

Copyright (C) 2008-2019 HPDCS Group http://www.dis.uniroma1.it/~hpdcs

This file is part of ROOT-Sim (ROme OpTimistic Simulator).

ROOT-Sim is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; only version 3 of the License applies.

ROOT-Sim is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with ROOT-Sim; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

Author
Francesco Quaglia
Alessandro Pellegrini
Roberto Vitali

Definition in file main.c.

Function Documentation

static bool end_computing ( void  )
static

This function checks the different possibilities for termination detection termination.

Definition at line 67 of file main.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int main ( int  argc,
char **  argv 
)

This function implements the ROOT-Sim's entry point

Parameters
argcNumber of arguments passed to ROOT-Sim
argvArguments passed to ROOT-Sim
Returns
Exit code

Definition at line 190 of file main.c.

+ Here is the call graph for this function:

static void * main_simulation_loop ( void *  arg)
static

This function implements the main simulation loop

Parameters
argThis argument should be always set to NULL

Definition at line 102 of file main.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

jmp_buf exit_jmp

This jump buffer allows rootsim_error, in case of a failure, to jump out of any point in the code to the final part of the loop in which all threads synchronize. This avoids side effects like, e.g., accessing a NULL pointer.

Definition at line 62 of file main.c.