[libfabric-users] API suggestion: some return values without minus sign

Hugh Fisher laranzu at ozemail.com.au
Sun Jun 22 18:09:12 PDT 2025


Suggestion for the libfabric public API, add three defines in fabric.h

#define FI_RET_EAVAIL   (-FI_EAVAIL)
#define FI_RET_AGAIN    (-FI_EAGAIN)
#define FI_RET_TIMEDOUT (-FI_ETIMEDOUT)

This is so we don’t have to write the minus sign when comparing the return value from fi_send, etc to particular values.

It’s an easy mistake: in developing my current program I wrote  “if (err == FI_EAGAIN) … “ and was very impressed by the speed and reliability of my network link, I never ran out of resources. Even though I’d posted tens of thousands of fi_recv ops with no active sender … uh, that can’t be right. 

I suggest only these three values, not all possible error codes, because these three are the “not really errors” that are most likely to be individually tested for.

I considered FI_ERR_AVAIL etc instead of FI_RET, but I think the RET prefix makes it clear that these are derived values.

Happy to try and submit a pull request on GitHub, but thought this was a better place to discuss initially.

—
cheers,
Hugh Fisher




More information about the Libfabric-users mailing list