a fake orted to change the remote IP address to the address of the SSH session
smbaker [Tue, 11 Dec 2012 09:49:36 +0000 (01:49 -0800)]
scripts/orted [new file with mode: 0755]

diff --git a/scripts/orted b/scripts/orted
new file mode 100755 (executable)
index 0000000..fd3389f
--- /dev/null
@@ -0,0 +1,21 @@
+#! /usr/bin/python
+
+import subprocess
+import sys
+import os
+
+if "SSH_CONNECTION" in os.environ:
+    parts = os.environ["SSH_CONNECTION"].split()
+    remote_ip = parts[0]
+else:
+    remote_ip = None
+
+newargs = []
+for arg in sys.argv[1:]:
+   if ("tcp://192.168" in arg) and (remote_ip is not None):
+       parts = arg.split(":")
+       parts[1]="//" + remote_ip # "//128.112.171.38"
+       arg=":".join(parts)
+   newargs.append(arg)
+
+subprocess.call(["/usr/lib64/openmpi/bin/orted"] + newargs)