10#define VERIFY_MAPPING 0
29 TWOPT_UINT(
"synch",
g_tw_synchronization_protocol,
"Sychronization Protocol: SEQUENTIAL=1, CONSERVATIVE=2, OPTIMISTIC=3, OPTIMISTIC_DEBUG=4, OPTIMISTIC_REALTIME=5, SEQUENTIAL_ROLLBACK_CHECK=6"),
64 for (i = 0; i < *argc; i++) {
65 printf(
"%s ", (*argv)[i]);
75 printf(
"%s\n", ctime(&raw_time));
97 st_damaris_ross_init();
107 int csv_check = stat(
"ross.csv", &buffer);
109 if (NULL == (
g_tw_csv = fopen(
"ross.csv",
"a")))
114 fprintf(
g_tw_csv,
"total_pe,total_kp,total_lp,end_ts,mapping,model_events,network_events,total_events,"
115 "runtime,events_processed,events_aborted,events_rb,pe_event_ties,eff,send_loc_remote,"
116 "percent_loc,send_net_remote,percent_net,rb_total,rb_primary,rb_secondary,fc_attempts,"
117 "num_gvt,net_events,event_rate,events_past_end,event_alloc,memory_alloc,memory_wasted,"
118 "remote_sends,remote_recvs,pe_struct,kp_struct,lp_struct,lp_model_struct,lp_rngs,"
119 "total_lp_size,event_struct,event_struct_model,init_time,pq_time,avl_time,lz4_time,"
122 fprintf(
g_tw_csv,
"rio_load,rio_init,");
124 fprintf(
g_tw_csv,
"event_proc_time,event_cancel_time,event_abort_time,gvt_time,fc_time,"
125 "primary_rb_time,net_read_time,net_other_time,inst_comp_time,inst_write_time,total_time");
127 fprintf(
g_tw_csv,
",model_nevent_proc,model_nevent_rb,model_net_events,model_eff,"
128 "alp_nevent_proc,alp_nevent_rb,alp_net_events,alp_eff");
144 tw_error(
TW_LOC,
"If using --rng-seed#, all four seeds must be specified\n");
157 tw_error(
TW_LOC,
"If using --core-rng-seed#, all four seeds must be specified\n");
183 unsigned int nlp_per_kp;
199 printf(
"\tPE %d\n",
g_tw_pe->id);
202 for(kpid = 0, lpid = 0; kpid <
nkp_per_pe; kpid++) {
206 printf(
"\t\tKP %d", kpid);
209 for(j = 0; j < nlp_per_kp && lpid <
g_tw_nlp; j++, lpid++) {
246 for(i = 0, lpid=lp_offset; i <
g_tw_nlp; i++, lpid+=lp_stride) {
254 printf(
"LP %4d KP %4d PE %4d\n", lpid, kpid,
pe->id);
273 tw_error(
TW_LOC,
"MPI_Allreduce in tw_define_lps() failed: Attempted to calculate total LPs");
311 tw_error(
TW_LOC,
"CUSTOM mapping flag set but not custom mapping function! \n");
336 memset(&null_type, 0,
sizeof(null_type));
346 if (kp->
pe == NULL) {
355 if (!lp || !lp->
pe) {
363 if (lp->
pe != lp->
kp->
pe) {
367 if (!memcmp(lp->
type, &null_type,
sizeof(null_type))) {
374unsigned cacheList[] = {
381unsigned instList[] = {
382 PEVT_LSU_COMMIT_CACHEABLE_LDS,
386 PEVT_INST_QFPU_FPGRP1,
401 if (g_st_damaris_enabled)
402 st_damaris_inst_init();
406 Bgpm_Init(BGPM_MODE_SWDISTRIB);
409 int hEvtSet = Bgpm_CreateEventSet();
413 Bgpm_AddEventList(hEvtSet, instList,
sizeof(instList)/
sizeof(
unsigned) );
416 printf(
"***************************************************************************************** \n");
417 printf(
"* NOTICE: Build configured with Blue Gene/Q specific, BGPM performance monitoring code!!* \n");
418 printf(
"***************************************************************************************** \n");
463 int numEvts = Bgpm_NumEvents(hEvtSet);
464 printf(
"\n \n ================================= \n");
465 printf(
"Performance Counter Results:\n");
466 printf(
"--------------------------------- \n");
467 for (i=0; i<numEvts; i++) {
468 Bgpm_ReadEvent(hEvtSet, i, &cnt);
469 printf(
" %40s = %20llu\n", Bgpm_GetEventLabel(hEvtSet, i), cnt);
471 printf(
"================================= \n");
508 unsigned int num_events_per_pe;
538 printf(
"\nROSS Core Configuration: \n");
539 printf(
"\t%-50s %11u\n",
"Total PEs",
tw_nnodes());
545 printf(
"\t%-50s %11llu\n",
"Total LPs",
549 printf(
"\t%-50s %11.2lf\n",
"Simulation End Time",
g_tw_ts_end);
555 printf(
"\t%-50s %11s\n",
"LP-to-PE Mapping",
"linear");
560 printf(
"\t%-50s %11s\n",
"LP-to-PE Mapping",
"round robin");
561 fprintf(
g_tw_csv,
"%s,",
"round robin");
565 printf(
"\t%-50s %11s\n",
"LP-to-PE Mapping",
"model defined");
566 fprintf(
g_tw_csv,
"%s,",
"model defined");
572 st_damaris_init_print();
576 fprintf(
g_tw_csv,
"%d,", num_events_per_pe);
579#ifndef ROSS_DO_NOT_PRINT
580 printf(
"\nROSS Event Memory Allocation:\n");
581 printf(
"\t%-50s %11d\n",
"Model events", num_events_per_pe);
buddy_list_bucket_t * create_buddy_table(unsigned int power_of_two)
static tw_clock tw_clock_read(void)
const tw_optdef * st_special_lp_opts(void)
void specialized_lp_setup()
void specialized_lp_init_mapping()
const tw_optdef * st_inst_opts()
tw_lpid g_st_analysis_nlp
void st_buffer_allocate()
int g_st_use_analysis_lps
int LZ4_compressBound(int inputSize)
void tw_net_start(void)
Starts the network library after option parsing.
void tw_net_stop(void)
Stops the network library after simulation end.
const tw_optdef * tw_net_init(int *argc, char ***argv)
Initalize the network library and parse options.
tw_pq * tw_pq_create(void)
const tw_optdef io_opts[3]
int g_io_events_buffered_per_rank
tw_eventq g_io_free_events
void * tw_calloc(const char *file, int line, const char *for_who, size_t e_sz, size_t n)
unsigned int g_tw_gvt_threshold
buddy_list_bucket_t * g_tw_buddy_master
void tw_rand_init_streams(tw_lp *lp, unsigned int nstreams, unsigned int n_core_streams)
unsigned int g_tw_events_per_pe_extra
void tw_scheduler_optimistic(tw_pe *me)
const tw_optdef * tw_clock_setup()
unsigned int g_tw_lz4_knob
unsigned int g_tw_events_per_pe
void tw_error(const char *file, int line, const char *fmt,...)
map_custom_f g_tw_custom_initial_mapping
uint32_t g_tw_buddy_alloc
void tw_scheduler_sequential_rollback_check(tw_pe *me)
unsigned int g_tw_nRNG_per_lp
unsigned int g_tw_nRNG_core_per_lp
void tw_printf(const char *file, int line, const char *fmt,...)
tw_seed g_tw_core_rng_seed
void tw_kp_onpe(tw_kpid id, tw_pe *pe)
void tw_scheduler_conservative(tw_pe *me)
void tw_lp_onkp(tw_lp *lp, tw_kp *kp)
void tw_scheduler_optimistic_realtime(tw_pe *me)
uint32_t g_tw_avl_node_count
void tw_scheduler_optimistic_debug(tw_pe *me)
void tw_scheduler_sequential(tw_pe *me)
tw_synch g_tw_synchronization_protocol
void tw_sched_init(tw_pe *me)
unsigned long long g_tw_max_opt_lookahead
void tw_lp_onpe(tw_lpid index, tw_pe *pe, tw_lpid id)
const tw_optdef * tw_gvt_setup(void)
static int tw_ismaster(void)
static tw_kp * tw_getkp(tw_kpid id)
@ SEQUENTIAL_ROLLBACK_CHECK
static void tw_eventq_push(tw_eventq *q, tw_event *e)
static void tw_eventq_alloc(tw_eventq *q, unsigned int cnt)
static tw_event * tw_eventq_shift(tw_eventq *q)
static tw_event * tw_eventq_pop(tw_eventq *q)
#define TWOPT_UINT(n, v, h)
#define TWOPT_ULONGLONG(n, v, h)
void tw_opt_parse(int *argc, char ***argv)
void tw_opt_add(const tw_optdef *options)
#define TWOPT_DOUBLE(n, v, h)
#define TWOPT_ARGSFILE(n, v, h)
tw_pe * pe
PE that services this KP.
tw_kp * kp
kp – Kernel process that we belong to (must match pe).
tw_lptype * type
Type of this LP, including service callbacks.
Function Pointers for ROSS Event Handlers.
Holds the entire PE state.
tw_statistics stats
per PE counters
static int32_t ross_core_rng_seed1
tw_lpid map_onetype(tw_lpid gid)
static int32_t ross_rng_seed3
static tw_pe * setup_pes(void)
static const tw_optdef kernel_options[]
static char * ross_args_file
static tw_clock init_start
void tw_init(int *argc, char ***argv)
static void tw_delta_alloc(tw_pe *pe)
static void late_sanity_check(void)
static int32_t ross_core_rng_seed4
static int32_t ross_core_rng_seed2
void map_round_robin(void)
static void early_sanity_check(void)
static int32_t ross_core_rng_seed3
static int32_t ross_rng_seed4
void tw_define_lps(tw_lpid nlp, size_t msg_sz)
static int32_t ross_rng_seed2
static int32_t ross_rng_seed1