21 prefix = (uint32_t)(cookie>>32);
32 int proc = (int)(cookie<<32>>32);
34 sync_store(&
photon_processes[proc].remote_eager_buf->acct.rloc, 0, SYNC_RELEASE);
39 int proc = (int)(cookie<<32>>32);
41 sync_store(&
photon_processes[proc].remote_pwc_buf->acct.rloc, 0, SYNC_RELEASE);
46 int proc = (int)(cookie<<32>>32);
48 sync_store(&
photon_processes[proc].remote_fin_ledger->acct.rloc, 0, SYNC_RELEASE);
53 int proc = (int)(cookie<<32>>32);
55 sync_store(&
photon_processes[proc].remote_rcv_info_ledger->acct.rloc, 0, SYNC_RELEASE);
60 int proc = (int)(cookie<<32>>32);
62 sync_store(&
photon_processes[proc].remote_snd_info_ledger->acct.rloc, 0, SYNC_RELEASE);
67 int proc = (int)(cookie<<32>>32);
69 sync_store(&
photon_processes[proc].remote_eager_ledger->acct.rloc, 0, SYNC_RELEASE);
74 int proc = (int)(cookie<<32>>32);
76 sync_store(&
photon_processes[proc].remote_pwc_ledger->acct.rloc, 0, SYNC_RELEASE);
93 dbg_err(
"Error getting shmem event, rx=%d", rc);
101 dbg_err(
"Error getting event, rc=%d", rc);
107 dbg_trace(
"got event: 0x%016lx", *
id);
119 dbg_err(
"Error getting shmem event, rx=%d", rc);
127 dbg_err(
"Error getting events");
133 dbg_trace(
"got %d events", *n);
145 dbg_err(
"Error getting revent");
150 dbg_trace(
"got revent: 0x%016lx (imm=0x%016lx)", *
id, *imm);
162 dbg_err(
"Error getting revents");
167 dbg_trace(
"got %d revents", *n);
184 if ((cookie == req->id) && (req->type ==
EVQUEUE)) {
187 dbg_trace(
"Set request completed with rid: 0x%016lx", cookie);
197 int nentries = sync_addf(&treq->rattr.events, -1, SYNC_RELAXED);
200 dbg_trace(
"Set request completed, rid: 0x%016lx", cookie);
204 else if (nentries != 1) {
205 dbg_info(
"Unexpected nentries value: %d, op=%d, 0x%016lx",
206 nentries, treq->op, treq->flags);
209 else if (treq->type ==
LEDGER) {
213 dbg_trace(
"Set local completion done flag for ledger rid: 0x%016lx", cookie);
219 dbg_warn(
"Got an event that we did not expect: 0x%016lx", cookie);
236 dbg_trace(
"(%d/0x%016lx)", req->proc, req->id);
256 dbg_trace(
"Enqueuing PWC local completion");
289 dbg_trace(
"(0x%016lx)", req->id);
302 curr = sync_load(&l->curr, SYNC_RELAXED);
303 c_ind = curr & (l->num_entries - 1);
304 curr_entry = &(entries[c_ind]);
306 sync_cas(&l->curr, &curr, curr+1, SYNC_RELAXED, SYNC_RELAXED)) {
307 dbg_trace(
"Found curr: %d, req: 0x%016lx while looking for req: 0x%016lx",
308 c_ind, curr_entry->request, req->id);
310 if (curr_entry->request == req->id) {
317 dbg_trace(
"Setting request completed, rid: 0x%016lx", curr_entry->request);
323 sync_fadd(&l->prog, 1, SYNC_RELAXED);
329 dbg_warn(
"req->state != (PENDING | COMPLETE), returning 0");
341 dbg_trace(
"(0x%016lx)",req->id);
348 dbg_trace(
"curr_entry(proc==%d)=%p", i ,curr_entry);
362 curr = sync_load(&l->curr, SYNC_RELAXED);
363 c_ind = curr & (l->num_entries - 1);
364 curr_entry = &(entries[c_ind]);
365 if ((curr_entry->request != (uint64_t) 0) &&
366 sync_cas(&l->curr, &curr, curr+1, SYNC_RELAXED, SYNC_RELAXED)) {
367 dbg_trace(
"Found: %d/0x%016lx/0x%016lx", c_ind, curr_entry->request, req->id);
369 if (curr_entry->request == req->id) {
379 sync_fadd(&l->prog, 1, SYNC_RELAXED);
405 dbg_trace(
"Enqueuing PWC local completion");
426 assert(treq && treq->id == req->id);
#define REQUEST_FLAG_LDONE
int __photon_nbpop_sr(photonRequest req)
int __photon_get_event(int proc, photon_rid *id)
int __photon_get_revent(int proc, photon_rid *id, uint64_t *imm)
photonRequest photon_lookup_request(photon_rid rid)
#define PHOTON_EVENT_REQCOMP
int __photon_handle_cq_event(photonRequest req, photon_rid cookie, photonRequest *rreq)
#define REQUEST_COOK_PBUF
struct photon_rdma_ledger_entry_t * photonRDMALedgerEntry
photonBackend __photon_shmem
int __photon_get_nevents(int proc, int max, photon_rid **ids, int *n)
uint64_t photon_rid
The Photon request ID.
photonBackend __photon_fabric
#define PHOTON_ANY_SOURCE
RNDV and PWC flag: return completions from any source.
#define REQUEST_COOK_RINFO
#define REQUEST_COOK_EAGER
#define REQUEST_COOK_SINFO
#define REQUEST_COOK_GPWC
int __photon_nbpop_ledger(photonRequest req)
#define REQUEST_COOK_ELEDG
int __photon_nbpop_event(photonRequest req)
#define REQUEST_COOK_EBUF
struct photon_req_t * photonRequest
ProcessInfo * photon_processes
#define PHOTON_EVENT_NONE
#define PHOTON_ERROR
Error code, general error.
#define PHOTON_OK
Photon success code.
#define REQUEST_FLAG_EDONE
int __photon_get_revents(int proc, int max, photon_rid **ids, uint64_t **imms, int *n)
#define REQUEST_COOK_PLEDG
struct photon_rdma_ledger_t * photonLedger
int __photon_wait_event(photonRequest req)
#define PHOTON_EVENT_ERROR
int __photon_handle_cq_special(photon_rid cookie)
int __photon_wait_ledger(photonRequest req)
int photon_pwc_add_req(photonRequest req)
int __photon_try_one_event(photonRequest *rreq)
#define PHOTON_EVENT_REQFOUND
#define REQUEST_COMPLETED
photonLedger local_fin_ledger