ROOT-Sim core  3.0.0-rc.2
A General-Purpose Multi-threaded Parallel/Distributed Simulation Library
Functions | Variables
init.c File Reference

Initialization routines. More...

#include <arch/thread.h>
#include <core/core.h>
#include <distributed/mpi.h>
#include <log/log.h>
#include <parallel/parallel.h>
#include <serial/serial.h>
#include <ROOT-Sim.h>
#include <inttypes.h>
#include <string.h>
Include dependency graph for init.c:

Functions

static void print_logo (void)
 Prints a fancy ROOT-Sim logo.
 
static void print_config (void)
 Pretty prints ROOT-Sim current configuration.
 
int RootsimInit (const struct simulation_configuration *conf)
 Initialize the core library. More...
 
int RootsimRun (void)
 Start the simulation. More...
 

Variables

static bool configuration_done = false
 A flag to check if the core library has been initialized correctly.
 
struct simulation_configuration global_config = {0}
 The global configuration of the simulation, passed by the model.
 

Detailed Description

Initialization routines.

This module implements the simulator initialization routines

Function Documentation

◆ RootsimInit()

int RootsimInit ( const struct simulation_configuration conf)

Initialize the core library.

This function must be invoked so as to initialize the core. The structure passed to this function is copied into a library variable, that is used by the core to support the simulation run.

Parameters
confA pointer to a struct simulation_configuration used to configure the core library.
Returns
zero if the configuration is successful, non-zero otherwise.

◆ RootsimRun()

int RootsimRun ( void  )

Start the simulation.

This function starts the simulation. It must be called after having initialized the ROOT-Sim core by calling RootsimInit(), otherwise the invocation will fail.

Returns
zero on successful simulation completion, non-zero otherwise.