/* For Cray devices we have only one PD */ static ucs_status_t uct_ugni_query_pd_resources(uct_pd_resource_desc_t **resources_p, unsigned *num_resources_p) { if (getenv("PMI_GNI_PTAG") != NULL) { return uct_single_pd_resource(&uct_ugni_pd_component, resources_p, num_resources_p); } else { *resources_p = NULL; *num_resources_p = 0; return UCS_OK; } }
static ucs_status_t uct_knem_query_pd_resources(uct_pd_resource_desc_t **resources_p, unsigned *num_resources_p) { int fd; int rc; struct knem_cmd_info info; memset(&info, 0, sizeof(struct knem_cmd_info)); fd = open("/dev/knem", O_RDWR); if (fd < 0) { ucs_debug("Could not open the KNEM device file at /dev/knem: %m. Disabling knem resource"); *resources_p = NULL; *num_resources_p = 0; return UCS_OK; } rc = ioctl(fd, KNEM_CMD_GET_INFO, &info); if (rc < 0) { *resources_p = NULL; *num_resources_p = 0; close(fd); ucs_debug("KNEM get info failed. not using knem, err = %d %m", rc); return UCS_OK; } if (KNEM_ABI_VERSION != info.abi) { *resources_p = NULL; *num_resources_p = 0; close(fd); ucs_error("KNEM ABI mismatch: KNEM_ABI_VERSION: %d, Driver binary interface version: %d", KNEM_ABI_VERSION, info.abi); return UCS_OK; } /* We have to close it since it is not clear * if it will be selected in future */ close(fd); return uct_single_pd_resource(&uct_knem_pd_component, resources_p, num_resources_p); }
static ucs_status_t uct_cuda_query_pd_resources(uct_pd_resource_desc_t **resources_p, unsigned *num_resources_p) { return uct_single_pd_resource(&uct_cuda_pd, resources_p, num_resources_p); }