[cig-commits] r8639 - cs/pythia/trunk/mpi
leif at geodynamics.org
leif at geodynamics.org
Wed Dec 12 12:41:07 PST 2007
Author: leif
Date: 2007-12-12 12:41:06 -0800 (Wed, 12 Dec 2007)
New Revision: 8639
Modified:
cs/pythia/trunk/mpi/Launcher.py
cs/pythia/trunk/mpi/LauncherMPICH.py
Log:
Fix for issue133. "Global" args must precede "local" args for
MPICH2/mpd's 'mpiexec'. Therefore -- when using 'nodelist' and
'nodegen' to instruct Pyre to generate a machinefile -- the placement
of the "-machinefile" option is now explicitly governed by the user
using the 'command' option and a macro -- e.g.,
[CitcomS.launcher]
command = mpiexec -machinefile ${launcher.machinefile} -np ${nodes}
nodelist=1,2,3,4
nodegen=compute-%d
Modified: cs/pythia/trunk/mpi/Launcher.py
===================================================================
--- cs/pythia/trunk/mpi/Launcher.py 2007-12-11 00:44:37 UTC (rev 8638)
+++ cs/pythia/trunk/mpi/Launcher.py 2007-12-12 20:41:06 UTC (rev 8639)
@@ -68,7 +68,7 @@
# use only the specific nodes specified explicitly
if self.nodelist:
- self._appendNodeListArgs(args)
+ self._expandNodeListArgs(args)
args.append(os.path.abspath(self.executable))
args += self.arguments
Modified: cs/pythia/trunk/mpi/LauncherMPICH.py
===================================================================
--- cs/pythia/trunk/mpi/LauncherMPICH.py 2007-12-11 00:44:37 UTC (rev 8638)
+++ cs/pythia/trunk/mpi/LauncherMPICH.py 2007-12-12 20:41:06 UTC (rev 8639)
@@ -26,14 +26,23 @@
machinefile.meta['tip'] = """filename of machine file"""
- def _appendNodeListArgs(self, args):
+ def _expandNodeListArgs(self, args):
+ from pyre.util import expandMacros
+
machinefile = self.machinefile
nodegen = self.nodegen
file = open(machinefile, "w")
for node in self.nodelist:
file.write((nodegen + '\n') % node)
file.close()
- args.extend(['-machinefile', machinefile])
+ substitutions = {
+ 'launcher.machinefile': machinefile,
+ }
+ for i,arg in enumerate(args):
+ args[i] = expandMacros(arg, substitutions)
+ return
+
+
# end of file
More information about the cig-commits
mailing list