71 MPI_Initialized(&flag);
79 MPI_Comm _photon_comm = 0;
81 _photon_comm = MPI_COMM_WORLD;
136 MPI_Finalized(&flag);
155 MPI_Comm _photon_comm = 0;
157 _photon_comm = MPI_COMM_WORLD;
158 rc = MPI_Allgather(ptr, n, MPI_BYTE, ivec_ptr, n, MPI_BYTE, _photon_comm);
159 if (rc != MPI_SUCCESS)
166 rc = PMI_Allgather(ptr, ivec_ptr, n);
167 if (rc != PMI_SUCCESS)
178 log_err(
"Error in external exchange");
183 log_err(
"Unrecognized exchange type requested!");
201 MPI_Comm _photon_comm = 0;
203 _photon_comm = MPI_COMM_WORLD;
204 rc = MPI_Barrier(_photon_comm);
205 if (rc != MPI_SUCCESS)
213 if (rc != PMI_SUCCESS)
224 log_err(
"Error in external barrier");
229 log_err(
"Unrecognized exchange type requested!");
243 uint64_t *key_0, *key_1, *va;
245 key_0 = (uint64_t *)malloc(
_photon_nproc *
sizeof(uint64_t));
246 key_1 = (uint64_t *)malloc(
_photon_nproc *
sizeof(uint64_t));
256 log_err(
"Could not gather shared storage key_0");
263 log_err(
"Could not gather shared storage key_1");
270 log_err(
"Could not gather shared storage base ptrs");
341 int ledger_size, offset;
344 dbg_trace(
"Setting up RI ledgers");
352 dbg_trace(
"allocating rcv info ledger for %d: %p", i, bptr);
353 dbg_trace(
"Offset: %d", ledger_size * i);
357 if (!photon_processes[i].local_rcv_info_ledger) {
358 log_err(
"couldn't create local rcv info ledger for process %d", i);
364 dbg_trace(
"allocating remote ri ledger for %d: %p", i, bptr);
365 dbg_trace(
"Offset: %d", ledger_size * PHOTON_TPROC + ledger_size * i);
368 if (!photon_processes[i].remote_rcv_info_ledger) {
369 log_err(
"couldn't create remote rcv info ledger for process %d", i);
379 dbg_trace(
"allocating snd info ledger for %d: %p", i, bptr);
380 dbg_trace(
"Offset: %d", offset + ledger_size * i);
384 if (!photon_processes[i].local_snd_info_ledger) {
385 log_err(
"couldn't create local snd info ledger for process %d", i);
391 dbg_trace(
"allocating remote ri ledger for %d: %p", i, bptr);
392 dbg_trace(
"Offset: %d", offset + ledger_size * PHOTON_TPROC + ledger_size * i);
395 if (!photon_processes[i].remote_snd_info_ledger) {
396 log_err(
"couldn't create remote snd info ledger for process %d", i);
409 dbg_trace(
"Setting up FIN ledgers");
411 esize =
sizeof(
struct photon_rdma_ledger_entry_t);
416 dbg_trace(
"allocating local FIN ledger for %d", i);
420 if (!photon_processes[i].local_fin_ledger) {
421 log_err(
"couldn't create local FIN ledger for process %d", i);
425 dbg_trace(
"allocating remote FIN ledger for %d", i);
429 if (!photon_processes[i].remote_fin_ledger) {
430 log_err(
"couldn't create remote FIN ledger for process %d", i);
439 int i, esize, ersize;
440 int ledger_size, recv_ledger_size;
444 dbg_trace(
"Setting up PWC ledgers");
453 dbg_trace(
"allocating local (recv) PWC ledger for %d", i);
457 if (!photon_processes[i].local_pwc_ledger) {
458 log_err(
"couldn't create local PWC ledger for process %d", i);
462 dbg_trace(
"allocating remote PWC ledger for %d", i);
466 if (!photon_processes[i].remote_pwc_ledger) {
467 log_err(
"couldn't create remote PWC ledger for process %d", i);
480 dbg_trace(
"Setting up EAGER ledgers");
482 esize =
sizeof(
struct photon_rdma_ledger_entry_t);
487 dbg_trace(
"allocating local EAGER ledger for %d", i);
491 if (!photon_processes[i].local_eager_ledger) {
492 log_err(
"couldn't create local EAGER ledger for process %d", i);
496 dbg_trace(
"allocating remote EAGER ledger for %d", i);
500 if (!photon_processes[i].remote_eager_ledger) {
501 log_err(
"couldn't create remote EAGER ledger for process %d", i);
514 dbg_trace(
"Setting up EAGER buffers");
521 dbg_trace(
"allocating local eager buffer for %d", i);
523 bptr = (uint8_t *) (buf + buf_size * i);
525 if (!photon_processes[i].local_eager_buf) {
526 log_err(
"couldn't create local eager buffer for process %d", i);
530 dbg_trace(
"allocating remote eager buffer for %d", i);
532 bptr = (uint8_t *) (buf + buf_size * PHOTON_TPROC + buf_size * i);
534 if (!photon_processes[i].remote_eager_buf) {
535 log_err(
"couldn't create remote eager buffer for process %d", i);
548 dbg_trace(
"Setting up PWC buffers");
554 dbg_trace(
"allocating local pwc eager buffer for %d", i);
556 bptr = (uint8_t *) (buf + buf_size * i);
558 if (!photon_processes[i].local_eager_buf) {
559 log_err(
"couldn't create local pwc eager buffer for process %d", i);
563 dbg_trace(
"allocating remote pwc eager buffer for %d", i);
565 bptr = (uint8_t *) (buf + buf_size * PHOTON_TPROC + buf_size * i);
567 if (!photon_processes[i].remote_eager_buf) {
568 log_err(
"couldn't create remote pwc eager buffer for process %d", i);
photonLedger remote_pwc_ledger
photon_op_t photon_op_band
#define PHOTON_LSI_PTR(a)
photon_datatype_t photon_unsigned_long
photon_datatype_t photon_long_long_int
photonRILedger photon_ri_ledger_create_reuse(photonRILedgerEntry ledger_buffer, int ledger_size, int prefix)
photonLedger photon_rdma_ledger_create_reuse(void *ledger_buffer, int num_entries, int entry_size, int prefix)
int photon_exchange_barrier()
#define PHOTON_EXCH_PMI
Use PMI for metadata exchange.
photonLedger local_pwc_ledger
photon_datatype_t photon_byte
struct photon_ri_ledger_entry_t * photonRILedgerEntry
photonBufferHandle shared_storage
#define PHOTON_RPEDG_SIZE
#define PHOTON_LRI_PTR(a)
photon_datatype_t photon_unsigned_char
photon_datatype_t photon_char
photon_datatype_t photon_unsigned
photon_datatype_t photon_long_double
#define REQUEST_COOK_PBUF
#define PHOTON_LEDG_SSIZE(c, s)
photonLedger remote_eager_ledger
photon_datatype_t photon_packed
struct photon_rdma_ledger_entry_t * photonRDMALedgerEntry
int photon_exchange_finalize(photonConfig lcfg)
photon_op_t photon_op_lor
struct photon_cid_ledger_entry_t * photonCIDLedgerEntry
photonRILedger remote_rcv_info_ledger
photon_datatype_t photon_long
photon_op_t photon_op_sum
photonEagerBuf local_pwc_buf
photon_datatype_t photon_int
#define PHOTON_LPB_PTR(a)
photon_op_t photon_op_prod
photon_op_t photon_op_bxor
photon_op_t photon_op_minloc
photon_op_t photon_op_min
#define REQUEST_COOK_RINFO
#define PHOTON_LEB_PTR(a)
photon_op_t photon_op_no_op
#define REQUEST_COOK_SINFO
photon_op_t photon_op_replace
photon_op_t photon_op_bor
#define REQUEST_COOK_ELEDG
#define PHOTON_INFO_SSIZE(c)
int photon_setup_eager_buf(ProcessInfo *photon_processes, char *buf, int size)
photonLedger remote_fin_ledger
#define REQUEST_COOK_EBUF
ProcessInfo * photon_processes
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)
photon_datatype_t photon_datatype_null
#define PHOTON_ERROR
Error code, general error.
#define PHOTON_CID_ENTRY_SIZE
photon_datatype_t photon_double
photonLedger local_eager_ledger
photon_op_t photon_op_lxor
photonRILedger local_snd_info_ledger
photon_op_t photon_op_null
photon_datatype_t photon_unsigned_long_long
photonEagerBuf remote_pwc_buf
photonEagerBuf photon_rdma_eager_buf_create_reuse(uint8_t *eager_buffer, int size, int prefix)
photon_datatype_t photon_signed_char
#define PHOTON_OK
Photon success code.
#define PHOTON_EXCH_MPI
Use MPI for metadata exchange.
#define PHOTON_EBUF_SSIZE(c)
photon_op_t photon_op_land
photonRILedger local_rcv_info_ledger
#define REQUEST_COOK_PLEDG
#define PHOTON_EXCH_XSP
Use XSP for metadata exchange.
photon_datatype_t photon_float
photonEagerBuf local_eager_buf
int photon_exchange_init(photonConfig lcfg, photonConfig cfg)
photonEagerBuf remote_eager_buf
photon_datatype_t photon_wchar
photonRILedger remote_snd_info_ledger
struct photon_cid_recv_ledger_entry_t * photonCIDRecvLedgerEntry
int photon_setup_pwc_ledger(ProcessInfo *photon_processes, char *buf, int num_entries)
photonConfig __photon_config
int photon_exchange_allgather(void *ptr, void *ivec_ptr, int n)
#define PHOTON_EXCH_EXTERNAL
Use externally defined functions for metadata exchange.
#define PHOTON_CID_RECV_ENTRY_SIZE
int photon_setup_eager_ledger(ProcessInfo *photon_processes, char *buf, int num_entries)
int photon_setup_fin_ledger(ProcessInfo *photon_processes, char *buf, int num_entries)
photon_datatype_t photon_short
int photon_exchange_ledgers(ProcessInfo *processes, int flags)
photon_op_t photon_op_maxloc
photon_op_t photon_op_max
photon_datatype_t photon_unsigned_short
photonComm PHOTON_COMM_WORLD
photonLedger local_fin_ledger