INNER CODE UNIT · Python
local_size
bytedance/byteps · byteps/common/__init__.py:94
def local_size(self):
"""A function that returns the number of BytePS processes within the
node the current process is running on.
Returns:
An integer scalar containing the number of local BytePS processes.
"""
local_size = self.C_LIB_CTYPES.byteps_local_size()
if local_size == -1:
raise ValueError(
'BytePS has not been initialized; use bps.init().')
return local_size
def rank(self):
"""A function that returns the BytePS rank of the calling process.
Returns:
An integer scalar with the BytePS rank of the calling process.
"""
rank = self.C_LIB_CTYPES.byteps_rank()