File: vprotocol_pessimist_event.h

package info (click to toggle)
openmpi 5.0.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 202,312 kB
  • sloc: ansic: 612,441; makefile: 42,495; sh: 11,230; javascript: 9,244; f90: 7,052; java: 6,404; perl: 5,154; python: 1,856; lex: 740; fortran: 61; cpp: 20; tcl: 12
file content (80 lines) | stat: -rw-r--r-- 3,129 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
 * Copyright (c) 2004-2013 The Trustees of the University of Tennessee.
 *                         All rights reserved.
 * Copyright (c) 2015      Los Alamos National Security, LLC. 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 {
  opal_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 {                                                                \
        opal_free_list_item_t *item;                                    \
        item = opal_free_list_wait (&mca_vprotocol_pessimist.events_pool); \
        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 {                                                                \
        opal_free_list_item_t *item;                                    \
        item = opal_free_list_wait (&mca_vprotocol_pessimist.events_pool); \
        event = (mca_vprotocol_pessimist_event_t *) item;               \
        event->type = VPROTOCOL_PESSIMIST_EVENT_TYPE_DELIVERY;          \
    } while(0)

#define VPESSIMIST_EVENT_RETURN(event)                                  \
    opal_free_list_return (&mca_vprotocol_pessimist.events_pool,        \
                           (opal_free_list_item_t *) event)

END_C_DECLS

#endif /* INCLUDE_VPROTOCOL_PESSIMIST_EVENT_H__ */