Last active
June 14, 2023 14:55
-
-
Save chengscott/f82735756d831643633f4453631f9980 to your computer and use it in GitHub Desktop.
Cray MPI Wrapper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import os | |
import sys | |
import shlex | |
os.putenv('RANK', os.getenv('PMI_RANK')) | |
os.putenv('WORLD_SIZE', os.getenv('PMI_SIZE')) | |
os.putenv('LOCAL_RANK', os.getenv('PMI_LOCAL_RANK')) | |
os.putenv('LOCAL_SIZE', os.getenv('PMI_LOCAL_SIZE')) | |
argv = [] | |
if os.getenv('PMI_RANK') == '0': | |
argv = shlex.split(os.getenv('WRAPPER_CMD')) | |
argv += sys.argv[1:] | |
os.execvp(argv[0], argv) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment