[Core][Distributed] add coordinator to reduce code duplication in tp and pp (#5293)
test_utils.py
tests/utils.py