"...git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "c2a38ef9df350c6e01a8d1e299bc082da26beb7e"
Unverified Commit 9a72b78b authored by kylasa's avatar kylasa Committed by GitHub
Browse files

Updated the key to retrieve correct rank of a process (#4756)

Merging this PR to the master branch
parent ed66a209
...@@ -26,17 +26,18 @@ def get_proc_info(): ...@@ -26,17 +26,18 @@ def get_proc_info():
MPI_WORLDSIZE appropriately as described above to retrieve total no. of MPI_WORLDSIZE appropriately as described above to retrieve total no. of
processes, when needed. processes, when needed.
MPI_LOCALRANKID is only valid on a single-node cluster. In a multi-node cluster
the correct key to use is PMI_RANK. In a multi-node cluster, MPI_LOCALRANKID
returns local rank of the process in the context of a particular node in which
it is unique.
Returns: Returns:
-------- --------
integer : integer :
Rank of the current process. Rank of the current process.
""" """
env_variables = dict(os.environ) env_variables = dict(os.environ)
if "OMPI_COMM_WORLD_RANK" in env_variables: return int(os.environ.get("PMI_RANK") or 0)
local_rank = int(os.environ.get("OMPI_COMM_WORLD_RANK") or 0)
elif "MPI_LOCALRANKID" in env_variables:
local_rank = int(os.environ.get("MPI_LOCALRANKID") or 0)
return local_rank
def gen_edge_files(schema_map, output): def gen_edge_files(schema_map, output):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment