#include "heartbeat.h" HeartBeat::HeartBeat(int num_procs) { this->num_procs = num_procs; this->online = new int[num_procs]; for(int i=0; ionline[i] = 1; } this->last_send_time = new time_t[num_procs]; for(int i=0; ilast_send_time[i] = 0; } this->requests = new MPI_Request[num_procs]; this->send_requests = new MPI_Request[num_procs]; for(int i=1; ionline; delete []this->last_send_time; delete []this->requests; } void HeartBeat::update() { for(int i=1; i 5) { if(online[i]) printf("[leader] ERROR: worker %d offline\n", i); online[i] = 0; } else { if(!online[i]) printf("[leader] RECONNECT: worker %d online\n", i); online[i] = 1; } } for(int i=1; i