/** Allocate a shared memory segment. Collective. * * @param[out] base_ptrs Array that will contain pointers to the base address of * each process' patch of the segment. Array is of length * equal to the number of processes in the group. * @param[in] size Number of bytes to allocate on the local process. */ int ARMCI_Malloc_group(void **base_ptrs, armci_size_t size, ARMCI_Group *group) { int i; gmr_t *mreg; ARMCII_Assert(PARMCI_Initialized()); mreg = gmr_create(size, base_ptrs, group); if (DEBUG_CAT_ENABLED(DEBUG_CAT_ALLOC)) { #define BUF_LEN 1000 char ptr_string[BUF_LEN]; int count = 0; if (mreg == NULL) { strncpy(ptr_string, "NULL", 5); } else { for (i = 0; i < mreg->nslices && count < BUF_LEN; i++) count += snprintf(ptr_string+count, BUF_LEN-count, (i == mreg->nslices-1) ? "%p" : "%p ", base_ptrs[i]); } ARMCII_Dbg_print(DEBUG_CAT_ALLOC, "base ptrs [%s]\n", ptr_string); #undef BUF_LEN } return 0; }
int ARMCI_Initialized(void) { return PARMCI_Initialized(); }
int armci_domain_count(armci_domain_t domain) { assert(PARMCI_Initialized()); return l_state.size; }
int armci_domain_my_id(armci_domain_t domain) { assert(PARMCI_Initialized()); return l_state.rank; }