2005-12-21 00:42:58 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
2006-03-28 02:44:26 +04:00
|
|
|
* Copyright (c) 2004-2006 The Regents of the University of California.
|
2005-12-21 00:42:58 +03:00
|
|
|
* All rights reserved.
|
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
*/
|
|
|
|
#ifndef OMPI_PML_DR_VFRAG_H_
|
|
|
|
#define OMPI_PML_DR_VFRAG_H_
|
|
|
|
|
|
|
|
#include "ompi_config.h"
|
|
|
|
#include "opal/event/event.h"
|
|
|
|
#include "pml_dr.h"
|
|
|
|
|
|
|
|
#if defined(c_plusplus) || defined(__cplusplus)
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2006-03-24 01:08:59 +03:00
|
|
|
#define MCA_PML_DR_VFRAG_NACKED 0x01
|
|
|
|
#define MCA_PML_DR_VFRAG_RNDV 0x02
|
2006-05-04 21:30:58 +04:00
|
|
|
#define MCA_PML_DR_VFRAG_RETRANS 0x04
|
2005-12-21 00:42:58 +03:00
|
|
|
|
|
|
|
struct mca_pml_dr_vfrag_t {
|
2006-06-12 20:44:00 +04:00
|
|
|
ompi_free_list_item_t super;
|
2005-12-21 00:42:58 +03:00
|
|
|
ompi_ptr_t vf_send;
|
|
|
|
ompi_ptr_t vf_recv;
|
|
|
|
uint32_t vf_id;
|
|
|
|
uint16_t vf_idx;
|
|
|
|
uint16_t vf_len;
|
|
|
|
size_t vf_offset;
|
|
|
|
size_t vf_size;
|
|
|
|
size_t vf_max_send_size;
|
|
|
|
uint64_t vf_ack;
|
|
|
|
uint64_t vf_mask;
|
2006-06-01 22:58:38 +04:00
|
|
|
int64_t vf_pending;
|
2006-03-24 01:08:59 +03:00
|
|
|
uint32_t vf_state;
|
2006-02-24 20:08:14 +03:00
|
|
|
struct mca_bml_base_btl_t* bml_btl;
|
2006-03-04 03:36:16 +03:00
|
|
|
|
2006-02-24 20:08:14 +03:00
|
|
|
/* we need a timer for the vfrag for:
|
|
|
|
1) a watchdog timer for local completion of the current
|
|
|
|
operation
|
|
|
|
2) a timeout for ACK of the VRAG
|
|
|
|
*/
|
2006-05-04 20:16:26 +04:00
|
|
|
struct timeval vf_wdog_tv;
|
|
|
|
opal_event_t vf_wdog_ev;
|
|
|
|
uint8_t vf_wdog_cnt;
|
|
|
|
|
|
|
|
struct timeval vf_ack_tv;
|
|
|
|
opal_event_t vf_ack_ev;
|
|
|
|
uint8_t vf_ack_cnt;
|
2005-12-21 00:42:58 +03:00
|
|
|
};
|
|
|
|
typedef struct mca_pml_dr_vfrag_t mca_pml_dr_vfrag_t;
|
|
|
|
|
|
|
|
OBJ_CLASS_DECLARATION(mca_pml_dr_vfrag_t);
|
|
|
|
|
|
|
|
#define MCA_PML_DR_VFRAG_ALLOC(vfrag,rc) \
|
|
|
|
do { \
|
2006-06-13 02:09:03 +04:00
|
|
|
ompi_free_list_item_t* item; \
|
2005-12-21 00:42:58 +03:00
|
|
|
OMPI_FREE_LIST_WAIT(&mca_pml_dr.vfrags, item, rc); \
|
|
|
|
vfrag = (mca_pml_dr_vfrag_t*)item; \
|
|
|
|
} while(0)
|
|
|
|
|
|
|
|
|
|
|
|
#define MCA_PML_DR_VFRAG_RETURN(vfrag) \
|
|
|
|
do { \
|
2006-06-13 02:09:03 +04:00
|
|
|
OMPI_FREE_LIST_RETURN(&mca_pml_dr.vfrags, \
|
|
|
|
(ompi_free_list_item_t*)vfrag); \
|
2005-12-21 00:42:58 +03:00
|
|
|
} while(0)
|
|
|
|
|
2006-03-22 18:02:36 +03:00
|
|
|
#define MCA_PML_DR_VFRAG_INIT(vfrag) \
|
|
|
|
do { \
|
2006-03-24 09:49:45 +03:00
|
|
|
(vfrag)->vf_idx = 0; \
|
|
|
|
(vfrag)->vf_ack = 0; \
|
2006-05-04 20:16:26 +04:00
|
|
|
(vfrag)->vf_wdog_cnt = 0; \
|
|
|
|
(vfrag)->vf_ack_cnt = 0; \
|
2007-01-05 01:07:37 +03:00
|
|
|
(vfrag)->vf_recv.pval = NULL; \
|
2006-03-24 01:08:59 +03:00
|
|
|
(vfrag)->vf_state = 0; \
|
|
|
|
(vfrag)->vf_pending = 0; \
|
2006-05-04 20:16:26 +04:00
|
|
|
(vfrag)->vf_wdog_tv = mca_pml_dr.wdog_timer; \
|
|
|
|
(vfrag)->vf_ack_tv = mca_pml_dr.ack_timer; \
|
2006-03-22 00:23:33 +03:00
|
|
|
} while(0)
|
2006-03-16 22:38:21 +03:00
|
|
|
|
2006-03-24 09:49:45 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Watchdog Timer
|
|
|
|
*/
|
|
|
|
|
2005-12-21 00:42:58 +03:00
|
|
|
#define MCA_PML_DR_VFRAG_WDOG_START(vfrag) \
|
|
|
|
do { \
|
2006-05-04 20:16:26 +04:00
|
|
|
opal_event_add(&(vfrag)->vf_wdog_ev, &(vfrag)->vf_wdog_tv); \
|
2006-02-24 20:08:14 +03:00
|
|
|
} while(0)
|
|
|
|
|
2006-03-24 09:49:45 +03:00
|
|
|
#define MCA_PML_DR_VFRAG_WDOG_STOP(vfrag) \
|
|
|
|
do { \
|
2006-05-04 20:16:26 +04:00
|
|
|
opal_event_del(&(vfrag)->vf_wdog_ev); \
|
2006-03-24 09:49:45 +03:00
|
|
|
} while(0)
|
|
|
|
|
2006-02-24 20:08:14 +03:00
|
|
|
#define MCA_PML_DR_VFRAG_WDOG_RESET(vfrag) \
|
|
|
|
do { \
|
2006-05-04 20:16:26 +04:00
|
|
|
opal_event_del(&(vfrag)->vf_wdog_ev); \
|
|
|
|
opal_event_add(&(vfrag)->vf_wdog_ev, &vfrag->vf_wdog_tv); \
|
2005-12-21 00:42:58 +03:00
|
|
|
} while(0)
|
|
|
|
|
2006-03-24 09:49:45 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Ack Timer
|
|
|
|
*/
|
2006-02-24 20:08:14 +03:00
|
|
|
|
|
|
|
#define MCA_PML_DR_VFRAG_ACK_START(vfrag) \
|
|
|
|
do { \
|
2006-05-04 20:16:26 +04:00
|
|
|
opal_event_add(&(vfrag)->vf_ack_ev, &(vfrag)->vf_ack_tv); \
|
2006-02-24 20:08:14 +03:00
|
|
|
} while(0)
|
|
|
|
|
|
|
|
#define MCA_PML_DR_VFRAG_ACK_STOP(vfrag) \
|
|
|
|
do { \
|
2006-05-04 20:16:26 +04:00
|
|
|
opal_event_del(&vfrag->vf_ack_ev); \
|
2005-12-21 00:42:58 +03:00
|
|
|
} while(0)
|
|
|
|
|
2006-03-24 09:49:45 +03:00
|
|
|
#define MCA_PML_DR_VFRAG_ACK_RESET(vfrag) \
|
|
|
|
do { \
|
|
|
|
MCA_PML_DR_VFRAG_ACK_STOP(vfrag); \
|
|
|
|
MCA_PML_DR_VFRAG_ACK_START(vfrag); \
|
|
|
|
} while(0)
|
|
|
|
|
2006-05-04 20:16:26 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Reset a VFRAG to use a new BTL
|
|
|
|
*/
|
|
|
|
|
|
|
|
void mca_pml_dr_vfrag_reset(mca_pml_dr_vfrag_t*);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reschedule a vfrag that has timed out
|
|
|
|
*/
|
|
|
|
|
|
|
|
void mca_pml_dr_vfrag_reschedule(mca_pml_dr_vfrag_t*);
|
|
|
|
|
2005-12-21 00:42:58 +03:00
|
|
|
#if defined(c_plusplus) || defined(__cplusplus)
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|