<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hello all,<br>
<br>
Trying to run mpiexec with cr enabled, I hit a (small) problem where
running mpiexec without specifying a path to the command, I get a
"command line too long" message. Command works OK if we specify a path
before the command name.<br>
Hereafter a patch that fixes this (small) problem.<br>
<br>
xavier<br>
<br>
<br>
traces
----------------------------------------------------------------------------------<br>
<tt><i><br>
# mpiexec -n 2 ./cpi<br>
command line too long<br>
# /usr/local/mvapich2/bin/mpiexec -n 2 ./cpi<br>
Process 0 of 2 is on woodcr1<br>
Process 1 of 2 is on woodcr1<br>
pi is approximately 3.1415926544231318, Error is 0.0000000008333387<br>
wall clock time = 0.223271<br>
#<br>
Patched command:<br>
# mpiexec -n 2 ./cpi<br>
Process 0 of 2 is on woodcr1<br>
Process 1 of 2 is on woodcr1<br>
pi is approximately 3.1415926544231318, Error is 0.0000000008333387<br>
wall clock time = 0.224422<br>
# <br>
<br>
</i></tt>Patch
---------------------------------------------------------------------------------------<br>
<tt>--- mvapich2-trunk-2007-03-01/src/pm/mpd/mpiexec_cr.c~
2007-02-16 21:17:51.000000000 +0100<br>
+++ mvapich2-trunk-2007-03-01/src/pm/mpd/mpiexec_cr.c 2007-03-02
13:51:11.000000000 +0100<br>
@@ -435,7 +435,8 @@<br>
CR_Init();<br>
/*replace the command line to mpiexec*/<br>
rchar = strrchr(argv[0],'/');<br>
- length = rchar+1-argv[0];<br>
+ /* strrchr returns NULL if char is not found */<br>
+ length = rchar ? rchar+1-argv[0] : 0;<br>
if (length+strlen(MPIRUN)>MAX_PATH_LEN) {<br>
fprintf(stderr,"command line too long\n");<br>
exit (1);<br>
<br>
</tt><br>
</body>
</html>