[Ocfs2-test-devel] [PATCH 4/9] ocfs2-test: recovery_load - Converted from LAM/MPI to OpenMPI.

Marcos Matsunaga Marcos.Matsunaga at oracle.com
Tue Feb 17 14:39:01 PST 2009


Signed-off-by: Marcos Matsunaga <Marcos.Matsunaga at oracle.com>
---
 programs/recovery_load/recovery_load.py |   36 +++++++++++++++++++++++-------
 1 files changed, 27 insertions(+), 9 deletions(-)

diff --git a/programs/recovery_load/recovery_load.py b/programs/recovery_load/recovery_load.py
index 2276428..6cfeb92 100644
--- a/programs/recovery_load/recovery_load.py
+++ b/programs/recovery_load/recovery_load.py
@@ -56,6 +56,7 @@ def Populate():
 		os.system('rm -fr '+localdir)
 	o2tf.CreateDir(DEBUGON, localdir, logfile)
 	o2tf.untar(DEBUGON, localdir, tarfile, logfile)
+#
 def Find():
 	finddir=os.path.join(options.directory, str('%s_recovery' % nodelist[NodeIndex]))
 	if DEBUGON:
@@ -67,6 +68,9 @@ def Find():
 			options.directory, logfile, 0, '')
 	os.system(str('find %s -type f -exec touch {} \;' % options.directory))
 #
+def Cleanup(ret):
+	sys.exit(ret)
+#
 # MAIN
 #
 Usage = 'usage: %prog [-D|--Debug] \
@@ -188,29 +192,47 @@ if NodeIndex == nodelen-1:
 #
 # first. Start MPI
 if not Client:
-	o2tf.StartMPI(DEBUGON, ','.join(nodelist), logfile)
+	o2tf.OpenMPIInit(DEBUGON, ','.join(nodelist), logfile, 'ssh')
 
 	if DEBUGON:
 		cmdline = os.path.join(config.BINDIR, 'recovery_load.py -D')
 	else:
 		cmdline = os.path.join(config.BINDIR, 'recovery_load.py')
 # Extract the tar file
-	o2tf.lamexec( DEBUGON, nproc, config.WAIT, 
+	ret = o2tf.openmpi_run( DEBUGON, nproc, 
 		str('%s -e -d %s -l %s -n %s -t %s' % \
 		(cmdline, options.directory,
 		options.logfile,
 		options.nodes, tarfile) ),
 		','.join(nodelist),
-		logfile)
+		'ssh',
+		logfile,
+		'WAIT')
+	if not ret:
+		o2tf.printlog('recovery_load: extraction successful.',
+			logfile, 0, '')
+	else:
+		o2tf.printlog('recovery_load: extraction failed.',
+			logfile, 0, '')
+		Cleanup(ret)
 # run the find command
 	raw_input('Extraction completed. Press ENTER to continue.')
-	o2tf.lamexec( DEBUGON, nproc, config.WAIT, 
+	ret = o2tf.openmpi_run( DEBUGON, nproc, 
 		str('%s -f -d %s -l %s -n %s' % \
 		(cmdline, options.directory,
 		options.logfile,
 		options.nodes) ),
 		','.join(nodelist),
-		logfile)
+		'ssh',
+		logfile,
+		'WAIT')
+	if not ret:
+		o2tf.printlog('recovery_load: find successful.',
+			logfile, 0, '')
+	else:
+		o2tf.printlog('recovery_load: find failed.',
+			logfile, 0, '')
+		Cleanup(ret)
 else:
 	if options.extract:
 		Populate()
@@ -221,7 +243,3 @@ else:
 			o2tf.printlog('recovery_load: SHOULD NOT BE HERE.',
 			logfile, 0, '')
 			sys.exit(1)
-	
-o2tf.printlog('recovery_load: Job completed successfully',
-	logfile, 3, '=')
-sys.exit
-- 
1.5.6.5




More information about the Ocfs2-test-devel mailing list