You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/01/31 19:34:16 UTC

[GitHub] cjolivier01 closed pull request #9049: Allow user to pass specific environment variables for server/worker/both through launch.py

cjolivier01 closed pull request #9049: Allow user to pass specific environment variables for server/worker/both through launch.py
URL: https://github.com/apache/incubator-mxnet/pull/9049
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/tools/launch.py b/tools/launch.py
index de42ea2a7d..0908950636 100755
--- a/tools/launch.py
+++ b/tools/launch.py
@@ -36,7 +36,14 @@ def dmlc_opts(opts):
             '--cluster', opts.launcher,
             '--host-file', opts.hostfile,
             '--sync-dst-dir', opts.sync_dst_dir]
-    args += opts.command;
+
+    # convert to dictionary
+    dopts = vars(opts)
+    for key in ['env_server', 'env_worker', 'env']:
+        for v in dopts[key]:
+            args.append('--' + key.replace("_","-"))
+            args.append(v)
+    args += opts.command
     try:
         from dmlc_tracker import opts
     except ImportError:
@@ -64,6 +71,21 @@ def main():
     parser.add_argument('--launcher', type=str, default='ssh',
                         choices = ['local', 'ssh', 'mpi', 'sge', 'yarn'],
                         help = 'the launcher to use')
+    parser.add_argument('--env-server', action='append', default=[],
+                        help = 'Given a pair of environment_variable:value, sets this value of \
+                        environment variable for the server processes. This overrides values of \
+                        those environment variable on the machine where this script is run from. \
+                        Example OMP_NUM_THREADS:3')
+    parser.add_argument('--env-worker', action='append', default=[],
+                        help = 'Given a pair of environment_variable:value, sets this value of \
+                        environment variable for the worker processes. This overrides values of \
+                        those environment variable on the machine where this script is run from. \
+                        Example OMP_NUM_THREADS:3')
+    parser.add_argument('--env', action='append', default=[],
+                        help = 'given a environment variable, passes their \
+                        values from current system to all workers and servers. \
+                        Not necessary when launcher is local as in that case \
+                        all environment variables which are set are copied.')
     parser.add_argument('command', nargs='+',
                         help = 'command for launching the program')
     args, unknown = parser.parse_known_args()


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services