photon  1.1
photon_pwc.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_PWC_H
15 #define PHOTON_PWC_H
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 #include "libphoton.h"
22 #include "photon_request.h"
23 #include "util.h"
24 
25 #define PWC_ALIGN 8
26 #define PWC_BUFFER 0x01
27 #define PWC_LEDGER 0x02
28 
29 typedef enum pwc_cid_type_t {
35 } pwc_cid_type;
36 
37 typedef enum pwc_command_t {
44 } pwc_command;
45 
46 typedef struct photon_eb_hdr_t {
47  volatile uint8_t header;
49  uintptr_t addr;
50  uint16_t length;
51  volatile uint8_t footer;
53 
54 #define EB_MSG_SIZE(s) (sizeof(struct photon_eb_hdr_t) + s + sizeof(uint8_t))
55 #define PWC_MAX_PACKED (ALIGN(EB_MSG_SIZE(_photon_spsize + _photon_idsize), PWC_ALIGN))
56 
57 // interface to deal with pwc used along with post/put/get/test
58 int photon_pwc_init(photonConfig cfg);
61 int photon_pwc_register_ctype_handler(pwc_cid_type type, void *handler);
62 
63 int _photon_put_with_completion(int proc, uint64_t size,
64  photonBuffer lbuf,
65  photonBuffer rbuf,
66  photon_cid local, photon_cid remote,
67  int flags,
68  pwc_cid_type type, pwc_command cmd);
69 
70 int _photon_get_with_completion(int proc, uint64_t size,
71  photonBuffer lbuf,
72  photonBuffer rbuf,
73  photon_cid local, photon_cid remote,
74  int flags,
75  pwc_cid_type type, pwc_command cmd);
76 
77 int _photon_probe_completion(int proc, int *flag, int *remaining,
78  photon_cid *comp, int *src,
79  void (*cb)(photon_cid), int flags);
80 
81 #ifdef __cplusplus
82 }
83 #endif
84 
85 #endif
int _photon_get_with_completion(int proc, uint64_t size, photonBuffer lbuf, photonBuffer rbuf, photon_cid local, photon_cid remote, int flags, pwc_cid_type type, pwc_command cmd)
Definition: photon_pwc.c:854
volatile uint8_t header
Definition: photon_pwc.h:47
The Photon completion ID used by the PWC API.
Definition: photon.h:78
pwc_cid_type
Definition: photon_pwc.h:29
int _photon_put_with_completion(int proc, uint64_t size, photonBuffer lbuf, photonBuffer rbuf, photon_cid local, photon_cid remote, int flags, pwc_cid_type type, pwc_command cmd)
Definition: photon_pwc.c:759
photonRequest photon_pwc_pop_req(int proc)
Definition: photon_pwc.c:755
uintptr_t addr
Definition: photon_pwc.h:49
volatile uint8_t footer
Definition: photon_pwc.h:51
pwc_command
Definition: photon_pwc.h:37
photon_cid_hdr cent
Definition: photon_pwc.h:48
struct photon_req_t * photonRequest
int photon_pwc_init(photonConfig cfg)
Definition: photon_pwc.c:716
int _photon_probe_completion(int proc, int *flag, int *remaining, photon_cid *comp, int *src, void(*cb)(photon_cid), int flags)
Definition: photon_pwc.c:1390
int photon_pwc_register_ctype_handler(pwc_cid_type type, void *handler)
Definition: photon_pwc.c:743
uint16_t length
Definition: photon_pwc.h:50
int photon_pwc_add_req(photonRequest req)
Definition: photon_pwc.c:749