photon  1.1
photon_rdma_ledger.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_RDMA_LEDGER_H
15 #define PHOTON_RDMA_LEDGER_H
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 #include "photon_buffer_internal.h"
22 
23 typedef struct photon_rdma_ledger_entry_t {
24  volatile photon_rid request;
26 
27 typedef struct photon_cid_recv_hdr_t {
28  uintptr_t req;
29  int cnt;
31 
32 typedef struct photon_cid_hdr_t {
33  volatile uint16_t type;
34  uint16_t cmd;
35  uint32_t size;
37 
38 typedef struct photon_cid_ledger_entry_t {
40  char data[];
42 
43 typedef struct photon_cid_recv_ledger_entry_t {
46  char data[];
48 
49 typedef struct photon_rdma_ledger_t {
50  uint64_t prog;
51  uint64_t curr;
52  uint64_t tail;
53  uint32_t num_entries;
54  uint16_t entry_size;
55  void *entries;
56  struct photon_buffer_t remote;
57  struct photon_acct_t acct;
59 
60 typedef struct photon_rdma_ledger_entry_t * photonRDMALedgerEntry;
61 typedef struct photon_cid_ledger_entry_t * photonCIDLedgerEntry;
62 typedef struct photon_cid_recv_ledger_entry_t * photonCIDRecvLedgerEntry;
63 typedef struct photon_rdma_ledger_t * photonLedger;
64 
65 #define PHOTON_CID_ENTRY_SIZE (sizeof(photon_cid_ledger_entry)+_photon_idsize)
66 #define PHOTON_CID_RECV_ENTRY_SIZE (sizeof(photon_cid_recv_ledger_entry)+_photon_idsize)
67 
69 photonLedger photon_rdma_ledger_create_reuse(void *ledger_buffer,
70  int num_entries, int entry_size,
71  int prefix);
73 void photon_rdma_ledger_free(photonLedger ledger);
75 int photon_rdma_ledger_get_next(int proc, photonLedger ledger);
76 
77 #ifdef __cplusplus
78 }
79 #endif
80 
81 #endif
Convenience pointer type for the buffer structure.
Definition: photon.h:105
photon_cid_recv_hdr rhdr
volatile photon_rid request
struct photon_rdma_ledger_entry_t * photonRDMALedgerEntry
struct photon_cid_ledger_entry_t * photonCIDLedgerEntry
photon_cid_hdr hdr
uint64_t photon_rid
The Photon request ID.
Definition: photon.h:75
PHOTON_INTERNAL photonLedger photon_rdma_ledger_create_reuse(void *ledger_buffer, int num_entries, int entry_size, int prefix)
volatile uint16_t type
PHOTON_INTERNAL void photon_rdma_ledger_free(photonLedger ledger)
#define PHOTON_INTERNAL
PHOTON_INTERNAL int photon_rdma_ledger_get_next(int proc, photonLedger ledger)
struct photon_rdma_ledger_t * photonLedger
struct photon_cid_recv_ledger_entry_t * photonCIDRecvLedgerEntry
photon_cid_hdr hdr