ROSS
tw-setup.c
Go to the documentation of this file.
1#include <ross.h>
2#include "lz4.h"
3#include <sys/stat.h>
4
5/**
6 * @file tw-setup.c
7 * @brief tw_define_lps is defined here!
8 */
9
10#define VERIFY_MAPPING 0
11
12static tw_pe *setup_pes(void);
13unsigned int nkp_per_pe = 16;
15
16static int32_t ross_rng_seed1;
17static int32_t ross_rng_seed2;
18static int32_t ross_rng_seed3;
19static int32_t ross_rng_seed4;
20
21static int32_t ross_core_rng_seed1;
22static int32_t ross_core_rng_seed2;
23static int32_t ross_core_rng_seed3;
24static int32_t ross_core_rng_seed4;
25static char* ross_args_file;
26
27static const tw_optdef kernel_options[] = {
28 TWOPT_GROUP("ROSS Kernel"),
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"),
30 TWOPT_UINT("nkp", nkp_per_pe, "number of kernel processes (KPs) per pe"),
31 TWOPT_DOUBLE("end", g_tw_ts_end, "simulation end timestamp"),
32 TWOPT_UINT("batch", g_tw_mblock, "messages per scheduler block"),
33 TWOPT_UINT("extramem", g_tw_events_per_pe_extra, "Number of extra events allocated per PE."),
34 TWOPT_UINT("buddy-size", g_tw_buddy_alloc, "delta encoding buddy system allocation (2^X)"),
35 TWOPT_UINT("lz4-knob", g_tw_lz4_knob, "LZ4 acceleration factor (higher = faster)"),
36 TWOPT_DOUBLE("cons-lookahead", g_tw_lookahead, "Set g_tw_lookahead"),
37 TWOPT_ULONGLONG("max-opt-lookahead", g_tw_max_opt_lookahead, "Optimistic simulation: maximum lookahead allowed in virtual clock time"),
38#ifdef AVL_TREE
39 TWOPT_UINT("avl-size", g_tw_avl_node_count, "AVL Tree contains 2^avl-size nodes"),
40#endif
41 TWOPT_UINT("rng-seed1",ross_rng_seed1, "ROSS RNG Seed 1 of 4"),
42 TWOPT_UINT("rng-seed2",ross_rng_seed2, "ROSS RNG Seed 2 of 4"),
43 TWOPT_UINT("rng-seed3",ross_rng_seed3, "ROSS RNG Seed 3 of 4"),
44 TWOPT_UINT("rng-seed4",ross_rng_seed4, "ROSS RNG Seed 4 of 4"),
45 TWOPT_UINT("core-rng-seed1",ross_core_rng_seed1, "ROSS Core RNG Seed 1 of 4"),
46 TWOPT_UINT("core-rng-seed2",ross_core_rng_seed2, "ROSS Core RNG Seed 2 of 4"),
47 TWOPT_UINT("core-rng-seed3",ross_core_rng_seed3, "ROSS Core RNG Seed 3 of 4"),
48 TWOPT_UINT("core-rng-seed4",ross_core_rng_seed4, "ROSS Core RNG Seed 4 of 4"),
49 TWOPT_ARGSFILE("args-file",ross_args_file, "ROSS Command Line Args File"),
50 TWOPT_END()
51};
52
53void tw_init(int *argc, char ***argv) {
54 int i;
56#if HAVE_CTIME
57 time_t raw_time;
58#endif
59
60 tw_opt_add(tw_net_init(argc, argv));
61
62 // Print out the command-line so we know what we passed in
63 if (tw_ismaster()) {
64 for (i = 0; i < *argc; i++) {
65 printf("%s ", (*argv)[i]);
66 }
67 printf("\n\n");
68 }
69
70 // Print our revision if we have it
71#ifdef ROSS_VERSION
72 if (tw_ismaster()) {
73#if HAVE_CTIME
74 time(&raw_time);
75 printf("%s\n", ctime(&raw_time));
76#endif
77 printf("ROSS Version: %s\n\n", ROSS_VERSION);
78 }
79#endif
80
85#ifdef USE_DAMARIS
86 tw_opt_add(st_damaris_opts());
87#endif
89#ifdef USE_RIO
91#endif
92
93 // by now all options must be in
94 tw_opt_parse(argc, argv);
95
96#ifdef USE_DAMARIS
97 st_damaris_ross_init();
98 if (!g_st_ross_rank) // Damaris ranks only
99 return;
100 else
101 {
102#endif
103
104 if(tw_ismaster())
105 {
106 struct stat buffer;
107 int csv_check = stat("ross.csv", &buffer);
108
109 if (NULL == (g_tw_csv = fopen("ross.csv", "a")))
110 tw_error(TW_LOC, "Unable to open: ross.csv\n");
111
112 if (csv_check == -1)
113 {
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,"
120 "buddy_time,");
121#ifdef USE_RIO
122 fprintf(g_tw_csv, "rio_load,rio_init,");
123#endif
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");
129 fprintf(g_tw_csv, "\n");
130 }
131 }
132
134 {
135 if (!g_tw_mynode)
136 printf("RNG Seeds: %d %d %d %d\n",ross_rng_seed1, ross_rng_seed2, ross_rng_seed3, ross_rng_seed4);
137 g_tw_rng_seed = (int32_t*)calloc(4, sizeof(int32_t));
142 }
144 tw_error(TW_LOC, "If using --rng-seed#, all four seeds must be specified\n");
145
147 {
148 if (!g_tw_mynode)
149 printf("Core RNG Seeds: %d %d %d %d\n",ross_core_rng_seed1, ross_core_rng_seed2, ross_core_rng_seed3, ross_core_rng_seed4);
150 g_tw_core_rng_seed = (int32_t*)calloc(4, sizeof(int32_t));
155 }
157 tw_error(TW_LOC, "If using --core-rng-seed#, all four seeds must be specified\n");
158
159 //tw_opt_print();
160
161 tw_net_start();
162 tw_gvt_start();
163#ifdef USE_DAMARIS
164 } // end of if(g_st_ross_rank)
165#endif
166}
167
168static void early_sanity_check(void) {
169 if (!g_tw_nlp) {
170 tw_error(TW_LOC, "need at least one LP");
171 }
172 if (!nkp_per_pe) {
173 tw_printf(TW_LOC, "number of KPs (%u) must be >= 1, adjusting.", g_tw_nkp);
174 g_tw_nkp = 1;
175 }
176}
177
178/*
179 * map: map LPs->KPs->PEs linearly
180 */
181void map_linear(void) {
182
183 unsigned int nlp_per_kp;
184 tw_lpid lpid;
185 tw_kpid kpid;
186 unsigned int j;
187
188 // may end up wasting last KP, but guaranteed each KP has == nLPs
189 nlp_per_kp = (int)ceil((double) g_tw_nlp / (double) g_tw_nkp);
190
191 if(!nlp_per_kp) {
192 tw_error(TW_LOC, "Not enough KPs defined: %d", g_tw_nkp);
193 }
194
196
197#if VERIFY_MAPPING
198 printf("NODE %d: nlp %lld, offset %lld\n", g_tw_mynode, g_tw_nlp, g_tw_lp_offset);
199 printf("\tPE %d\n", g_tw_pe->id);
200#endif
201
202 for(kpid = 0, lpid = 0; kpid < nkp_per_pe; kpid++) {
203 tw_kp_onpe(kpid, g_tw_pe);
204
205#if VERIFY_MAPPING
206 printf("\t\tKP %d", kpid);
207#endif
208
209 for(j = 0; j < nlp_per_kp && lpid < g_tw_nlp; j++, lpid++) {
210 tw_lp_onpe(lpid, g_tw_pe, g_tw_lp_offset+lpid);
211 tw_lp_onkp(g_tw_lp[lpid], g_tw_kp[kpid]);
212
213#if VERIFY_MAPPING
214 if(0 == j % 20) {
215 printf("\n\t\t\t");
216 }
217 printf("%lld ", lpid+g_tw_lp_offset);
218#endif
219 }
220
221#if VERIFY_MAPPING
222 printf("\n");
223#endif
224 }
225
226 if(!g_tw_lp[g_tw_nlp-1]) {
227 tw_error(TW_LOC, "Not all LPs defined! (g_tw_nlp=%d)", g_tw_nlp);
228 }
229
230 if(g_tw_lp[g_tw_nlp-1]->gid != g_tw_lp_offset + g_tw_nlp - 1) {
231 tw_error(TW_LOC, "LPs not sequentially enumerated!");
232 }
233}
234
235void map_round_robin(void) {
236 tw_pe * pe = g_tw_pe; // ASSUMPTION: only 1 pe
237
238 tw_kpid kpid;
239 tw_lpid lpid;
240 unsigned int i;
241
242 // ASSUMPTION: g_tw_nlp is the same on each rank
243 int lp_stride = tw_nnodes();
244 int lp_offset = g_tw_mynode;
245
246 for(i = 0, lpid=lp_offset; i < g_tw_nlp; i++, lpid+=lp_stride) {
247 kpid = i % g_tw_nkp;
248
249 tw_lp_onpe(i, pe, lpid);
250 tw_kp_onpe(kpid, pe);
251 tw_lp_onkp(g_tw_lp[i], g_tw_kp[kpid]);
252
253#if VERIFY_MAPPING
254 printf("LP %4d KP %4d PE %4d\n", lpid, kpid, pe->id);
255#endif
256 }
257}
258
259/**
260 * IMPORTANT: This function sets the value for g_tw_nlp which is a rather
261 * important global variable. It is also set in (very few) other places,
262 * but mainly just here.
263 */
264void tw_define_lps(tw_lpid nlp, size_t msg_sz) {
265 unsigned int i;
266
267 g_tw_nlp = nlp;
268
269 /** We can't assume that every model uses equivalent values for g_tw_nlp across PEs
270 * so let's allreduce here to calculate how many total LPs there are in the sim.
271 */
272 if(MPI_Allreduce(&g_tw_nlp, &g_tw_total_lps, 1, MPI_UINT64_T, MPI_SUM, MPI_COMM_ROSS))
273 tw_error(TW_LOC,"MPI_Allreduce in tw_define_lps() failed: Attempted to calculate total LPs");
274
275 g_tw_msg_sz = msg_sz;
276
278
279 /*
280 * Construct the KP array.
281 */
282 if( g_tw_nkp == 1 && g_tw_synchronization_protocol != OPTIMISTIC_DEBUG ) { // if it is the default, then check with the overide param
284 }
285 // else assume the application overloaded and has BRAINS to set its own g_tw_nkp
286
287 g_tw_kp = (tw_kp **) tw_calloc(TW_LOC, "KPs", sizeof(*g_tw_kp), g_tw_nkp);
288
290 //if (g_tw_mapping == CUSTOM) // analysis LPs currently only supported for custom mapping
291 specialized_lp_setup(); // for ROSS analysis LPs, important for setting g_st_analysis_nlp
292
293 /*
294 * Construct the LP array.
295 */
296 g_tw_lp = (tw_lp **) tw_calloc(TW_LOC, "LPs", sizeof(*g_tw_lp), g_tw_nlp + g_st_analysis_nlp);
297
298 switch(g_tw_mapping) {
299 case LINEAR:
300 map_linear();
301 break;
302
303 case ROUND_ROBIN:
305 break;
306
307 case CUSTOM:
310 } else {
311 tw_error(TW_LOC, "CUSTOM mapping flag set but not custom mapping function! \n");
312 }
313 break;
314
315 default:
316 tw_error(TW_LOC, "Bad value for g_tw_mapping %d \n", g_tw_mapping);
317 }
318
319 //if (g_tw_mapping == CUSTOM)
321
322 // init LP RNG stream(s)
323 for(i = 0; i < g_tw_nlp + g_st_analysis_nlp; i++) {
324 if(g_tw_rng_default == 1) {
326 }
327 }
328
329}
330
331static void late_sanity_check(void) {
332 tw_kpid i;
333 tw_lptype null_type;
334 tw_kp *kp;
335
336 memset(&null_type, 0, sizeof(null_type));
337
338 /* KPs must be mapped . */
339 // should we worry if model doesn't use all defined KPs? probably not.
340 for (i = 0; i < g_tw_nkp; i++) {
341 kp = tw_getkp(i);
342 if( kp == NULL ) {
343 tw_error(TW_LOC, "Local KP %u is NULL \n", i);
344 }
345
346 if (kp->pe == NULL) {
347 tw_error(TW_LOC, "Local KP %u has no PE assigned.", i);
348 }
349 }
350
351 /* LPs KP and PE must agree. */
352 for (i = 0; i < g_tw_nlp + g_st_analysis_nlp; i++) {
353 tw_lp *lp = g_tw_lp[i];
354
355 if (!lp || !lp->pe) {
356 tw_error(TW_LOC, "LP %u has no PE assigned.", i);
357 }
358
359 if (!lp->kp) {
360 tw_error(TW_LOC, "LP not mapped to a KP!");
361 }
362
363 if (lp->pe != lp->kp->pe) {
364 tw_error(TW_LOC, "LP %u has mismatched KP and PE.", lp->id);
365 }
366
367 if (!memcmp(lp->type, &null_type, sizeof(null_type))) {
368 tw_error(TW_LOC, "LP %u has no type.", lp->id);
369 }
370 }
371}
372
373#ifdef USE_BGPM
374unsigned cacheList[] = {
375 PEVT_L2_HITS,
376 PEVT_L2_MISSES,
377 PEVT_L2_FETCH_LINE,
378 PEVT_L2_STORE_LINE,
379};
380
381unsigned instList[] = {
382 PEVT_LSU_COMMIT_CACHEABLE_LDS,
383 PEVT_L1P_BAS_MISS,
384 PEVT_INST_XU_ALL,
385 PEVT_INST_QFPU_ALL,
386 PEVT_INST_QFPU_FPGRP1,
387 PEVT_INST_ALL,
388};
389#endif
390
391void tw_run(void) {
392 tw_pe *me;
393
395
396 me = setup_pes();
397
398 // init instrumentation
399 st_inst_init();
400#ifdef USE_DAMARIS
401 if (g_st_damaris_enabled)
402 st_damaris_inst_init();
403#endif
404
405#ifdef USE_BGPM
406 Bgpm_Init(BGPM_MODE_SWDISTRIB);
407
408 // Create event set and add events needed to calculate CPI,
409 int hEvtSet = Bgpm_CreateEventSet();
410
411 // Change the type here to get the other performance monitor sets -- defaults to instList set
412 // Sets need to be different because there are conflicts when mixing certain events.
413 Bgpm_AddEventList(hEvtSet, instList, sizeof(instList)/sizeof(unsigned) );
414
415 if( me->id == 0) {
416 printf("***************************************************************************************** \n");
417 printf("* NOTICE: Build configured with Blue Gene/Q specific, BGPM performance monitoring code!!* \n");
418 printf("***************************************************************************************** \n");
419 }
420
421 Bgpm_Apply(hEvtSet);
422 Bgpm_Start(hEvtSet);
423#endif
424
425 tw_sched_init(me);
427
429 case SEQUENTIAL: // case 1
431 break;
432
433 case CONSERVATIVE: // case 2
435 break;
436
437 case OPTIMISTIC: // case 3
439 break;
440
441 case OPTIMISTIC_DEBUG: // case 4
443 break;
444
445 case OPTIMISTIC_REALTIME: // case 5
447 break;
448
449 case SEQUENTIAL_ROLLBACK_CHECK: // case 6
451 break;
452
453 default:
454 tw_error(TW_LOC, "No Synchronization Protocol Specified! \n");
455 }
456
457#ifdef USE_BGPM
458 Bgpm_Stop(hEvtSet);
459
460 if( me->id == 0 ) { // Have only RANK 0 output stats
461 int i;
462 uint64_t cnt;
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);
470 }
471 printf("================================= \n");
472 }
473#endif
474}
475
476void tw_end(void) {
477#ifdef USE_DAMARIS
478 if(g_st_ross_rank)
479 {
480#endif
481 if(tw_ismaster()) {
482 fprintf(g_tw_csv, "\n");
483 fclose(g_tw_csv);
484 }
485#ifdef USE_DAMARIS
486 } // end if(g_st_ross_rank)
487#endif
488
490 tw_net_stop();
491}
492
493/**
494 * By the time this function gets called, g_tw_delta_sz should be as large
495 * as it will ever get.
496 */
497static void tw_delta_alloc(tw_pe *pe) {
499
500 pe->delta_buffer[0] = (unsigned char *)tw_calloc(TW_LOC, "Delta buffers", g_tw_delta_sz, 1);
501 pe->delta_buffer[1] = (unsigned char *)tw_calloc(TW_LOC, "Delta buffers", g_tw_delta_sz, 1);
502 pe->delta_buffer[2] = (unsigned char *)tw_calloc(TW_LOC, "Delta buffers", g_tw_delta_sz, 1);
503}
504
505static tw_pe * setup_pes(void) {
506 tw_pe *pe = g_tw_pe;
507
508 unsigned int num_events_per_pe;
509
510 num_events_per_pe = 1 + g_tw_events_per_pe + g_tw_events_per_pe_extra;
511
512 if (!pe) {
513 tw_error(TW_LOC, "No PE configured on this node.");
514 }
515
516 // TODO need to make sure we don't break this stuff
517 if (g_tw_buddy_alloc) {
519 if (g_tw_buddy_master == NULL) {
520 tw_error(TW_LOC, "create_buddy_table() failed.");
521 }
523 }
524 pe->pq = tw_pq_create();
525
526 tw_eventq_alloc(&pe->free_q, num_events_per_pe);
527 pe->abort_event = tw_eventq_shift(&pe->free_q);
528#ifdef USE_RIO
529 int i;
530 tw_clock start = tw_clock_read();
531 for (i = 0; i < g_io_events_buffered_per_rank; i++) {
533 }
534 pe->stats.s_rio_load = (tw_clock_read() - start);
535#endif
536
538 printf("\nROSS Core Configuration: \n");
539 printf("\t%-50s %11u\n", "Total PEs", tw_nnodes());
540 fprintf(g_tw_csv, "%u,", tw_nnodes());
541
542 printf("\t%-50s [Nodes (%u) x KPs (%lu)] %lu\n", "Total KPs", tw_nnodes(), g_tw_nkp, (tw_nnodes() * g_tw_nkp));
543 fprintf(g_tw_csv, "%lu,", (tw_nnodes() * g_tw_nkp));
544
545 printf("\t%-50s %11llu\n", "Total LPs",
547 fprintf(g_tw_csv, "%llu,", g_tw_total_lps);
548
549 printf("\t%-50s %11.2lf\n", "Simulation End Time", g_tw_ts_end);
550 fprintf(g_tw_csv, "%.2lf,", g_tw_ts_end);
551
552
553 switch(g_tw_mapping) {
554 case LINEAR:
555 printf("\t%-50s %11s\n", "LP-to-PE Mapping", "linear");
556 fprintf(g_tw_csv, "%s,", "linear");
557 break;
558
559 case ROUND_ROBIN:
560 printf("\t%-50s %11s\n", "LP-to-PE Mapping", "round robin");
561 fprintf(g_tw_csv, "%s,", "round robin");
562 break;
563
564 case CUSTOM:
565 printf("\t%-50s %11s\n", "LP-to-PE Mapping", "model defined");
566 fprintf(g_tw_csv, "%s,", "model defined");
567 break;
568 }
569 printf("\n");
570
571#ifdef USE_DAMARIS
572 st_damaris_init_print();
573#endif
574
575 // moved these so ross.csv stays consistent
576 fprintf(g_tw_csv, "%d,", num_events_per_pe);
577 fprintf(g_tw_csv, "%d,", g_tw_gvt_threshold);
578 fprintf(g_tw_csv, "%d,", g_tw_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);
582
583 printf("\t%-50s %11d\n", "Network events", g_tw_gvt_threshold);
584
585 printf("\t%-50s %11d\n", "Total events", g_tw_events_per_pe);
586 printf("\n");
587#endif
588 }
589 return pe;
590}
591
592// This is the default lp type mapping function
593// valid ONLY if there is one lp type
595 (void) gid;
596 return 0;
597}
tw_pe * pe
Definition avl_tree.c:10
#define ROSS_VERSION
Definition config.h:11
buddy_list_bucket_t * create_buddy_table(unsigned int power_of_two)
Definition buddy.c:288
static tw_clock tw_clock_read(void)
Definition aarch64.h:8
uint64_t tw_clock
Definition aarch64.h:6
const tw_optdef * st_special_lp_opts(void)
void st_inst_init(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)
Definition lz4.c:372
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.
Definition network-mpi.c:66
unsigned tw_nnodes(void)
MPI_Comm MPI_COMM_ROSS
Definition network-mpi.c:4
tw_pq * tw_pq_create(void)
Definition splay.c:56
const tw_optdef io_opts[3]
Definition io-mpi.c:12
int g_io_events_buffered_per_rank
Definition io-mpi.c:23
tw_eventq g_io_free_events
Definition io-mpi.c:25
uint64_t tw_lpid
Definition ross-base.h:49
void * tw_calloc(const char *file, int line, const char *for_who, size_t e_sz, size_t n)
Definition tw-util.c:206
unsigned int g_tw_gvt_threshold
Definition ross-global.c:84
buddy_list_bucket_t * g_tw_buddy_master
Definition ross-global.c:40
tw_seed g_tw_rng_seed
Definition ross-global.c:34
void tw_rand_init_streams(tw_lp *lp, unsigned int nstreams, unsigned int n_core_streams)
Definition rand-clcg4.c:329
unsigned int g_tw_events_per_pe_extra
Definition ross-global.c:82
void tw_scheduler_optimistic(tw_pe *me)
Definition tw-sched.c:922
const tw_optdef * tw_clock_setup()
Definition aarch64.c:20
tw_pe * g_tw_pe
Definition ross-global.c:79
tw_lp ** g_tw_lp
Definition ross-global.c:28
unsigned int g_tw_lz4_knob
Definition ross-global.c:45
tw_kpid g_tw_nkp
Definition ross-global.c:27
unsigned int g_tw_events_per_pe
Definition ross-global.c:80
tw_kp ** g_tw_kp
Definition ross-global.c:29
void tw_error(const char *file, int line, const char *fmt,...)
Definition tw-util.c:77
map_custom_f g_tw_custom_initial_mapping
Definition ross-global.c:21
tw_peid g_tw_mynode
Definition ross-global.c:92
uint32_t g_tw_buddy_alloc
Definition ross-global.c:39
void tw_scheduler_sequential_rollback_check(tw_pe *me)
Definition tw-sched.c:1111
FILE * g_tw_csv
Definition ross-global.c:95
unsigned int g_tw_nRNG_per_lp
Definition ross-global.c:31
size_t g_tw_msg_sz
Definition ross-global.c:37
unsigned int g_tw_nRNG_core_per_lp
Definition ross-global.c:32
tw_lpid g_tw_rng_default
Definition ross-global.c:33
void tw_printf(const char *file, int line, const char *fmt,...)
Definition tw-util.c:64
tw_seed g_tw_core_rng_seed
Definition ross-global.c:35
tw_lp_map g_tw_mapping
Definition ross-global.c:22
void tw_kp_onpe(tw_kpid id, tw_pe *pe)
Definition tw-kp.c:4
void tw_scheduler_conservative(tw_pe *me)
Definition tw-sched.c:778
void tw_lp_onkp(tw_lp *lp, tw_kp *kp)
Definition tw-lp.c:73
tw_lpid g_tw_nlp
Definition ross-global.c:24
tw_lpid g_tw_total_lps
Definition ross-global.c:25
tw_peid g_tw_masternode
Definition ross-global.c:93
void tw_scheduler_optimistic_realtime(tw_pe *me)
Definition tw-sched.c:972
uint32_t g_tw_avl_node_count
Definition ross-global.c:41
size_t g_tw_delta_sz
Definition ross-global.c:38
unsigned int g_tw_mblock
Definition ross-global.c:66
void tw_scheduler_optimistic_debug(tw_pe *me)
Definition tw-sched.c:1028
void tw_scheduler_sequential(tw_pe *me)
Definition tw-sched.c:691
tw_synch g_tw_synchronization_protocol
Definition ross-global.c:19
double g_tw_lookahead
Definition ross-global.c:53
void tw_sched_init(tw_pe *me)
Definition tw-sched.c:477
tw_lpid g_tw_lp_offset
Definition ross-global.c:26
unsigned long long g_tw_max_opt_lookahead
Definition ross-global.c:68
double g_tw_ts_end
Definition ross-global.c:72
void tw_lp_onpe(tw_lpid index, tw_pe *pe, tw_lpid id)
Definition tw-lp.c:57
#define TW_LOC
void tw_gvt_start(void)
void tw_gvt_finish(void)
const tw_optdef * tw_gvt_setup(void)
static int tw_ismaster(void)
static tw_kp * tw_getkp(tw_kpid id)
tw_peid tw_kpid
Definition ross-types.h:55
@ CUSTOM
Definition ross-types.h:50
@ ROUND_ROBIN
Definition ross-types.h:49
@ LINEAR
Definition ross-types.h:48
@ OPTIMISTIC_REALTIME
Definition ross-types.h:41
@ SEQUENTIAL
Definition ross-types.h:37
@ CONSERVATIVE
Definition ross-types.h:38
@ OPTIMISTIC
Definition ross-types.h:39
@ SEQUENTIAL_ROLLBACK_CHECK
Definition ross-types.h:42
@ OPTIMISTIC_DEBUG
Definition ross-types.h:40
static void tw_eventq_push(tw_eventq *q, tw_event *e)
Definition tw-eventq.h:281
static void tw_eventq_alloc(tw_eventq *q, unsigned int cnt)
Definition tw-eventq.h:210
static tw_event * tw_eventq_shift(tw_eventq *q)
Definition tw-eventq.h:377
static tw_event * tw_eventq_pop(tw_eventq *q)
Definition tw-eventq.h:313
#define TWOPT_UINT(n, v, h)
Definition tw-opts.h:33
#define TWOPT_GROUP(h)
Definition tw-opts.h:30
#define TWOPT_ULONGLONG(n, v, h)
Definition tw-opts.h:32
#define TWOPT_END()
Definition tw-opts.h:39
void tw_opt_parse(int *argc, char ***argv)
Definition tw-opts.c:552
void tw_opt_add(const tw_optdef *options)
Definition tw-opts.c:23
#define TWOPT_DOUBLE(n, v, h)
Definition tw-opts.h:35
#define TWOPT_ARGSFILE(n, v, h)
Definition tw-opts.h:37
tw_pe * pe
PE that services this KP.
Definition ross-types.h:379
LP State Structure.
Definition ross-types.h:336
tw_pe * pe
Definition ross-types.h:340
tw_kp * kp
kp – Kernel process that we belong to (must match pe).
Definition ross-types.h:345
tw_lptype * type
Type of this LP, including service callbacks.
Definition ross-types.h:348
tw_lpid id
local LP id
Definition ross-types.h:337
Function Pointers for ROSS Event Handlers.
Definition ross-types.h:97
Holds the entire PE state.
Definition ross-types.h:416
tw_peid id
Definition ross-types.h:417
tw_statistics stats
per PE counters
Definition ross-types.h:463
tw_clock s_init
Definition ross-types.h:145
static int32_t ross_core_rng_seed1
Definition tw-setup.c:21
tw_lpid map_onetype(tw_lpid gid)
Definition tw-setup.c:594
static int32_t ross_rng_seed3
Definition tw-setup.c:18
static tw_pe * setup_pes(void)
Definition tw-setup.c:505
static const tw_optdef kernel_options[]
Definition tw-setup.c:27
static char * ross_args_file
Definition tw-setup.c:25
static tw_clock init_start
Definition tw-setup.c:14
void tw_run(void)
Definition tw-setup.c:391
void tw_init(int *argc, char ***argv)
Definition tw-setup.c:53
static void tw_delta_alloc(tw_pe *pe)
Definition tw-setup.c:497
static void late_sanity_check(void)
Definition tw-setup.c:331
static int32_t ross_core_rng_seed4
Definition tw-setup.c:24
static int32_t ross_core_rng_seed2
Definition tw-setup.c:22
void map_round_robin(void)
Definition tw-setup.c:235
static void early_sanity_check(void)
Definition tw-setup.c:168
void tw_end(void)
Definition tw-setup.c:476
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
void tw_define_lps(tw_lpid nlp, size_t msg_sz)
Definition tw-setup.c:264
static int32_t ross_rng_seed2
Definition tw-setup.c:17
void map_linear(void)
Definition tw-setup.c:181
static int32_t ross_rng_seed1
Definition tw-setup.c:16