ROOT-Sim core  3.0.0-rc.2
A General-Purpose Multi-threaded Parallel/Distributed Simulation Library
process.h
Go to the documentation of this file.
1 
11 #pragma once
12 
13 #include <datatypes/array.h>
14 #include <lp/msg.h>
15 
17 struct process_ctx {
19  dyn_array(struct lp_msg *) p_msgs;
21 
24 
26 };
27 
28 #define is_msg_sent(msg_p) (((uintptr_t)(msg_p)) & 3U)
29 #define is_msg_remote(msg_p) (((uintptr_t)(msg_p)) & 2U)
30 #define is_msg_local_sent(msg_p) (((uintptr_t)(msg_p)) & 1U)
31 #define is_msg_past(msg_p) (!(((uintptr_t)(msg_p)) & 3U))
32 #define unmark_msg(msg_p) ((struct lp_msg *)(((uintptr_t)(msg_p)) & (UINTPTR_MAX - 3)))
33 
34 struct lp_ctx; // forward declaration
35 
36 extern void process_lp_init(struct lp_ctx *lp);
37 extern void process_lp_fini(struct lp_ctx *lp);
38 
39 extern void process_msg(void);
double simtime_t
Simulation time data type.
Definition: ROOT-Sim.h:27
Dynamic array datatype.
Message management functions.
void process_lp_fini(struct lp_ctx *lp)
Finalize the processing module in the current LP.
Definition: process.c:111
void process_lp_init(struct lp_ctx *lp)
Initializes the processing module in the current LP.
Definition: process.c:90
void process_msg(void)
Extract and process a message, if available.
Definition: process.c:352
A complete LP context.
Definition: lp.h:22
A model simulation message.
Definition: msg.h:59
The message processing data produced by the LP.
Definition: process.h:17
dyn_array(struct lp_msg *) p_msgs
The messages processed in the past by the owner LP.
simtime_t bound
The current logical time at which this LP is.
Definition: process.h:25
struct lp_msg * early_antis
The list of remote anti-messages delivered before their original counterpart.
Definition: process.h:22