<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body text="#000066" bgcolor="#ffffcc">
<tt>Tristan,<br>
<br>
See my comments inline<br>
</tt>
<pre class="moz-signature" cols="72">Regards,
Marcos Eduardo Matsunaga
Oracle USA
Linux Engineering
“The statements and opinions expressed here are my own and do not
necessarily represent those of Oracle Corporation.”
</pre>
<br>
On 06/03/2010 11:19 PM, tristan wrote:
<blockquote cite="mid:4C0870AC.7070207@oracle.com" type="cite">Marcos
Matsunaga wrote:
<br>
<blockquote type="cite">- Made some changes trying to prevent
write_torture script from waiting
<br>
indefinetely for the return from openmpi.
<br>
<br>
Signed-off-by: Marcos Matsunaga <a class="moz-txt-link-rfc2396E" href="mailto:Marcos.Matsunaga@oracle.com"><Marcos.Matsunaga@oracle.com></a>
<br>
---
<br>
programs/write_torture/run_write_torture.py | 43
+++++++++++---------------
<br>
programs/write_torture/write_torture.c | 10 +++++-
<br>
2 files changed, 26 insertions(+), 27 deletions(-)
<br>
<br>
diff --git a/programs/write_torture/run_write_torture.py
b/programs/write_torture/run_write_torture.py
<br>
index aac64a6..6f4a7d0 100755
<br>
--- a/programs/write_torture/run_write_torture.py
<br>
+++ b/programs/write_torture/run_write_torture.py
<br>
@@ -54,6 +54,7 @@ Usage = '\n %prog [-b|--blocksize] \
<br>
[-c | --count count] \
<br>
[-d | --directory directory] \
<br>
[-f | --filename <filename>] \
<br>
+[-i | --if <Network Interface>] \
<br>
[-l | --logfile logfile] \
<br>
[-n | --nodelist nodelist] \
<br>
[-p | --procs procs] \
<br>
@@ -95,6 +96,12 @@ if __name__=='__main__':
<br>
If specified, a single file will be used by \
<br>
instances of the test.')
<br>
#
<br>
+ parser.add_option('-i',
<br>
+ '--if',
<br>
+ dest='interface',
<br>
+ type='string',
<br>
+ help='Network interface to be used by the test.')
<br>
+#
<br>
parser.add_option('-l', '--logfile',
dest='logfile',
<br>
@@ -122,9 +129,7 @@ if __name__=='__main__':
<br>
(options, args) = parser.parse_args()
<br>
if len(args) != 0:
<br>
o2tf.printlog('args left %s' % len(args), -
logfile, - 0, - '')
<br>
+ logfile, 0, '')
<br>
parser.error('incorrect number of arguments')
<br>
#
<br>
if options.blocksize:
<br>
@@ -132,9 +137,7 @@ if __name__=='__main__':
<br>
blockvalues = blocksize.split(',')
<br>
if len(blockvalues) != 2:
<br>
o2tf.printlog('Blocksize must be specified in format
xxx,yyy\n\n', - logfile, - 0, - '')
<br>
+ logfile, 0, '')
<br>
parser.error('Invalid format.')
<br>
else:
<br>
parser.error('Blocksize parameter needs to be specified.')
<br>
@@ -142,16 +145,12 @@ if __name__=='__main__':
<br>
if int(blockvalues[0]) < MINBLOCKSIZE or int(blockvalues[1])
> MAXBLOCKSIZE:
<br>
o2tf.printlog('Blocksize must be between %s and %s\n\n' %
(MINBLOCKSIZE, MAXBLOCKSIZE), - logfile, - 0,
- '')
<br>
+ logfile, 0, '')
<br>
parser.error('Invalid range.')
<br>
if DEBUGON:
<br>
o2tf.printlog('Blocksize range from %s to %s\n\n' %
(str(blockvalues[0]), str(blockvalues[1])), - logfile, -
0, - '')
<br>
+ logfile, 0, '')
<br>
#
<br>
if options.count:
<br>
count = options.count
<br>
@@ -175,7 +174,8 @@ if __name__=='__main__':
<br>
nodelist = nodelist.add(options.nodelist)
<br>
else:
<br>
nodelist = options.nodelist.split(',')
<br>
-
<br>
+#
<br>
+ interface = options.interface
<br>
#
<br>
if options.procs:
<br>
procs = options.procs
<br>
@@ -190,23 +190,15 @@ else:
<br>
#
<br>
if DEBUGON:
<br>
o2tf.printlog('run_write_torture: main - current directory %s' %
os.getcwd(),
<br>
- logfile, - 0, - '')
<br>
+ logfile, 0, '')
<br>
o2tf.printlog('run_write_torture: main - cmd = %s' % cmd,
<br>
- logfile, - 0, - '')
<br>
+ logfile, 0, '')
<br>
o2tf.printlog('run_write_torture: main - blocksize = %s' %
options.blocksize,
<br>
- logfile, - 0, - '')
<br>
+ logfile, 0, '')
<br>
#
<br>
for z in range(options.count):
<br>
o2tf.printlog('run_write_torture: Running test# %s' % z, -
logfile, - 0, - '')
<br>
+ logfile, 0, '')
<br>
#
<br>
o2tf.OpenMPIInit(DEBUGON, options.nodelist, logfile, 'ssh')
<br>
ret = o2tf.openmpi_run(DEBUGON, options.procs,
<br>
@@ -217,6 +209,7 @@ for z in range(options.count):
<br>
os.path.join(options.directory, filename) ) ),
options.nodelist, 'ssh',
<br>
+ options.interface,
<br>
options.logfile,
<br>
'WAIT')
<br>
if not ret:
<br>
diff --git a/programs/write_torture/write_torture.c
b/programs/write_torture/write_torture.c
<br>
index de5abcf..7b93306 100644
<br>
--- a/programs/write_torture/write_torture.c
<br>
+++ b/programs/write_torture/write_torture.c
<br>
@@ -94,6 +94,9 @@ static int launch_child(char *fname, int open_flags,
int (*newmain)(void))
<br>
mypid = getpid();
<br>
srand(mypid);
<br>
ret = newmain();
<br>
+ fprintf(stderr,
<br>
+ "%s: Error %d launch child \n", hostn, + ret);
<br>
exit(ret);
<br>
}
<br>
if (pid == -1) {
<br>
@@ -395,7 +398,7 @@ int main(int argc, char **argv)
<br>
if (signal(SIGINT, signal_handler) == SIG_ERR) {
<br>
fprintf(stderr, "%s: Couldn't setup parent signal handler!\n",
<br>
hostn);
<br>
- return 1;
<br>
+ exit(1);
<br>
</blockquote>
<br>
It makes no sense here, we didn't fork any children yet.
<br>
</blockquote>
Right.. I was just testing. This was not to be in the patch. I'll
remove the next. It didn't help anyway.<br>
<blockquote cite="mid:4C0870AC.7070207@oracle.com" type="cite"><br>
<blockquote type="cite"> }
<br>
<br>
/* We don't care. Getting back a short write is just fine. */
<br>
@@ -486,5 +489,8 @@ kill_all:
<br>
dprintf("%s: Killed children\n", hostn);
<br>
}
<br>
<br>
- return ret == -ECHILD ? ret : 0;
<br>
+ fprintf(stderr, "%s: kill_all %d \n", hostn, ret);
<br>
+ exit(0);
<br>
</blockquote>
<br>
Why we need to always return '0' from the binary? a 'none-zero' return
from binary cause the openmpi waiting indefinitely?
<br>
</blockquote>
I was just trying to see if openmpi would close, but it seems to be
waiting indefinitely. Need to do more tests. Removing this too.<br>
<blockquote cite="mid:4C0870AC.7070207@oracle.com" type="cite"><br>
<blockquote type="cite">+/* return ret == -ECHILD ? ret : 0;
<br>
+ */
<br>
}
<br>
</blockquote>
<br>
</blockquote>
</body>
</html>