From f8958463aeb40b5caeb2bf1e304f80980b9626f2 Mon Sep 17 00:00:00 2001 From: Sam Lang Date: Tue, 8 Jan 2013 09:56:41 -0600 Subject: [PATCH] task/mpi: Allow working directory to be specified Signed-off-by: Sam Lang --- teuthology/task/mpi.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/teuthology/task/mpi.py b/teuthology/task/mpi.py index 385d907bcf875..c5a13745b3fa3 100644 --- a/teuthology/task/mpi.py +++ b/teuthology/task/mpi.py @@ -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') -- 2.39.5