()
| 25 | |
| 26 | |
| 27 | def get_master_node(): |
| 28 | import subprocess |
| 29 | |
| 30 | if os.getenv("SLURM_JOB_ID") is None: |
| 31 | raise RuntimeError("get_master_node can only used in Slurm launch!") |
| 32 | result = subprocess.check_output('scontrol show hostnames "$SLURM_JOB_NODELIST" | head -n 1', shell=True) |
| 33 | result = result.decode("utf8").strip() |
| 34 | return result |
| 35 | |
| 36 | |
| 37 | def move_norm_to_cuda(norm: Union[float, torch.Tensor]) -> Union[float, torch.Tensor]: |
no outgoing calls
no test coverage detected