Commit b4709624 authored by Shane Snyder's avatar Shane Snyder
Browse files

update perf-regression tests for new ssg

parent cb674a29
......@@ -73,7 +73,7 @@ int main(int argc, char **argv)
int nranks;
int ret;
ssg_group_id_t gid;
ssg_member_id_t self;
int ssg_self_rank;
int rank;
int namelen;
char processor_name[MPI_MAX_PROCESSOR_NAME];
......@@ -151,13 +151,13 @@ int main(int argc, char **argv)
ret = ssg_init(mid);
assert(ret == 0);
gid = ssg_group_create_mpi("bake-bench", MPI_COMM_WORLD, NULL, NULL);
assert(gid != SSG_GROUP_ID_NULL);
assert(gid != SSG_GROUP_ID_INVALID);
assert(ssg_get_group_size(gid) == 2);
self = ssg_get_group_self_id(gid);
ssg_self_rank = ssg_get_group_self_rank(gid);
if(self == 0)
if(ssg_self_rank == 0)
{
bake_provider_t provider;
bake_target_id_t tid;
......@@ -183,7 +183,7 @@ int main(int argc, char **argv)
MPI_Barrier(MPI_COMM_WORLD);
if(self > 0)
if(ssg_self_rank > 0)
{
/* ssg id 1 (client) initiates benchmark */
hg_handle_t handle;
......@@ -193,7 +193,7 @@ int main(int argc, char **argv)
bake_target_id_t bti;
uint64_t num_targets = 0;
target_addr = ssg_get_addr(gid, 0);
target_addr = ssg_get_group_member_addr(gid, ssg_get_group_member_id_from_rank(gid, 1));
assert(target_addr != HG_ADDR_NULL);
ret = bake_client_init(mid, &bcl);
......
......@@ -94,7 +94,8 @@ int main(int argc, char **argv)
int nranks;
int ret;
ssg_group_id_t gid;
ssg_member_id_t self;
ssg_member_id_t ssg_self_id;
int ssg_self_rank;
int rank;
int namelen;
char processor_name[MPI_MAX_PROCESSOR_NAME];
......@@ -190,9 +191,10 @@ int main(int argc, char **argv)
assert(ssg_get_group_size(gid) == 2);
self = ssg_get_self_id(mid);
ssg_self_id = ssg_get_self_id(mid);
ssg_self_rank = ssg_get_group_self_rank(gid);
self_addr = ssg_get_group_member_addr(gid, self);
self_addr = ssg_get_group_member_addr(gid, ssg_self_id);
assert(self_addr != HG_ADDR_NULL);
ret = margo_addr_to_string(mid, ssg_self_str, &ssg_self_str_len, self_addr);
assert(ret == 0);
......@@ -201,7 +203,7 @@ int main(int argc, char **argv)
rank, nranks, processor_name, ssg_self_str);
if(self == 1)
if(ssg_self_rank == 1)
{
/* server side: prep everything before letting the client initiate
* benchmark
......@@ -257,16 +259,18 @@ int main(int argc, char **argv)
MPI_Barrier(MPI_COMM_WORLD);
if(self == 0)
if(ssg_self_rank == 0)
{
/* ssg id 0 (client) initiates benchmark */
/* ssg rank 0 (client) initiates benchmark */
/* warmup */
if(g_opts.warmup_seconds)
ret = run_benchmark(g_bw_id, 1, gid, mid, 0, g_opts.warmup_seconds, 0);
ret = run_benchmark(g_bw_id, ssg_get_group_member_id_from_rank(gid, 1),
gid, mid, 0, g_opts.warmup_seconds, 0);
assert(ret == 0);
ret = run_benchmark(g_bw_id, 1, gid, mid, 1, g_opts.duration_seconds, 1);
ret = run_benchmark(g_bw_id, ssg_get_group_member_id_from_rank(gid, 1),
gid, mid, 1, g_opts.duration_seconds, 1);
assert(ret == 0);
}
else
......
......@@ -47,7 +47,8 @@ int main(int argc, char **argv)
int nranks;
int ret;
ssg_group_id_t gid;
ssg_member_id_t self;
ssg_member_id_t ssg_self_id;
int ssg_self_rank;
int rank;
double *measurement_array;
int namelen;
......@@ -119,12 +120,13 @@ int main(int argc, char **argv)
assert(ssg_get_group_size(gid) == 2);
self = ssg_get_self_id(mid);
ssg_self_id = ssg_get_self_id(mid);
ssg_self_rank = ssg_get_group_self_rank(gid);
#if 0
printf("MPI rank %d has SSG ID %lu\n", rank, self);
printf("MPI rank %d has SSG ID %lu\n", rank, ssg_self_id);
#endif
self_addr = ssg_get_group_member_addr(gid, self);
self_addr = ssg_get_group_member_addr(gid, ssg_self_id);
assert(self_addr != HG_ADDR_NULL);
ret = margo_addr_to_string(mid, ssg_self_str, &ssg_self_str_len, self_addr);
assert(ret == 0);
......@@ -132,14 +134,15 @@ int main(int argc, char **argv)
printf("Process %d of %d is on host %s, advertising Hg address %s\n",
rank, nranks, processor_name, ssg_self_str);
if(self == 0)
if(ssg_self_rank == 0)
{
/* ssg id 0 runs benchmark */
measurement_array = calloc(g_opts.iterations, sizeof(*measurement_array));
assert(measurement_array);
ret = run_benchmark(g_opts.warmup_iterations, g_opts.iterations, noop_id, 1, gid, mid, measurement_array);
ret = run_benchmark(g_opts.warmup_iterations, g_opts.iterations, noop_id,
ssg_get_group_member_id_from_rank(gid, 1), gid, mid, measurement_array);
assert(ret == 0);
printf("# <op> <iterations> <warmup_iterations> <size> <min> <q1> <med> <avg> <q3> <max>\n");
......
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