#include #include #include "success_or_die.h" int main(int argc, char** argv) { SUCCESS_OR_DIE( gaspi_proc_init(GASPI_BLOCK) ); gaspi_rank_t iProc; gaspi_rank_t nProc; SUCCESS_OR_DIE( gaspi_proc_rank(&iProc) ); SUCCESS_OR_DIE( gaspi_proc_num(&nProc) ); if(iProc == 0) exit(1); auto test = gaspi_barrier(GASPI_GROUP_ALL, 500); if(test == GASPI_TIMEOUT) { if(iProc == 1) { std::cout << "time out" << std::endl; gaspi_state_vector_t state = (gaspi_state_vector_t) (new gaspi_state_t[nProc]); gaspi_state_vec_get( state ); for ( int i= 0; i < nProc; ++i ) { std::cout << i << " -> " << (state[i] == GASPI_STATE_HEALTHY ? "healthy" : "dead") << std::endl; } delete[] state; } } gaspi_barrier (GASPI_GROUP_ALL, 500); SUCCESS_OR_DIE( gaspi_proc_term(GASPI_BLOCK) ); return EXIT_SUCCESS; }