int MPIDI_nem_ckpt_start(void) { int mpi_errno = MPI_SUCCESS; int i; MPIDI_STATE_DECL(MPID_STATE_MPIDI_NEM_CKPT_START); MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_NEM_CKPT_START); if (checkpointing) goto fn_exit; checkpointing = TRUE; marker_count = MPIDI_Process.my_pg->size - 1; /* We won't receive a marker from ourselves. */ ++current_wave; /* send markers to all other processes */ /* FIXME: we're only handling processes in our pg, so no dynamic connections */ for (i = 0; i < MPIDI_Process.my_pg->size; ++i) { MPID_Request *req; MPIDI_VC_t *vc; MPIDI_CH3I_VC *vc_ch; MPID_PKT_DECL_CAST(upkt, MPID_nem_pkt_ckpt_marker_t, ckpt_pkt); /* Don't send a marker to ourselves. */ if (i == MPIDI_Process.my_pg_rank) continue; MPIDI_PG_Get_vc_set_active(MPIDI_Process.my_pg, i, &vc); vc_ch = &vc->ch; MPIDI_Pkt_init(ckpt_pkt, MPIDI_NEM_PKT_CKPT_MARKER); ckpt_pkt->wave = current_wave; mpi_errno = MPIDI_CH3_iStartMsg(vc, ckpt_pkt, sizeof(ckpt_pkt), &req); MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ckptpkt"); if (req != NULL) { MPIU_ERR_CHKANDJUMP(req->status.MPI_ERROR, mpi_errno, MPI_ERR_OTHER, "**ckptpkt"); MPID_Request_release(req); } if (!vc_ch->is_local) { mpi_errno = vc_ch->ckpt_pause_send_vc(vc); if (mpi_errno) MPIU_ERR_POP(mpi_errno); } } fn_exit: MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_NEM_CKPT_START); return mpi_errno; fn_fail: goto fn_exit; }
int MPID_nem_tcp_get_vc_from_conninfo (char *pg_id, int pg_rank, struct MPIDI_VC **vc) { int mpi_errno = MPI_SUCCESS; MPIDI_PG_t *pg; MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TCP_GET_VC_FROM_CONNINFO); MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TCP_GET_VC_FROM_CONNINFO); MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "pg_id=%s pg_rank=%d", pg_id, pg_rank)); mpi_errno = MPIDI_PG_Find (pg_id, &pg); if (mpi_errno) MPIU_ERR_POP (mpi_errno); MPIU_ERR_CHKINTERNAL(pg == NULL, mpi_errno, "invalid PG"); MPIU_ERR_CHKINTERNAL(pg_rank < 0 || pg_rank > MPIDI_PG_Get_size (pg), mpi_errno, "invalid pg_rank"); MPIDI_PG_Get_vc_set_active (pg, pg_rank, vc); fn_exit: MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TCP_GET_VC_FROM_CONNINFO); return mpi_errno; fn_fail: goto fn_exit; }