photon  1.1
libphoton.c
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 #include <stdlib.h>
15 #include <string.h>
16 #include <assert.h>
17 
18 #include "libphoton.h"
19 #include "photon_backend.h"
20 #include "photon_pwc.h"
21 #include "photon_coll.h"
22 #include "photon_forwarder.h"
23 #include "logging.h"
24 #include "util.h"
25 
26 #ifdef HAVE_SHMEM
27 #include "photon_shmem_posix.h"
28 #include "photon_shmem_cma.h"
29 #endif
30 
31 #ifdef HAVE_VERBS
32 #include "verbs.h"
33 #endif
34 
35 #ifdef HAVE_UGNI
36 #include "photon_ugni.h"
37 #endif
38 
39 #ifdef HAVE_LIBFABRIC
40 #include "photon_fi.h"
41 #endif
42 
43 #ifdef HAVE_XSP
44 #include "photon_xsp_forwarder.h"
45 #endif
46 
47 // Globals
48 photonConfig __photon_config = NULL;
49 photonBackend __photon_shmem = NULL;
50 photonBackend __photon_fabric = NULL;
52 
65 
66 #if defined(ENABLE_DEBUG) || defined(ENABLE_CALLTRACE)
67 int _photon_start_debugging = 1;
68 #endif
69 
70 #if defined(ENABLE_CALLTRACE)
71 FILE *_phot_ofp;
72 #endif
73 // END Globals
74 
75 // return 1==initialized, 0==not initialized
77  int rc;
79  return 0;
80  }
81  // call internal check
82  rc = _photon_initialized();
83  if (rc == PHOTON_OK) {
84  return 1;
85  }
86  else {
87  return 0;
88  }
89 }
90 
91 int photon_init(photonConfig cfg) {
92  photonBackend be = NULL;
93  photonConfig lcfg = NULL;
94  char *errmsg = "";
95 
96  if(__photon_fabric &&
97  (__photon_fabric->initialized() == PHOTON_OK)) {
98  log_warn("Photon already initialized");
99  return PHOTON_OK;
100  }
101 
102  if (__photon_fabric &&
103  (__photon_fabric->initialized() != PHOTON_OK)) {
104  log_warn("Photon fabric backend is still initializing");
105  return PHOTON_OK;
106  }
107 
108  // copy the configuration
109  lcfg = calloc(1, sizeof(struct photon_config_t));
110  if (!lcfg) {
111  log_err("Could not allocate space for internal config!");
112  return PHOTON_ERROR;
113  }
114 
115  memcpy(lcfg, cfg, sizeof(struct photon_config_t));
116  if (cfg->ibv.eth_dev)
117  lcfg->ibv.eth_dev = strdup(cfg->ibv.eth_dev);
118  if (cfg->ibv.ib_dev)
119  lcfg->ibv.ib_dev = strdup(cfg->ibv.ib_dev);
120  if (cfg->ibv.ud_gid_prefix)
121  lcfg->ibv.ud_gid_prefix = strdup(cfg->ibv.ud_gid_prefix);
122  if (cfg->fi.eth_dev)
123  lcfg->fi.eth_dev = strdup(cfg->fi.eth_dev);
124  if (cfg->fi.provider)
125  lcfg->fi.provider = strdup(cfg->fi.provider);
126  if (cfg->fi.node)
127  lcfg->fi.node = strdup(cfg->fi.node);
128  if (cfg->fi.domain)
129  lcfg->fi.domain = strdup(cfg->fi.domain);
130  if (cfg->fi.service)
131  lcfg->fi.service = strdup(cfg->fi.service);
132 
133  // This will override nproc and myrank if Photon was enabled with MPI or
134  // some other supporting PM and the PM library is not yet initialized
135  photon_exchange_init(lcfg, cfg);
136 
137  _photon_nforw = lcfg->forwarder.use_forwarder;
138  _photon_ebsize = lcfg->cap.eager_buf_size;
139  _photon_pbsize = lcfg->cap.pwc_buf_size;
140  _photon_smsize = lcfg->cap.small_msg_size;
141  _photon_upsize = lcfg->cap.small_pwc_size;
142  _photon_idsize = lcfg->cap.max_cid_size;
143  _LEDGER_SIZE = lcfg->cap.ledger_entries;
144 
145  // Finally, track the config with a global
146  __photon_config = lcfg;
147 
148  one_debug("Photon initializing");
149 
150  switch (lcfg->backend) {
152  {
153 #ifdef HAVE_VERBS
154  __photon_fabric = be = &photon_verbs_backend;
155  photon_buffer_init(&verbs_buffer_interface);
156 #else
157  errmsg = "IB Verbs backend";
158  goto error_exit;
159 #endif
160  }
161  break;
162  case PHOTON_BACKEND_UGNI:
163  {
164 #ifdef HAVE_UGNI
165  __photon_fabric = be = &photon_ugni_backend;
166  photon_buffer_init(&ugni_buffer_interface);
167 #else
168  errmsg = "uGNI backend";
169  goto error_exit;
170 #endif
171  }
172  break;
173  case PHOTON_BACKEND_FI:
174  {
175 #ifdef HAVE_LIBFABRIC
176  __photon_fabric = be = &photon_fi_backend;
177  photon_buffer_init(&fi_buffer_interface);
178 #else
179  errmsg = "libfabric backend";
180  goto error_exit;
181 #endif
182  }
183  break;
184  default:
185  {
186 #ifdef HAVE_UGNI
187  __photon_fabric = be = &photon_ugni_backend;
188  photon_buffer_init(&ugni_buffer_interface);
189  lcfg->backend = PHOTON_BACKEND_UGNI;
190 #elif HAVE_VERBS
191  __photon_fabric = be = &photon_verbs_backend;
192  photon_buffer_init(&verbs_buffer_interface);
193  lcfg->backend = PHOTON_BACKEND_VERBS;
194 #elif HAVE_LIBFABRIC
195  __photon_fabric = be = &photon_fi_backend;
196  photon_buffer_init(&fi_buffer_interface);
197  lcfg->backend = PHOTON_BACKEND_FI;
198 #elif HAVE_SHMEM
199  one_debug("No network fabric detected, using shared memory only");
200 #else
201  errmsg = "network fabric backend";
202  goto error_exit;
203 #endif
204  one_debug("Photon configured with %s backend", PHOTON_BACKEND_TO_STRING[lcfg->backend]);
205  }
206  break;
207  }
208 
209  switch (lcfg->meta_exch) {
210  case PHOTON_EXCH_MPI:
211 #ifndef HAVE_MPI
212  errmsg = "MPI exchange";
213  goto error_exit;
214 #endif
215  break;
216  case PHOTON_EXCH_PMI:
217 #ifndef HAVE_PMI
218  errmsg = "PMI exchange";
219  goto error_exit;
220 #endif
221  break;
222  case PHOTON_EXCH_XSP:
223 #ifndef HAVE_XSP
224  errmsg = "XSP exchange";
225  goto error_exit;
226 #endif
227  break;
229  if ((lcfg->exch.allgather == NULL) ||
230  (lcfg->exch.barrier == NULL)) {
231  errmsg = "External exchange function (see config)";
232  goto error_exit;
233  } else {
234  assert(lcfg->exch.allgather);
235  assert(lcfg->exch.barrier);
236  }
237  break;
238  default:
239  errmsg = "unknown exchange";
240  goto error_exit;
241  break;
242  }
243 
244 #ifdef HAVE_SHMEM
245 #ifdef HAVE_SHMEM_CMA
246  __photon_shmem = &photon_shmem_cma;
247 #elif HAVE_SHMEM_POSIX
248  __photon_shmem = &photon_shmem_posix;
249 #else
250  errmsg = "shmem backend";
251  goto error_exit;
252 #endif
253  photon_buffer_init(&shmem_buffer_interface);
254 #endif
255 
256  // update defaults
257  if (_photon_ebsize < 0)
259  if (_photon_pbsize < 0)
261  else if (_photon_pbsize < MIN_PWC_BUF_SIZE)
263  if (_photon_smsize < 0)
265  if (_photon_idsize < 0)
267  if (_photon_upsize < 0)
269  if (_LEDGER_SIZE <= 0)
271  if (lcfg->cap.max_rd < 0)
272  lcfg->cap.max_rd = DEF_MAX_REQUESTS;
273  if (lcfg->cap.default_rd <= 0)
274  lcfg->cap.default_rd = DEF_NUM_REQUESTS;
275  if (lcfg->cap.num_cq <= 0)
276  lcfg->cap.num_cq = DEF_NUM_CQ;
277  if (lcfg->cap.use_rcq < 0)
278  lcfg->cap.use_rcq = DEF_USE_RCQ;
279 
280  // adjust usable small_pwc size for internal use
282 
283  // some of our backends should always use RCQ
284  if (((lcfg->backend == PHOTON_BACKEND_UGNI) ||
285  (lcfg->backend == PHOTON_BACKEND_FI)) &&
286  (lcfg->cap.use_rcq <= 0)) {
287  lcfg->cap.use_rcq = 1;
288  one_debug("Enabling remote completion support for %s backend",
289  PHOTON_BACKEND_TO_STRING[lcfg->backend]);
290  }
291 
292  if (lcfg->cap.num_cq > _photon_nproc) {
293  lcfg->cap.num_cq = _photon_nproc;
294  one_warn("Requesting (num_cq > nproc), setting num_cq to nproc");
295  }
296 
297  // sanity checking
298  assert(is_power_of_2(_LEDGER_SIZE));
299  assert(_LEDGER_SIZE <= MAX_LEDGER_SIZE);
300  assert(is_power_of_2(!_photon_ebsize || _photon_ebsize));
301  assert(is_power_of_2(_photon_pbsize));
302  assert(_photon_pbsize <= MAX_PWC_BUF_SIZE);
303 
304 
305  // figure out forwarder info
306  if (lcfg->forwarder.use_forwarder) {
307  // if init is called with a rank greater than or equal to nproc, then we are a forwarder
308  // TODO: fix this in the case of non-MPI
309  if ((int)lcfg->address >= lcfg->nproc) {
310  _photon_fproc = (int)lcfg->address;
311  _forwarder = 1;
312  }
313  // otherwise we are a proc that wants to use a forwarder
314  else {
315  // do some magic to determing which forwarder to use for this rank
316  // right now every rank gets the first forwarder */
317  _photon_fproc = lcfg->nproc;
318  _forwarder = 0;
319  }
320 #ifdef HAVE_XSP
321  __photon_forwarder = &xsp_forwarder;
322 #else
323  log_warn("Photon was built without forwarder support!");
324 #endif
325  }
326 
327  // the configured backend init gets called library init
328  return _photon_init(lcfg, NULL, NULL);
329 
330 error_exit:
331  log_err("photon_init(): %s support not present", errmsg);
332  free(lcfg);
333  return PHOTON_ERROR;
334 }
335 
336 int photon_cancel(photon_rid request, int flags) {
337  int rc;
338  CHECK_INIT(1)
339  rc = _photon_cancel(request, flags);
340  if (rc != PHOTON_OK) {
341  dbg_err("Error in backend cancel");
342  return rc;
343  }
344 
345  return PHOTON_OK;
346 }
347 
349  int rc;
350  CHECK_INIT(1)
351  rc = _photon_finalize();
352  if (rc != PHOTON_OK) {
353  log_err("Error in backend finalize");
354  return rc;
355  }
356 
358 
359  if (__photon_config->ibv.eth_dev)
360  free((char*)__photon_config->ibv.eth_dev);
361  if (__photon_config->ibv.ib_dev)
362  free((char*)__photon_config->ibv.ib_dev);
363  if (__photon_config->ibv.ud_gid_prefix)
364  free((char*)__photon_config->ibv.ud_gid_prefix);
365  free(__photon_config);
366 
367  return PHOTON_OK;
368 }
369 
370 int photon_register_buffer(void *buf, uint64_t size) {
371  return _photon_register_buffer(buf, size);
372 }
373 
374 int photon_unregister_buffer(void *buf, uint64_t size) {
375  CHECK_INIT(size)
376  return _photon_unregister_buffer(buf, size);
377 }
378 
379 int photon_get_dev_addr(int af, photonAddr addr) {
380  CHECK_INIT(__photon_fabric->get_dev_addr)
381  return __photon_fabric->get_dev_addr(af, addr);
382 }
383 
384 int photon_get_dev_name(char **dev_name) {
385  CHECK_INIT(__photon_fabric->get_dev_name)
386  return __photon_fabric->get_dev_name(dev_name);
387 }
388 
389 int photon_register_addr(photonAddr addr, int af) {
390  CHECK_INIT(__photon_fabric->register_addr)
391  return __photon_fabric->register_addr(addr, af);
392 }
393 
395  CHECK_INIT(__photon_fabric->unregister_addr)
396  return __photon_fabric->unregister_addr(addr, af);
397 }
398 
399 int photon_test(photon_rid request, int *flag, int *type, photonStatus status) {
400  CHECK_INIT(1)
401  return _photon_test(request, flag, type, status);
402 }
403 
404 int photon_wait(photon_rid request) {
405  CHECK_INIT(1)
406  return _photon_wait(request);
407 }
408 
409 int photon_post_recv_buffer_rdma(int proc, void *ptr, uint64_t size, int tag, photon_rid *request) {
410  CHECK_INIT(1)
411  return _photon_post_recv_buffer_rdma(proc, ptr, size, tag, request);
412 }
413 
414 int photon_post_send_buffer_rdma(int proc, void *ptr, uint64_t size, int tag, photon_rid *request) {
415  CHECK_INIT(1)
416  return _photon_post_send_buffer_rdma(proc, ptr, size, tag, request);
417 }
418 
419 int photon_post_send_request_rdma(int proc, uint64_t size, int tag, photon_rid *request) {
420  CHECK_INIT(1)
421  return _photon_post_send_request_rdma(proc, size, tag, request);
422 }
423 
424 int photon_wait_recv_buffer_rdma(int proc, uint64_t size, int tag, photon_rid *request) {
425  CHECK_INIT(1)
426  return _photon_wait_recv_buffer_rdma(proc, size, tag, request);
427 }
428 
429 int photon_wait_send_buffer_rdma(int proc, uint64_t size, int tag, photon_rid *request) {
430  if(_photon_initialized() != PHOTON_OK) {
431  init_err();
432  return PHOTON_ERROR_NOINIT;
433  }
434 
435  return _photon_wait_send_buffer_rdma(proc, size, tag, request);
436 }
437 
439  if(_photon_initialized() != PHOTON_OK) {
440  init_err();
441  return PHOTON_ERROR_NOINIT;
442  }
443 
444  return _photon_wait_send_request_rdma(tag);
445 }
446 
447 int photon_post_os_put(photon_rid request, int proc, void *ptr, uint64_t size, int tag, uint64_t r_offset) {
448  if(_photon_initialized() != PHOTON_OK) {
449  init_err();
450  return PHOTON_ERROR_NOINIT;
451  }
452 
453  return _photon_post_os_put(request, proc, ptr, size, tag, r_offset);
454 }
455 
456 int photon_post_os_get(photon_rid request, int proc, void *ptr, uint64_t size, int tag, uint64_t r_offset) {
457  CHECK_INIT(1)
458  return _photon_post_os_get(request, proc, ptr, size, tag, r_offset);
459 }
460 
461 int photon_post_os_put_direct(int proc, void *ptr, uint64_t size, photonBuffer rbuf, int flags, photon_rid *request) {
462  CHECK_INIT(1)
463  return _photon_post_os_put_direct(proc, ptr, size, rbuf, flags, request);
464 }
465 
466 int photon_post_os_get_direct(int proc, void *ptr, uint64_t size, photonBuffer rbuf, int flags, photon_rid *request) {
467  CHECK_INIT(1)
468  return _photon_post_os_get_direct(proc, ptr, size, rbuf, flags, request);
469 }
470 
471 int photon_send_FIN(photon_rid request, int proc, int flags) {
472  CHECK_INIT(1)
473  return _photon_send_FIN(request, proc, flags);
474 }
475 
476 int photon_wait_any(int *ret_proc, photon_rid *ret_req) {
477  CHECK_INIT(1)
478 #ifdef PHOTON_MULTITHREADED
479  // TODO: These can probably be implemented by having
480  // a condition var for the unreaped lists
481  return PHOTON_ERROR;
482 #else
483  return _photon_wait_any(ret_proc, ret_req);
484 #endif
485 }
486 
487 int photon_wait_any_ledger(int *ret_proc, photon_rid *ret_req) {
488  CHECK_INIT(1)
489 #ifdef PHOTON_MULTITHREADED
490  return PHOTON_ERROR;
491 #else
492  return _photon_wait_any_ledger(ret_proc, ret_req);
493 #endif
494 }
495 
496 int photon_probe_ledger(int proc, int *flag, int type, photonStatus status) {
497  CHECK_INIT(1)
498  return _photon_probe_ledger(proc, flag, type, status);
499 }
500 
501 // begin SR interface
502 int photon_probe(photonAddr addr, int *flag, photonStatus status) {
503  CHECK_INIT(1)
504  return _photon_probe(addr, flag, status);
505 }
506 
507 int photon_send(photonAddr addr, void *ptr, uint64_t size, int flags, uint64_t *request) {
508  CHECK_INIT(1)
509  return _photon_send(addr, ptr, size, flags, request);
510 }
511 
512 int photon_recv(uint64_t request, void *ptr, uint64_t size, int flags) {
513  CHECK_INIT(1)
514  return _photon_recv(request, ptr, size, flags);
515 }
516 // end SR interface
517 
518 // begin with completion
519 int photon_put_with_completion(int proc, uint64_t size, photonBuffer lbuf, photonBuffer rbuf,
520  photon_cid local, photon_cid remote, int flags) {
521  CHECK_INIT(1)
522  return _photon_put_with_completion(proc, size, lbuf, rbuf, local, remote, flags,
524 }
525 
526 int photon_get_with_completion(int proc, uint64_t size, photonBuffer lbuf, photonBuffer rbuf,
527  photon_cid local, photon_cid remote, int flags) {
528  CHECK_INIT(1)
529  return _photon_get_with_completion(proc, size, lbuf, rbuf, local, remote, flags,
531 }
532 
533 int photon_probe_completion(int proc, int *flag, int *remaining, photon_cid *comp, int *src,
534  void (*cb)(photon_cid), int flags) {
535  // we can start probing before backend initialization
536  //CHECK_INIT(1)
537  return _photon_probe_completion(proc, flag, remaining, comp, src, cb, flags);
538 }
539 
541  photon_rid *request, int flags) {
542  CHECK_INIT(1)
543  return _photon_collective_init(comm, ctype, local, request, flags);
544 }
545 
546 int photon_collective_join(photon_rid request, void *in, void *out, int scount, int rcount,
547  photonDatatype stype, photonDatatype rtype, int root, void *op) {
548  CHECK_INIT(1)
549  return _photon_collective_join(request, in, out, scount, rcount, stype, rtype, root, op);
550 }
551 
552 int photon_collective_comm_create(void *active, int num_active, int total, photonComm *c) {
553  CHECK_INIT(1)
554  return _photon_collective_comm_create(active, num_active, total, c);
555 }
556 
557 int photon_collective_init_new_comm(void *active, int num_active, int total, photon_coll ctype,
558  photon_cid local, photon_rid *request, int flags, photonComm *c) {
559  CHECK_INIT(1)
560  return _photon_collective_init_new_comm(active, num_active, total, ctype, local, request, flags, c);
561 }
562 
563 // end with completion
564 
565 // begin I/O
566 int photon_io_init(char *file, int amode, void *view, int niter) {
567  CHECK_INIT(1)
568  return _photon_io_init(file, amode, view, niter);
569 }
570 
572  CHECK_INIT(1)
573  return _photon_io_finalize();
574 }
575 
576 void photon_io_print_info(void *io) {
577  if (__photon_forwarder != NULL) {
578  __photon_forwarder->io_print(io);
579  }
580 }
581 
582 // end I/O
583 
584 // utility API method to get backend-specific buffer info
585 int photon_get_buffer_private(void *buf, uint64_t size,
586  const struct photon_buffer_priv_t **pptr) {
587  return _photon_get_buffer_private(buf, size, pptr);
588 }
589 
590 // utility method to get the remote buffer info set after a wait buffer request
591 int photon_get_buffer_remote(photon_rid request, photonBuffer ret_buf) {
592  return _photon_get_buffer_remote(request, ret_buf);
593 }
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
int _photon_post_send_request_rdma(int proc, uint64_t size, int tag, photon_rid *request)
#define MIN_PWC_BUF_SIZE
int _photon_collective_join(photon_rid request, void *in, void *out, int scount, int rcount, photonDatatype stype, photonDatatype rtype, int root, void *op)
Definition: photon_coll.c:191
int photon_recv(uint64_t request, void *ptr, uint64_t size, int flags)
Definition: libphoton.c:512
photon_datatype_t photonDatatype
int photon_finalize()
Definition: libphoton.c:348
#define PHOTON_EXCH_PMI
Use PMI for metadata exchange.
Definition: photon.h:37
int _photon_send(photonAddr addr, void *ptr, uint64_t size, int flags, photon_rid *request)
The Photon completion ID used by the PWC API.
Definition: photon.h:78
int photon_io_init(char *file, int amode, void *view, int niter)
Definition: libphoton.c:566
int _photon_wait_recv_buffer_rdma(int proc, uint64_t size, int tag, photon_rid *request)
int _photon_spsize
Definition: libphoton.c:62
PHOTON_INTERNAL int _photon_initialized(void)
int photon_post_os_put(photon_rid request, int proc, void *ptr, uint64_t size, int tag, uint64_t r_offset)
Definition: libphoton.c:447
#define DEF_MAX_REQUESTS
#define DEF_NUM_CQ
#define DEF_PWC_CID_SIZE
Use uGNI photon backend.
Definition: photon_config.h:43
#define MAX_PWC_BUF_SIZE
int _photon_smsize
Definition: libphoton.c:60
int _LEDGER_SIZE
Definition: libphoton.c:53
int photon_probe_ledger(int proc, int *flag, int type, photonStatus status)
Definition: libphoton.c:496
#define DEF_SP_SIZE
int _photon_nproc
Definition: libphoton.c:55
int photon_wait_send_request_rdma(int tag)
Definition: libphoton.c:438
photonBackend __photon_shmem
Definition: libphoton.c:49
int photon_exchange_finalize(photonConfig lcfg)
Use libfabric backend.
Definition: photon_config.h:44
The main Photon configuration structure, passed to photon_init(). -1 may be set for integer values to...
Definition: photon_config.h:59
int photon_probe(photonAddr addr, int *flag, photonStatus status)
Definition: libphoton.c:502
int photon_initialized()
Definition: libphoton.c:76
int photon_cancel(photon_rid request, int flags)
Definition: libphoton.c:336
uint64_t photon_rid
The Photon request ID.
Definition: photon.h:75
photonBackend __photon_fabric
Definition: libphoton.c:50
#define MAX_LEDGER_SIZE
int photon_init(photonConfig cfg)
Definition: libphoton.c:91
int photon_register_addr(photonAddr addr, int af)
Definition: libphoton.c:389
int _photon_fproc
Definition: libphoton.c:57
int photon_probe_completion(int proc, int *flag, int *remaining, photon_cid *comp, int *src, void(*cb)(photon_cid), int flags)
Definition: libphoton.c:533
int _photon_pbsize
Definition: libphoton.c:59
int photon_post_os_get_direct(int proc, void *ptr, uint64_t size, photonBuffer rbuf, int flags, photon_rid *request)
Definition: libphoton.c:466
int _photon_nforw
Definition: libphoton.c:56
struct photon_forwarder_t * photonForwarder
Definition: libphoton.h:29
#define PHOTON_ERROR_NOINIT
Error code, subsystem not initialized.
Definition: photon.h:31
int photon_post_recv_buffer_rdma(int proc, void *ptr, uint64_t size, int tag, photon_rid *request)
Definition: libphoton.c:409
int photon_post_send_request_rdma(int proc, uint64_t size, int tag, photon_rid *request)
Definition: libphoton.c:419
#define DEF_PWC_BUF_SIZE
int _photon_post_os_get_direct(int proc, void *ptr, uint64_t size, photonBuffer rbuf, int flags, photon_rid *request)
int _photon_finalize()
int _photon_upsize
Definition: libphoton.c:61
union photon_addr_t * photonAddr
Convenience pointer type for the address union.
Definition: photon.h:112
int _photon_post_recv_buffer_rdma(int proc, void *ptr, uint64_t size, int tag, photon_rid *request)
int _photon_myrank
Definition: libphoton.c:54
int photon_test(photon_rid request, int *flag, int *type, photonStatus status)
Definition: libphoton.c:399
int _forwarder
Definition: libphoton.c:64
photonForwarder __photon_forwarder
Definition: libphoton.c:51
int photon_unregister_addr(photonAddr addr, int af)
Definition: libphoton.c:394
int photon_unregister_buffer(void *buf, uint64_t size)
Definition: libphoton.c:374
int _photon_init(photonConfig cfg, ProcessInfo *info, photonBufferHandle ss)
int _photon_wait_send_request_rdma(int tag)
int _photon_collective_init_new_comm(void *active, int num_active, int total, photon_coll ctype, photon_cid local, photon_rid *request, int flags, photonComm *c)
Definition: photon_coll.c:143
int _photon_recv(photon_rid request, void *ptr, uint64_t size, int flags)
int photon_get_with_completion(int proc, uint64_t size, photonBuffer lbuf, photonBuffer rbuf, photon_cid local, photon_cid remote, int flags)
Definition: libphoton.c:526
int photon_send(photonAddr addr, void *ptr, uint64_t size, int flags, uint64_t *request)
Experimental UD interface.
Definition: libphoton.c:507
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)
int _photon_io_finalize()
#define PHOTON_ERROR
Error code, general error.
Definition: photon.h:32
int _photon_send_FIN(photon_rid request, int proc, int flags)
Use Verbs photon backend.
Definition: photon_config.h:42
int photon_collective_comm_create(void *active, int num_active, int total, photonComm *c)
In-progress communicator handling.
Definition: libphoton.c:552
int photon_send_FIN(photon_rid request, int proc, int flags)
Definition: libphoton.c:471
int photon_get_buffer_remote(photon_rid request, photonBuffer ret_buf)
Definition: libphoton.c:591
int _photon_get_buffer_remote(photon_rid request, photonBuffer ret_buf)
void photon_io_print_info(void *io)
Definition: libphoton.c:576
int _photon_post_os_get(photon_rid request, int proc, void *ptr, uint64_t size, int tag, uint64_t r_offset)
int photon_wait_send_buffer_rdma(int proc, uint64_t size, int tag, photon_rid *request)
Definition: libphoton.c:429
#define PHOTON_OK
Photon success code.
Definition: photon.h:30
int _photon_get_buffer_private(void *addr, uint64_t size, const struct photon_buffer_priv_t **pptr)
#define PHOTON_EXCH_MPI
Use MPI for metadata exchange.
Definition: photon.h:36
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
int _photon_ebsize
Definition: libphoton.c:58
int photon_wait(photon_rid request)
Definition: libphoton.c:404
int _photon_collective_init(photonComm c, photon_coll ctype, photon_cid local, photon_rid *request, int flags)
Definition: photon_coll.c:97
int photon_get_dev_addr(int af, photonAddr addr)
Definition: libphoton.c:379
int _photon_probe(photonAddr addr, int *flag, photonStatus status)
#define PHOTON_EXCH_XSP
Use XSP for metadata exchange.
Definition: photon.h:38
int photon_buffer_init(photonBufferInterface bi)
int photon_register_buffer(void *buf, uint64_t size)
Definition: libphoton.c:370
int photon_collective_init_new_comm(void *active, int num_active, int total, photon_coll ctype, photon_cid local, photon_rid *request, int flags, photonComm *c)
In-progress communicator handling.
Definition: libphoton.c:557
int _photon_probe_ledger(int proc, int *flag, int type, photonStatus status)
int _photon_idsize
Definition: libphoton.c:63
int photon_exchange_init(photonConfig lcfg, photonConfig cfg)
Convenience pointer type for the private buffer structure.
Definition: photon.h:98
int _photon_cancel(photon_rid request, int flags)
int _photon_register_buffer(void *addr, uint64_t size)
int _photon_io_init(char *file, int amode, void *view, int niter)
int photon_collective_join(photon_rid request, void *in, void *out, int scount, int rcount, photonDatatype stype, photonDatatype rtype, int root, void *op)
Definition: libphoton.c:546
photonConfig __photon_config
Definition: libphoton.c:48
#define PHOTON_EXCH_EXTERNAL
Use externally defined functions for metadata exchange.
Definition: photon.h:39
int photon_post_send_buffer_rdma(int proc, void *ptr, uint64_t size, int tag, photon_rid *request)
Definition: libphoton.c:414
int photon_wait_recv_buffer_rdma(int proc, uint64_t size, int tag, photon_rid *request)
Definition: libphoton.c:424
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_post_os_get(photon_rid request, int proc, void *ptr, uint64_t size, int tag, uint64_t r_offset)
Definition: libphoton.c:456
int photon_collective_init(photonComm comm, photon_coll ctype, photon_cid local, photon_rid *request, int flags)
Definition: libphoton.c:540
#define DEF_SMALL_MSG_SIZE
void * photonComm
int photon_put_with_completion(int proc, uint64_t size, photonBuffer lbuf, photonBuffer rbuf, photon_cid local, photon_cid remote, int flags)
Definition: libphoton.c:519
int _photon_wait_any_ledger(int *ret_proc, photon_rid *ret_req)
int photon_get_buffer_private(void *buf, uint64_t size, const struct photon_buffer_priv_t **pptr)
Definition: libphoton.c:585
#define DEF_USE_RCQ
int photon_io_finalize()
Definition: libphoton.c:571
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
#define DEF_EAGER_BUF_SIZE
int _photon_collective_comm_create(void *active, int num_active, int total, photonComm *c)
Definition: photon_coll.c:86
int _photon_test(photon_rid request, int *flag, int *type, photonStatus status)
#define DEF_NUM_REQUESTS
int _photon_wait_send_buffer_rdma(int proc, uint64_t size, int tag, photon_rid *request)
int photon_wait_any(int *ret_proc, photon_rid *ret_req)
Definition: libphoton.c:476
int _photon_post_os_put_direct(int proc, void *ptr, uint64_t size, photonBuffer rbuf, int flags, photon_rid *request)
int photon_wait_any_ledger(int *ret_proc, photon_rid *ret_req)
Definition: libphoton.c:487
#define DEF_LEDGER_SIZE
int photon_post_os_put_direct(int proc, void *ptr, uint64_t size, photonBuffer rbuf, int flags, photon_rid *request)
Definition: libphoton.c:461
int photon_get_dev_name(char **dev_name)
Definition: libphoton.c:384