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

add ifdef to force a swim failure

parent 8f09794e
......@@ -149,10 +149,16 @@ ssg_group_id_t ssg_group_create(
SSG_DEBUG(g, "group lookup successful (size=%d)\n", group_size);
#if USE_SWIM_FD
int swim_active = 1;
#ifdef SWIM_FORCE_FAIL
if (g->self_rank == 1)
swim_active = 0;
#endif
/* initialize swim failure detector */
// TODO: we should probably barrier or sync somehow to avoid rpc failures
// due to timing skew of different ranks initializing swim
g->fd_ctx = (void *)swim_init(g, 1);
g->fd_ctx = (void *)swim_init(g, swim_active);
if (g->fd_ctx == NULL) goto fini;
#endif
......
......@@ -192,6 +192,11 @@ static void swim_dping_recv_ult(hg_handle_t handle)
swim_ctx = (swim_context_t *)g->fd_ctx;
assert(swim_ctx != NULL);
#ifdef SWIM_FORCE_FAIL
int drop = 1;
if (g->self_rank == 1 && drop) goto fini;
#endif
hret = HG_Get_input(handle, &dping_req);
if(hret != HG_SUCCESS) goto fini;
......@@ -321,6 +326,11 @@ static void swim_iping_recv_ult(hg_handle_t handle)
swim_ctx = (swim_context_t *)g->fd_ctx;
assert(swim_ctx != NULL);
#ifdef SWIM_FORCE_FAIL
int drop = 1;
if (g->self_rank == 1 && drop) goto fini;
#endif
hret = HG_Get_input(handle, &iping_req);
if(hret != HG_SUCCESS) goto fini;
......
......@@ -142,8 +142,10 @@ int main(int argc, char *argv[])
margo_finalize(mid);
#ifndef SWIM_FORCE_FAIL
if(hgctx) HG_Context_destroy(hgctx);
if(hgcl) HG_Finalize(hgcl);
#endif
if (strcmp(mode, "mpi") == 0)
MPI_Finalize();
......
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