<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18812"></HEAD>
<BODY>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=280025921-05082009>Hi,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=280025921-05082009> A user can choose the MPICH2 channel at runtime
by using the "-channel" option of mpiexec. This requires
using mpich2mpi.dll (with mpich.dll you are only linking with the default
channel).</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=280025921-05082009> So in your case you can do the
following,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=280025921-05082009></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=280025921-05082009># Create your MPI libs from mpich2mpi.dll and
fmpich2.dll using wlib.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=280025921-05082009># Distribute all the MPICH2 dlls (look for mpich2*.dll,
mpe*.dll & fmpich*.dll in c:\windows\system32 directory on the machine
where you installed MPICH2) with your application. You can leave the MPICH2
dlls in the directory containing your executable or copy them to the user's
"c:\windows\system32" directory (Note that SYSTEM32 directory is actually
%SystemRoot%\system32).</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=280025921-05082009></SPAN></FONT><FONT color=#0000ff size=2
face=Arial><SPAN class=280025921-05082009></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=280025921-05082009> Let us know if you still have
questions.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=280025921-05082009></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=280025921-05082009>(PS: When building your own wrapper libraries from a
3rd party dll its always a good idea to use "Dependency Walker", depends.exe,
which is available with Visual Studio. The dependency walker should show all the
dependencies for an executable. In your case compile a simple MPI program, say
hellow.exe, with MPICH2 & use dependency walker to check the
dependencies for hellow.exe.)</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=280025921-05082009></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=280025921-05082009>Regards,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=280025921-05082009>Jayesh</SPAN></FONT></DIV><BR>
<DIV dir=ltr lang=en-us class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>From:</B> lccostajr@gmail.com
[mailto:lccostajr@gmail.com] <B>On Behalf Of </B>Luiz Carlos da Costa
Junior<BR><B>Sent:</B> Wednesday, August 05, 2009 4:39 PM<BR><B>To:</B> Jayesh
Krishna<BR><B>Cc:</B> mpich-discuss@mcs.anl.gov<BR><B>Subject:</B> Re:
[mpich-discuss] Fatal error in MPI_Init<BR></FONT><BR></DIV>
<DIV></DIV>Hi,<BR><BR>I could make the program work, but there are some points I
still would like to clarify.<BR><BR>The problem is that my program also links to
another library using its dll file. However, in my development environment,
these dll's are not placed in the same directory where I build my application.
Actually, I keep these dll's in the library's installation directory and my PATH
environment variable points to this folder. <BR><BR>I could just figure out of
the problem because I was trying to reduce my applications size and, in order to
do that, I replaced many of the subroutines by dummy ones. When I disabled my
part of the code related to the second library, it worked.<BR><BR>So, the
solution I found was to copy the needed dll's to my application's folder. But
I'm not so comfortable with this because this scheme had always worked, even
with MPICH1 (i.e., when I link and run my application with MPIRUN).<BR><BR>Is
such behavior expected? Why does mpiexec work differently from mpirun?<BR>Any
mistake from my side?<BR><BR>Another point is that I use to include 'mpif.h' in
my Fortran routines that use MPICH2 and, I link my application with mpich2.lib
and fmpich2.lib, which are the import libraries I have created from mpich2.dll
and fmpich2.dll, using OpenWatcom "wlib" utility.<BR><BR>I didn't know that the
correct library to use was mpich2mpi.dll. Sorry for the question, but what are
the differences?<BR>As I could make it run with mpich2.dll and fmpich2.dll, what
kind of errors may I expect?<BR><BR>Thanks again.<BR>LC<BR><BR><BR>
<DIV class=gmail_quote>2009/7/28 Jayesh Krishna <SPAN dir=ltr><<A
href="mailto:jayesh@mcs.anl.gov"
target=_blank>jayesh@mcs.anl.gov</A>></SPAN><BR>
<BLOCKQUOTE
style="BORDER-LEFT: rgb(204,204,204) 1px solid; MARGIN: 0pt 0pt 0pt 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote>
<DIV>
<DIV dir=ltr align=left><SPAN><FONT color=#0000ff size=2
face=Arial>Hi,</FONT></SPAN></DIV>
<DIV>
<DIV dir=ltr align=left><SPAN><FONT color=#0000ff size=2
face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN>>> create library files from mpich2.dll
and fmpich2.dll (distributed with MPICH2 setup),</SPAN></DIV></DIV>
<DIV dir=ltr align=left><SPAN> How are you creating lib files from the
dlls (In any case you should be using mpich2mpi.dll instead of mpich2.dll)?
</SPAN></DIV>
<DIV>
<DIV dir=ltr align=left><SPAN></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN><FONT color=#0000ff size=2 face=Arial>>>
<FONT color=#000000 size=3 face="Times New Roman">compile all my code with the
MPICH2 libraries</FONT></FONT></SPAN></DIV></DIV>
<DIV dir=ltr align=left><SPAN><FONT color=#0000ff size=2 face=Arial> Are
you compiling your code with the libraries distributed with MPICH2 ? Or are
you using the libs created by you ?</FONT></SPAN></DIV>
<DIV>
<DIV dir=ltr align=left><SPAN><FONT color=#0000ff size=2
face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN><FONT color=#0000ff size=2 face=Arial>>>
run my code using "mpiexe -host hostname -n N
myapplication"</FONT></SPAN></DIV></DIV>
<DIV dir=ltr align=left><SPAN><FONT color=#0000ff size=2 face=Arial> Can
you run your code on the localhost (Does "mpiexec -n N myapplication" work ?
)?</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN><FONT color=#0000ff size=2
face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN><FONT color=#0000ff size=2
face=Arial>Regards,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN><FONT color=#0000ff size=2
face=Arial>Jayesh</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN><FONT color=#0000ff size=2
face=Arial></FONT></SPAN> </DIV><BR>
<DIV dir=ltr lang=en-us align=left>
<HR>
<FONT size=2 face=Tahoma><B>From:</B> <A href="mailto:lccostajr@gmail.com"
target=_blank>lccostajr@gmail.com</A> [mailto:<A
href="mailto:lccostajr@gmail.com" target=_blank>lccostajr@gmail.com</A>] <B>On
Behalf Of </B>Luiz Carlos da Costa Junior<BR><B>Sent:</B> Monday, July 27,
2009 8:06 PM<BR><B>To:</B> Jayesh Krishna<BR><B>Cc:</B> <A
href="mailto:mpich-discuss@mcs.anl.gov"
target=_blank>mpich-discuss@mcs.anl.gov</A><BR><B>Subject:</B> Re:
[mpich-discuss] Fatal error in MPI_Init<BR></FONT><BR></DIV>
<DIV>
<DIV></DIV>
<DIV>
<DIV></DIV>Hi Jayesh,<BR><BR>I compile my code with OpenWatcom
compiler.<BR>The procedure I use is:<BR>
<OL>
<LI>create library files from mpich2.dll and fmpich2.dll (distributed with
MPICH2 setup),
<LI>compile all my code with the MPICH2 libraries
<LI>run my code using "mpiexe -host hostname -n N myapplication"</LI></OL>I
had already used procedure successfully before, but I don't know what is
happening now.<BR>I have tried with MPICH2 versions 1.0.8 and the newer one
1.1.1, but the error is the same.<BR><BR>I also tried to repeat this procedure
on a computer without MPI's installation, but I got the same.<BR><BR>As I told
before, I'am able to run CPI and also non-MPI programs.<BR>Any clue that can
help me?<BR><BR>Thanks<BR><BR>
<DIV class=gmail_quote>2009/7/27 Jayesh Krishna <SPAN dir=ltr><<A
href="mailto:jayesh@mcs.anl.gov"
target=_blank>jayesh@mcs.anl.gov</A>></SPAN><BR>
<BLOCKQUOTE
style="BORDER-LEFT: rgb(204,204,204) 1px solid; MARGIN: 0pt 0pt 0pt 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote>
<DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2
face=Arial><SPAN>Hi,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2
face=Arial><SPAN> Did you recompile your code with MPICH2 ? Which
version of MPICH2 are you using ? How are you launching your MPI job (the
command used to launch your job) ? Are you able to run non-MPI programs
(Does "mpiexec -n 2 hostname" work ?)?</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2
face=Arial><SPAN></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN>(PS: The
error message)</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2
face=Arial><SPAN>Regards,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2
face=Arial><SPAN>Jayesh</SPAN></FONT></DIV><BR>
<DIV dir=ltr lang=en-us align=left>
<HR>
<FONT size=2 face=Tahoma><B>From:</B> <A
href="mailto:mpich-discuss-bounces@mcs.anl.gov"
target=_blank>mpich-discuss-bounces@mcs.anl.gov</A> [mailto:<A
href="mailto:mpich-discuss-bounces@mcs.anl.gov"
target=_blank>mpich-discuss-bounces@mcs.anl.gov</A>] <B>On Behalf Of
</B>Luiz Carlos da Costa Junior<BR><B>Sent:</B> Friday, July 24, 2009 10:56
PM<BR><B>To:</B> MPICH Discuss<BR><B>Subject:</B> [mpich-discuss] Fatal
error in MPI_Init<BR></FONT><BR></DIV>
<DIV>
<DIV></DIV>
<DIV>
<DIV></DIV>Dears sirs,<BR><BR>I got the following message when I tried to
run my code under Windows XP:<BR><BR>
<DIV style="FONT-FAMILY: courier new,monospace; MARGIN-LEFT: 40px">Fatal
error in MPI_Init: Other MPI error, error stack:<BR>MPIR_Init_thread(394):
Initialization failed<BR>MPID_Init(90)........: channel initialization
failed<BR>MPID_Init(357).......: PMI_Init returned -1<BR>[0] PMI_Init
failed: FAIL - init called when another process has exited without calling
init<BR><BR>job aborted:<BR>rank: node: exit code[: error message]<BR>0:
amsterdam: 1: Fatal error in MPI_Init: Other MPI error, error
stack:<BR>MPIR_Init_thread(394): Initialization
failed<BR>MPID_Init(90)........: channel initialization
failed<BR>MPID_Init(357).......: PMI_Init returned -1<BR>1: amsterdam:
-1073741515<BR>2: amsterdam: -1073741515<BR>3: amsterdam: -1073741515<BR>4:
amsterdam: -1073741515<BR></DIV><BR>This software can be compiled against
Linux (using Intel) and Windows (using Open Watcom).<BR>Under Linux, it
works normally.<BR>Under Windows, I got the message above.<BR>SMPD seems to
be ok once the distributed CPI program works normally.<BR>If I link my code
with MPICH1-1.2.6 and run with "mpirun", it also works fine.<BR><BR>The
weird thing is that I could already make it work with MPICH2/Windows/Open
Watcom.<BR><BR>Do you have any clue regarding the reason of this
error?<BR>What can I be doing wrong?<BR><BR>Thanks in
advance,<BR>LC<BR></DIV></DIV></DIV></BLOCKQUOTE></DIV><BR></DIV></DIV></DIV></BLOCKQUOTE></DIV><BR></BODY></HTML>