14 #ifndef PHOTON_BACKEND_H 15 #define PHOTON_BACKEND_H 32 #include "libsync/sync.h" 33 #include "libsync/queues.h" 39 #define PHOTON_GET_CQ_IND(n, i) ((n > 1) ? (i % n) : 0) 41 #define DEF_EAGER_BUF_SIZE (1024*8) // 8K bytes of space per rank 42 #define DEF_PWC_BUF_SIZE (1024*8) // 8K bytes of space per rank 43 #define DEF_PWC_CID_SIZE (8) // Default to 64 bit completion IDs 44 #define DEF_SMALL_MSG_SIZE (1024) 45 #define DEF_LEDGER_SIZE (64) 46 #define DEF_SP_SIZE (128) 50 #define MAX_LEDGER_SIZE (1<<13) // Only 13 bits available in RCQ 51 #define MAX_PWC_BUF_SIZE (1<<13) // Only 13 bits available in RCQ 52 #define MIN_PWC_BUF_SIZE (1024) // PWC requires some internal buffer 54 #define UD_MASK_SIZE (1<<6) 56 #define EVENT_NIL 0x00 61 #define RDMA_FLAG_NIL 0x00 62 #define RDMA_FLAG_NO_CQE (1<<1) 63 #define RDMA_FLAG_WITH_IMM (1<<2) 65 #define LEDGER_ALL 0xff 66 #define LEDGER_INFO (1<<1) 67 #define LEDGER_EAGER (1<<2) 68 #define LEDGER_FIN (1<<3) 69 #define LEDGER_PWC (1<<4) 70 #define LEDGER_BUF (1<<5) 71 #define LEDGER_PBUF (1<<6) 73 #define PH_BE_NIL 0x00 74 #define PH_BE_IN_ORDER (1<<1) 78 typedef struct proc_info_t {
118 typedef struct photon_ud_hdr_t {
126 typedef struct photon_backend_attr_t {
135 int (*initialized)(void);
137 int (*finalize)(void);
138 int (*connect)(
void *local_ci,
void *remote_ci,
int pindex,
void **ret_ci,
int *ret_len,
143 int (*get_dev_name)(
char **ib_dev);
146 int (*rdma_put)(
int proc, uintptr_t laddr, uintptr_t raddr, uint64_t size,
147 photonBuffer lbuf, photonBuffer rbuf, uint64_t id, uint64_t imm,
int flags);
148 int (*rdma_get)(
int proc, uintptr_t laddr, uintptr_t raddr, uint64_t size,
149 photonBuffer lbuf, photonBuffer rbuf, uint64_t id,
int flags);
150 int (*rdma_send)(
photonAddr addr, uintptr_t laddr, uint64_t size,
151 photonBuffer lbuf, uint64_t id, uint64_t imm,
int flags);
152 int (*rdma_recv)(
photonAddr addr, uintptr_t laddr, uint64_t size,
153 photonBuffer lbuf, uint64_t id,
int flags);
154 int (*tx_size_left)(
int proc);
155 int (*rx_size_left)(
int proc);
156 int (*get_event)(
int proc,
int max,
photon_rid *ids,
int *n);
157 int (*get_revent)(
int proc,
int max,
photon_rid *ids, uint64_t *imms,
int *n);
166 int photon_xsp_lookup_proc(libxspSess *sess,
ProcessInfo **ret_pi,
int *index);
167 int photon_xsp_unused_proc(
ProcessInfo **ret_pi,
int *index);
photonLedger remote_pwc_ledger
PHOTON_INTERNAL int _photon_unregister_buffer(void *buffer, uint64_t size)
photonLedger local_pwc_ledger
PHOTON_INTERNAL int _photon_initialized(void)
PHOTON_INTERNAL int _photon_io_init(char *file, int amode, void *view, int niter)
PHOTON_INTERNAL int _photon_post_os_get(photon_rid request, int proc, void *ptr, uint64_t size, int tag, uint64_t r_offset)
struct photon_buffer_handle_t * photonBufferHandle
PHOTON_INTERNAL int _photon_cancel(photon_rid request, int flags)
photonLedger remote_eager_ledger
PHOTON_INTERNAL int _photon_send(photonAddr addr, void *ptr, uint64_t size, int flags, photon_rid *request)
PHOTON_INTERNAL int _photon_test(photon_rid request, int *flag, int *type, photonStatus status)
PHOTON_INTERNAL int _photon_register_buffer(void *buffer, uint64_t size)
photonRequestTable request_table
PHOTON_INTERNAL int _photon_wait_any_ledger(int *ret_proc, photon_rid *ret_req)
struct photon_req_table_t * photonRequestTable
uint64_t photon_rid
The Photon request ID.
photonRILedger remote_rcv_info_ledger
photonEagerBuf local_pwc_buf
PHOTON_INTERNAL int _photon_post_recv_buffer_rdma(int proc, void *ptr, uint64_t size, int tag, photon_rid *request)
PHOTON_INTERNAL int _photon_wait_any(int *ret_proc, photon_rid *ret_req)
PHOTON_INTERNAL int _photon_wait_recv_buffer_rdma(int proc, uint64_t size, int tag, photon_rid *request)
struct photon_ri_ledger_t * photonRILedger
PHOTON_INTERNAL int _photon_post_send_request_rdma(int proc, uint64_t size, int tag, photon_rid *request)
struct photon_backend_t photon_default_backend
union photon_addr_t * photonAddr
Convenience pointer type for the address union.
PHOTON_INTERNAL int _photon_wait(photon_rid request)
PHOTON_INTERNAL int _photon_post_os_put(photon_rid request, int proc, void *ptr, uint64_t size, int tag, uint64_t r_offset)
photonLedger remote_fin_ledger
PHOTON_INTERNAL int _photon_init(photonConfig cfg, ProcessInfo *info, photonBufferHandle ss)
PHOTON_INTERNAL int _photon_probe_ledger(int proc, int *flag, int type, photonStatus status)
photonLedger local_eager_ledger
int _photon_get_buffer_private(void *buf, uint64_t size, const struct photon_buffer_priv_t **pptr)
PHOTON_INTERNAL int _photon_io_finalize()
int _photon_get_buffer_remote(photon_rid request, photonBuffer ret_buf)
PHOTON_INTERNAL int _photon_wait_send_buffer_rdma(int proc, uint64_t size, int tag, photon_rid *request)
int _photon_handle_addr(photonAddr addr, photonAddr ret_addr)
photonRILedger local_snd_info_ledger
photon_backend_attr * attr
photonEagerBuf remote_pwc_buf
PHOTON_INTERNAL int _photon_post_send_buffer_rdma(int proc, void *ptr, uint64_t size, int tag, photon_rid *request)
PHOTON_INTERNAL int _photon_wait_send_request_rdma(int tag)
photonRILedger local_rcv_info_ledger
PHOTON_INTERNAL int _photon_finalize(void)
photonEagerBuf local_eager_buf
photonEagerBuf remote_eager_buf
struct photon_rdma_ledger_t * photonLedger
Convenience pointer type for the private buffer structure.
photonRILedger remote_snd_info_ledger
PHOTON_INTERNAL int _photon_probe(photonAddr addr, int *flag, photonStatus status)
PHOTON_INTERNAL int _photon_recv(uint64_t request, void *ptr, uint64_t size, int flags)
PHOTON_INTERNAL int _photon_post_os_put_direct(int proc, void *ptr, uint64_t size, photonBuffer rbuf, int flags, photon_rid *request)
ProcessInfo * photon_processes
PHOTON_INTERNAL int _photon_post_os_get_direct(int proc, void *ptr, uint64_t size, photonBuffer rbuf, int flags, photon_rid *request)
PHOTON_INTERNAL int _photon_send_FIN(photon_rid request, int proc, int flags)
photonLedger local_fin_ledger
struct photon_rdma_eager_buf_t * photonEagerBuf
photonBufferHandle shared_storage