ROSS
tw-setup.c File Reference

tw_define_lps is defined here!

#include <ross.h>
#include "lz4.h"
#include <sys/stat.h>

Go to the source code of this file.

Macros

#define VERIFY_MAPPING   0

Functions

static tw_pesetup_pes (void)
void tw_init (int *argc, char ***argv)
static void early_sanity_check (void)
void map_linear (void)
void map_round_robin (void)
void tw_define_lps (tw_lpid nlp, size_t msg_sz)
static void late_sanity_check (void)
void tw_run (void)
void tw_end (void)
static void tw_delta_alloc (tw_pe *pe)
tw_lpid map_onetype (tw_lpid gid)

Variables

unsigned int nkp_per_pe = 16
static tw_clock init_start = 0
static int32_t ross_rng_seed1
static int32_t ross_rng_seed2
static int32_t ross_rng_seed3
static int32_t ross_rng_seed4
static int32_t ross_core_rng_seed1
static int32_t ross_core_rng_seed2
static int32_t ross_core_rng_seed3
static int32_t ross_core_rng_seed4
static char * ross_args_file
static const tw_optdef kernel_options []

Macro Definition Documentation

◆ VERIFY_MAPPING

#define VERIFY_MAPPING   0

Definition at line 10 of file tw-setup.c.

Function Documentation

◆ early_sanity_check()

void early_sanity_check ( void )
static

Definition at line 168 of file tw-setup.c.

References g_tw_nkp, g_tw_nlp, nkp_per_pe, tw_error(), TW_LOC, and tw_printf().

Referenced by tw_define_lps().

◆ late_sanity_check()

void late_sanity_check ( void )
static

◆ map_linear()

void map_linear ( void )

◆ map_onetype()

tw_lpid map_onetype ( tw_lpid gid)

Definition at line 594 of file tw-setup.c.

◆ map_round_robin()

void map_round_robin ( void )

Definition at line 235 of file tw-setup.c.

References g_tw_kp, g_tw_lp, g_tw_mynode, g_tw_nkp, g_tw_nlp, g_tw_pe, pe, tw_kp_onpe(), tw_lp_onkp(), tw_lp_onpe(), and tw_nnodes().

Referenced by tw_define_lps().

◆ setup_pes()

◆ tw_define_lps()

void tw_define_lps ( tw_lpid nlp,
size_t msg_sz )

IMPORTANT: This function sets the value for g_tw_nlp which is a rather important global variable. It is also set in (very few) other places, but mainly just here.

We can't assume that every model uses equivalent values for g_tw_nlp across PEs so let's allreduce here to calculate how many total LPs there are in the sim.

Definition at line 264 of file tw-setup.c.

References CUSTOM, early_sanity_check(), g_st_analysis_nlp, g_tw_custom_initial_mapping, g_tw_kp, g_tw_lp, g_tw_mapping, g_tw_msg_sz, g_tw_nkp, g_tw_nlp, g_tw_nRNG_core_per_lp, g_tw_nRNG_per_lp, g_tw_rng_default, g_tw_synchronization_protocol, g_tw_total_lps, LINEAR, map_linear(), map_round_robin(), MPI_COMM_ROSS, nkp_per_pe, OPTIMISTIC_DEBUG, ROUND_ROBIN, specialized_lp_init_mapping(), specialized_lp_setup(), st_buffer_allocate(), tw_calloc(), tw_error(), TW_LOC, and tw_rand_init_streams().

Referenced by main().

◆ tw_delta_alloc()

void tw_delta_alloc ( tw_pe * pe)
static

By the time this function gets called, g_tw_delta_sz should be as large as it will ever get.

Definition at line 497 of file tw-setup.c.

References g_tw_delta_sz, LZ4_compressBound(), pe, tw_calloc(), and TW_LOC.

Referenced by setup_pes().

◆ tw_end()

void tw_end ( void )

Definition at line 476 of file tw-setup.c.

References g_tw_csv, tw_gvt_finish(), tw_ismaster(), and tw_net_stop().

Referenced by main().

◆ tw_init()

◆ tw_run()

Variable Documentation

◆ init_start

tw_clock init_start = 0
static

Definition at line 14 of file tw-setup.c.

Referenced by tw_init(), and tw_run().

◆ kernel_options

const tw_optdef kernel_options[]
static
Initial value:
= {
{ TWOPTTYPE_GROUP, NULL, ("ROSS Kernel"), NULL } ,
{ TWOPTTYPE_UINT, ("synch"), ("Sychronization Protocol: SEQUENTIAL=1, CONSERVATIVE=2, OPTIMISTIC=3, OPTIMISTIC_DEBUG=4, OPTIMISTIC_REALTIME=5, SEQUENTIAL_ROLLBACK_CHECK=6"), &(g_tw_synchronization_protocol) } ,
{ TWOPTTYPE_UINT, ("nkp"), ("number of kernel processes (KPs) per pe"), &(nkp_per_pe) } ,
{ TWOPTTYPE_DOUBLE, ("end"), ("simulation end timestamp"), &(g_tw_ts_end) } ,
{ TWOPTTYPE_UINT, ("batch"), ("messages per scheduler block"), &(g_tw_mblock) } ,
{ TWOPTTYPE_UINT, ("extramem"), ("Number of extra events allocated per PE."), &(g_tw_events_per_pe_extra) } ,
{ TWOPTTYPE_UINT, ("buddy-size"), ("delta encoding buddy system allocation (2^X)"), &(g_tw_buddy_alloc) } ,
{ TWOPTTYPE_UINT, ("lz4-knob"), ("LZ4 acceleration factor (higher = faster)"), &(g_tw_lz4_knob) } ,
{ TWOPTTYPE_DOUBLE, ("cons-lookahead"), ("Set g_tw_lookahead"), &(g_tw_lookahead) } ,
{ TWOPTTYPE_ULONGLONG, ("max-opt-lookahead"), ("Optimistic simulation: maximum lookahead allowed in virtual clock time"), &(g_tw_max_opt_lookahead) } ,
{ TWOPTTYPE_UINT, ("avl-size"), ("AVL Tree contains 2^avl-size nodes"), &(g_tw_avl_node_count) } ,
{ TWOPTTYPE_UINT, ("rng-seed1"), ("ROSS RNG Seed 1 of 4"), &(ross_rng_seed1) } ,
{ TWOPTTYPE_UINT, ("rng-seed2"), ("ROSS RNG Seed 2 of 4"), &(ross_rng_seed2) } ,
{ TWOPTTYPE_UINT, ("rng-seed3"), ("ROSS RNG Seed 3 of 4"), &(ross_rng_seed3) } ,
{ TWOPTTYPE_UINT, ("rng-seed4"), ("ROSS RNG Seed 4 of 4"), &(ross_rng_seed4) } ,
{ TWOPTTYPE_UINT, ("core-rng-seed1"), ("ROSS Core RNG Seed 1 of 4"), &(ross_core_rng_seed1) } ,
{ TWOPTTYPE_UINT, ("core-rng-seed2"), ("ROSS Core RNG Seed 2 of 4"), &(ross_core_rng_seed2) } ,
{ TWOPTTYPE_UINT, ("core-rng-seed3"), ("ROSS Core RNG Seed 3 of 4"), &(ross_core_rng_seed3) } ,
{ TWOPTTYPE_UINT, ("core-rng-seed4"), ("ROSS Core RNG Seed 4 of 4"), &(ross_core_rng_seed4) } ,
{ TWOPTTYPE_ARGSFILE, ("args-file"), ("ROSS Command Line Args File"), &(ross_args_file) } ,
{ (tw_opttype)0, NULL, NULL, NULL }
}
unsigned int g_tw_events_per_pe_extra
Definition ross-global.c:82
unsigned int g_tw_lz4_knob
Definition ross-global.c:45
uint32_t g_tw_buddy_alloc
Definition ross-global.c:39
uint32_t g_tw_avl_node_count
Definition ross-global.c:41
unsigned int g_tw_mblock
Definition ross-global.c:66
tw_synch g_tw_synchronization_protocol
Definition ross-global.c:19
double g_tw_lookahead
Definition ross-global.c:53
unsigned long long g_tw_max_opt_lookahead
Definition ross-global.c:68
double g_tw_ts_end
Definition ross-global.c:72
tw_opttype
Definition tw-opts.h:7
@ TWOPTTYPE_ARGSFILE
Definition tw-opts.h:16
@ TWOPTTYPE_DOUBLE
Definition tw-opts.h:13
@ TWOPTTYPE_ULONGLONG
Definition tw-opts.h:10
@ TWOPTTYPE_UINT
Definition tw-opts.h:11
@ TWOPTTYPE_GROUP
Definition tw-opts.h:8
static int32_t ross_core_rng_seed1
Definition tw-setup.c:21
static int32_t ross_rng_seed3
Definition tw-setup.c:18
static char * ross_args_file
Definition tw-setup.c:25
static int32_t ross_core_rng_seed4
Definition tw-setup.c:24
static int32_t ross_core_rng_seed2
Definition tw-setup.c:22
unsigned int nkp_per_pe
Definition tw-setup.c:13
static int32_t ross_core_rng_seed3
Definition tw-setup.c:23
static int32_t ross_rng_seed4
Definition tw-setup.c:19
static int32_t ross_rng_seed2
Definition tw-setup.c:17
static int32_t ross_rng_seed1
Definition tw-setup.c:16

Definition at line 27 of file tw-setup.c.

Referenced by tw_init().

◆ nkp_per_pe

unsigned int nkp_per_pe = 16

Definition at line 13 of file tw-setup.c.

Referenced by early_sanity_check(), map_linear(), and tw_define_lps().

◆ ross_args_file

char* ross_args_file
static

Definition at line 25 of file tw-setup.c.

◆ ross_core_rng_seed1

int32_t ross_core_rng_seed1
static

Definition at line 21 of file tw-setup.c.

Referenced by tw_init().

◆ ross_core_rng_seed2

int32_t ross_core_rng_seed2
static

Definition at line 22 of file tw-setup.c.

Referenced by tw_init().

◆ ross_core_rng_seed3

int32_t ross_core_rng_seed3
static

Definition at line 23 of file tw-setup.c.

Referenced by tw_init().

◆ ross_core_rng_seed4

int32_t ross_core_rng_seed4
static

Definition at line 24 of file tw-setup.c.

Referenced by tw_init().

◆ ross_rng_seed1

int32_t ross_rng_seed1
static

Definition at line 16 of file tw-setup.c.

Referenced by tw_init().

◆ ross_rng_seed2

int32_t ross_rng_seed2
static

Definition at line 17 of file tw-setup.c.

Referenced by tw_init().

◆ ross_rng_seed3

int32_t ross_rng_seed3
static

Definition at line 18 of file tw-setup.c.

Referenced by tw_init().

◆ ross_rng_seed4

int32_t ross_rng_seed4
static

Definition at line 19 of file tw-setup.c.

Referenced by tw_init().