MCPcopy Create free account
hub / github.com/PKU-Alignment/align-anything / is_main_process

Function is_main_process

align_anything/utils/multi_process.py:33–35  ·  view source on GitHub ↗

Check if the current process is the main process.

()

Source from the content-addressed store, hash-verified

31
32
33def is_main_process() -> bool:
34 """Check if the current process is the main process."""
35 return not dist.is_initialized() or dist.get_rank() == 0
36
37
38def print_on_main_process(msg: str) -> None:

Callers 15

set_logger_levelFunction · 0.90
__new__Method · 0.90
valMethod · 0.90
saveMethod · 0.90
trainMethod · 0.90
trainMethod · 0.90
trainMethod · 0.90
evalMethod · 0.90
evalMethod · 0.90
trainMethod · 0.90
trainMethod · 0.90
trainMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected