![]() |
ROOT-Sim core
3.0.0-rc.2
A General-Purpose Multi-threaded Parallel/Distributed Simulation Library
|
LP construction functions. More...
#include <lp/lp.h>#include <datatypes/msg_queue.h>#include <core/sync.h>#include <gvt/termination.h>
Macros | |
| #define | partition_start(part_id, part_cnt, part_fnc, start_i, tot_i) |
| Compute the first index of a partition in a linear space of indexes. More... | |
Functions | |
| void | lp_global_init (void) |
| Initialize the global data structures for the LPs. | |
| void | lp_global_fini (void) |
| Finalize the global data structures for the LPs. | |
| void | lp_init (void) |
| Initialize the data structures of the LPs hosted in the calling thread. | |
| void | lp_fini (void) |
| Finalize the data structures of the LPs hosted in the calling thread. | |
| void | SetState (void *state) |
| Set the LP simulation state main pointer. More... | |
Variables | |
| uint64_t | lid_node_first |
| The lowest LP id between the ones hosted on this node. | |
| __thread uint64_t | lid_thread_first |
| The lowest LP id between the ones hosted on this thread. | |
| __thread uint64_t | lid_thread_end |
| One plus the highest LP id between the ones hosted on this thread. | |
| __thread struct lp_ctx * | current_lp |
| A pointer to the currently processed LP context. | |
| struct lp_ctx * | lps |
| A pointer to the LP contexts array. More... | |
| lp_id_t | n_lps_node |
| The number of LPs hosted on this node. More... | |
| bool | lp_initialized |
LP construction functions.
LP construction functions
| #define partition_start | ( | part_id, | |
| part_cnt, | |||
| part_fnc, | |||
| start_i, | |||
| tot_i | |||
| ) |
Compute the first index of a partition in a linear space of indexes.
| part_id | the id of the requested partition |
| part_cnt | the number of requested partitions |
| part_fnc | the function which computes the partition id from an index |
| start_i | the first valid index of the space to partition |
| tot_i | the size of the index space to partition |
The description is somewhat confusing but this does a simple thing. Each LP has an integer id and we want each node/processing unit to have more or less the same number of LPs assigned to it; this macro computes the first index of the LP to assign to a node/processing unit.
| void SetState | ( | void * | state | ) |
Set the LP simulation state main pointer.
| state | The state pointer to be passed to ProcessEvent() for the invoker LP |
| struct lp_ctx* lps |
A pointer to the LP contexts array.
Valid entries are contained between lid_node_first and lid_node_first + n_lps_node - 1, limits included
| lp_id_t n_lps_node |
The number of LPs hosted on this node.
The total number of LPs hosted in the node.