2007-07-26 02:28:04 +04:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2004-2007 The Trustees of the University of Tennessee.
|
|
|
|
* All rights reserved.
|
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
2007-07-21 01:36:11 +04:00
|
|
|
#include "ompi_config.h"
|
|
|
|
#include "opal/mca/base/mca_base_param.h"
|
|
|
|
#include "ompi/mca/pml/base/pml_base_request.h"
|
2008-01-29 10:35:14 +03:00
|
|
|
#include "opal_stdint.h"
|
2007-07-21 01:36:11 +04:00
|
|
|
|
2008-03-28 00:05:44 +03:00
|
|
|
#ifndef __INCLUDE_VPROTOCOL_PESSIMIST_EVENT_H__
|
|
|
|
#define __INCLUDE_VPROTOCOL_PESSIMIST_EVENT_H__
|
|
|
|
|
2007-12-12 22:13:23 +03:00
|
|
|
BEGIN_C_DECLS
|
|
|
|
|
2008-01-24 07:59:31 +03:00
|
|
|
/* Make sure -Wformat is happy... */
|
2007-07-21 01:36:11 +04:00
|
|
|
typedef uint64_t vprotocol_pessimist_clock_t;
|
2008-01-24 07:59:31 +03:00
|
|
|
#define PRIpclock PRIx64
|
2007-07-21 01:36:11 +04:00
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
VPROTOCOL_PESSIMIST_EVENT_TYPE_MATCHING,
|
|
|
|
VPROTOCOL_PESSIMIST_EVENT_TYPE_DELIVERY
|
|
|
|
} vprotocol_pessimist_event_type_t;
|
|
|
|
|
|
|
|
typedef struct vprotocol_pessimist_matching_event_t {
|
|
|
|
vprotocol_pessimist_clock_t reqid; /* recv request post "clock" */
|
|
|
|
int src; /* matched src */
|
|
|
|
} vprotocol_pessimist_matching_event_t;
|
|
|
|
|
|
|
|
typedef struct vprotocol_pessimist_delivery_event_t {
|
|
|
|
vprotocol_pessimist_clock_t probeid; /* operation "clock" (for waits, tests, probes) */
|
|
|
|
vprotocol_pessimist_clock_t reqid; /* delivered request (recv or send) -TODO: SUPPORT FOR WaitSome/TestSome- */
|
|
|
|
} vprotocol_pessimist_delivery_event_t;
|
|
|
|
|
|
|
|
typedef union vprotocol_pessimist_mem_event_t {
|
2009-03-17 20:35:28 +03:00
|
|
|
vprotocol_pessimist_matching_event_t e_matching;
|
|
|
|
vprotocol_pessimist_delivery_event_t e_delivery;
|
2007-07-21 01:36:11 +04:00
|
|
|
} vprotocol_pessimist_mem_event_t;
|
|
|
|
|
|
|
|
typedef struct mca_vprotocol_pessimist_event_t {
|
|
|
|
ompi_free_list_item_t super;
|
|
|
|
vprotocol_pessimist_event_type_t type;
|
|
|
|
mca_pml_base_request_t *req;
|
|
|
|
vprotocol_pessimist_mem_event_t u_event;
|
|
|
|
} mca_vprotocol_pessimist_event_t;
|
|
|
|
|
|
|
|
OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_vprotocol_pessimist_event_t);
|
|
|
|
|
|
|
|
|
|
|
|
#define VPESSIMIST_MATCHING_EVENT_NEW(event) do { \
|
|
|
|
ompi_free_list_item_t *item; \
|
|
|
|
int rc; \
|
|
|
|
OMPI_FREE_LIST_WAIT(&mca_vprotocol_pessimist.events_pool, item, rc); \
|
|
|
|
event = (mca_vprotocol_pessimist_event_t *) item; \
|
|
|
|
event->type = VPROTOCOL_PESSIMIST_EVENT_TYPE_MATCHING; \
|
|
|
|
event->u_event.e_matching.src = -1; \
|
|
|
|
} while(0)
|
|
|
|
|
|
|
|
#define VPESSIMIST_DELIVERY_EVENT_NEW(event) do { \
|
|
|
|
ompi_free_list_item_t *item; \
|
|
|
|
int rc; \
|
|
|
|
OMPI_FREE_LIST_WAIT(&mca_vprotocol_pessimist.events_pool, item, rc); \
|
|
|
|
event = (mca_vprotocol_pessimist_event_t *) item; \
|
|
|
|
event->type = VPROTOCOL_PESSIMIST_EVENT_TYPE_DELIVERY; \
|
|
|
|
} while(0)
|
|
|
|
|
|
|
|
#define VPESSIMIST_EVENT_RETURN(event) \
|
|
|
|
OMPI_FREE_LIST_RETURN(&mca_vprotocol_pessimist.events_pool, \
|
|
|
|
(ompi_free_list_item_t *) event)
|
|
|
|
|
2007-12-12 22:13:23 +03:00
|
|
|
END_C_DECLS
|
|
|
|
|
2007-07-21 01:36:11 +04:00
|
|
|
#endif /* INCLUDE_VPROTOCOL_PESSIMIST_EVENT_H__ */
|