ROSS
specialized-lps.c
Go to the documentation of this file.
1 #include "ross.h"
2 #include "analysis-lp.h"
3 
4 /*
5  * This file is for general set up functions related to setting up any
6  * ROSS specialized LPs.
7  *
8  * TODO add some output on these LPs, add some counters that can be subtracted from other counters, so we're not including this in the model info
9  */
10 
13 int g_st_sample_count = 65536;
14 
17 
19 {
22  {
25  }
26  else
27  return;
28 
29  // determine total LPs used by model and assign value to analysis_start_gid
31  MPI_Allreduce(&g_tw_nlp, &g_st_total_model_lps, 1, MPI_UNSIGNED_LONG_LONG, MPI_SUM, MPI_COMM_ROSS);
32  else
34 
36  g_st_analysis_nlp = g_tw_nkp; // # of analysis LPs per PE
37 
38 
39 }
40 
42 {
43  tw_lpid lpid;
44  for(lpid = 0; lpid < g_st_analysis_nlp; lpid++)
45  {
46  tw_lp_onpe(g_tw_nlp + lpid, g_tw_pe, analysis_start_gid + g_tw_mynode * g_st_analysis_nlp + lpid);
47  tw_lp_onkp(g_tw_lp[g_tw_nlp + lpid], g_tw_kp[lpid]); // analysis lpid == kpid
49  }
50 }
51 
53 {
54  // has to be set at beginning of tw_run, in case model changes g_tw_ts_end between calling tw_init and tw_run
55  if (g_st_sampling_end == 0)
57 }
58 
60 {
61  TWOPT_GROUP("Specialized ROSS LPs"),
62  //TWOPT_UINT("analysis-lps", g_st_use_analysis_lps, "Set to 1 to turn on analysis LPs (1 per KP) for virtual time sampling"),
63  TWOPT_UINT("sample-count", g_st_sample_count, "Number of samples to allocate in memory"),
64  TWOPT_END()
65 };
66 
68 {
69  return special_lp_opt;
70 }
tw_synch g_tw_synchronization_protocol
Definition: ross-global.c:18
tw_lp ** g_tw_lp
Definition: ross-global.c:26
double g_tw_ts_end
Definition: ross-global.c:68
int g_st_engine_stats
MPI_Comm MPI_COMM_ROSS
Definition: network-mpi.c:4
tw_lpid analysis_start_gid
tw_lpid g_tw_nlp
Definition: ross-global.c:23
void tw_lp_onpe(tw_lpid index, tw_pe *pe, tw_lpid id)
Definition: tw-lp.c:57
uint64_t tw_lpid
Definition: ross.h:160
void specialized_lp_setup()
tw_lpid g_st_analysis_nlp
int g_st_use_analysis_lps
void st_analysis_lp_settype(tw_lpid lpid)
Definition: analysis-lp.c:300
const tw_optdef special_lp_opt[]
void specialized_lp_run()
tw_peid g_tw_mynode
Definition: ross-global.c:88
double g_st_sampling_end
#define TWOPT_UINT(n, v, h)
Definition: tw-opts.h:30
tw_lpid g_st_total_model_lps
#define TWOPT_END()
Definition: tw-opts.h:35
void tw_lp_onkp(tw_lp *lp, tw_kp *kp)
Definition: tw-lp.c:73
const tw_optdef * st_special_lp_opts(void)
int g_st_model_stats
tw_pe * g_tw_pe
Definition: ross-global.c:75
#define TWOPT_GROUP(h)
Definition: tw-opts.h:27
int g_st_sample_count
tw_kpid g_tw_nkp
Definition: ross-global.c:25
void specialized_lp_init_mapping()
void st_buffer_init(int type)
tw_kp ** g_tw_kp
Definition: ross-global.c:27