photon  1.1
photon_event.h
Go to the documentation of this file.
1 // =============================================================================
2 // Photon RDMA Library (libphoton)
3 //
4 // Copyright (c) 2016, Trustees of Indiana University,
5 // All rights reserved.
6 //
7 // This software may be modified and distributed under the terms of the BSD
8 // license. See the COPYING file for details.
9 //
10 // This software was created at the Indiana University Center for Research in
11 // Extreme Scale Technologies (CREST).
12 // =============================================================================
13 
14 #ifndef PHOTON_EVENT_H
15 #define PHOTON_EVENT_H
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 #include "photon_backend.h"
22 
23 #define PHOTON_EVENT_OK 0x00
24 #define PHOTON_EVENT_ERROR 0x01
25 #define PHOTON_EVENT_NONE 0x02
26 #define PHOTON_EVENT_REQCOMP 0x04
27 #define PHOTON_EVENT_REQFOUND 0x05
28 #define PHOTON_EVENT_NOTIMPL 0x06
29 
30 #define PHOTON_EFLAG_LEDG 0x00
31 #define PHOTON_EFLAG_PACK 0x01
32 
33 #define PHOTON_EFLAG_ONE 0x00
34 #define PHOTON_EFLAG_TWO 0x01
35 
36 #define PHOTON_ETYPE_DATA 0x00
37 #define PHOTON_ETYPE_NTFY 0x01
38 
39 #define ENCODE_RCQ_32(t,l,f,c,p) ((((((uint32_t)t)<<15) | \
40  (((uint16_t)l)<<14) | \
41  (((uint16_t)f)<<13) | \
42  ((uint16_t)c)) << 16) | \
43  (uint16_t)p )
44 #define DECODE_RCQ_32_PROC(v) ((uint32_t)v<<16>>16)
45 #define DECODE_RCQ_32_CURR(v) ((uint32_t)v<<3>>19)
46 #define DECODE_RCQ_32_FLAG(v) ((uint32_t)v<<2>>31)
47 #define DECODE_RCQ_32_LEAD(v) ((uint32_t)v<<1>>31)
48 #define DECODE_RCQ_32_TYPE(v) ((uint32_t)v>>31)
49 
50 #define ENCODE_RCQ_64_CURR(v) ((uint64_t)v<<32)
51 #define DECODE_RCQ_64_CURR(v) ((uint64_t)v>>32)
52 
54 PHOTON_INTERNAL int __photon_get_nevents(int proc, int max, photon_rid **id, int *n);
55 PHOTON_INTERNAL int __photon_get_revent(int proc, photon_rid *id, uint64_t *imm);
56 PHOTON_INTERNAL int __photon_get_nrevents(int proc, int max, photon_rid **id, uint64_t **imms, int *n);
57 
64 
69 
70 #ifdef __cplusplus
71 }
72 #endif
73 
74 #endif
PHOTON_INTERNAL int __photon_get_nevents(int proc, int max, photon_rid **id, int *n)
Definition: photon_event.c:113
PHOTON_INTERNAL int __photon_wait_event(photonRequest req)
Definition: photon_event.c:418
PHOTON_INTERNAL int __photon_handle_send_event(photonRequest req, photon_rid rid)
uint64_t photon_rid
The Photon request ID.
Definition: photon.h:75
PHOTON_INTERNAL int __photon_nbpop_ledger(photonRequest req)
Definition: photon_event.c:285
PHOTON_INTERNAL int __photon_get_event(int proc, photon_rid *id)
Definition: photon_event.c:87
PHOTON_INTERNAL int __photon_handle_recv_event(photon_rid id)
PHOTON_INTERNAL int __photon_handle_cq_event(photonRequest req, photon_rid rid, photonRequest *rreq)
Definition: photon_event.c:173
PHOTON_INTERNAL int __photon_nbpop_sr(photonRequest req)
Definition: photon_event.c:272
PHOTON_INTERNAL int __photon_nbpop_event(photonRequest req)
Definition: photon_event.c:233
struct photon_req_t * photonRequest
#define PHOTON_INTERNAL
PHOTON_INTERNAL int __photon_try_one_event(photonRequest *rreq)
Definition: photon_event.c:387
PHOTON_INTERNAL int __photon_get_revent(int proc, photon_rid *id, uint64_t *imm)
Definition: photon_event.c:139
PHOTON_INTERNAL int __photon_get_nrevents(int proc, int max, photon_rid **id, uint64_t **imms, int *n)
PHOTON_INTERNAL int __photon_handle_cq_special(photon_rid rid)
Definition: photon_event.c:19
PHOTON_INTERNAL int __photon_wait_ledger(photonRequest req)
Definition: photon_event.c:337