1
1
openmpi/opal
William Zhang e958f3cf22 btl tcp: Use reachability and graph solving for global interface matching
Previously we used a fairly simple algorithm in
mca_btl_tcp_proc_insert() to pair local and remote modules. This was a
point in time solution rather than a global optimization problem (where
global means all modules between two peers). The selection logic would
often fail due to pairing interfaces that are not routable for traffic.
The complexity of the selection logic was Θ(n^n), which was expensive.
Due to poor scalability, this logic was only used when the number of
interfaces was less than MAX_PERMUTATION_INTERFACES (default 8). More
details can be found in this ticket:
https://svn.open-mpi.org/trac/ompi/ticket/2031 (The complexity estimates
in the ticket do not match what I calculated from the function)
As a fallback, when interfaces surpassed this threshold, a brute force
O(n^2) double for loop was used to match interfaces.

This commit solves two problems. First, the point-in-time solution is
turned into a global optimization solution. Second, the reachability
framework was used to create a more realistic reachability map. We
switched from using IP/netmask to using the reachability framework,
which supports route lookup. This will help many corner cases as well as
utilize any future development of the reachability framework.

The solution implemented in this commit has a complexity mainly derived
from the bipartite assignment solver. If the local and remote peer both
have the same number of interfaces (n), the complexity of matching will
be O(n^5).

With the decrease in complexity to O(n^5), I calculated and tested
that initialization costs would be 5000 microseconds with 30 interfaces
per node (Likely close to the maximum realistic number of interfaces we
will encounter). For additional datapoints, data up to 300 (a very
unrealistic number) of interfaces was simulated. Up until 150
interfaces, the matching costs will be less than 1 second, climbing to
10 seconds with 300 interfaces. Reflecting on these results, I removed
the suboptimal O(n^2) fallback logic, as it no longer seems necessary.

Data was gathered comparing the scaling of initialization costs with
ranks. For low number of interfaces, the impact of initialization is
negligible. At an interface count of 7-8, the new code has slightly
faster initialization costs. At an interface count of 15, the new code
has slower initialization costs. However, all initialization costs
scale linearly with the number of ranks.

In order to use the reachable function, we populate local and remote
lists of interfaces. We then convert the interface matching problem
into a graph problem. We create a bipartite graph with the local and
remote interfaces as vertices and use negative reachability weights as
costs. Using the bipartite assignment solver, we generate the matches
for the graph. To ensure that both the local and remote process have
the same output, we ensure we mirror their respective inputs for the
graphs. Finally, we store the endpoint matches that we created earlier
in a hash table. This is stored with the btl_index as the key and a
struct mca_btl_tcp_addr_t* as the value. This is then retrieved during
insertion time to set the endpoint address.

Signed-off-by: William Zhang <wilzhang@amazon.com>
2020-01-21 18:24:08 +00:00
..
class Merge pull request #7299 from awlauria/fix_warnings 2020-01-17 11:33:41 -05:00
datatype Swap the 2 fields to maintain the size of the struct. 2019-11-07 11:25:03 -05:00
dss Ensure buffer_unload leaves the buffer in a clean state 2019-09-04 08:32:27 -07:00
etc Correct the comment in the default MCA param template - we do not support a param called "component_path". The correct syntax is "mca_base_component_path" 2018-01-05 08:46:44 -08:00
include Merge pull request #7124 from devreal/fix-opal-align-min 2020-01-14 15:18:55 -05:00
mca btl tcp: Use reachability and graph solving for global interface matching 2020-01-21 18:24:08 +00:00
memoryhooks opal: clean up init/finalize 2018-12-18 14:37:04 -07:00
runtime Created opal_gethostname() as safer gethostname substitute. 2020-01-13 08:52:17 -08:00
test/reachable opal/util: Change opal/util/if.h macro IF_NAMESIZE to OPAL_IF_NAMESIZE 2019-07-29 21:24:39 +00:00
threads opal/threads: reverted #6199 2019-01-29 13:34:44 -05:00
tools Fix typo and update URLs (https, redirection) [skip ci] 2020-01-07 03:52:25 +09:00
util Merge pull request #7299 from awlauria/fix_warnings 2020-01-17 11:33:41 -05:00
win32 opal: convert from strncpy() -> opal_string_copy() 2018-09-27 11:56:18 -07:00
common_sym_whitelist.txt opal: add code patcher framework 2016-04-13 17:16:13 -06:00
Makefile.am opal: remove generated asm code 2017-08-03 09:18:58 -06:00
win_makefile Purge whitespace from the repo 2015-06-23 20:59:57 -07:00