pyUSID.processing.comp_utils.group_ranks_by_socket

pyUSID.processing.comp_utils.group_ranks_by_socket(verbose=False)[source]

Groups MPI ranks in COMM_WORLD by socket. Another way to think about this is that it assigns a master rank for each rank such that there is a single master rank per socket (CPU). The results from this function can be used to split MPI communicators based on the socket for intra-node communication.

Parameters:

verbose (bool, optional) – Whether or not to print debugging statements

Returns:

master_ranks – Array with values that signify which rank a given rank should consider its master.

Return type:

1D unsigned integer numpy.ndarray

Notes

This is necessary when wanting to carve up the memory for all ranks within a socket. This is also relevant when trying to bring down the number of ranks that are writing to the HDF5 file. This is all based on the premise that data analysis involves a fair amount of file writing and writing with 3 ranks is a lot better than writing with 100 ranks. An assumption is made that the communication between the ranks within each socket would be faster than communicating across nodes / scokets. No assumption is made about the names of each socket