The ROme OpTimistic Simulator  3.0.0
A General-Purpose Multithreaded Parallel/Distributed Simulation Platform
lp.h
Go to the documentation of this file.
1 
11 #pragma once
12 
13 #include <core/core.h>
14 #include <gvt/termination.h>
15 #include <lib/lib.h>
16 #include <lp/msg.h>
17 #include <lp/process.h>
18 #include <mm/model_allocator.h>
19 
21 struct lp_ctx {
25  struct lib_ctx *lib_ctx_p;
27  struct process_data p;
30 };
31 
32 #define lid_to_rid(lp_id) ((lp_id) * n_threads / n_lps_node)
33 
34 extern __thread uint64_t lp_id_first;
35 extern __thread uint64_t lp_id_end;
36 
37 extern uint64_t n_lps_node;
38 extern __thread struct lp_ctx *current_lp;
39 extern struct lp_ctx *lps;
40 
41 extern void lp_global_init(void);
42 extern void lp_global_fini(void);
43 
44 extern void lp_init(void);
45 extern void lp_fini(void);
46 
47 extern void lp_cleanup(void);
48 
49 __attribute__ ((pure)) extern lp_id_t lp_id_get_mt(void);
50 __attribute__ ((pure)) extern struct lib_ctx *lib_ctx_get_mt(void);
simtime_t
double simtime_t
The type used to represent logical time in the simulation.
Definition: core.h:62
lib.h
Model library main header.
mm_state
The checkpointable memory context assigned to a single LP.
Definition: buddy.h:24
process_data
The message processing data produced by the LP.
Definition: process.h:17
lp_ctx::p
struct process_data p
The message processing context of this LP.
Definition: lp.h:27
msg.h
Message management functions.
lp_ctx
A complete LP context.
Definition: lp.h:21
process.h
LP state management functions.
termination.h
Termination detection module.
n_lps_node
uint64_t n_lps_node
The total number of LPs hosted in the node.
Definition: lp.c:21
lp_ctx::lib_ctx_p
struct lib_ctx * lib_ctx_p
The additional libraries context of this LP.
Definition: lp.h:25
lib_ctx
Definition: lib.h:17
lp_id_t
uint64_t lp_id_t
Used to uniquely identify LPs in the simulation.
Definition: core.h:75
model_allocator.h
Memory management functions for simulation models.
core.h
Core ROOT-Sim functionalities.
lp_ctx::t_d
simtime_t t_d
The termination time of this LP, handled by the termination module.
Definition: lp.h:23