10 #define VERIFY_MAPPING 0
44 for (i = 0; i < *argc; i++) {
45 printf(
"%s ", (*argv)[i]);
55 printf(
"%s\n", ctime(&raw_time));
77 st_damaris_ross_init();
87 int csv_check = stat(
"ross.csv", &buffer);
89 if (NULL == (
g_tw_csv = fopen(
"ross.csv",
"a")))
94 fprintf(
g_tw_csv,
"total_pe,total_kp,total_lp,end_ts,mapping,model_events,network_events,total_events,"
95 "runtime,events_processed,events_aborted,events_rb,pe_event_ties,eff,send_loc_remote,"
96 "percent_loc,send_net_remote,percent_net,rb_total,rb_primary,rb_secondary,fc_attempts,"
97 "num_gvt,net_events,event_rate,events_past_end,event_alloc,memory_alloc,memory_wasted,"
98 "remote_sends,remote_recvs,pe_struct,kp_struct,lp_struct,lp_model_struct,lp_rngs,"
99 "total_lp_size,event_struct,event_struct_model,init_time,pq_time,avl_time,lz4_time,"
102 fprintf(
g_tw_csv,
"rio_load,rio_init,");
104 fprintf(
g_tw_csv,
"event_proc_time,event_cancel_time,event_abort_time,gvt_time,fc_time,"
105 "primary_rb_time,net_read_time,net_other_time,inst_comp_time,inst_write_time,total_time");
107 fprintf(
g_tw_csv,
",model_nevent_proc,model_nevent_rb,model_net_events,model_eff,"
108 "alp_nevent_proc,alp_nevent_rb,alp_net_events,alp_eff");
137 unsigned int nlp_per_kp;
156 for(kpid = 0, lpid = 0; kpid <
nkp_per_pe; kpid++) {
160 printf(
"\t\tKP %d", kpid);
163 for(j = 0; j < nlp_per_kp && lpid <
g_tw_nlp; j++, lpid++) {
200 for(i = 0, lpid=lp_offset; i <
g_tw_nlp; i++, lpid+=lp_stride) {
208 printf(
"LP %4d KP %4d PE %4d\n", lpid, kpid, pe->
id);
259 tw_error(
TW_LOC,
"CUSTOM mapping flag set but not custom mapping function! \n");
284 memset(&null_type, 0,
sizeof(null_type));
294 if (kp->
pe == NULL) {
303 if (!lp || !lp->
pe) {
311 if (lp->
pe != lp->
kp->
pe) {
315 if (!memcmp(lp->
type, &null_type,
sizeof(null_type))) {
322 unsigned cacheList[] = {
329 unsigned instList[] = {
330 PEVT_LSU_COMMIT_CACHEABLE_LDS,
334 PEVT_INST_QFPU_FPGRP1,
349 if (g_st_damaris_enabled)
350 st_damaris_inst_init();
354 Bgpm_Init(BGPM_MODE_SWDISTRIB);
357 int hEvtSet = Bgpm_CreateEventSet();
361 Bgpm_AddEventList(hEvtSet, instList,
sizeof(instList)/
sizeof(
unsigned) );
364 printf(
"***************************************************************************************** \n");
365 printf(
"* NOTICE: Build configured with Blue Gene/Q specific, BGPM performance monitoring code!!* \n");
366 printf(
"***************************************************************************************** \n");
407 int numEvts = Bgpm_NumEvents(hEvtSet);
408 printf(
"\n \n ================================= \n");
409 printf(
"Performance Counter Results:\n");
410 printf(
"--------------------------------- \n");
411 for (i=0; i<numEvts; i++) {
412 Bgpm_ReadEvent(hEvtSet, i, &cnt);
413 printf(
" %40s = %20llu\n", Bgpm_GetEventLabel(hEvtSet, i), cnt);
415 printf(
"================================= \n");
451 unsigned int num_events_per_pe;
481 printf(
"\nROSS Core Configuration: \n");
482 printf(
"\t%-50s %11u\n",
"Total PEs",
tw_nnodes());
489 printf(
"\t%-50s %11llu\n",
"Total LPs",
493 printf(
"\t%-50s %11.2lf\n",
"Simulation End Time",
g_tw_ts_end);
499 printf(
"\t%-50s %11s\n",
"LP-to-PE Mapping",
"linear");
504 printf(
"\t%-50s %11s\n",
"LP-to-PE Mapping",
"round robin");
505 fprintf(
g_tw_csv,
"%s,",
"round robin");
509 printf(
"\t%-50s %11s\n",
"LP-to-PE Mapping",
"model defined");
510 fprintf(
g_tw_csv,
"%s,",
"model defined");
516 st_damaris_init_print();
520 fprintf(
g_tw_csv,
"%d,", num_events_per_pe);
523 #ifndef ROSS_DO_NOT_PRINT
524 printf(
"\nROSS Event Memory Allocation:\n");
525 printf(
"\t%-50s %11d\n",
"Model events", num_events_per_pe);
tw_synch g_tw_synchronization_protocol
void tw_kp_onpe(tw_kpid id, tw_pe *pe)
const tw_optdef * st_inst_opts(void)
static const tw_optdef kernel_options[]
void tw_net_stop(void)
Stops the network library after simulation end.
static void early_sanity_check(void)
void tw_error(const char *file, int line, const char *fmt,...) NORETURN
tw_lptype * type
Type of this LP, including service callbacks.
const tw_optdef * tw_gvt_setup(void)
tw_statistics stats
per PE counters
unsigned int g_tw_gvt_threshold
tw_eventq g_io_free_events
static int tw_ismaster(void)
static void tw_eventq_alloc(tw_eventq *q, unsigned int cnt)
tw_pe * pe
PE that services this KP.
unsigned char * delta_buffer[3]
buffers used for delta encoding
tw_pq * tw_pq_create(void)
void tw_scheduler_optimistic(tw_pe *me)
void tw_define_lps(tw_lpid nlp, size_t msg_sz)
#define TWOPT_DOUBLE(n, v, h)
static tw_clock tw_clock_read(void)
Holds the entire PE state.
const tw_optdef * tw_net_init(int *argc, char ***argv)
Initalize the network library and parse options.
static tw_event * tw_eventq_shift(tw_eventq *q)
unsigned int tw_nnodes(void)
#define TWOPT_ULONGLONG(n, v, h)
void tw_lp_onpe(tw_lpid index, tw_pe *pe, tw_lpid id)
static tw_kp * tw_getkp(tw_kpid id)
tw_eventq free_q
Linked list of free tw_events.
const tw_optdef * tw_clock_setup(void)
Function Pointers for ROSS Event Handlers.
tw_kp * kp
kp – Kernel process that we belong to (must match pe).
static tw_clock init_start
void specialized_lp_setup()
void tw_init(int *argc, char ***argv)
void map_round_robin(void)
tw_lpid g_st_analysis_nlp
int g_st_use_analysis_lps
unsigned int g_tw_events_per_pe_extra
buddy_list_bucket_t * g_tw_buddy_master
static void late_sanity_check(void)
tw_event * abort_event
Placeholder event for when free_q is empty.
uint32_t g_tw_avl_node_count
#define TWOPT_UINT(n, v, h)
tw_pq * pq
Priority queue used to sort events.
void tw_lp_onkp(tw_lp *lp, tw_kp *kp)
void tw_opt_add(const tw_optdef *options)
const tw_optdef * st_special_lp_opts(void)
static tw_event * tw_eventq_pop(tw_eventq *q)
uint32_t g_tw_buddy_alloc
static void tw_eventq_push(tw_eventq *q, tw_event *e)
void tw_scheduler_sequential(tw_pe *me)
map_custom_f g_tw_custom_initial_mapping
unsigned int g_tw_nRNG_per_lp
void tw_scheduler_optimistic_debug(tw_pe *me)
const tw_optdef io_opts[]
void tw_scheduler_optimistic_realtime(tw_pe *me)
void tw_net_start(void)
Starts the network library after option parsing.
void specialized_lp_init_mapping()
unsigned long long g_tw_max_opt_lookahead
int LZ4_compressBound(int isize)
void tw_sched_init(tw_pe *me)
void tw_rand_init_streams(tw_lp *lp, unsigned int nstreams)
tw_lpid map_onetype(tw_lpid gid)
void tw_scheduler_conservative(tw_pe *me)
unsigned int g_tw_lz4_knob
void st_buffer_allocate()
void * tw_calloc(const char *file, int line, const char *for_who, size_t e_sz, size_t n)
void tw_opt_parse(int *argc_p, char ***argv_p)
static void tw_delta_alloc(tw_pe *pe)
buddy_list_bucket_t * create_buddy_table(unsigned int power_of_two)
unsigned int g_tw_events_per_pe
int g_io_events_buffered_per_rank
void tw_printf(const char *file, int line, const char *fmt,...)
static tw_pe * setup_pes(void)