-
Notifications
You must be signed in to change notification settings - Fork 344
Creating an error when a SLURM variable isn't found, usually because … #869
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…SLURM is not run with .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Tristanjmeyers for sending this in! Looks reasonable.
/blossom-ci |
FYI this is failing CI due to formatting issues. It's nothing wrong really,
(it's just moving the string to a new line...) |
I've done that, sorry for not linting! |
/blossom-ci |
addr = os.environ.get("SLURM_LAUNCH_NODE_IPADDR") | ||
except TypeError: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry @Tristanjmeyers - I looked at this more closely and we need to adjust this. os.environ.get
will return None
for missing variables, and raise no error. I think you can either:
- Remove the try/except type error, and change to
if addr is None: raise EnvErr...
; or - change from
os.environ.get('SLURM_LAUNCH_NODE_IPADDR')
toos.environ['SLURM_LAUNCH_NODE_IPADDR']
andTypeError
toKeyError
.
Raising an environment error when the variable
SLURM_LAUNCH_NODE_IPADDR
is not found. This is usually because the user isn't runningSLURM
withsrun
, and instead using something likesbatch
. So, instead of raising aTypeError
, this will now raise anEnvironmentError
and print some help.PhysicsNeMo Pull Request
Description
physicsnemo.distributed.manager
now has atry: ... except TypeError:
statement.physicsnemo.distributed.DistributedManager
expectssrun
rather thansbatch
#819Checklist
Dependencies
N/A