ofiwg/libfabric — pull request #209 by jsquyres (2014-10-21 20:50:52+00:00)
Title: Add provider versioning

Per #196, add versioning to fi_register_provider(). If multiple providers with the same name register, then only keep the one with the higher version number. This can only happen when DL providers are loaded.

There are 3 possible cases:

1. If provider A registers with the name "foo" and version 1, and then later provider B registers with name "foo" and version 2, then provider B will be kept. **NOTE:** Provider A is not told that it will be ignored.
1. If provider A registers with the name "foo" and version 10, and then later provider B registers with name "foo" and version 9, then provider A will be kept, and B's call to fi_register_provider() will return -EALREADY.
1. If provider A registers with the name "foo" and version 10, and then later provider B registers with name "foo" and version 10 (i.e., both are the same (name, version) tuple), then provider A will be kept, and B's call to fi_register_provider() will return -EALREADY.

I'm not sure if case 1 is problematic or not. It does seem a little weird to be asymmetric in terms of handling.

@shefty @pmmccorm Can you please review / comment?