[ofiwg] libfabric fi_getinfo question
Vasiliy Tolstov
v.tolstov at selfip.ru
Thu Jul 16 02:14:46 PDT 2015
Hello, i'm try to understand usage of libfabric and stuc at simple
example, it returns
fi_getinfo(): info.c:34, ret=-22 (Invalid argument)
i'm try to resolve local node address with hostname =
cn33.z1.mn2.simplecloud.ru and node_desc = cn33.z1.mn2.simplecloud.ru
P.S does it possible to resolve node address via libfabric that
entered in node_desc
(/sys/devices/pci0000:00/0000:00:02.0/0000:02:00.0/infiniband/mlx4_0/node_desc)
int main(int argc, char **argv) {
int ret;
hints = fi_allocinfo();
if (hints == NULL) {
fprintf(stderr, "%s\n", "failed to alloc info");
return -1;
}
hints->addr_format = FI_SOCKADDR_IB;
ret = fi_getinfo(FI_VERSION(1, 0),
"cn33.z1.mn2.simplecloud.ru", NULL, 0, hints, &fi);
if (ret < 0) {
FT_PRINTERR("fi_getinfo", ret);
return ret;
}
if (fi == NULL) {
fprintf(stderr, "%s\n", "failed to get info");
return -1;
}
for (rp = fi; rp != NULL; rp = rp->next) {
if (rp->addr_format == FI_SOCKADDR_IB) {
addrlen = fi->dest_addrlen;
remote_addr = malloc(addrlen);
memcpy(remote_addr, fi->dest_addr, addrlen);
}
}
fi_freeinfo(fi);
return 0;
}
--
Vasiliy Tolstov,
e-mail: v.tolstov at selfip.ru
More information about the ofiwg
mailing list