20 #include <arpa/inet.h> 24 #include "photon_forwarder.h" 37 static photonMsgBuf sendbuf;
38 static photonMsgBuf recvbuf;
53 int info_ledger_size, fin_ledger_size, pwc_ledger_size, eager_ledger_size;
54 int eager_bufsize, pwc_bufsize;
56 srand48(getpid() * time(NULL));
60 one_debug(
"num CQs:\t\t%d", cfg->cap.num_cq);
66 one_debug(
"init req per rank:\t%d", cfg->cap.default_rd);
67 one_debug(
"completion order:\t%s", PHOTON_ORDER_TO_STRING[cfg->attr.comp_order]);
70 log_err(
"Failed to allocate buffer table");
73 dbg_trace(
"Allocated buffertable");
76 if (!photon_processes) {
77 log_err(
"Could not allocate process information");
84 dbg_trace(
"Allocated and cleared process info");
96 dbg_trace(
"Allocated request structures");
107 bufsize = info_ledger_size + fin_ledger_size + pwc_ledger_size + eager_ledger_size;
108 bufsize += (eager_bufsize + pwc_bufsize);
110 rc = posix_memalign((
void**)&buf, getpagesize(), bufsize);
112 log_err(
"Couldn't allocate ledgers");
116 one_debug(
"shared buffer size:\t%d", bufsize);
119 log_err(
"couldn't setup snd/rcv info ledgers");
124 log_err(
"couldn't setup send ledgers");
129 log_err(
"couldn't setup send ledgers");
134 log_err(
"couldn't setup eager ledgers");
139 log_err(
"couldn't setup eager buffers");
144 log_err(
"couldn't setup pwc eager buffers");
150 log_err(
"Couldn't register shared storage");
158 log_err(
"Could not initialize photon shared memory");
167 log_err(
"Could not initialize photon fabric backend");
173 uint64_t msgbuf_size, p_size;
174 int p_offset, p_hsize;
179 dbg_err(
"Could not get mtu for UD service");
185 p_size = p_offset + *mtu - 84;
192 dbg_trace(
"sr partition size: %lu", p_size);
199 dbg_err(
"could not create send message buffer");
206 dbg_err(
"could not create recv message buffer");
212 for (i = 0; i < recvbuf->p_count; i++) {
214 recvbuf->p_size, &recvbuf->db->bint.buf,
225 if (photon_processes[i].backend == NULL) {
233 log_err(
"Could not register local buffer for the ledger entries");
241 log_err(
"Could not exchange ledgers");
251 while( !SLIST_EMPTY(&pending_mem_register_list) ) {
253 dbg_trace(
"registering buffer in queue");
254 mem_reg_req = SLIST_FIRST(&pending_mem_register_list);
255 SLIST_REMOVE_HEAD(&pending_mem_register_list, list);
259 dbg_trace(
"ended successfully =============");
271 free(photon_processes);
287 dbg_err(
"Could not find request to cancel: 0x%016lx", request);
308 log_err(
"Could not finalize shmem");
316 log_err(
"Could not finalize fabric");
325 static int first_time = 1;
328 dbg_trace(
"(%p, %lu)", addr, size);
333 SLIST_INIT(&pending_mem_register_list);
337 mem_reg_req->
buffer = addr;
340 SLIST_INSERT_HEAD(&pending_mem_register_list, mem_reg_req, list);
341 dbg_trace(
"called before init, queueing buffer info");
346 dbg_trace(
"we had an existing buffer, reusing it");
353 log_err(
"could not create photon buffer");
357 dbg_trace(
"created buffer: %p", db);
360 log_err(
"Couldn't register buffer of size %lu at %p", size, addr);
364 dbg_trace(
"registered buffer");
370 dbg_trace(
"added buffer to table");
383 dbg_trace(
"(%p, %llu)", addr, size);
388 dbg_err(
"no such buffer is registered at %p", addr);
392 if (--(db->ref_count) == 0) {
427 dbg_trace(
"(0x%016lx)", request);
431 dbg_warn(
"Request (id=0x%016lx) could not be found", request);
438 dbg_trace(
"returning 1, flag:-1");
448 if( type != NULL ) *type = 1;
454 if( type != NULL ) *type = 2;
460 if( type != NULL ) *type = 0;
470 status->src_addr.global.proc_id = req->proc;
471 status->tag = req->tag;
472 status->size = req->size;
477 dbg_trace(
"returning 0, flag:1");
485 dbg_trace(
"returning 0, flag:0");
492 dbg_trace(
"returning -1, flag:0");
499 dbg_warn(
"Reached default case");
511 dbg_trace(
"(0x%016lx)", request);
515 log_err(
"Wrong request value, operation not in table");
520 dbg_warn(
"Request 0x%016lx is already free!", req->id);
546 photonBackend be = photon_processes[proc].
backend;
553 dbg_trace(
"(%d, %p, %lu, %d, %p)", proc, ptr, size, tag, request);
556 log_err(
"Requested recv from ptr not in table");
562 log_err(
"Could not get request descriptor for proc %d", proc);
576 req->rattr.events = 1;
577 req->rattr.cookie = req->id;
579 if (request != NULL) {
583 log_warn(
"request == NULL, could not return request ID: 0x%016lx", req->id);
601 dbg_trace(
"New curr (proc=%d): %u", proc, curr);
605 rmt_addr += curr *
sizeof(*entry);
609 entry->request = req->id;
611 entry->addr = (uintptr_t)ptr;
613 entry->priv = db->bint.buf.priv;
616 dbg_trace(
"Post recv");
617 dbg_trace(
"Request: 0x%016lx", entry->request);
618 dbg_trace(
"Address: %p", (
void *)entry->addr);
619 dbg_trace(
"RAddress: %p", (
void *)rmt_addr);
620 dbg_trace(
"Size: %lu", entry->size);
621 dbg_trace(
"Tag: %d", entry->tag);
622 dbg_trace(
"Keys: 0x%016lx / 0x%016lx", entry->priv.key0, entry->priv.key1);
625 rc = be->rdma_put(proc, (uintptr_t)entry, rmt_addr,
sizeof(*entry), &(
shared_storage->bint.buf),
629 dbg_err(
"RDMA PUT failed for 0x%016lx", req->id);
637 if (request != NULL) {
646 photonBackend be = photon_processes[proc].
backend;
648 uintptr_t rmt_addr, eager_addr;
653 int offset, rc, curr;
659 dbg_trace(
"Exceeding known receiver eager buf progress!");
671 dbg_trace(
"Exceeding known receiver eager ledger progress!");
679 log_err(
"Could not get request descriptor for proc %d", proc);
693 req->rattr.events = 1;
694 req->rattr.cookie = req->id;
696 if (request != NULL) {
700 log_warn(
"request == NULL, could not return request ID: 0x%016lx", req->id);
703 eager_addr = (uintptr_t)eb->remote.addr + offset;
706 dbg_trace(
"EAGER PUT of size %lu to addr: 0x%016lx", size, eager_addr);
708 rc = be->rdma_put(proc, (uintptr_t)ptr, eager_addr, size, &(db->bint.buf),
712 dbg_err(
"RDMA EAGER PUT failed for 0x%016lx", eager_cookie);
716 dbg_trace(
"new eager curr == %d", curr);
717 rmt_addr = l->remote.addr + (curr *
sizeof(*entry));
719 entries = l->entries;
720 entry = &entries[curr];
722 entry->request = (size<<32) | (req->id<<32>>32);
724 dbg_trace(
"Updating remote eager ledger address: 0x%016lx, %lu", rmt_addr,
sizeof(*entry));
726 rc = be->rdma_put(proc, (uintptr_t)entry, rmt_addr,
sizeof(*entry), &(
shared_storage->bint.buf),
730 dbg_err(
"RDMA PUT failed for 0x%016lx", req->id);
750 photonBackend be = photon_processes[proc].
backend;
755 dbg_trace(
"Exceeding known receiver snd_info progress!");
760 dbg_trace(
"new curr == %d", curr);
764 log_err(
"Could not get request descriptor for proc %d", proc);
775 req->rattr.events = 1;
776 req->rattr.cookie = req->id;
778 if (request != NULL) {
782 log_warn(
"request == NULL, could not return request ID: 0x%016lx", req->id);
786 rmt_addr += curr *
sizeof(*entry);
791 entry->request = req->id;
793 entry->addr = (uintptr_t)ptr;
795 entry->priv = db->bint.buf.priv;
799 dbg_trace(
"Post send request");
800 dbg_trace(
"Request: 0x%016lx", entry->request);
801 dbg_trace(
"Addr: %p", (
void *)entry->addr);
802 dbg_trace(
"Size: %lu", entry->size);
803 dbg_trace(
"Tag: %d", entry->tag);
804 dbg_trace(
"Keys: 0x%016lx / 0x%016lx", entry->priv.key0, entry->priv.key1);
805 dbg_trace(
"Updating remote ledger address: 0x%016lx, %lu", rmt_addr,
sizeof(*entry));
807 rc = be->rdma_put(proc, (uintptr_t)entry, rmt_addr,
sizeof(*entry), &(
shared_storage->bint.buf),
811 dbg_err(
"RDMA PUT failed for 0x%016lx", req->id);
824 dbg_trace(
"(%d, %p, %lu, %d, %p)", proc, ptr, size, tag, request);
827 log_err(
"Requested post of send buffer for ptr not in table");
843 if (request != NULL) {
850 photonBackend be = photon_processes[proc].
backend;
855 dbg_trace(
"(%d, %lu, %d, %p)", proc, size, tag, request);
859 log_err(
"Could not get request descriptor for proc %d", proc);
872 req->rattr.events = 1;
873 req->rattr.cookie = req->id;
875 if (request != NULL) {
879 log_warn(
"request == NULL, could not return request ID: 0x%016lx", req->id);
889 dbg_trace(
"new curr == %d", curr);
895 entry->request = req->id;
897 entry->addr = (uintptr_t)0;
902 dbg_trace(
"Post send request");
903 dbg_trace(
"Request: 0x%016lx", entry->request);
904 dbg_trace(
"Addr: %p", (
void *)entry->addr);
905 dbg_trace(
"Size: %lu", entry->size);
906 dbg_trace(
"Tag: %d", entry->tag);
907 dbg_trace(
"Keys: 0x%016lx / 0x%016lx", entry->priv.key0, entry->priv.key1);
912 rmt_addr += curr *
sizeof(*entry);
914 rc = be->rdma_put(proc, (uintptr_t)entry, rmt_addr,
sizeof(*entry), &(
shared_storage->bint.buf),
918 dbg_err(
"RDMA PUT failed for 0x%016lx", req->id);
926 if (request != NULL) {
938 dbg_trace(
"(%d, %d)", proc, tag);
941 curr = sync_load(&photon_processes[proc].local_rcv_info_ledger->curr, SYNC_RELAXED);
945 dbg_trace(
"Spinning on info ledger looking for receive request");
946 dbg_trace(
"looking in position %d/%p", c_ind, curr_entry);
948 entry_iterator = curr_entry;
950 while (entry_iterator->header == 0 || entry_iterator->footer == 0) {
953 dbg_err(
"Failure getting event");
958 if( (tag < 0) || (entry_iterator->tag == tag ) ) {
959 if (sync_cas(&photon_processes[proc].local_rcv_info_ledger->curr, &curr, curr+1, SYNC_RELAXED, SYNC_RELAXED)) {
966 if (request != NULL) {
970 log_err(
"Could not setup request for proc %d", proc);
974 sync_fadd(&photon_processes[proc].local_rcv_info_ledger->prog, 1, SYNC_RELAXED);
985 uint64_t curr, curr_eager;
989 dbg_trace(
"(%d, %d)", proc, tag);
993 curr = sync_load(&photon_processes[proc].local_snd_info_ledger->curr, SYNC_RELAXED);
997 curr_eager = sync_load(&photon_processes[proc].local_eager_ledger->curr, SYNC_RELAXED);
1000 eager_entry = &(entries[ce_ind]);
1002 dbg_trace(
"Spinning on info/eager ledger looking for receive request");
1003 dbg_trace(
"looking in position %d/%p (%d/%p)", c_ind, curr_entry, ce_ind, eager_entry);
1005 entry_iterator = curr_entry;
1008 while((entry_iterator->header == 0 || entry_iterator->footer == 0) && (eager_entry->request == 0)) {
1012 if (sync_cas(&photon_processes[proc].local_eager_ledger->curr, &curr_eager, curr_eager+1, SYNC_RELAXED, SYNC_RELAXED)) {
1018 else if (eager_entry->request && (size == eager_entry->request>>32)) {
1019 if (sync_cas(&photon_processes[proc].local_eager_ledger->curr, &curr_eager, curr_eager+1, SYNC_RELAXED, SYNC_RELAXED)) {
1025 else if( ((tag < 0) || (entry_iterator->tag == tag )) && (size ==
PHOTON_ANY_SIZE) ) {
1026 if (sync_cas(&photon_processes[proc].local_snd_info_ledger->curr, &curr, curr+1, SYNC_RELAXED, SYNC_RELAXED)) {
1031 else if (((tag < 0) || (entry_iterator->tag == tag )) && (size == entry_iterator->size)) {
1032 if (sync_cas(&photon_processes[proc].local_snd_info_ledger->curr, &curr, curr+1, SYNC_RELAXED, SYNC_RELAXED)) {
1039 if (request != NULL) {
1043 sync_fadd(&photon_processes[proc].local_eager_ledger->prog, 1, SYNC_RELAXED);
1047 sync_fadd(&photon_processes[proc].local_snd_info_ledger->prog, 1, SYNC_RELAXED);
1050 log_err(
"Could not setup request for proc %d", proc);
1063 int iproc, still_searching = 1;
1070 dbg_trace(
"(%d)", tag);
1072 dbg_trace(
"Spinning on send info ledger looking for send request");
1080 curr = sync_load(&photon_processes[iproc].local_snd_info_ledger->curr, SYNC_RELAXED);
1083 dbg_trace(
"looking in position %d/%p for proc %d", c_ind, curr_entry, iproc);
1085 entry_iterator = curr_entry;
1086 while(entry_iterator->header == 1 && entry_iterator->footer == 1)
1087 if( (entry_iterator->addr == (uintptr_t)0) && (entry_iterator->priv.key0 == 0) && ((tag < 0) || (entry_iterator->tag == tag )) ) {
1088 if (sync_cas(&photon_processes[iproc].local_snd_info_ledger->curr, &curr, curr+1, SYNC_RELAXED, SYNC_RELAXED)) {
1089 dbg_trace(
"Found matching send request with tag %d from proc %d", tag, iproc);
1090 still_searching = 0;
1095 stime = _tictoc(stime, -1);
1097 }
while(still_searching);
1099 curr_entry->header = 0;
1100 curr_entry->footer = 0;
1101 sync_fadd(&photon_processes[iproc].local_snd_info_ledger->prog, 1, SYNC_RELAXED);
1107 int tag, uint64_t r_offset) {
1108 photonBackend be = photon_processes[proc].
backend;
1114 dbg_trace(
"(%d, %p, %lu, %lu, %lu)", proc, ptr, size, r_offset, request);
1117 log_err(
"Could not find request");
1121 if (request != req->id) {
1122 log_err(
"Request mismatch encountered!");
1126 if (proc != req->proc) {
1127 log_err(
"Request/proc mismatch: %d/%d", proc, req->proc);
1139 drb = &(req->remote_info.buf);
1142 log_err(
"Tried posting a send for a buffer not registered");
1146 if (drb->size > 0 && size + r_offset > drb->size) {
1147 log_err(
"Requested to send %lu bytes to a buffer of size %lu at offset %lu", size, drb->size, r_offset);
1151 dbg_trace(
"Posting Request ID: %d/%lu", proc, request);
1154 rc = be->rdma_put(proc, (uintptr_t)ptr, drb->addr + (uintptr_t)r_offset,
1158 dbg_err(
"RDMA PUT failed for 0x%016lx", request);
1170 int tag, uint64_t r_offset) {
1171 photonBackend be = photon_processes[proc].
backend;
1177 dbg_trace(
"(%d, %p, %lu, %lu, 0x%016lx)", proc, ptr, size, r_offset, request);
1180 log_err(
"Could not find request");
1184 if (request != req->id) {
1185 log_err(
"Request mismatch encountered!");
1189 if (proc != req->proc) {
1190 log_err(
"Request/proc mismatch: %d/%d", proc, req->proc);
1202 drb = &(req->remote_info.buf);
1205 log_err(
"Tried posting a os_get() into a buffer that's not registered");
1209 if ( (drb->size > 0) && ((size+r_offset) > drb->size) ) {
1210 log_err(
"Requested to get %lu bytes from a %lu buffer size at offset %lu", size, drb->size, r_offset);
1216 uint64_t offset, curr,
new, left;
1218 curr = sync_load(&eb->curr, SYNC_RELAXED);
1219 offset = curr & (eb->size - 1);
1220 left = eb->size - offset;
1222 new = curr + left + size;;
1229 if (sync_cas(&eb->curr, &curr,
new, SYNC_RELAXED, SYNC_RELAXED)) {
1230 dbg_trace(
"EAGER copy message of size %lu from addr: 0x%016lx (offset=%lu)",
1231 size, (uintptr_t)&eb->data[offset], offset);
1232 memcpy(ptr, &eb->data[offset], size);
1233 memset(&eb->data[offset], 0, size);
1235 sync_store(&eb->prog,
new, SYNC_RELAXED);
1241 dbg_trace(
"Posted Request ID: %d/0x%016lx", proc, request);
1244 rc = be->rdma_get(proc, (uintptr_t)ptr, drb->addr + (uintptr_t)r_offset,
1245 size, &(db->bint.buf), drb, request, 0);
1248 dbg_err(
"RDMA GET failed for 0x%016lx\n", request);
1261 photonBackend be = photon_processes[proc].
backend;
1267 dbg_trace(
"(%d, %p, %lu, %lu, %p)", proc, ptr, size, rbuf->size, request);
1270 log_err(
"Tried posting a os_put_direct() from a buffer that's not registered");
1274 lbuf.
addr = (uintptr_t)ptr;
1276 lbuf.
priv = db->bint.buf.priv;
1280 dbg_trace(
"Could not setup direct buffer request for proc %d", proc);
1287 rc = be->rdma_put(proc, (uintptr_t)ptr, rbuf->addr,
1288 size, &(db->bint.buf), rbuf, req->rattr.cookie,
1292 dbg_err(
"RDMA PUT failed for 0x%016lx", req->rattr.cookie);
1296 dbg_trace(
"Posted Proc/Request/Cookie: %d/0x%016lx/0x%016lx", proc, req->id, req->rattr.cookie);
1302 if (request != NULL) {
1309 photonBackend be = photon_processes[proc].
backend;
1315 dbg_trace(
"(%d, %p, %lu, %lu, %p)", proc, ptr, size, rbuf->size, request);
1318 log_err(
"Tried posting a os_get_direct() from a buffer that's not registered");
1322 lbuf.
addr = (uintptr_t)ptr;
1324 lbuf.
priv = db->bint.buf.priv;
1328 dbg_trace(
"Could not setup direct buffer request for proc %d", proc);
1335 rc = be->rdma_get(proc, (uintptr_t)ptr, rbuf->addr, size,
1336 &(db->bint.buf), rbuf, req->rattr.cookie,
1340 dbg_err(
"RDMA GET failed for 0x%016lx", req->rattr.cookie);
1344 dbg_trace(
"Posted Proc/Request/Cookie: %d/0x%016lx/0x%016lx", proc, req->id, req->rattr.cookie);
1350 if (request != NULL) {
1357 photonBackend be = photon_processes[proc].
backend;
1362 dbg_trace(
"(%d, 0x%016lx)", proc, request);
1365 log_err(
"Could not find request");
1370 dbg_trace(
"Warning: sending FIN for a request (EVQUEUE) that is not in completed state (state==%d)", req->state);
1374 log_err(
"Trying to FIN a remote buffer request that was never set!");
1381 dbg_trace(
"Exceeding known receiver FIN progress!");
1388 entry = &(entries[curr]);
1389 dbg_trace(
"photon_processes[%d].remote_fin_ledger->curr==%d", proc, curr);
1391 if( entry == NULL ) {
1392 log_err(
"entry is NULL for proc=%d", proc);
1396 entry->request = req->remote_info.id.u64;
1401 rmt_addr += curr *
sizeof(*entry);
1403 rc = be->rdma_put(proc, (uintptr_t)entry, rmt_addr,
sizeof(*entry), &(
shared_storage->bint.buf),
1413 dbg_trace(
"Removing request 0x%016lx for remote buffer request 0x%016lx", request, req->remote_info.id);
1416 dbg_trace(
"%d requests left in reqtable for proc %d",
photon_count_request(req->proc), req->proc);
1422 MARK_DONE(photon_processes[proc].remote_fin_ledger, 1);
1437 if (ret_req == NULL) {
1445 *ret_proc = req->proc;
1460 if (ret_req == NULL || ret_proc == NULL) {
1465 log_warn(
"No outstanding requests to wait for");
1474 entries = l->entries;
1476 curr = sync_load(&l->curr, SYNC_RELAXED);
1477 c_ind = curr & (l->num_entries - 1);
1478 curr_entry = &(entries[c_ind]);
1479 dbg_trace(
"Wait All Out: %d", c_ind);
1481 if ((curr_entry->request != (uint64_t) 0) &&
1482 sync_cas(&l->curr, &curr, curr+1, SYNC_RELAXED, SYNC_RELAXED)) {
1484 dbg_trace(
"Wait All In: %d/0x%016lx", c_ind, curr_entry->request);
1488 *ret_req = curr_entry->request;
1494 sync_fadd(&l->prog, 1, SYNC_RELAXED);
1510 int start, end, c_ind;
1525 for (i=start; i<end; i++) {
1535 dbg_err(
"unknown ledger type");
1543 curr = sync_load(&photon_processes[i].local_eager_ledger->curr, SYNC_RELAXED);
1546 eager_entry = &(entries[c_ind]);
1547 if (eager_entry->request) {
1548 status->src_addr.global.proc_id = i;
1549 status->request = eager_entry->request;
1550 status->size = eager_entry->request>>32;
1558 curr = sync_load(&ledger->curr, SYNC_RELAXED);
1559 c_ind = curr & (ledger->num_entries - 1);
1560 entry_iterator = &(ledger->entries[c_ind]);
1561 if (entry_iterator->header && entry_iterator->footer && (entry_iterator->tag > 0)) {
1562 status->src_addr.global.proc_id = i;
1563 status->request = entry_iterator->request;
1564 status->tag = entry_iterator->tag;
1565 status->size = entry_iterator->size;
1567 dbg_trace(
"Request: 0x%016lx", entry_iterator->request);
1568 dbg_trace(
"Address: %p", (
void *)entry_iterator->addr);
1569 dbg_trace(
"Size: %lu", entry_iterator->size);
1570 dbg_trace(
"Tag: %d", entry_iterator->tag);
1597 status->src_addr.global.proc_id = req->proc;
1598 status->request = req->id;
1599 status->tag = req->tag;
1600 status->size = req->size;
1603 dbg_trace(
"returning 0, flag:1");
1642 if (!(addr->blkaddr.blk0) &&
1643 !(addr->blkaddr.blk1) &&
1644 !(addr->blkaddr.blk2)) {
1647 uint32_t *iptr = (uint32_t*)&(raddr->raw[12]);
1648 *iptr = htonl(addr->blkaddr.blk3);
1651 dbg_err(
"block_id, missing ud_gid_prefix?");
1656 raddr->global.prefix = addr->global.prefix;
1657 raddr->global.proc_id = addr->global.proc_id;
1668 dbg_warn(
"Could not find buffer: 0x%016lx of size %lu", (uintptr_t)addr, size);
1672 if (!db->is_registered) {
1673 dbg_err(
"Could not lookup private buffer info on unregistered buffer");
1690 log_err(
"Could not find request 0x%016lx", request);
1695 dbg_trace(
"Request has already trasitioned, can not return remote buffer info");
1700 (*ret_buf).addr = req->remote_info.buf.addr;
1701 (*ret_buf).size = req->remote_info.buf.size;
1702 (*ret_buf).priv = req->remote_info.buf.priv;
1714 int photon_xsp_lookup_proc(libxspSess *sess,
ProcessInfo **ret_pi,
int *index) {
1718 if (photon_processes[i].sess &&
1719 !xsp_sesscmp(photon_processes[i].sess, sess)) {
1722 *ret_pi = &photon_processes[i];
1733 int photon_xsp_unused_proc(
ProcessInfo **ret_pi,
int *index) {
1738 if (!photon_processes[i].sess)
1742 if (i == _photon_nproc) {
1752 *ret_pi = &photon_processes[i];
int _photon_try_eager(int proc, void *ptr, uint64_t size, int tag, photon_rid *request, photonBufferHandle db)
#define REQUEST_FLAG_LDONE
int _photon_post_send_request_rdma(int proc, uint64_t size, int tag, photon_rid *request)
int __photon_nbpop_sr(photonRequest req)
#define REQUEST_COOK_RECV
Convenience pointer type for the buffer structure.
int buffertable_remove(photonBufferHandle buf)
photonRequest photon_lookup_request(photon_rid rid)
#define PHOTON_NP_PBUF_SIZE
#define PHOTON_EVENT_REQCOMP
photonBufferHandle photon_buffer_create(void *addr, uint64_t size, int flags)
int _photon_send(photonAddr addr, void *ptr, uint64_t size, int flags, photon_rid *request)
int _photon_wait_recv_buffer_rdma(int proc, uint64_t size, int tag, photon_rid *request)
#define PHOTON_NP_LEDG_SIZE
photonRequest photon_setup_request_ledger_eager(photonRDMALedgerEntry entry, int curr, int proc)
struct photon_ri_ledger_entry_t * photonRILedgerEntry
PHOTON_INTERNAL int _photon_initialized(void)
photonBufferHandle shared_storage
#define PHOTON_LRI_PTR(a)
#define REQUEST_FLAG_EAGER
int photon_count_request(int proc)
#define REQUEST_OP_RECVBUF
struct photon_buffer_handle_t * photonBufferHandle
photonRequest photon_setup_request_direct(photonBuffer lbuf, photonBuffer rbuf, uint64_t size, int proc, int events)
photonLedger remote_eager_ledger
#define PHOTON_PROBE_RLEDGER
RNDV probe flag: return RECV ledger completion IDs.
int photon_wait_send_request_rdma(int tag)
struct photon_rdma_ledger_entry_t * photonRDMALedgerEntry
photonBackend __photon_shmem
#define PHOTON_ANY_SIZE
RNDV flag: return completions of any size.
uint64_t photon_rid
The Photon request ID.
photonBackend __photon_fabric
photonRILedger remote_rcv_info_ledger
#define PHOTON_NP_EBUF_SIZE
#define PHOTON_NP_PEDG_SIZE
#define PHOTON_ANY_SOURCE
RNDV and PWC flag: return completions from any source.
#define PHOTON_LPB_PTR(a)
struct photon_ri_ledger_t * photonRILedger
#define REQUEST_FLAG_WFIN
int buffertable_find_exact(void *addr, uint64_t size, photonBufferHandle *result)
#define PHOTON_ERROR_NOINIT
Error code, subsystem not initialized.
#define PHOTON_LEB_PTR(a)
#define PHOTON_NP_INFO_SIZE
#define REQUEST_COOK_EAGER
int _photon_post_os_get_direct(int proc, void *ptr, uint64_t size, photonBuffer rbuf, int flags, photon_rid *request)
int photon_msgbuffer_free(photonMsgBuf mbuf)
union photon_addr_t * photonAddr
Convenience pointer type for the address union.
#define PHOTON_NP_RPEDG_SIZE
int _photon_post_recv_buffer_rdma(int proc, void *ptr, uint64_t size, int tag, photon_rid *request)
struct photon_buffer_priv_t priv
THe associated private buffer information.
int buffertable_insert(photonBufferHandle buf)
int __photon_nbpop_ledger(photonRequest req)
photonRequest photon_get_request(int proc)
int __photon_nbpop_event(photonRequest req)
int photon_setup_eager_buf(ProcessInfo *photon_processes, char *buf, int size)
photonForwarder __photon_forwarder
int _photon_init(photonConfig cfg, ProcessInfo *info, photonBufferHandle ss)
int _photon_wait_send_request_rdma(int tag)
void photon_buffer_free(photonBufferHandle buf)
int photon_rdma_eager_buf_get_offset(int proc, photonEagerBuf buf, int size, int lim)
int _photon_recv(photon_rid request, void *ptr, uint64_t size, int flags)
photonLedger remote_fin_ledger
struct photon_req_t * photonRequest
ProcessInfo * photon_processes
#define PHOTON_REQ_SHUTDOWN
CANCEL flag: clear all outstanding requests.
int _photon_post_os_put(photon_rid request, int proc, void *ptr, uint64_t size, int tag, uint64_t r_offset)
int _photon_wait_any(int *ret_proc, photon_rid *ret_req)
int _photon_wait(photon_rid request)
#define PHOTON_PROBE_SLEDGER
RNDV probe flag: return SEND ledger completion IDs.
int photon_buffer_register(photonBufferHandle buf, int flags)
int _photon_io_finalize()
int photon_setup_pwc_buf(ProcessInfo *photon_processes, char *buf, int size)
int photon_setup_ri_ledger(ProcessInfo *photon_processes, char *buf, int num_entries)
#define PHOTON_EVENT_NONE
#define PHOTON_ERROR
Error code, general error.
int photon_free_request(photonRequest req)
photonLedger local_eager_ledger
uint64_t size
The size of the buffer in bytes.
int photon_ri_ledger_get_next(int proc, photonRILedger l)
int _photon_send_FIN(photon_rid request, int proc, int flags)
int _photon_handle_addr(photonAddr addr, photonAddr raddr)
photonRILedger local_snd_info_ledger
Use Verbs photon backend.
int _photon_get_buffer_remote(photon_rid request, photonBuffer ret_buf)
int _photon_post_os_get(photon_rid request, int proc, void *ptr, uint64_t size, int tag, uint64_t r_offset)
int photon_buffer_unregister(photonBufferHandle buf)
#define PHOTON_OK
Photon success code.
int photon_rdma_ledger_get_next(int proc, photonLedger l)
int _photon_get_buffer_private(void *addr, uint64_t size, const struct photon_buffer_priv_t **pptr)
#define REQUEST_FLAG_EDONE
#define PHOTON_REQ_COMPLETED
RNDV flag: explitily set a request completed for FIN.
#define REQUEST_OP_SENDBUF
int buffertable_find_containing(void *addr, uint64_t size, photonBufferHandle *result)
photonRILedger local_rcv_info_ledger
photonMsgBuf photon_msgbuffer_new(uint64_t size, uint64_t p_size, int p_offset, int p_hsize)
photonRequest photon_setup_request_ledger_info(photonRILedgerEntry ri_entry, int curr, int proc)
int _photon_probe(photonAddr addr, int *flag, photonStatus status)
int _photon_try_rndv(int proc, void *ptr, uint64_t size, int tag, photon_rid *request, photonBufferHandle db)
int photon_request_init(photonConfig cfg)
#define PHOTON_ERROR_RESOURCE
Error code, resource not available.
int photon_coll_init(photonConfig cfg)
photonEagerBuf local_eager_buf
int _photon_probe_ledger(int proc, int *flag, int type, photonStatus status)
photonEagerBuf remote_eager_buf
struct photon_rdma_ledger_t * photonLedger
Convenience pointer type for the private buffer structure.
int __photon_wait_event(photonRequest req)
int _photon_cancel(photon_rid request, int flags)
photonRILedger remote_snd_info_ledger
int _photon_register_buffer(void *addr, uint64_t size)
int buffertable_init(int size)
int _photon_io_init(char *file, int amode, void *view, int niter)
int photon_setup_pwc_ledger(ProcessInfo *photon_processes, char *buf, int num_entries)
#define PHOTON_EVENT_ERROR
SLIST_HEAD(pendingmemregs, photon_mem_register_req)
photonConfig __photon_config
int photon_pwc_init(photonConfig cfg)
void buffertable_finalize()
int photon_setup_eager_ledger(ProcessInfo *photon_processes, char *buf, int num_entries)
int _photon_unregister_buffer(void *addr, uint64_t size)
int _photon_post_send_buffer_rdma(int proc, void *ptr, uint64_t size, int tag, photon_rid *request)
int __photon_wait_ledger(photonRequest req)
int photon_setup_fin_ledger(ProcessInfo *photon_processes, char *buf, int num_entries)
int __photon_try_one_event(photonRequest *rreq)
int _photon_wait_any_ledger(int *ret_proc, photon_rid *ret_req)
int photon_exchange_ledgers(ProcessInfo *processes, int flags)
#define PHOTON_EVENT_REQFOUND
#define REQUEST_COMPLETED
uintptr_t addr
The base address of the buffer.
int _photon_test(photon_rid request, int *flag, int *type, photonStatus status)
int _photon_wait_send_buffer_rdma(int proc, uint64_t size, int tag, photon_rid *request)
int _photon_post_os_put_direct(int proc, void *ptr, uint64_t size, photonBuffer rbuf, int flags, photon_rid *request)
#define REQUEST_OP_SENDREQ
photonLedger local_fin_ledger
struct photon_rdma_eager_buf_t * photonEagerBuf