]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
task/mpi: Allow working directory to be specified
authorSam Lang <sam.lang@inktank.com>
Tue, 8 Jan 2013 15:56:41 +0000 (09:56 -0600)
committerSam Lang <sam.lang@inktank.com>
Tue, 8 Jan 2013 16:07:42 +0000 (10:07 -0600)
Signed-off-by: Sam Lang <sam.lang@inktank.com>
teuthology/task/mpi.py

index 385d907bcf875ea71f8af95f640003b6a7307f84..c5a13745b3fa359839a1aa518f6027839e79ce62 100644 (file)
@@ -16,6 +16,7 @@ def task(ctx, config):
         tasks:
         - ceph:
         - ceph-fuse: [client.0, client.1]
+        - ssh_keys:
         - mpi: 
             nodes: [client.0, client.1]
             exec: ior ...
@@ -25,6 +26,7 @@ def task(ctx, config):
         tasks:
         - ceph:
         - ceph-fuse:
+        - ssh_keys:
         - mpi:
             exec: ior ...
 
@@ -32,10 +34,27 @@ def task(ctx, config):
 
         tasks:
         - ceph:
+        - ssh_keys:
         - mpi:
             nodes: all
             exec: ...
 
+    Example that specifies a working directory for MPI processes:
+
+        tasks:
+        - ceph:
+        - ceph-fuse:
+        - pexec:
+            clients:
+              - ln -s /tmp/cephtest/mnt.* /tmp/cephtest/gmnt
+        - ssh_keys:
+        - mpi:
+            exec: fsx-mpi
+            workdir: /tmp/cephtest/gmnt
+        - pexec:
+            clients:
+              - rm -f /tmp/cephtest/gmnt
+
     """
     assert isinstance(config, dict), 'task mpi got invalid config'
     assert 'exec' in config, 'task mpi got invalid config, missing exec'
@@ -67,6 +86,10 @@ def task(ctx, config):
             hosts.append(ip)
             remotes.append(remote)
 
+    workdir = []
+    if 'workdir' in config:
+        workdir = ['-wdir', config['workdir'] ]
+
     log.info('mpi rank 0 is: {name}'.format(name=master_remote.name))
 
     # write out the mpi hosts file
@@ -75,6 +98,7 @@ def task(ctx, config):
     teuthology.write_file(remote=master_remote, path='/tmp/cephtest/mpi-hosts', data='\n'.join(hosts))
     log.info('mpiexec on {name}: {cmd}'.format(name=master_remote.name, cmd=mpiexec))
     args=['mpiexec', '-f', '/tmp/cephtest/mpi-hosts']
+    args.extend(workdir)
     args.extend(mpiexec.split(' '))
     master_remote.run(args=args, )
     log.info('mpi task completed')