photon  1.1
photon.h
Go to the documentation of this file.
1 // =============================================================================
2 // Photon RDMA Library (libphoton)
3 //
4 // Copyright (c) 2017, 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_H
15 #define PHOTON_H
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 #include <stdint.h>
22 
27 
29 
30 #define PHOTON_OK 0x0000
31 #define PHOTON_ERROR_NOINIT 0x0001
32 #define PHOTON_ERROR 0x0002
33 #define PHOTON_ERROR_RESOURCE 0x0004
34 
35 #define PHOTON_EXCH_TCP 0x0000
36 #define PHOTON_EXCH_MPI 0x0001
37 #define PHOTON_EXCH_PMI 0x0002
38 #define PHOTON_EXCH_XSP 0x0004
39 #define PHOTON_EXCH_EXTERNAL 0x0008
40 
41 #define PHOTON_REQ_NIL 0x0000
42 #define PHOTON_REQ_COMPLETED 0x0001
43 #define PHOTON_REQ_PWC_NO_LCE 0x0002
44 #define PHOTON_REQ_PWC_NO_RCE 0x0004
45 #define PHOTON_REQ_SHUTDOWN 0x0008
46 
47 #define PHOTON_PROBE_ANY 0xffff
48 #define PHOTON_PROBE_EVQ 0x0001
49 #define PHOTON_PROBE_LEDGER 0x0002
50 #define PHOTON_PROBE_SLEDGER 0x0004
51 #define PHOTON_PROBE_RLEDGER 0x0008
52 
53 #define PHOTON_ANY_TAG -1
54 #define PHOTON_ANY_SOURCE -1
55 #define PHOTON_ANY_SIZE -1
56 
57 typedef union photon_addr_t {
60  uint8_t raw[16];
61  unsigned long s_addr;
62  struct {
63  uint64_t prefix;
64  uint64_t proc_id;
65  } global;
66  struct {
67  uint32_t blk0;
68  uint32_t blk1;
69  uint32_t blk2;
70  uint32_t blk3;
71  } blkaddr;
72 } photon_addr;
73 
75 typedef uint64_t photon_rid;
76 
78 typedef struct {
79  union {
80  uint64_t u64;
81  void *data;
82  };
83  uint32_t size;
84 } photon_cid;
85 
88  union photon_addr_t src_addr;
89  photon_rid request;
90  uint64_t size;
91  int tag;
92  int count;
93  int error;
94 };
95 
99  uint64_t key0;
100  uint64_t key1;
101 };
102 
106  uintptr_t addr;
107  uint64_t size;
108  struct photon_buffer_priv_t priv;
109 };
110 
112 typedef union photon_addr_t * photonAddr;
114 typedef struct photon_status_t * photonStatus;
116 typedef struct photon_buffer_priv_t * photonBufferPriv;
118 typedef struct photon_buffer_t * photonBuffer;
119 
121 
122 #include "photon_attributes.h"
123 #include "photon_buffer.h"
124 #include "photon_collectives.h"
125 #include "photon_rndv.h"
126 #include "photon_wc.h"
127 #include "photon_ud.h"
128 #include "photon_atomics.h"
129 #include "photon_config.h"
130 #include "photon_main.h"
131 
132 #ifdef __cplusplus
133 }
134 #endif
135 
136 #endif
Convenience pointer type for the buffer structure.
Definition: photon.h:105
uint32_t size
Size 0 indicates u64 field is used, otherwise data pointer is used.
Definition: photon.h:83
uint32_t blk3
Definition: photon.h:70
The Photon completion ID used by the PWC API.
Definition: photon.h:78
unsigned long s_addr
Definition: photon.h:61
uint64_t photon_rid
The Photon request ID.
Definition: photon.h:75
uint32_t blk0
Definition: photon.h:67
union photon_addr_t * photonAddr
Convenience pointer type for the address union.
Definition: photon.h:112
uint64_t size
Definition: photon.h:90
uint64_t key0
Definition: photon.h:99
void * data
Pointer to user-defined completion ID data.
Definition: photon.h:81
uint64_t size
The size of the buffer in bytes.
Definition: photon.h:107
uint32_t blk2
Definition: photon.h:69
uint64_t u64
Unsigned 64b representation of the ID.
Definition: photon.h:80
Convenience pointer type for the private buffer structure.
Definition: photon.h:98
photon_rid request
Definition: photon.h:89
Status for Photon requests returned by the RNDV API.
Definition: photon.h:87
uint64_t proc_id
Definition: photon.h:64
uint32_t blk1
Definition: photon.h:68
uintptr_t addr
The base address of the buffer.
Definition: photon.h:106
uint64_t prefix
Definition: photon.h:63