(args)
| 66 | |
| 67 | |
| 68 | def default_init(args): |
| 69 | import datetime |
| 70 | import time |
| 71 | try: |
| 72 | dist.destroy_process_group() |
| 73 | # the first time will raise exception, so the following code is skipped. |
| 74 | print('destroy comm, increase port for 1. (this could cause problem)') |
| 75 | url = ':'.join(args.dist_url.split(':')[:-1]) |
| 76 | port = int(args.dist_url.split(':')[-1]) + 1 |
| 77 | args.dist_url = f"{url}:{port}" |
| 78 | print(f"new master url: {args.dist_url}") |
| 79 | except: |
| 80 | pass |
| 81 | dist.init_process_group(backend='gloo', timeout=datetime.timedelta(seconds=5*60), init_method=args.dist_url, world_size=args.world_size, rank=args.rank) |
| 82 | |
| 83 | |
| 84 | def init_communicators(args): |
no outgoing calls
no test coverage detected