Commit b72457a4 authored by Philip Carns's avatar Philip Carns

Merge branch 'commit_f2' into 'master'

Commit function

The ROSS API has changed to add a commit function (see [d3bdc07](https://github.com/carothersc/ROSS/commit/d3bdc077a0c4d1481dc06c4b4d4f1eb8e4e6fbf6)).

This merge request updates the various CODES models to the latest ROSS API. All  test pass. It also updates the documentation to CODES v 0.5.2 and ROSS v d3bdc07. 

See merge request !5
parents 78745f23 00475389
...@@ -3,12 +3,12 @@ machines. ...@@ -3,12 +3,12 @@ machines.
0 - Checkout, build, and install the trunk version of ROSS 0 - Checkout, build, and install the trunk version of ROSS
(https://github.com/carothersc/ROSS). At the time of (https://github.com/carothersc/ROSS). At the time of
release (0.5.0), ROSS's latest commit hash was d9cef53, so this revision is release (0.5.2), ROSS's latest commit hash was d3bdc07, so this revision is
"safe" in the unlikely case incompatible changes come along in the future. If "safe" in the unlikely case incompatible changes come along in the future. If
working from the CODES master branches, use the ROSS master branch. working from the CODES master branches, use the ROSS master branch.
git clone http://github.com/carothersc/ROSS.git git clone http://github.com/carothersc/ROSS.git
# if using 0.5.0 release: git checkout d9cef53 # if using 0.5.2 release: git checkout d3bdc07
cd ROSS cd ROSS
mkdir build mkdir build
cd build cd build
...@@ -18,7 +18,7 @@ working from the CODES master branches, use the ROSS master branch. ...@@ -18,7 +18,7 @@ working from the CODES master branches, use the ROSS master branch.
make -j 3 make -j 3
make install make install
<the result should be that the latest version of ROSS is installed in the <the result should be that the latest version of ROSS is installed in the
ROSS/install/ directory> ROSS/install/ directory>
For more details on installing ROSS, go to For more details on installing ROSS, go to
...@@ -60,7 +60,7 @@ working from the CODES master branches, use the ROSS master branch. ...@@ -60,7 +60,7 @@ working from the CODES master branches, use the ROSS master branch.
of Darshan installed in the default system path, or else add of Darshan installed in the default system path, or else add
<DARSHAN_PREFIX>/lib/pkgconfig to your PKG_CONFIG_PATH environment <DARSHAN_PREFIX>/lib/pkgconfig to your PKG_CONFIG_PATH environment
variable before calling configure. variable before calling configure.
4 - Build and install CODES 4 - Build and install CODES
make && make install make && make install
......
0.5.2 (July 13, 2016)
Summer of CODES was another huge success!
This update adds the commit function to the CODES models, representing an
update to the latest version of ROSS (d3bdc07)
0.5.1 (June 09, 2016) 0.5.1 (June 09, 2016)
network: network:
...@@ -34,7 +40,7 @@ networks: ...@@ -34,7 +40,7 @@ networks:
addition of the SlimFly network topology, corresponding to the Wolfe et al. addition of the SlimFly network topology, corresponding to the Wolfe et al.
paper "Modeling a Million-node Slim Fly Network using Parallel Discrete-event paper "Modeling a Million-node Slim Fly Network using Parallel Discrete-event
Simulation", at SIGSIM-PADS'16. See README.slimfly.txt Simulation", at SIGSIM-PADS'16. See README.slimfly.txt
(src/networks/model-net/doc). (src/networks/model-net/doc).
modelnet now supports sampling at regular intervals. Dragonfly LPs can modelnet now supports sampling at regular intervals. Dragonfly LPs can
......
...@@ -53,7 +53,7 @@ enum svr_event ...@@ -53,7 +53,7 @@ enum svr_event
LOCAL /* local event */ LOCAL /* local event */
}; };
/* this struct serves as the ***persistent*** state of the LP representing the /* this struct serves as the ***persistent*** state of the LP representing the
* server in question. This struct is setup when the LP initialization function * server in question. This struct is setup when the LP initialization function
* ptr is called */ * ptr is called */
struct svr_state struct svr_state
...@@ -107,7 +107,8 @@ tw_lptype svr_lp = { ...@@ -107,7 +107,8 @@ tw_lptype svr_lp = {
(pre_run_f) NULL, (pre_run_f) NULL,
(event_f) svr_event, (event_f) svr_event,
(revent_f) svr_rev_event, (revent_f) svr_rev_event,
(final_f) svr_finalize, (commit_f) NULL,
(final_f) svr_finalize,
(map_f) codes_mapping, (map_f) codes_mapping,
sizeof(svr_state), sizeof(svr_state),
}; };
...@@ -193,9 +194,9 @@ int main( ...@@ -193,9 +194,9 @@ int main(
/* ROSS initialization function calls */ /* ROSS initialization function calls */
tw_opt_add(app_opt); /* add user-defined args */ tw_opt_add(app_opt); /* add user-defined args */
/* initialize ROSS and parse args. NOTE: tw_init calls MPI_Init */ /* initialize ROSS and parse args. NOTE: tw_init calls MPI_Init */
tw_init(&argc, &argv); tw_init(&argc, &argv);
if (!conf_file_name[0]) if (!conf_file_name[0])
{ {
fprintf(stderr, "Expected \"codes-config\" option, please see --help.\n"); fprintf(stderr, "Expected \"codes-config\" option, please see --help.\n");
MPI_Finalize(); MPI_Finalize();
...@@ -204,9 +205,9 @@ int main( ...@@ -204,9 +205,9 @@ int main(
MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Comm_size(MPI_COMM_WORLD, &nprocs); MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
/* loading the config file into the codes-mapping utility, giving us the /* loading the config file into the codes-mapping utility, giving us the
* parsed config object in return. * parsed config object in return.
* "config" is a global var defined by codes-mapping */ * "config" is a global var defined by codes-mapping */
if (configuration_load(conf_file_name, MPI_COMM_WORLD, &config)){ if (configuration_load(conf_file_name, MPI_COMM_WORLD, &config)){
fprintf(stderr, "Error loading config file %s.\n", conf_file_name); fprintf(stderr, "Error loading config file %s.\n", conf_file_name);
...@@ -222,7 +223,7 @@ int main( ...@@ -222,7 +223,7 @@ int main(
/* Setup takes the global config object, the registered LPs, and /* Setup takes the global config object, the registered LPs, and
* generates/places the LPs as specified in the configuration file. * generates/places the LPs as specified in the configuration file.
* This should only be called after ALL LP types have been registered in * This should only be called after ALL LP types have been registered in
* codes */ * codes */
codes_mapping_setup(); codes_mapping_setup();
...@@ -233,7 +234,7 @@ int main( ...@@ -233,7 +234,7 @@ int main(
assert(num_nets==1); assert(num_nets==1);
net_id = *net_ids; net_id = *net_ids;
free(net_ids); free(net_ids);
/* in this example, we are using simplenet, which simulates point to point /* in this example, we are using simplenet, which simulates point to point
* communication between any two entities (other networks are trickier to * communication between any two entities (other networks are trickier to
* setup). Hence: */ * setup). Hence: */
if(net_id != SIMPLENET) if(net_id != SIMPLENET)
...@@ -242,7 +243,7 @@ int main( ...@@ -242,7 +243,7 @@ int main(
MPI_Finalize(); MPI_Finalize();
return 0; return 0;
} }
/* calculate the number of servers in this simulation, /* calculate the number of servers in this simulation,
* ignoring annotations */ * ignoring annotations */
num_servers = codes_mapping_get_lp_count(group_name, 0, "server", NULL, 1); num_servers = codes_mapping_get_lp_count(group_name, 0, "server", NULL, 1);
...@@ -253,7 +254,7 @@ int main( ...@@ -253,7 +254,7 @@ int main(
configuration_get_value_int(&config, param_group_nm, num_reqs_key, NULL, &num_reqs); configuration_get_value_int(&config, param_group_nm, num_reqs_key, NULL, &num_reqs);
configuration_get_value_int(&config, param_group_nm, payload_sz_key, NULL, &payload_sz); configuration_get_value_int(&config, param_group_nm, payload_sz_key, NULL, &payload_sz);
/* begin simulation */ /* begin simulation */
tw_run(); tw_run();
/* model-net has the capability of outputting network transmission stats */ /* model-net has the capability of outputting network transmission stats */
...@@ -270,7 +271,7 @@ const tw_lptype* svr_get_lp_type() ...@@ -270,7 +271,7 @@ const tw_lptype* svr_get_lp_type()
static void svr_add_lp_type() static void svr_add_lp_type()
{ {
/* lp_type_register should be called exactly once per process per /* lp_type_register should be called exactly once per process per
* LP type */ * LP type */
lp_type_register("server", svr_get_lp_type()); lp_type_register("server", svr_get_lp_type());
} }
...@@ -282,7 +283,7 @@ static void svr_init( ...@@ -282,7 +283,7 @@ static void svr_init(
tw_event *e; tw_event *e;
svr_msg *m; svr_msg *m;
tw_stime kickoff_time; tw_stime kickoff_time;
memset(ns, 0, sizeof(*ns)); memset(ns, 0, sizeof(*ns));
/* each server sends a dummy event to itself that will kick off the real /* each server sends a dummy event to itself that will kick off the real
...@@ -290,12 +291,12 @@ static void svr_init( ...@@ -290,12 +291,12 @@ static void svr_init(
*/ */
/* skew each kickoff event slightly to help avoid event ties later on */ /* skew each kickoff event slightly to help avoid event ties later on */
kickoff_time = g_tw_lookahead + tw_rand_unif(lp->rng); kickoff_time = g_tw_lookahead + tw_rand_unif(lp->rng);
/* first create the event (time arg is an offset, not absolute time) */ /* first create the event (time arg is an offset, not absolute time) */
e = tw_event_new(lp->gid, kickoff_time, lp); e = tw_event_new(lp->gid, kickoff_time, lp);
/* after event is created, grab the allocated message and set msg-specific /* after event is created, grab the allocated message and set msg-specific
* data */ * data */
m = tw_event_data(e); m = tw_event_data(e);
m->svr_event_type = KICKOFF; m->svr_event_type = KICKOFF;
/* event is ready to be processed, send it off */ /* event is ready to be processed, send it off */
...@@ -324,7 +325,7 @@ static void svr_event( ...@@ -324,7 +325,7 @@ static void svr_event(
handle_kickoff_event(ns, b, m, lp); handle_kickoff_event(ns, b, m, lp);
break; break;
case LOCAL: case LOCAL:
handle_local_event(ns, b, m, lp); handle_local_event(ns, b, m, lp);
break; break;
default: default:
printf("\n Invalid message type %d ", m->svr_event_type); printf("\n Invalid message type %d ", m->svr_event_type);
...@@ -353,7 +354,7 @@ static void svr_rev_event( ...@@ -353,7 +354,7 @@ static void svr_rev_event(
handle_kickoff_rev_event(ns, b, m, lp); handle_kickoff_rev_event(ns, b, m, lp);
break; break;
case LOCAL: case LOCAL:
handle_local_rev_event(ns, b, m, lp); handle_local_rev_event(ns, b, m, lp);
break; break;
default: default:
assert(0); assert(0);
...@@ -368,7 +369,7 @@ static void svr_finalize( ...@@ -368,7 +369,7 @@ static void svr_finalize(
svr_state * ns, svr_state * ns,
tw_lp * lp) tw_lp * lp)
{ {
printf("server %llu recvd %d bytes in %lf seconds, %lf MiB/s sent_count %d recvd_count %d local_count %d \n", printf("server %llu recvd %d bytes in %lf seconds, %lf MiB/s sent_count %d recvd_count %d local_count %d \n",
(unsigned long long)(lp->gid/2), (unsigned long long)(lp->gid/2),
payload_sz*ns->msg_recvd_count, payload_sz*ns->msg_recvd_count,
ns_to_s(ns->end_ts-ns->start_ts), ns_to_s(ns->end_ts-ns->start_ts),
...@@ -395,7 +396,7 @@ static tw_stime s_to_ns(tw_stime ns) ...@@ -395,7 +396,7 @@ static tw_stime s_to_ns(tw_stime ns)
tw_lpid get_next_server(tw_lpid sender_id) tw_lpid get_next_server(tw_lpid sender_id)
{ {
tw_lpid rtn_id; tw_lpid rtn_id;
/* first, get callers LP and group info from codes-mapping. Caching this /* first, get callers LP and group info from codes-mapping. Caching this
* info in the LP struct isn't a bad idea for preventing a huge number of * info in the LP struct isn't a bad idea for preventing a huge number of
* lookups */ * lookups */
char grp_name[MAX_NAME_LENGTH], lp_type_name[MAX_NAME_LENGTH], char grp_name[MAX_NAME_LENGTH], lp_type_name[MAX_NAME_LENGTH],
...@@ -404,8 +405,8 @@ tw_lpid get_next_server(tw_lpid sender_id) ...@@ -404,8 +405,8 @@ tw_lpid get_next_server(tw_lpid sender_id)
int dest_rep_id; int dest_rep_id;
codes_mapping_get_lp_info(sender_id, grp_name, &grp_id, lp_type_name, codes_mapping_get_lp_info(sender_id, grp_name, &grp_id, lp_type_name,
&lp_type_id, annotation, &grp_rep_id, &off); &lp_type_id, annotation, &grp_rep_id, &off);
/* in this example, we assume that, for our group of servers, each /* in this example, we assume that, for our group of servers, each
* "repetition" consists of a single server/NIC pair. Hence, we grab the * "repetition" consists of a single server/NIC pair. Hence, we grab the
* server ID for the next repetition, looping around if necessary */ * server ID for the next repetition, looping around if necessary */
num_reps = codes_mapping_get_group_reps(grp_name); num_reps = codes_mapping_get_group_reps(grp_name);
dest_rep_id = (grp_rep_id+1) % num_reps; dest_rep_id = (grp_rep_id+1) % num_reps;
...@@ -429,7 +430,7 @@ static void handle_kickoff_event( ...@@ -429,7 +430,7 @@ static void handle_kickoff_event(
/* normally, when using ROSS, events are allocated as a result of the event /* normally, when using ROSS, events are allocated as a result of the event
* creation process. However, since we are now asking model-net to * creation process. However, since we are now asking model-net to
* communicate with an entity on our behalf, we need to generate both the * communicate with an entity on our behalf, we need to generate both the
* message to the recipient and an optional callback message * message to the recipient and an optional callback message
* - thankfully, memory need not persist past the model_net_event call - it * - thankfully, memory need not persist past the model_net_event call - it
* copies the messages */ * copies the messages */
svr_msg m_local; svr_msg m_local;
...@@ -443,9 +444,9 @@ static void handle_kickoff_event( ...@@ -443,9 +444,9 @@ static void handle_kickoff_event(
/* record when transfers started on this server */ /* record when transfers started on this server */
ns->start_ts = tw_now(lp); ns->start_ts = tw_now(lp);
/* each server sends a request to the next highest server /* each server sends a request to the next highest server
* In this simulation, LP determination is simple: LPs are assigned * In this simulation, LP determination is simple: LPs are assigned
* round robin as in serv_1, net_1, serv_2, net_2, etc. * round robin as in serv_1, net_1, serv_2, net_2, etc.
* However, that may not always be the case, so we also show a more * However, that may not always be the case, so we also show a more
* complicated way to map through codes_mapping */ * complicated way to map through codes_mapping */
if (use_brute_force_map) if (use_brute_force_map)
...@@ -457,13 +458,13 @@ static void handle_kickoff_event( ...@@ -457,13 +458,13 @@ static void handle_kickoff_event(
/* model-net needs to know about (1) higher-level destination LP which is a neighboring server in this case /* model-net needs to know about (1) higher-level destination LP which is a neighboring server in this case
* (2) struct and size of remote message and (3) struct and size of local message (a local message can be null) */ * (2) struct and size of remote message and (3) struct and size of local message (a local message can be null) */
m->ret = model_net_event(net_id, "test", dest_id, payload_sz, 0.0, sizeof(svr_msg), m->ret = model_net_event(net_id, "test", dest_id, payload_sz, 0.0, sizeof(svr_msg),
(const void*)&m_remote, sizeof(svr_msg), (const void*)&m_local, lp); (const void*)&m_remote, sizeof(svr_msg), (const void*)&m_local, lp);
ns->msg_sent_count++; ns->msg_sent_count++;
} }
/* at the moment, no need for local callbacks from model-net, so we maintain a /* at the moment, no need for local callbacks from model-net, so we maintain a
* count for debugging purposes */ * count for debugging purposes */
static void handle_local_event( static void handle_local_event(
svr_state * ns, svr_state * ns,
tw_bf * b, tw_bf * b,
...@@ -492,7 +493,7 @@ static void handle_ack_event( ...@@ -492,7 +493,7 @@ static void handle_ack_event(
* destination server */ * destination server */
/* safety check that this request got to the right server, both with our /* safety check that this request got to the right server, both with our
* brute-force lp calculation and our more generic codes-mapping * brute-force lp calculation and our more generic codes-mapping
* calculation */ * calculation */
assert(m->src == (lp->gid + offset)%(num_servers*2) && assert(m->src == (lp->gid + offset)%(num_servers*2) &&
m->src == get_next_server(lp->gid)); m->src == get_next_server(lp->gid));
...@@ -509,11 +510,11 @@ static void handle_ack_event( ...@@ -509,11 +510,11 @@ static void handle_ack_event(
m_remote.src = lp->gid; m_remote.src = lp->gid;
/* send another request */ /* send another request */
m->ret = model_net_event(net_id, "test", m->src, payload_sz, 0.0, sizeof(svr_msg), m->ret = model_net_event(net_id, "test", m->src, payload_sz, 0.0, sizeof(svr_msg),
(const void*)&m_remote, sizeof(svr_msg), (const void*)&m_local, lp); (const void*)&m_remote, sizeof(svr_msg), (const void*)&m_local, lp);
ns->msg_sent_count++; ns->msg_sent_count++;
m->incremented_flag = 1; m->incremented_flag = 1;
} }
else else
{ {
...@@ -541,7 +542,7 @@ static void handle_req_event( ...@@ -541,7 +542,7 @@ static void handle_req_event(
m_remote.src = lp->gid; m_remote.src = lp->gid;
/* safety check that this request got to the right server */ /* safety check that this request got to the right server */
assert(lp->gid == (m->src + offset)%(num_servers*2) && assert(lp->gid == (m->src + offset)%(num_servers*2) &&
lp->gid == get_next_server(m->src)); lp->gid == get_next_server(m->src));
ns->msg_recvd_count++; ns->msg_recvd_count++;
...@@ -550,8 +551,8 @@ static void handle_req_event( ...@@ -550,8 +551,8 @@ static void handle_req_event(
/* simulated payload of 1 MiB */ /* simulated payload of 1 MiB */
/* also trigger a local event for completion of payload msg */ /* also trigger a local event for completion of payload msg */
/* remote host will get an ack event */ /* remote host will get an ack event */
m->ret = model_net_event(net_id, "test", m->src, payload_sz, 0.0, sizeof(svr_msg), m->ret = model_net_event(net_id, "test", m->src, payload_sz, 0.0, sizeof(svr_msg),
(const void*)&m_remote, sizeof(svr_msg), (const void*)&m_local, lp); (const void*)&m_remote, sizeof(svr_msg), (const void*)&m_local, lp);
return; return;
} }
...@@ -582,7 +583,7 @@ static void handle_req_rev_event( ...@@ -582,7 +583,7 @@ static void handle_req_rev_event(
(void)b; (void)b;
(void)m; (void)m;
ns->msg_recvd_count--; ns->msg_recvd_count--;
/* model-net has its own reverse computation support */ /* model-net has its own reverse computation support */
model_net_event_rc2(lp, &m->ret); model_net_event_rc2(lp, &m->ret);
return; return;
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
/**** BEGIN SIMULATION DATA STRUCTURES ****/ /**** BEGIN SIMULATION DATA STRUCTURES ****/
/* 'magic' numbers used as sanity check on events */ /* 'magic' numbers used as sanity check on events */
static int node_magic; static int node_magic;
static int forwarder_magic; static int forwarder_magic;
/* counts of the various types of nodes in the example system */ /* counts of the various types of nodes in the example system */
...@@ -55,8 +55,8 @@ enum forwarder_event ...@@ -55,8 +55,8 @@ enum forwarder_event
}; };
typedef struct forwarder_state_s { typedef struct forwarder_state_s {
int id; // index w.r.t. forwarders in my group int id; // index w.r.t. forwarders in my group
int is_in_foo; int is_in_foo;
int fwd_node_count; int fwd_node_count;
int fwd_forwarder_count; int fwd_forwarder_count;
} forwarder_state; } forwarder_state;
...@@ -98,7 +98,7 @@ void node_finalize( ...@@ -98,7 +98,7 @@ void node_finalize(
// messages // messages
int mult; int mult;
if (ns->is_in_foo){ if (ns->is_in_foo){
mult = 1; mult = 1;
} }
else{ else{
mult = (num_foo_nodes / num_bar_nodes) + mult = (num_foo_nodes / num_bar_nodes) +
...@@ -197,7 +197,7 @@ void node_event_handler( ...@@ -197,7 +197,7 @@ void node_event_handler(
tw_lp * lp){ tw_lp * lp){
(void)b; (void)b;
assert(m->h.magic == node_magic); assert(m->h.magic == node_magic);
switch (m->h.event_type){ switch (m->h.event_type){
case NODE_KICKOFF: case NODE_KICKOFF:
// nodes from foo ping to nodes in bar // nodes from foo ping to nodes in bar
...@@ -223,7 +223,8 @@ static tw_lptype node_lp = { ...@@ -223,7 +223,8 @@ static tw_lptype node_lp = {
(pre_run_f) NULL, (pre_run_f) NULL,
(event_f) node_event_handler, (event_f) node_event_handler,
(revent_f) NULL, (revent_f) NULL,
(final_f) node_finalize, (commit_f) NULL,
(final_f) node_finalize,
(map_f) codes_mapping, (map_f) codes_mapping,
sizeof(node_state), sizeof(node_state),
}; };
...@@ -243,7 +244,7 @@ void node_register(){ ...@@ -243,7 +244,7 @@ void node_register(){
void forwarder_lp_init( void forwarder_lp_init(
forwarder_state * ns, forwarder_state * ns,
tw_lp * lp){ tw_lp * lp){
// like nodes, forwarders in this example are addressed logically // like nodes, forwarders in this example are addressed logically
ns->id = codes_mapping_get_lp_relative_id(lp->gid, 1, 0); ns->id = codes_mapping_get_lp_relative_id(lp->gid, 1, 0);
int id_all = codes_mapping_get_lp_relative_id(lp->gid, 0, 0); int id_all = codes_mapping_get_lp_relative_id(lp->gid, 0, 0);
ns->is_in_foo = (id_all < num_foo_forwarders); ns->is_in_foo = (id_all < num_foo_forwarders);
...@@ -261,7 +262,7 @@ void handle_forwarder_fwd( ...@@ -261,7 +262,7 @@ void handle_forwarder_fwd(
forwarder_state * ns, forwarder_state * ns,
forwarder_msg * m, forwarder_msg * m,
tw_lp * lp){ tw_lp * lp){
// compute the forwarder lpid to forward to // compute the forwarder lpid to forward to
int mod; int mod;
const char * dest_group; const char * dest_group;
char * category; char * category;
...@@ -295,13 +296,13 @@ void handle_forwarder_recv( ...@@ -295,13 +296,13 @@ void handle_forwarder_recv(
forwarder_state * ns, forwarder_state * ns,
forwarder_msg * m, forwarder_msg * m,
tw_lp * lp) { tw_lp * lp) {
// compute the node to relay the message to // compute the node to relay the message to
const char * dest_group; const char * dest_group;
const char * annotation; const char * annotation;
char * category; char * category;
int net_id; int net_id;
if (ns->is_in_foo){ if (ns->is_in_foo){
dest_group = "FOO_CLUSTER"; dest_group = "FOO_CLUSTER";
annotation = "foo"; annotation = "foo";
category = "pong"; category = "pong";
net_id = net_id_foo; net_id = net_id_foo;
...@@ -354,7 +355,8 @@ static tw_lptype forwarder_lp = { ...@@ -354,7 +355,8 @@ static tw_lptype forwarder_lp = {
(pre_run_f) NULL, (pre_run_f) NULL,
(event_f) forwarder_event_handler, (event_f) forwarder_event_handler,
(revent_f) NULL, (revent_f) NULL,
(final_f) forwarder_finalize, (commit_f) NULL,
(final_f) forwarder_finalize,
(map_f) codes_mapping, (map_f) codes_mapping,
sizeof(forwarder_state), sizeof(forwarder_state),
}; };
...@@ -395,16 +397,16 @@ int main(int argc, char *argv[]) ...@@ -395,16 +397,16 @@ int main(int argc, char *argv[])
/* ROSS initialization function calls */ /* ROSS initialization function calls */
tw_opt_add(app_opt); /* add user-defined args */ tw_opt_add(app_opt); /* add user-defined args */
/* initialize ROSS and parse args. NOTE: tw_init calls MPI_Init */ /* initialize ROSS and parse args. NOTE: tw_init calls MPI_Init */
tw_init(&argc, &argv); tw_init(&argc, &argv);
if (!conf_file_name[0]) { if (!conf_file_name[0]) {
tw_error(TW_LOC, tw_error(TW_LOC,
"Expected \"codes-config\" option, please see --help.\n"); "Expected \"codes-config\" option, please see --help.\n");
return 1; return 1;
} }
/* loading the config file into the codes-mapping utility, giving us the /* loading the config file into the codes-mapping utility, giving us the
* parsed config object in return. * parsed config object in return.
* "config" is a global var defined by codes-mapping */ * "config" is a global var defined by codes-mapping */
if (configuration_load(conf_file_name, MPI_COMM_WORLD, &config)){ if (configuration_load(conf_file_name, MPI_COMM_WORLD, &config)){
tw_error(TW_LOC, "Error loading config file %s.\n", conf_file_name); tw_error(TW_LOC, "Error loading config file %s.\n", conf_file_name);
...@@ -470,7 +472,7 @@ int main(int argc, char *argv[]) ...@@ -470,7 +472,7 @@ int main(int argc, char *argv[])
} }
free(net_ids); free(net_ids);
/* begin simulation */ /* begin simulation */
tw_run(); tw_run();
tw_end(); tw_end();
......
...@@ -99,6 +99,7 @@ tw_lptype svr_lp = { ...@@ -99,6 +99,7 @@ tw_lptype svr_lp = {
(pre_run_f) NULL, (pre_run_f) NULL,
(event_f) svr_event, (event_f) svr_event,
(revent_f) svr_rev_event, (revent_f) svr_rev_event,
(commit_f) NULL,
(final_f) svr_finalize, (final_f) svr_finalize,
(map_f) codes_mapping, (map_f) codes_mapping,
sizeof(svr_state), sizeof(svr_state),
...@@ -169,11 +170,11 @@ static void handle_kickoff_rev_event( ...@@ -169,11 +170,11 @@ static void handle_kickoff_rev_event(
if(b->c1) if(b->c1)
tw_rand_reverse_unif(lp->rng); tw_rand_reverse_unif(lp->rng);
model_net_event_rc(net_id, lp, PAYLOAD_SZ); model_net_event_rc(net_id, lp, PAYLOAD_SZ);
ns->msg_sent_count--; ns->msg_sent_count--;
tw_rand_reverse_unif(lp->rng); tw_rand_reverse_unif(lp->rng);
} }
static void handle_kickoff_event( static void handle_kickoff_event(
svr_state * ns, svr_state * ns,
tw_bf * b, tw_bf * b,
...@@ -190,7 +191,7 @@ static void handle_kickoff_event( ...@@ -190,7 +191,7 @@ static void handle_kickoff_event(
char anno[MAX_NAME_LENGTH]; char anno[MAX_NAME_LENGTH];
tw_lpid local_dest = -1, global_dest = -1; tw_lpid local_dest = -1, global_dest = -1;
svr_msg * m_local = malloc(sizeof(svr_msg)); svr_msg * m_local = malloc(sizeof(svr_msg));
svr_msg * m_remote = malloc(sizeof(svr_msg)); svr_msg * m_remote = malloc(sizeof(svr_msg));
...@@ -215,7 +216,7 @@ static void handle_kickoff_event( ...@@ -215,7 +216,7 @@ static void handle_kickoff_event(
{ {
local_dest = (local_id + num_nodes_per_grp) % num_nodes; local_dest = (local_id + num_nodes_per_grp) % num_nodes;
//printf("\n LP %ld sending to %ld num nodes %d ", local_id, local_dest, num_nodes); //printf("\n LP %ld sending to %ld num nodes %d ", local_id, local_dest, num_nodes);
} }
else if(traffic == NEAREST_NEIGHBOR) else if(traffic == NEAREST_NEIGHBOR)
{ {
local_dest = (local_id + 1) % num_nodes; local_dest = (local_id + 1) % num_nodes;
...@@ -226,13 +227,13 @@ static void handle_kickoff_event( ...@@ -226,13 +227,13 @@ static void handle_kickoff_event(
global_dest = codes_mapping_get_lpid_from_relative(local_dest, group_name, lp_type_name, NULL, 0); global_dest = codes_mapping_get_lpid_from_relative(local_dest, group_name, lp_type_name, NULL, 0);
ns->msg_sent_count++; ns->msg_sent_count++;
model_net_event(net_id, "test", global_dest, PAYLOAD_SZ, 0.0, sizeof(svr_msg), (const void*)m_remote, sizeof(svr_msg), (const void*)m_local, lp); model_net_event(net_id, "test", global_dest, PAYLOAD_SZ, 0.0, sizeof(svr_msg), (const void*)m_remote, sizeof(svr_msg), (const void*)m_local, lp);
issue_event(ns, lp); issue_event(ns, lp);
return; return;
} }
static void handle_remote_rev_event( static void handle_remote_rev_event(
svr_state * ns, svr_state * ns,
tw_bf * b, tw_bf * b,
svr_msg * m, svr_msg * m,
tw_lp * lp) tw_lp * lp)
...@@ -383,7 +384,7 @@ int main( ...@@ -383,7 +384,7 @@ int main(
num_servers_per_rep = codes_mapping_get_lp_count("MODELNET_GRP", 1, "server", num_servers_per_rep = codes_mapping_get_lp_count("MODELNET_GRP", 1, "server",
NULL, 1); NULL, 1);
configuration_get_value_int(&config, "PARAMS", "num_routers", NULL, &num_routers_per_grp); configuration_get_value_int(&config, "PARAMS", "num_routers", NULL, &num_routers_per_grp);
num_groups = (num_routers_per_grp * (num_routers_per_grp/2) + 1); num_groups = (num_routers_per_grp * (num_routers_per_grp/2) + 1);
num_nodes = num_groups * num_routers_per_grp * (num_routers_per_grp / 2); num_nodes = num_groups * num_routers_per_grp * (num_routers_per_grp / 2);
num_nodes_per_grp = num_routers_per_grp * (num_routers_per_grp / 2); num_nodes_per_grp = num_routers_per_grp * (num_routers_per_grp / 2);
......
This diff is collapsed.
...@@ -77,7 +77,7 @@ struct loggp_state ...@@ -77,7 +77,7 @@ struct loggp_state
struct mn_stats loggp_stats_array[CATEGORY_MAX]; struct mn_stats loggp_stats_array[CATEGORY_MAX];
}; };
/* annotation-specific parameters (unannotated entry occurs at the /* annotation-specific parameters (unannotated entry occurs at the
* last index) */ * last index) */
static uint64_t num_params = 0; static uint64_t num_params = 0;
static loggp_param * all_params = NULL; static loggp_param * all_params = NULL;
...@@ -185,6 +185,7 @@ tw_lptype loggp_lp = { ...@@ -185,6 +185,7 @@ tw_lptype loggp_lp = {
(pre_run_f) NULL, (pre_run_f) NULL,
(event_f) loggp_event, (event_f) loggp_event,
(revent_f) loggp_rev_event, (revent_f) loggp_rev_event,
(commit_f) NULL,
(final_f) loggp_finalize, (final_f) loggp_finalize,
(map_f) codes_mapping,