INSEE 05.04.2011
Interconnection Nertworks Simulation and Evaluation Environment
Defines | Functions | Variables
C:/cygwin/home/Javier/insee/src/main.c File Reference

Main function of the FSIN simulator. More...

#include <stdio.h>
#include <string.h>
#include <time.h>
#include "globals.h"
#include "packet.h"
Include dependency graph for main.c:

Functions

int main (int argc, char *argv[])

Variables

long r_seed
 Random Seed.
double load
 The provided injected load.
double trigger_rate
 Probability to trigger new packets when a packet is received.
long trigger_max
 Maximum of packets triggered.
long trigger_min
 Minimum of packets triggered.
long trigger_dif
 Random interval == 1 + trigger_max - trigger_min.
long ndim
long radix
 Radix of each router.
long nstages
 Number of stages for indirect topologies.
long stDown
 Number of links down in a slim/thin tree. It also refeers to the number of nodes attached to a switching element in fattree and indirect cube .
long stUp
 Number of links up in a slim tree.
long NUMNODES
 Total number of nodes.
long n_ports
 Total number of ports in each router.
long nprocs
 Total number nodes that are able to inject.
long nodes_x
 Nodes in dimension X.
long nodes_y
 Nodes in dimension Y.
long nodes_z
 Nodes in dimension Z.
long nchan
 Number of Virtual Channels.
long nways
 Number of ways. (unidir. / bidir.)
long ninj
 Number of injectors in each router.
long pkt_len
 Length of FSIN packets in phits.
long phit_size
 Size, in bytes, of a phit. Used in application-driven simulation for splitting mpi messages into packets.
long buffer_cap
 Transit buffer capacity (in packets).
long binj_cap
 Injection buffer capacity (in packets).
long pnodes_x
 Nodes in dimension X of the submesh for icube placement.
long pnodes_y
 Nodes in dimension Y of the submesh for icube placement.
long pnodes_z
 Nodes in dimension Z of the submesh for icube placement.
long faults
 Number of broken links.
long tr_ql
long inj_ql
traffic_pattern_t pattern
topo_t topo
vc_management_t vc_management
routing_t routing
req_mode_t req_mode
arb_mode_t arb_mode
cons_mode_t cons_mode
inj_mode_t inj_mode
placement_t placement
long shift
 Number of places for shift placement.
long trace_nodes
 Number of tasks in the trace.
long trace_instances
 Number of instances of the trace to simulate.
char placefile [128]
bool_t parallel_injection
 Allows/Disallows the parallel injection (inject some packets in the same cycle & router).
long bub_adap [2]
 Bubble to adaptive channels.
long bub_x
 Bubble to X Dimension Escape Channels. Usually equal to Y,Z.
long bub_y
 Bubble to Y Dimension Escape Channels. Usually equal to X,Z.
long bub_z
 Bubble to Z Dimension Escape Channels. Usually equal to X,Y.
double intransit_pr
 Priority given to in-transit traffic.
double global_cc
 Global congestion control. Percent of the system recurses used.
long update_period
 Period taken to calculate the global ocupation.
unsigned long timeout_upper_limit
 Timeout limit to enter in congested mode.
unsigned long timeout_lower_limit
 Timeout limit to leave congested mode.
long monitored
 Monitored node.
long plevel
long pinterval
 Interval to print information about the system state.
long pheaders
long bheaders
bool_t extract
 Extract packets from head of the injection queue when they cannot be injected.
bool_t drop_packets
 Drop packets that have no room in the injection queue.
bool_t shotmode
 Are the system running in shotmode.
long shotsize
 Size of each shot (in packets per node)
long total_shot_size
 Number of packets in each shot.
long msglength
 The length of the long messages (in packets) for bimodal traffic.
double lm_prob
 Probability of inject a long message in bimodal traffic(in packets).
double lm_percent
 Probability of inject a long message in bimodal traffic(in messages).
double msg_sent_count [3]
 Number of Message sent of each type. (bimodal stats)
double msg_injected_count [3]
 Number of Message injected of each type. (bimodal stats)
double msg_rcvd_count [3]
 Number of Message received of each type. (bimodal stats)
double msg_acum_delay [3]
 Accumulative delay of each message type. (bimodal stats)
double msg_acum_inj_delay [3]
 Accumulative injection delay of each message type. (bimodal stats)
double msg_acum_sq_delay [3]
 Accumulative square delay of each message type. (bimodal stats)
double msg_acum_sq_inj_delay [3]
 Accumulative square injection delay of each message type. (bimodal stats)
long msg_max_delay [3]
 Maximum delay of each message type. (bimodal stats)
long msg_max_inj_delay [3]
 Maximum injection delay of each message type. (bimodal stats)
FILE * fp
 A pointer to a file. Used for several purposes.
char file [128]
long num_executions
 Number of executions, appended to the output filename.
char trcfile [128]
long samples
 Number of samples (batchs or shots) to take from the current Simulation.
long batch_time
 Sampling period.
long min_batch_size
 Minimum number of reception in a batch to save stats.
double threshold
 Threshold to accept convergency.
long warm_up_period
 Number of 'oblivious' cycles until start convergency asurement simulation.
long warmed_up
 The cycle in wich warming are really finished.
long conv_period
 Convergency estimation sampling period.
long max_conv_time
 Maximum time for Convergency estimation.
routernetwork
 An array of routers containing the system.
long sim_clock
 Simulation clock.
double sent_count = 0.0
 Number of packets sent. (stats)
double injected_count = 0.0
 Number of packets injected. (stats)
double rcvd_count = 0.0
 Number of packets received. (stats)
double last_rcvd_count = 0.0
 Number of packets received before the start of the present batch. (stats)
double dropped_count = 0.0
 Number of packets dropped. (stats)
double transit_dropped_count = 0.0
 Number of in-transit packets dropped. (stats)
double last_tran_drop_count = 0.0
 Number of in-transit packets dropped before the start of the present batch. (stats)
double inj_phit_count = 0.0
 Number of phits sent. (stats)
double sent_phit_count = 0.0
 Number of phits injected. (stats)
double rcvd_phit_count = 0.0
 Number of phits received. (stats)
double dropped_phit_count = 0.0
 Number of phits dropped. (stats)
double acum_delay = 0.0
 Accumulative delay. (stats)
double acum_inj_delay = 0.0
 Accumulative injection delay. (stats)
double acum_sq_delay = 0.0
 Accumulative square delay. (stats)
double acum_sq_inj_delay = 0.0
 Accumulative square injection delay. (stats)
long max_delay = 0
 Maximum delay. (stats)
long max_inj_delay = 0
 Maximum injection delay. (stats)
double acum_hops = 0.0
 Accumulative number of hops. (stats)
batch_tbatch
 Array to save all the batchs' stats.
double global_q_u_current = 0.0
double global_q_u = 0.0
long aload
 Provided load multiplied by RAND_MAX used in injection.
long lm_load
 Actual long message load multiplied by RAND_MAX used in bimodal injection.
long trigger
 Provided trigger_rate multiplied by RAND_MAX used in reactive traffic.
long ** destinations
 Matrix containing map of source/destination pairs at consumption (destination).
long ** sources
 Matrix containing map of source/destination pairs at injection (source).
long * con_dst
 Histograms of distance at consumption (source).
long * inj_dst
 Histograms of distance at injection (source).
long max_dst
 Size of distance histograms.
long * source_ports
 Array that contains the source ports for the monitored node.
long * dest_ports
 Array that contains the destination ports for the monitored node.
long * port_utilization
 Array that contains the port utilization of the monitored node.
dimport_coord_dim
 An array containig the dimension for each port.
wayport_coord_way
 An array containig the direction (way) for each port.
channelport_coord_channel
 An array containig the number of virtual channel for each port.
static time_t end_time
 Simulation finish time / date.
bool_t go_on = TRUE
 While this is TRUE the simulation will go on!
long reseted = 0
 Number of resets.
long last_reset_time = 0
 Time in which the last reset has been performed.
double cons_load
 Consumed load of the current simulation.
double inj_load
 Injection load of the current simulation.
void(* run_network )(void)
port_type(* select_input_port )(long i, long dest)
long(* neighbor )(long ad, dim wd, way ww)
routing_r(* calc_rr )(long source, long destination)
void(* request_port )(long i, port_type s_p)
port_type(* arbitrate_select )(long i, port_type d_p, port_type first, port_type last)
void(* arbitrate_cons )(long i)
void(* consume )(long i)
bool_t(* check_rr )(packet_t *pkt, dim *d_d, way *d_w)
void(* data_movement )(bool_t inject)
void(* arbitrate )(long i, port_type d_p)

Detailed Description

Main function of the FSIN simulator.


Function Documentation

int main ( int  argc,
char *  argv[] 
)

Main function.

Initializes the simulation & the network. Then runs the simulation & writes the results.

Parameters:
argcThe number of parameters given in the command line.
argvArray that constains all the parameters.
Returns:
The finalization code. Usually 0.

Variable Documentation

Id of the router arbitration mechanism.

See also:
arb_mode_t
atype_l
void(* arbitrate)(long i, port_type d_p)

'Virtual' Function that performs the arbitration of the output ports.

Parameters:
injectIt is TRUE if the injection has to be performed.
See also:
init_functions
arbitrate_direct
arbitrate_icube
arbitrate_trees
void(* arbitrate_cons)(long i)

'Virtual' Function that arbritates the consumption of the arriven packets.

Parameters:
iThe node in which the consumption is performed.
See also:
init_functions
cons_mode
arbitrate_cons_single
arbitrate_cons_multiple

'Virtual' Function that arbitrates the selection of an input port for an output port.

Parameters:
iThe node in which the consumption is performed.
d_pThe destination port to arbitrate for.
firstThe first input port that can use this output.
lastThe next of the last input port that can use this input.
Returns:
The selected port or NULL_PORT if there is no one.
See also:
init_functions
arb_mode
arbitrate
arbitrate_select_round_robin
arbitrate_select_fifo
arbitrate_select_longest
arbitrate_select_random
arbitrate_select_age
long bheaders

Batch headers. A Bitmap to know what batch stats are printed in final summary. 1 + 2 + 4 + 8 + 16 + 32 + 64 + 128 + 256 + 512 + 1024 + 2048 + 4096 BatchTime AvDistance InjLoad AccLoad PacketSent PacketRcvd PacketDrop AvgDelay StDevDelay MaxDelay InjAvgDel InjStDvDel InjMaxDel

routing_r(* calc_rr)(long source, long destination)

'Virtual' Function that calculates packet routing record.

Parameters:
sourceThe source node of the packet.
destinationThe destination node of the packet.
Returns:
The routing record needed to go from source to destination.
See also:
init_functions
topo
mesh_rr
midimew_rr
torus_rr
torus_rr_unidir
dtt_rr
dtt_rr_unidir
bool_t(* check_rr)(packet_t *pkt, dim *d_d, way *d_w)

'Virtual' Function that routes a packet.

Parameters:
pktThe packet to route.
d_dThe destination dimension is returned here.
d_wThe destination way is returned here.
Returns:
TRUE if the phit has reached its final destination
See also:
init_functions
routing
check_rr_dim_o_r
check_rr_dir_o_r
check_rr_fattree_static
check_rr_fattree_adaptive
check_rr_slimtree_static
check_rr_slimtree_adaptive
check_rr_thintree_static
check_rr_thintree_adaptive
check_rr_icube_static
check_rr_icube_adaptive
check_rr_icube_static_IB

Id of the consumption mode.

See also:
cons_mode_t
ctype_l
void(* consume)(long i)

'Virtual' Function that performs consumption.

Parameters:
iThe node in which the consumption is performed.
See also:
init_functions
cons_mode
consume_single
consume_multiple
void(* data_movement)(bool_t inject)

'Virtual' Function that performs the traffic movement in the network.

Parameters:
injectIt is TRUE if the injection has to be performed.
See also:
init_functions
data_movement_direct
data_movement_indirect
char file[128]

The output file name.

It will be appended one extension for each out: .mon for monitored node. .map for channel mapping. .hst for queue occupation histograms.

double global_q_u = 0.0

The global queue occupation.

This is the value shown to the nodes and is updated every update_period cycles with the value of global_q_u_current.

See also:
update_period
global_q_u_current
double global_q_u_current = 0.0

The global queue occupation.

This value is calculated each cycle.

See also:
update_period
global_q_u_current

Id of the injection mode.

See also:
inj_mode_t
injmode_l
long inj_ql

Injection queue length (in phits).

Equel to binj_cap multiplied by pkt_len.

See also:
binj_cap.
pkt_len.
long(* neighbor)(long ad, dim wd, way ww)

'Virtual' Function that performs the search of a neighbor node. Only used by direct topologies.

Parameters:
adA node address.
wdA dimension (X,Y or Z).
wwA way (UP or DOWN).
Returns:
The address of the neighbor in that direction and way.
See also:
topo
torus_neighbor
midimew_neighbor
torus_neighbor
dtt_neighbor

The traffic pattern Id.

See also:
traffic_pattern_t.
pattern_l.
long pheaders

Partial headers. A Bitmap to know what system stats are shown. 1 + 2 + 4 + 8 + 16 + 32 + 64 + 128 + 256 + 512 + 1024 clock inj_load cons_load av_delay delay_dev max_delay inj_delay i_d_dev i_dev_max netw. ocup queue_ocup

Id of the placement strategy.

See also:
placement_t
placement_l
long plevel

Print level - bitmap. 0 = Just final summary 1 = Source/destination Map 2 = port utilization Map 4 = Distance Histogram 8 = Histogram of port utilization 16 = Packet-level traces 32 = Phit-level traces 64 = Monitored node

Id of the request port mechanism.

See also:
req_mode_t
r_mode_l
void(* request_port)(long i, port_type s_p)

Id of the routing used in DOR (Dimension or Direction) and in Multistage networks.

See also:
routing_t
routing_l
void(* run_network)(void)

'Virtual' Function that runs the simulation.

See also:
init_functions
run_network_shotmode
run_network_trc
run_network_batch
run_network_exd
port_type(* select_input_port)(long i, long dest)

'Virtual' Function that performs the selection of the injection ports.

Parameters:
iThe node in wich the injection is performed.
destThe destination of the packet.
Returns:
The injection port to insert the packet.
See also:
init_functions
select_input_port_shortest
select_input_port_dor_only
select_input_port_dor_shortest
select_input_port_shortest_profitable
select_input_port_lpath

The topology Id.

See also:
topo_t.
topology_l.
long tr_ql

Transit queue length (in phits).

Equal to buffer_cap multiplied by pkt_len.

See also:
buffer_cap.
pkt_len.
char trcfile[128]

The name of a file containing a trace for trace driven.

If the file is in .alog format & only will be considered message sending an reception (events -101 & -102). If the file is a dimemas trace only point to point operations and cpu intervals are considered. The FSIN trace format is also allowed.

Id of the Virtual Channel management mechanism.

See also:
vc_management_t
vc_l