-
Notifications
You must be signed in to change notification settings - Fork 90
Generic MPI - Create library to changehostname when mpi starts #153
Conversation
.flake8
Outdated
| [flake8] | ||
| application_import_names = sagemaker_containers, test | ||
| application_import_names = sagemaker_containers, test, libchangehostname | ||
| import-order-style = google |
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.
nit: newline at the end
laurenyu
left a comment
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.
what about Windows? :)
| module = Py_InitModule3( | ||
| "libchangehostname", LibchangehostnameMethods, "Returns the value of $SM_CURRENT_HOST"); | ||
| } | ||
| #endif No newline at end of file |
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.
nit: newline at the end of the file
|
|
||
| int libchangehostname(char *name, size_t len) | ||
| { | ||
| const char *val = getenv("SM_CURRENT_HOST"); |
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.
i don't really like that it depends on an environment variable that might now be initialized yet.
I understand that right now we call it at 'the right' time, but since it's not really guaranteed by anyone I am worried that it might cause issues in the future.
Also sagemaker-containers is not just a library used by us, we also advertise and help customers to use it in BYOC use case.
Anyway we can switch to use json file or guarantee that it's called only after this environment variable is initialized?
* Generic MPI - Create library to changehostname when mpi starts (#153)
Description of changes:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.