/* Endpoint definition */ UCS_CLASS_INIT_FUNC(uct_ugni_ep_t, uct_iface_t *tl_iface, const struct sockaddr *addr) { uct_ugni_iface_t *iface = ucs_derived_of(tl_iface, uct_ugni_iface_t); const uct_sockaddr_ugni_t *iface_addr = (const uct_sockaddr_ugni_t*)addr; ucs_status_t rc = UCS_OK; gni_return_t ugni_rc; UCS_CLASS_CALL_SUPER_INIT(uct_base_ep_t, &iface->super); ugni_rc = GNI_EpCreate(iface->nic_handle, iface->local_cq, &self->ep); if (GNI_RC_SUCCESS != ugni_rc) { ucs_error("GNI_CdmCreate failed, Error status: %s %d", gni_err_str[ugni_rc], ugni_rc); return UCS_ERR_NO_DEVICE; } if(NULL != addr){ rc = ugni_connect_ep(iface, iface_addr, self); } ucs_arbiter_group_init(&self->arb_group); uint32_t *big_hash; big_hash = (void *)&self->ep; self->hash_key = big_hash[0]; sglib_hashed_uct_ugni_ep_t_add(iface->eps, self); return rc; }
/* Endpoint definition */ UCS_CLASS_INIT_FUNC(uct_ugni_ep_t, const uct_ep_params_t *params) { uct_ugni_iface_t *iface = ucs_derived_of(params->iface, uct_ugni_iface_t); ucs_status_t rc = UCS_OK; gni_return_t ugni_rc; uint32_t *big_hash; self->arb_sched = 0; UCS_CLASS_CALL_SUPER_INIT(uct_base_ep_t, &iface->super); self->flush_group = uct_ugni_new_flush_group(iface); #ifdef DEBUG self->flush_group->flush_comp.func = NULL; self->flush_group->parent = NULL; #endif uct_ugni_cdm_lock(&iface->cdm); ugni_rc = GNI_EpCreate(uct_ugni_iface_nic_handle(iface), iface->local_cq, &self->ep); uct_ugni_cdm_unlock(&iface->cdm); if (GNI_RC_SUCCESS != ugni_rc) { ucs_error("GNI_CdmCreate failed, Error status: %s %d", gni_err_str[ugni_rc], ugni_rc); return UCS_ERR_NO_DEVICE; } ucs_arbiter_group_init(&self->arb_group); big_hash = (void *)&self->ep; self->hash_key = big_hash[0]; if (uct_ugni_check_device_type(iface, GNI_DEVICE_ARIES)) { self->hash_key &= 0x00FFFFFF; } ucs_debug("Adding ep hash %x to iface %p", self->hash_key, iface); sglib_hashed_uct_ugni_ep_t_add(iface->eps, self); return rc; }
static UCS_CLASS_INIT_FUNC(uct_mm_ep_t, uct_iface_t *tl_iface, const uct_device_addr_t *dev_addr, const uct_iface_addr_t *iface_addr) { uct_mm_iface_t *iface = ucs_derived_of(tl_iface, uct_mm_iface_t); const uct_mm_iface_addr_t *addr = (const void*)iface_addr; ucs_status_t status; size_t size_to_attach; UCS_CLASS_CALL_SUPER_INIT(uct_base_ep_t, &iface->super); /* Connect to the remote address (remote FIFO) */ /* Attach the address's memory */ size_to_attach = UCT_MM_GET_FIFO_SIZE(iface); status = uct_mm_md_mapper_ops(iface->super.md)->attach(addr->id, size_to_attach, (void *)addr->vaddr, &self->mapped_desc.address, &self->mapped_desc.cookie, iface->path); if (status != UCS_OK) { ucs_error("failed to connect to remote peer with mm. remote mm_id: %zu", addr->id); return status; } self->mapped_desc.length = size_to_attach; self->mapped_desc.mmid = addr->id; uct_mm_set_fifo_ptrs(self->mapped_desc.address, &self->fifo_ctl, &self->fifo); self->cached_tail = self->fifo_ctl->tail; self->cached_signal_addrlen = self->fifo_ctl->signal_addrlen; self->cached_signal_sockaddr = self->fifo_ctl->signal_sockaddr; /* Send connect message to remote side so it will start polling */ status = uct_mm_ep_signal_remote(self, UCT_MM_IFACE_SIGNAL_CONNECT); if (status != UCS_OK) { uct_mm_md_mapper_ops(iface->super.md)->detach(&self->mapped_desc); return status; } /* Initiate the hash which will keep the base_adresses of remote memory * chunks that hold the descriptors for bcopy. */ sglib_hashed_uct_mm_remote_seg_t_init(self->remote_segments_hash); ucs_arbiter_group_init(&self->arb_group); /* Register for send side progress */ uct_worker_progress_register(iface->super.worker, uct_mm_iface_progress, iface); ucs_debug("mm: ep connected: %p, to remote_shmid: %zu", self, addr->id); return UCS_OK; }