Commit 7217dbfe authored by Philip Carns's avatar Philip Carns

remove implicit lp io prepare and flush

- these calls should be made by the top level model only, so that all
  results are consolidated into the same subdirectory
- add corresponding calls to modelnet test programs
parent 918e23dc
......@@ -24,13 +24,11 @@ static struct model_net_method* method_array[] =
static int model_net_get_msg_sz(int net_id);
static lp_io_handle handle;
int model_net_setup(char* name,
int packet_size,
const void* net_params)
{
int i, ret;
int i;
/* find struct for underlying method (according to configuration file) */
for(i=0; method_array[i] != NULL; i++)
{
......@@ -39,11 +37,6 @@ int model_net_setup(char* name,
method_array[i]->mn_setup(net_params);
method_array[i]->packet_size = packet_size;
model_net_add_lp_type(i);
ret = lp_io_prepare(name, LP_IO_UNIQ_SUFFIX, &handle, MPI_COMM_WORLD);
if(ret < 0)
{
return -1;
}
return(i);
}
}
......@@ -448,9 +441,6 @@ void model_net_report_stats(int net_id)
// TODO: ADd checks by network names
// // Add dragonfly and torus network models
method_array[net_id]->mn_report_stats();
int ret = lp_io_flush(handle, MPI_COMM_WORLD);
assert(ret == 0);
return;
}
/* registers the lp type */
......
......@@ -131,6 +131,7 @@ int main(
int nprocs;
int rank;
g_tw_ts_end = s_to_ns(60*60*24*365); /* one year, in nsecs */
lp_io_handle handle;
tw_opt_add(app_opt);
tw_init(&argc, &argv);
......@@ -158,9 +159,19 @@ int main(
offset = 1;
}
if(lp_io_prepare("modelnet-p2p-bw", LP_IO_UNIQ_SUFFIX, &handle, MPI_COMM_WORLD) < 0)
{
return(-1);
}
tw_run();
model_net_report_stats(net_id);
if(lp_io_flush(handle, MPI_COMM_WORLD) < 0)
{
return(-1);
}
tw_end();
return 0;
}
......
......@@ -146,6 +146,7 @@ int main(
int rank;
//printf("\n Config count %d ",(int) config.lpgroups_count);
g_tw_ts_end = s_to_ns(60*60*24*365); /* one year, in nsecs */
lp_io_handle handle;
tw_opt_add(app_opt);
tw_init(&argc, &argv);
......@@ -172,9 +173,19 @@ int main(
offset = 1;
}
if(lp_io_prepare("modelnet-test", LP_IO_UNIQ_SUFFIX, &handle, MPI_COMM_WORLD) < 0)
{
return(-1);
}
tw_run();
model_net_report_stats(net_id);
if(lp_io_flush(handle, MPI_COMM_WORLD) < 0)
{
return(-1);
}
tw_end();
return 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment