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

tristan.ye tristan.ye at oracle.com
Tue Feb 17 17:57:21 PST 2009


Looks good:)

On Tue, 2009-02-17 at 14:39 -0800, Marcos Matsunaga wrote:
> 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




More information about the Ocfs2-test-devel mailing list