2005-12-20 21:42:58 +00: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-27 22:44:26 +00:00
|
|
|
* Copyright (c) 2004-2006 The Regents of the University of California.
|
2005-12-20 21:42:58 +00: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"
|
Update libevent to the 2.0 series, currently at 2.0.7rc. We will update to their final release when it becomes available. Currently known errors exist in unused portions of the libevent code. This revision passes the IBM test suite on a Linux machine and on a standalone Mac.
This is a fairly intrusive change, but outside of the moving of opal/event to opal/mca/event, the only changes involved (a) changing all calls to opal_event functions to reflect the new framework instead, and (b) ensuring that all opal_event_t objects are properly constructed since they are now true opal_objects.
Note: Shiqing has just returned from vacation and has not yet had a chance to complete the Windows integration. Thus, this commit almost certainly breaks Windows support on the trunk. However, I want this to have a chance to soak for as long as possible before I become less available a week from today (going to be at a class for 5 days, and thus will only be sparingly available) so we can find and fix any problems.
Biggest change is moving the libevent code from opal/event to a new opal/mca/event framework. This was done to make it much easier to update libevent in the future. New versions can be inserted as a new component and tested in parallel with the current version until validated, then we can remove the earlier version if we so choose. This is a statically built framework ala installdirs, so only one component will build at a time. There is no selection logic - the sole compiled component simply loads its function pointers into the opal_event struct.
I have gone thru the code base and converted all the libevent calls I could find. However, I cannot compile nor test every environment. It is therefore quite likely that errors remain in the system. Please keep an eye open for two things:
1. compile-time errors: these will be obvious as calls to the old functions (e.g., opal_evtimer_new) must be replaced by the new framework APIs (e.g., opal_event.evtimer_new)
2. run-time errors: these will likely show up as segfaults due to missing constructors on opal_event_t objects. It appears that it became a typical practice for people to "init" an opal_event_t by simply using memset to zero it out. This will no longer work - you must either OBJ_NEW or OBJ_CONSTRUCT an opal_event_t. I tried to catch these cases, but may have missed some. Believe me, you'll know when you hit it.
There is also the issue of the new libevent "no recursion" behavior. As I described on a recent email, we will have to discuss this and figure out what, if anything, we need to do.
This commit was SVN r23925.
2010-10-24 18:35:54 +00:00
|
|
|
#include "opal/mca/event/event.h"
|
2009-03-17 21:34:30 +00:00
|
|
|
#include "opal/types.h"
|
2005-12-20 21:42:58 +00:00
|
|
|
#include "pml_dr.h"
|
|
|
|
|
2009-08-20 11:42:18 +00:00
|
|
|
BEGIN_C_DECLS
|
2005-12-20 21:42:58 +00:00
|
|
|
|
2006-03-23 22:08:59 +00:00
|
|
|
#define MCA_PML_DR_VFRAG_NACKED 0x01
|
|
|
|
#define MCA_PML_DR_VFRAG_RNDV 0x02
|
2006-05-04 17:30:58 +00:00
|
|
|
#define MCA_PML_DR_VFRAG_RETRANS 0x04
|
2005-12-20 21:42:58 +00:00
|
|
|
|
|
|
|
struct mca_pml_dr_vfrag_t {
|
2006-06-12 16:44:00 +00:00
|
|
|
ompi_free_list_item_t super;
|
2005-12-20 21:42:58 +00: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 18:58:38 +00:00
|
|
|
int64_t vf_pending;
|
2006-03-23 22:08:59 +00:00
|
|
|
uint32_t vf_state;
|
2006-02-24 17:08:14 +00:00
|
|
|
struct mca_bml_base_btl_t* bml_btl;
|
2006-03-04 00:36:16 +00:00
|
|
|
|
2006-02-24 17:08:14 +00: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 16:16:26 +00: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-20 21:42:58 +00: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-12 22:09:03 +00:00
|
|
|
ompi_free_list_item_t* item; \
|
2005-12-20 21:42:58 +00: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-12 22:09:03 +00:00
|
|
|
OMPI_FREE_LIST_RETURN(&mca_pml_dr.vfrags, \
|
|
|
|
(ompi_free_list_item_t*)vfrag); \
|
2005-12-20 21:42:58 +00:00
|
|
|
} while(0)
|
|
|
|
|
2006-03-22 15:02:36 +00:00
|
|
|
#define MCA_PML_DR_VFRAG_INIT(vfrag) \
|
|
|
|
do { \
|
2006-03-24 06:49:45 +00:00
|
|
|
(vfrag)->vf_idx = 0; \
|
|
|
|
(vfrag)->vf_ack = 0; \
|
2006-05-04 16:16:26 +00:00
|
|
|
(vfrag)->vf_wdog_cnt = 0; \
|
|
|
|
(vfrag)->vf_ack_cnt = 0; \
|
2007-01-04 22:07:37 +00:00
|
|
|
(vfrag)->vf_recv.pval = NULL; \
|
2006-03-23 22:08:59 +00:00
|
|
|
(vfrag)->vf_state = 0; \
|
|
|
|
(vfrag)->vf_pending = 0; \
|
2006-05-04 16:16:26 +00:00
|
|
|
(vfrag)->vf_wdog_tv = mca_pml_dr.wdog_timer; \
|
|
|
|
(vfrag)->vf_ack_tv = mca_pml_dr.ack_timer; \
|
2006-03-21 21:23:33 +00:00
|
|
|
} while(0)
|
2006-03-16 19:38:21 +00:00
|
|
|
|
2006-03-24 06:49:45 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Watchdog Timer
|
|
|
|
*/
|
|
|
|
|
2005-12-20 21:42:58 +00:00
|
|
|
#define MCA_PML_DR_VFRAG_WDOG_START(vfrag) \
|
|
|
|
do { \
|
2010-10-28 15:22:46 +00:00
|
|
|
opal_event_add(&(vfrag)->vf_wdog_ev, &(vfrag)->vf_wdog_tv); \
|
2006-02-24 17:08:14 +00:00
|
|
|
} while(0)
|
|
|
|
|
2006-03-24 06:49:45 +00:00
|
|
|
#define MCA_PML_DR_VFRAG_WDOG_STOP(vfrag) \
|
|
|
|
do { \
|
2010-10-28 15:22:46 +00:00
|
|
|
opal_event_del(&(vfrag)->vf_wdog_ev); \
|
2006-03-24 06:49:45 +00:00
|
|
|
} while(0)
|
|
|
|
|
2006-02-24 17:08:14 +00:00
|
|
|
#define MCA_PML_DR_VFRAG_WDOG_RESET(vfrag) \
|
|
|
|
do { \
|
2010-10-28 15:22:46 +00:00
|
|
|
opal_event_del(&(vfrag)->vf_wdog_ev); \
|
|
|
|
opal_event_add(&(vfrag)->vf_wdog_ev, &vfrag->vf_wdog_tv); \
|
2005-12-20 21:42:58 +00:00
|
|
|
} while(0)
|
|
|
|
|
2006-03-24 06:49:45 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Ack Timer
|
|
|
|
*/
|
2006-02-24 17:08:14 +00:00
|
|
|
|
|
|
|
#define MCA_PML_DR_VFRAG_ACK_START(vfrag) \
|
|
|
|
do { \
|
2010-10-28 15:22:46 +00:00
|
|
|
opal_event_add(&(vfrag)->vf_ack_ev, &(vfrag)->vf_ack_tv); \
|
2006-02-24 17:08:14 +00:00
|
|
|
} while(0)
|
|
|
|
|
|
|
|
#define MCA_PML_DR_VFRAG_ACK_STOP(vfrag) \
|
|
|
|
do { \
|
2010-10-28 15:22:46 +00:00
|
|
|
opal_event_del(&vfrag->vf_ack_ev); \
|
2005-12-20 21:42:58 +00:00
|
|
|
} while(0)
|
|
|
|
|
2006-03-24 06:49:45 +00: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 16:16:26 +00: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*);
|
|
|
|
|
2009-08-20 11:42:18 +00:00
|
|
|
END_C_DECLS
|
2005-12-20 21:42:58 +00:00
|
|
|
#endif
|
|
|
|
|