admin管理员组文章数量:1388812
I'm working with libfabric and trying to specify a source port for my application. I've set up my fi_info structure and assigned the source address and port, but it doesn't seem to be working as expected. Here's the relevant part of my code:
...
auto _hint = fi_allocinfo();
std::shared_ptr<fi_info> hint(_hint, std::bind(&fi_freeinfo, std::placeholders::_1));
hint->ep_attr->type = FI_EP_MSG;
hint->caps = FI_MSG;
hint->domain_attr->mr_mode = FI_MR_BASIC;
hint->mode = FI_LOCAL_MR;
// Define source (client) address
struct sockaddr_in *src_addr = new sockaddr_in{};
memset(src_addr, 0, sizeof(src_addr));
src_addr->sin_family = AF_INET;
src_addr->sin_addr.s_addr = htonl(INADDR_ANY);
src_addr->sin_port = htons(8899); // Source port
// Assign addresses to hints
hint->src_addr = src_addr;
hint->src_addrlen = sizeof(sockaddr_in);
hint->addr_format = FI_SOCKADDR_IN;
int ret = fi_getinfo(OFI_VERSION, address.c_str(), input.c_str(), 0, hint.get(), &_info);
if (ret) {
std::cout << "connect():fi_getinfo failed" << std::endl;
return nullptr;
}
...
My questions are:
- Is it possible to specify a source port in libfabric's verbs,DRMA?
- If so, what am I doing wrong in my code?
- Are there any additional steps or configurations required to make this work?
Any help or guidance would be greatly appreciated!
本文标签: cIs it possible to specify a source port in libfabric39s DRMA client sideStack Overflow
版权声明:本文标题:c++ - Is it possible to specify a source port in libfabric's DRMA client side? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744557444a2612561.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论