1
1
openmpi/ompi/mca/vprotocol/pessimist/vprotocol_pessimist_event.h
George Bosilca c9e5ab9ed1 Our macros for the OMPI-level free list had one extra argument, a possible return
value to signal that the operation of retrieving the element from the free list
failed. However in this case the returned pointer was set to NULL as well, so the
error code was redundant. Moreover, this was a continuous source of warnings when
the picky mode is on.

The attached parch remove the rc argument from the OMPI_FREE_LIST_GET and
OMPI_FREE_LIST_WAIT macros, and change to check if the item is NULL instead of
using the return code.

This commit was SVN r28722.
2013-07-04 08:34:37 +00:00

78 строки
2.9 KiB
C

/*
* Copyright (c) 2004-2013 The Trustees of the University of Tennessee.
* All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include "ompi/mca/pml/base/pml_base_request.h"
#include "opal_stdint.h"
#ifndef __INCLUDE_VPROTOCOL_PESSIMIST_EVENT_H__
#define __INCLUDE_VPROTOCOL_PESSIMIST_EVENT_H__
BEGIN_C_DECLS
/* Make sure -Wformat is happy... */
typedef uint64_t vprotocol_pessimist_clock_t;
#define PRIpclock PRIx64
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 {
vprotocol_pessimist_matching_event_t e_matching;
vprotocol_pessimist_delivery_event_t e_delivery;
} 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; \
OMPI_FREE_LIST_WAIT(&mca_vprotocol_pessimist.events_pool, item); \
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; \
OMPI_FREE_LIST_WAIT(&mca_vprotocol_pessimist.events_pool, item); \
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)
END_C_DECLS
#endif /* INCLUDE_VPROTOCOL_PESSIMIST_EVENT_H__ */