Exemple #1
0
static BOOL CALLBACK ofi_init_once_cb(PINIT_ONCE once, void* data, void** ctx)
{
	OFI_UNUSED(once);
	OFI_UNUSED(ctx);
	InitializeCriticalSection((CRITICAL_SECTION*)data);
	return TRUE;
}
int ofi_nd_fabric(struct fi_fabric_attr *attr, struct fid_fabric **fab,
		  void *context)
{
	OFI_UNUSED(context);

	if (attr) {
		if (attr->name && strcmp(attr->name, ofi_nd_prov.name))
			return -FI_EINVAL;
		if (attr->prov_name && strcmp(attr->prov_name, ofi_nd_prov.name))
			return -FI_EINVAL;
		if (attr->prov_version && attr->prov_version != ofi_nd_prov.version)
			return -FI_EINVAL;
	}

	struct nd_fabric *fabric = (struct nd_fabric*)calloc(1, sizeof(*fabric));
	if (!fabric)
		return -FI_ENOMEM;

	struct nd_fabric def = {
		.fid = {
			.fid = ofi_nd_fid,
			.ops = &ofi_nd_fabric_ops
		}
	};

	*fabric = def;

	*fab = &fabric->fid;

	fi_param_get_int(&ofi_nd_prov, "inlinethr", &gl_data.inline_thr);
	fi_param_get_int(&ofi_nd_prov, "prepostcnt", &gl_data.prepost_cnt);
	fi_param_get_int(&ofi_nd_prov, "prepostbuftcnt", &gl_data.prepost_buf_cnt);

	return FI_SUCCESS;
}
Exemple #3
0
BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved)
{
	OFI_UNUSED(instance);
	OFI_UNUSED(reserved);

	switch (reason) {
	case DLL_PROCESS_ATTACH:
		InitOnceExecuteOnce(&ofi_init_once, ofi_init_once_cb, &ofi_ini_lock, 0);
		break;
	case DLL_THREAD_ATTACH:
		break;
	case DLL_PROCESS_DETACH:
		fi_fini();
		break;
	case DLL_THREAD_DETACH:
		break;
	default:
		break;
	}

	return TRUE;
}
Exemple #4
0
static void cleanup_provider(struct fi_provider *provider, void *dlhandle)
{
	OFI_UNUSED(dlhandle);

	if (provider) {
		fi_param_undefine(provider);

		if (provider->cleanup)
			provider->cleanup();
	}

#ifdef HAVE_LIBDL
	if (dlhandle)
		dlclose(dlhandle);
#endif
}
Exemple #5
0
static int mrail_match_unexp_any(struct dlist_entry *item, const void *arg)
{
	OFI_UNUSED(item);
	OFI_UNUSED(arg);
	return 1;
}