flux-framework/flux-core — pull request #125 by garlick (2014-12-26 23:54:33+00:00)
Title: update matchtag protocol, add flux_json_multrpc()

This PR implements 32-bit matchtags to go with the change just made to RFC 3.

It then adds a `flux_json_multrpc()` function that is like `flux_json_rpc()`, but takes a nodeset instead of a nodeid. It uses matchtags to make the requests concurrently. An optional callback collects the results.

flux-module --direct was updated to use this method instead of hand-coded nodset iterator loops that made requests to each node serially on the high-latency ring overlay. This technique should hide that latency for larger nodesets.

This implementation sends all the requests before accepting any replies. A future enhancement would be to add a "fanout" like pdsh so that a configurable number of requests would be made concurrently. Although in Flux we are not subject to socket exhaustion like pdsh is with a high fan-out, we could run out of other resources like memory in extreme cases.

There are other more interesting and scalable ways to distribute work, but this one has the advantage of being really simple.