示例#1
0
static tw_stime mult = 1.4;
static tw_stime percent_remote = 0.25;
static unsigned int ttl_lps = 0;
static unsigned int nlp = 8;
static int g_phold_start_events = 1;
static int optimistic_memory = 100;
static char run_id[1024] = "undefined";

// rate for timestamp exponential distribution
static tw_stime mean = 1.0;

const tw_optdef phold_opts[] =
{
	TWOPT_GROUP("PHOLD Model"),
	TWOPT_STIME("remote", percent_remote, "desired remote event rate"),
	TWOPT_UINT("nlp", nlp, "number of LPs per processor"),
	TWOPT_STIME("mean", mean, "exponential distribution mean for timestamps"),
	TWOPT_STIME("mult", mult, "multiplier for event memory allocation"),
	TWOPT_UINT("start-events", g_phold_start_events, "number of initial messages per LP"),
	TWOPT_UINT("memory", optimistic_memory, "additional memory buffers"),
	TWOPT_CHAR("run", run_id, "user supplied run name"),
	TWOPT_END()
};

void
phold_md_opts()
{
	tw_opt_add(phold_opts);
}

void
示例#2
0
文件: torus.c 项目: wilseypa/ROSS
     tw_lp_onkp(g_tw_lp[i], g_tw_kp[kpid]);
     tw_lp_settype(i, &nodes_lps[0]);
   }
  for(i = 0; i < nlp_mpi_procs_per_pe; i++)
   {
     kpid = i % g_tw_nkp;
     pe = tw_getpe(kpid % g_tw_npe);
     tw_lp_onpe(nlp_nodes_per_pe+i, pe, N_nodes + g_tw_mynode * nlp_mpi_procs_per_pe + i + getRem() );
     tw_lp_onkp(g_tw_lp[nlp_nodes_per_pe + i], g_tw_kp[kpid]);
     tw_lp_settype(nlp_nodes_per_pe + i, &nodes_lps[1]);
   }
}
const tw_optdef app_opt [] =
{
	TWOPT_GROUP("Nodes Model"),
	TWOPT_UINT("memory", opt_mem, "optimistic memory"),
	TWOPT_UINT("vc_size", vc_size, "VC size"),
	TWOPT_ULONG("mpi-message-size", mpi_message_size, "mpi-message-size"),
	TWOPT_UINT("mem_factor", mem_factor, "mem_factor"),
	TWOPT_CHAR("traffic", traffic_str, "uniform, nearest, diagonal"), 
	TWOPT_STIME("injection_interval", injection_interval, "messages are injected during this interval only "),
	TWOPT_STIME("link_bandwidth", link_bandwidth, " link bandwidth per channel "),
	TWOPT_STIME("arrive_rate", MEAN_INTERVAL, "packet arrive rate"),
	TWOPT_END()
};


int
main(int argc, char **argv, char **env)
{
	int i;
示例#3
0
文件: bgp.c 项目: chleemobile/rossnet
/*
 *  Blue Gene/P model
 *  Header file
 *  by Ning Liu 
 */

#include "bgp.h"

const tw_optdef app_opt [] =
{
  TWOPT_GROUP("BGP Model"),
  TWOPT_UINT("memory", opt_mem, "optimistic memory"),
  TWOPT_UINT("numfs", N_FS_active, "number of file server active"),
  TWOPT_UINT("numion", N_ION_active, "number of ION active"),
  TWOPT_UINT("burst", burst_buffer_on, "burst buffer button"),
  TWOPT_END()
};

tw_peid bgp_mapping( tw_lpid gid)
{
  return (tw_peid)gid/g_tw_nlp;
  //return (tw_peid)gid%tw_nnodes();
}

tw_lptype mylps[] =
  {
    {
      (init_f) bgp_cn_init,
      (event_f) bgp_cn_eventHandler,
      (revent_f) bgp_cn_eventHandler_rc,
      (final_f) bgp_cn_finish,
示例#4
0
#include <ip.h>

const tw_optdef ip_opts[] =
{
	TWOPT_GROUP("IPv4 Model"),
	TWOPT_UINT("ip-log", g_ip_log_on, "turn on logging"),
	TWOPT_END()
};

void
ip_md_init(int argc, char ** argv, char ** env)
{
	//int	 i;

	char	 log[1024];

	g_ip_stats = tw_calloc(TW_LOC, "", sizeof(ip_stats), 1);

	// in secs..
	g_ip_minor_interval = 60;
	g_ip_major_interval = 86400;

	tw_opt_add(ip_opts);

	if(g_ip_log_on)
	{
		sprintf(log, "%s/ip.log", g_rn_logs_dir);
		g_ip_log = fopen(log, "w");

		if(!g_ip_log)
			tw_error(TW_LOC, "Unable to open: %s \n", log);
示例#5
0
tw_lptype       rm_lps[] = {
{
	 (init_f) _rm_init,
	 (event_f) _rm_event_handler,
	 (revent_f) _rm_rc_event_handler,
	 (final_f) _rm_final,
	 (map_f) _rm_map,
	 sizeof(rm_state)},
	{0},
};

static unsigned int optimistic_memory = 0;

static const tw_optdef rm_options [] =
{
	TWOPT_UINT("memory", optimistic_memory, "Additional memory buffers"),
	TWOPT_STIME("threshold", g_rm_wave_threshold, "Wave propagation threshold"),
	TWOPT_CHAR("scenario", g_rm_spatial_scenario_fn, "Path to scenario files"),
	TWOPT_END()
};

void
rm_init(int * argc, char *** argv)
{
	/*
	 * Default Global Variables
	 */
	strcpy(g_rm_spatial_scenario_fn, "scenario");

	// add command line options
	tw_opt_add(rm_options);
示例#6
0
#include <rp.h>

static const tw_optdef rp_options [] =
{
	TWOPT_UINT("rw-min", g_rp_mu, "random walk min change dir"),
	TWOPT_UINT("rw-max", g_rp_distr_sd, "random walk max change dir"),
	TWOPT_STIME("wave-percent", percent_wave, "percentage of waves per move"),
	TWOPT_END()
};

void
rp_md_opts()
{
	tw_opt_add(rp_options);
}
	
void
rp_md_init(int argc, char ** argv, char ** env)
{
	int	 nbufs;

	g_rp_stats = tw_calloc(TW_LOC, "", sizeof(*g_rp_stats), 1);

	nbufs = 1000000 / g_tw_nkp;
	nbufs = 10000 / g_tw_nkp;

	g_rp_fd = tw_memory_init(nbufs, sizeof(rp_message), 1);

	if(tw_ismaster())
	{
		printf("\nInitializing Model: Random Walk\n");
示例#7
0
#define EVENT_TAG 1

#define EVENT_SIZE(e) g_tw_event_msg_sz

static struct act_q posted_sends;
static struct act_q posted_recvs;
static tw_eventq outq;

static unsigned int read_buffer = 16;
static unsigned int send_buffer = 1024;
static int world_size = 1;

static const tw_optdef mpi_opts[] = {
  TWOPT_GROUP("ROSS MPI Kernel"),
  TWOPT_UINT(
	     "read-buffer",
	     read_buffer,
	     "network read buffer size in # of events"),
  TWOPT_UINT(
	     "send-buffer",
	     send_buffer,
	     "network send buffer size in # of events"),
  TWOPT_END()
};

// Forward declarations of functions used in MPI network message processing
static int recv_begin(tw_pe *me);
static void recv_finish(tw_pe *me, tw_event *e, char * buffer);
static int send_begin(tw_pe *me);
static void send_finish(tw_pe *me, tw_event *e, char * buffer);

// Start of implmentation of network processing routines/functions
示例#8
0
文件: phold.c 项目: nmcglohon/ROSS
    return;
}

st_model_types model_types[] = {
    {(ev_trace_f) event_trace,
     0,
    (model_stat_f) phold_stats_collect,
    sizeof(int)},
    {0}
};

const tw_optdef app_opt[] =
{
	TWOPT_GROUP("PHOLD Model"),
	TWOPT_STIME("remote", percent_remote, "desired remote event rate"),
	TWOPT_UINT("nlp", nlp_per_pe, "number of LPs per processor"),
	TWOPT_STIME("mean", mean, "exponential distribution mean for timestamps"),
	TWOPT_STIME("mult", mult, "multiplier for event memory allocation"),
	TWOPT_STIME("lookahead", lookahead, "lookahead for events"),
	TWOPT_UINT("start-events", g_phold_start_events, "number of initial messages per LP"),
	TWOPT_UINT("stagger", stagger, "Set to 1 to stagger event uniformly across 0 to end time."),
	TWOPT_UINT("memory", optimistic_memory, "additional memory buffers"),
	TWOPT_CHAR("run", run_id, "user supplied run name"),
	TWOPT_END()
};

int
main(int argc, char **argv, char **env)
{

#ifdef TEST_COMM_ROSS
示例#9
0
	{
	 (init_f) tcp_router_StartUp,
     (pre_run_f) NULL,
	 (event_f) tcp_router_EventHandler,
	 (revent_f) tcp_router_rc_EventHandler,
	 (final_f) tcp_router_Statistics_CollectStats,
	 (map_f) NULL,
      sizeof(Router_State)},
	{0},
};

const tw_optdef app_opt[] =
{
	TWOPT_GROUP("TCP Model"),
	TWOPT_STIME("remote-link", percent_remote, "desired remote TCP connectionsevent rate"),
	TWOPT_UINT("network-bits", nlp_per_model, "number of 2^bits is number of LPs in whole system"),
	TWOPT_STIME("mean", mean, "exponential distribution mean for timestamps"),
	TWOPT_STIME("mult", mult, "multiplier for event memory allocation"),
	TWOPT_STIME("lookahead", lookahead, "lookahead for links"),
	TWOPT_UINT("memory", optimistic_memory, "additional memory buffers"),
	TWOPT_CHAR("run", run_id, "user supplied run name"),
	TWOPT_END()
};

extern tcpStatistics TWAppStats;

int
main(int argc, char **argv)
{
  int i;
  tw_lp          *lp;
示例#10
0
tw_lptype olsr_lps[] = {
    {
        (init_f) olsr_init,
        (event_f) olsr_event,
        (revent_f) NULL,
        (final_f) olsr_final,
        (map_f) olsr_map,
        sizeof(node_state)
    },
    { 0 },
};

const tw_optdef olsr_opts[] = {
    TWOPT_GROUP("OLSR Model"),
    TWOPT_UINT("lp_per_pe", nlp_per_pe, "number of LPs per processor"),
    TWOPT_END(),
};

int main(int argc, char *argv[])
{
    int i;
    
    g_tw_events_per_pe = nlp_per_pe * nlp_per_pe * 1;
    
    tw_opt_add(olsr_opts);
    
    tw_init(&argc, &argv);
    
    tw_define_lps(nlp_per_pe, sizeof(olsr_msg_data), 0);
    
示例#11
0
static unsigned int gvt_cnt;
static tw_stime secs = 0.1;
static tw_stime delta_t = 0.01;
static unsigned int CPU = 1998;

static int TW_PARALLEL = 0;
static int TW_DISTRIBUTED = 0;

static const tw_optdef gvt_opts [] =
{
	TWOPT_GROUP("ROSS 7 O'clock GVT"),
	TWOPT_STIME("report-interval", gvt_print_interval, 
			"percent of runtime to print GVT"),
	TWOPT_STIME("delta_t", delta_t, "Max event send time (secs)"),
	TWOPT_STIME("clock-interval", secs, "GVT clock interval (in secs)"),
	TWOPT_UINT("clock-speed", CPU, "CPU clock speed (in MHz)"),
	TWOPT_UINT("gvt-interval", g_tw_gvt_interval, "GVT interval (shm only)"),
	TWOPT_END()
};

void
tw_gvt_stats(FILE * f)
{
	fprintf(f, "TW GVT Settings: Seven O'clock\n");
	fprintf(f, "\t%-50s %11.2lf (secs)\n", "GVT Clock Interval", secs);
	fprintf(f, "\t%-50s %11d\n", "GVT Interval", g_tw_gvt_interval);
	fprintf(f, "\t%-50s %11d\n", "Batch Size", g_tw_mblock);
	fprintf(f, "\n");
	fprintf(f, "TW GVT Statistics: Seven O'clock\n");
	fprintf(f, "\t%-50s %11d\n", "Total GVT Computations", g_tw_gvt_done);
}
示例#12
0
{
	{
		(init_f) torus_init,
		(event_f) event_handler,
		(revent_f) rc_event_handler,
		(final_f) final,
		(map_f) mapping,
		sizeof(nodes_state),
	},
	{0},
};

const tw_optdef app_opt [] =
{
	TWOPT_GROUP("Nodes Model"),
	TWOPT_UINT("memory", opt_mem, "optimistic memory"),
	//TWOPT_STIME("arrive-rate", ARRIVAL_RATE, "packet arrive rate"),
	TWOPT_END()
};


int
main(int argc, char **argv, char **env)
{
	int i;
	tw_opt_add(app_opt);
	tw_init(&argc, &argv);

	for (i=0; i<N_dims; i++)
	  N_nodes*=dim_length[i];
示例#13
0
#include <ross.h>

#define TW_GVT_NORMAL 0
#define TW_GVT_COMPUTE 1

static unsigned int g_tw_gvt_max_no_change = 10000;
static unsigned int g_tw_gvt_no_change = 0;
static tw_stat all_reduce_cnt = 0;
static unsigned int gvt_cnt = 0;
static unsigned int gvt_force = 0;

static const tw_optdef gvt_opts [] =
{
	TWOPT_GROUP("ROSS MPI GVT"),
	TWOPT_UINT("gvt-interval", g_tw_gvt_interval, "GVT Interval: Iterations through scheduling loop (synch=1,2,3,4), or ms between GVTs (synch=5)"),
	TWOPT_STIME("report-interval", gvt_print_interval,
			"percent of runtime to print GVT"),
	TWOPT_END()
};

tw_stat st_get_allreduce_count()
{
    return all_reduce_cnt;
}

const tw_optdef *
tw_gvt_setup(void)
{
	gvt_cnt = 0;

	return gvt_opts;
示例#14
0
#include <ross.h>
#include "lz4.h"

/**
 * @file tw-setup.c
 * @brief tw_define_lps is defined here!
 */

#define VERIFY_MAPPING 0

static tw_pe *setup_pes(void);
unsigned int nkp_per_pe = 16;

static const tw_optdef kernel_options[] = {
    TWOPT_GROUP("ROSS Kernel"),
    TWOPT_UINT("synch", g_tw_synchronization_protocol, "Sychronization Protocol: SEQUENTIAL=1, CONSERVATIVE=2, OPTIMISTIC=3, OPTIMISTIC_DEBUG=4"),
    TWOPT_UINT("nkp", nkp_per_pe, "number of kernel processes (KPs) per pe"),
    TWOPT_STIME("end", g_tw_ts_end, "simulation end timestamp"),
    TWOPT_UINT("batch", g_tw_mblock, "messages per scheduler block"),
    TWOPT_UINT("extramem", g_tw_events_per_pe_extra, "Number of extra events allocated per PE."),
    TWOPT_UINT("buddy-size", g_tw_buddy_alloc, "delta encoding buddy system allocation (2^X)"),
    TWOPT_UINT("lz4-knob", g_tw_lz4_knob, "LZ4 acceleration factor (higher = faster)"),
#ifdef AVL_TREE
    TWOPT_UINT("avl-size", g_tw_avl_node_count, "AVL Tree contains 2^avl-size nodes"),
#endif
    TWOPT_END()
};

void tw_init(int *argc, char ***argv) {
    int i;
#if HAVE_CTIME
示例#15
0
文件: epi.c 项目: chleemobile/rossnet
	 (event_f) epi_event_handler,
	 (revent_f) epi_rc_event_handler,
	 (final_f) epi_final,
	 (map_f) epi_map,
	 sizeof(epi_state)},
	{0},
};

const tw_optdef app_opt[] =
{
	TWOPT_GROUP("EPI Model: "),

	// output files
	TWOPT_CHAR("positions", g_epi_position_fn, "Agent position output file"),
	TWOPT_CHAR("hospital-output", g_epi_hospital_fn, "Hospital output file name"),
	TWOPT_UINT("report-int", g_epi_mod, "Reporting Interval"),

	// agent parameters
	TWOPT_STIME("sick-rate", g_epi_sick_rate, "Probability agents start sick"),
	TWOPT_CHAR("worried-well", g_epi_ww_rate, "Probability agents are worried well"),
	TWOPT_STIME("wwell-thresh", g_epi_ww_threshold, "Worried well threshold"),
	TWOPT_UINT("wwell-dur", g_epi_ww_duration, "Worried well duration"),
	TWOPT_STIME("work-while-sick", g_epi_wws_rate, "Probability agents work while sick"),

	// init model algorithmically
	TWOPT_GROUP("EPI Model: initialize algorithmically (default mode)"),
	TWOPT_UINT("nagents", g_epi_nagents, "number of agents per location per CPU"),
	TWOPT_ULONG("nlocations", g_tw_nlp, "number of locations per region per CPU"),
	TWOPT_UINT("nregions", g_epi_nregions, "number of regions per CPU"),
	TWOPT_UINT("mean", g_epi_mean, "exponential mean for location durations (secs)"),
示例#16
0
#include <ross.h>

#define TW_GVT_NORMAL 0
#define TW_GVT_COMPUTE 1

static unsigned int g_tw_gvt_max_no_change = 10000;
static unsigned int g_tw_gvt_no_change = 0;
static tw_stat all_reduce_cnt = 0;
static unsigned int gvt_cnt = 0;
static unsigned int gvt_force = 0;

static const tw_optdef gvt_opts [] =
{
	TWOPT_GROUP("ROSS MPI GVT"),
	TWOPT_UINT("gvt-interval", g_tw_gvt_interval, "GVT Interval"),
	TWOPT_STIME("report-interval", gvt_print_interval, 
				"percent of runtime to print GVT"),
	TWOPT_END()
};

const tw_optdef *
tw_gvt_setup(void)
{
	gvt_cnt = 0;
	
	return gvt_opts;
}

void
tw_gvt_start(void)
{
示例#17
0
文件: tw-setup.c 项目: wilseypa/ROSS
// needed for CTIME
#include "config.h"

/**
 * @file tw-setup.c
 * @brief tw_define_lps is defined here!
 */

#define VERIFY_MAPPING 0

static tw_pe *setup_pes(void);
unsigned int nkp_per_pe = 16;

static const tw_optdef kernel_options[] = {
	TWOPT_GROUP("ROSS Kernel"),
	TWOPT_UINT("synch", g_tw_synchronization_protocol, 
		   "Sychronization Protocol: SEQUENTIAL=1, CONSERVATIVE=2, OPTIMISTIC=3, OPTIMISTIC_DEBUG=4"),
	TWOPT_UINT("nkp", nkp_per_pe, "number of kernel processes (KPs) per pe"),
	TWOPT_STIME("end", g_tw_ts_end, "simulation end timestamp"),
	TWOPT_UINT("batch", g_tw_mblock, "messages per scheduler block"),
    TWOPT_UINT("extramem", g_tw_events_per_pe_extra,
               "Number of extra events allocated per PE."),
	TWOPT_END()
};

void
tw_init(int *argc, char ***argv)
{
        int i;
#if HAVE_CTIME
        time_t raw_time;
#endif
示例#18
0
#include <tlm.h>

static FILE	*g_tlm_output_f = NULL;

static const tw_optdef tlm_options [] =
{
	TWOPT_GROUP("Transmission Line Matrix Model"),
	TWOPT_UINT("memory", g_tlm_optmem, "Additional memory buffers"),
	TWOPT_STIME("threshold", g_tlm_wave_threshold, "Wave propagation threshold"),
	TWOPT_END()
};

void
tlm_md_opts()
{
	tw_opt_add(tlm_options);
}

void
tlm_md_init(int argc, char ** argv, char ** env)
{
	tw_lpid		 nlp_grid;

	int		 i;

	if(!g_rn_environment)
		return;

	g_tlm_stats = tw_calloc(TW_LOC, "", sizeof(*g_tlm_stats), 1);

	// g_tlm_output_fix up global variables
    tw_lp * lp);

tw_lptype svr_lp = {
    (init_f) svr_init,
    (pre_run_f) NULL,
    (event_f) svr_event,
    (revent_f) svr_rev_event,
    (final_f)  svr_finalize,
    (map_f) codes_mapping,
    sizeof(svr_state),
};

const tw_optdef app_opt [] =
{
        TWOPT_GROUP("Model net synthetic traffic " ),
	TWOPT_UINT("traffic", traffic, "UNIFORM RANDOM=1, NEAREST NEIGHBOR=2 "),
	TWOPT_STIME("arrival_time", arrival_time, "INTER-ARRIVAL TIME"),
        TWOPT_END()
};

const tw_lptype* svr_get_lp_type()
{
            return(&svr_lp);
}

static void svr_add_lp_type()
{
  lp_type_register("server", svr_get_lp_type());
}

static void issue_event(