[mpich-discuss] MPICH2 On Windows 64 bit and Mingw-w64 compilers

Jayesh Krishna jayesh at mcs.anl.gov
Tue Feb 22 09:25:20 CST 2011


Hi,
 Are you linking using libmpi.a or mpi.lib ? Are you able to run your code after compiling it with V4.5.3 ?

Regards,
Jayesh

----- Original Message -----
From: "Arun Murthy" <arun.murthy at fluidyn.com>
To: mpich-discuss at mcs.anl.gov
Sent: Tuesday, February 22, 2011 7:05:51 AM
Subject: Re: [mpich-discuss] MPICH2 On Windows 64 bit and Mingw-w64 compilers


Hi 

I downloaded the MPICH2-1.3.2p1 Windows EM64T/AMD64 (binary) onto my Windows-XP 64bit machine. I tried to use it with two GNU compilers: V4.4.3 and V.4.5.3. Basically, I tried to link the icpi.c example into an executable. With GCC V4.4.3, I get undefined symbols, while with V4.5.3, it works well. Does it mean that, if I want to use GCC V4.4.3, I need to rebuild MPICH2 from the source using the V4.4.3 compiler? 

The output details of my trials are below. 

Thanks for your help. 

With Best Regards 
Arun 

D:\tmp>"C:\Program Files\mingw_443\64bit\bin\gcc.exe" --ver 

Built by Equation Solution <http://www.Equation.com> . 
Using built-in specs. 
Target: x86_64-pc-mingw32 
Configured with: ../gcc-4.4.3-mingw/configure --host=x86_64-pc-mingw32 --build=x86_64-unknown-linux-gnu --target=x86_64-pc-mingw32 --prefix=/home/gfortran/gcc-home/binary/mingw32/native/x86_64/gcc/4.4.3 --with-gmp=/home/gfortran/gcc-home/binary/mingw32/native/x86_64/gmp --with-mpfr=/home/gfortran/gcc-home/binary/mingw32/native/x86_64/mpfr --with-mpc=/home/gfortran/gcc-home/binary/mingw32/native/x86_64/mpc --with-sysroot=/home/gfortran/gcc-home/binary/mingw32/cross/x86_64/gcc/4.4.3 --with-gcc --with-gnu-ld --with-gnu-as --disable-shared --disable-nls --disable-tls --enable-libgomp --enable-languages=c,fortran,c++ --enable-threads=win32 --disable-win32-registry 
Thread model: win32 
gcc version 4.4.3 (GCC) 

D:\tmp>"C:\Program Files\mingw_443\64bit\bin\gcc.exe" -I"C:\Program Files\MPICH2\include" icpi.c -L"C:\Program Files\MPICH2"\lib -lmpi -o icpi.exe 

C:\DOCUME~1\ns\LOCALS~1\Temp\ccg2hczk.o:icpi.c:(.text+0x76): undefined reference to `MPI_Init' 
C:\DOCUME~1\ns\LOCALS~1\Temp\ccg2hczk.o:icpi.c:(.text+0x87): undefined reference to `MPI_Comm_size' 
C:\DOCUME~1\ns\LOCALS~1\Temp\ccg2hczk.o:icpi.c:(.text+0x98): undefined reference to `MPI_Comm_rank' 
C:\DOCUME~1\ns\LOCALS~1\Temp\ccg2hczk.o:icpi.c:(.text+0xab): undefined reference to `MPI_Get_processor_name' 
C:\DOCUME~1\ns\LOCALS~1\Temp\ccg2hczk.o:icpi.c:(.text+0x142): undefined reference to `MPI_Wtime' 
C:\DOCUME~1\ns\LOCALS~1\Temp\ccg2hczk.o:icpi.c:(.text+0x16c): undefined reference to `MPI_Bcast' 
C:\DOCUME~1\ns\LOCALS~1\Temp\ccg2hczk.o:icpi.c:(.text+0x237): undefined reference to `MPI_Reduce' 
C:\DOCUME~1\ns\LOCALS~1\Temp\ccg2hczk.o:icpi.c:(.text+0x2b4): undefined reference to `MPI_Wtime' 
C:\DOCUME~1\ns\LOCALS~1\Temp\ccg2hczk.o:icpi.c:(.text+0x31b): undefined reference to `MPI_Finalize' 
collect2: ld returned 1 exit status 

D:\tmp>"C:\Program Files\mingw-w64\bin\x86_64-w64-mingw32-gcc.exe" --ver 

Using built-in specs. 
COLLECT_GCC=C:\Program Files\mingw-w64\bin\x86_64-w64-mingw32-gcc.exe 
COLLECT_LTO_WRAPPER=c:/program files/mingw-w64/bin/../libexec/gcc/x86_64-w64-min 
gw32/4.5.3/lto-wrapper.exe 
Target: x86_64-w64-mingw32 
Configured with: ../../../build/gcc/src/configure --target=x86_64-w64-mingw32 --prefix=/c/buildbot/mingw-w64/mingw32/mingw-x86-x86_64/build/build/root --with-sysroot=/c/buildbot/mingw-w64/mingw32/mingw-x86-x86_64/build/build/root --enable-languages=all,obj-c++ --enable-fully-dynamic-string --disable-multilib 
Thread model: win32 
gcc version 4.5.3 20110207 (prerelease) (GCC) 

D:\tmp>"C:\Program Files\mingw-w64\bin\x86_64-w64-mingw32-gcc.exe" -I"C:\Program Files\MPICH2\include" icpi.c -L"C:\Program Files\MPICH2"\lib -lmpi -lfmpich2g - 
o icpi.exe 

SUCCESS 

D:\tmp> 


On 11-01-2011 18:53, Arun Murthy wrote: 

Hi Jayesh 

Yes, I linked icpi.o with mpi.lib. Happy to hear that Mingw64 support will be available this month. I can wait for a couple of weeks for the next release. In the meantime, if you want me to test the pre-release version, I would be happy to do that. 

Thanks for your help. 

Best regards 
Arun 


On 11-01-2011 17:10, Jayesh Krishna wrote: 


Hi, 
Are you trying to link your code with mpi.lib ? Mingw compilers may not be playing nice with the windows libraries. AFAICT we added support for mingw 64-bit compilers (*.a libraries compatible with mingw 64-bit compilers) after 1.3.1 was released. It should be available in the next release, 1.3.2, due this month. 

(PS: If you need it sooner than that let me know and I can get you a custom build for development purposes) 
Regards, 
Jayesh 

----- Original Message ----- 
From: "Arun Murthy" <arun.murthy at fluidyn.com> 
To: "Jayesh Krishna" <jayesh at mcs.anl.gov> 
Cc: mpich-discuss at mcs.anl.gov 
Sent: Tuesday, January 11, 2011 2:12:01 AM 
Subject: Re: [mpich-discuss] MPICH2 On Windows 64 bit and Mingw-w64 compilers 

Hi Jayesh 

I opened CMD with "Run as administrator" and did the following: 

C:\tmp>"C:\Program Files\MPICH2\bin"\mpiexec.exe -n 2 -localroot c:\tmp\icpi.exe 

Job terminated with following error message: 

" 
Error posting writev, A request to send or receive data was disallowed because the socket had already been shut down in that direction with a previous shutdown call.(10058) 
unable to post a write for the next command, 
sock error: Error = 10058 

unable to post a write of the closed_request command to the parent context. 
unable to close the stdin context. 
state machine failed. 
" 

C:\tmp>"C:\Program Files\MPICH2\bin"\mpiexec.exe -n 2 -localroot -exitcodes c:\tmp\icpi.exe 

Job terminated with following error message: 

" 
rank: node: exit code 
0: Arun-PC: -1073741819 
1: Arun-PC: -1073741819 
" 

C:\tmp>"C:\Program Files\MPICH2\bin"\smpd -status 

" 
smpd running on Arun-PC 
" 

Thanks for your help. 
Best Regards 
Arun 
On 10-01-2011 22:08, Jayesh Krishna wrote: 

Hi, 
Can you try running the job from an administrator command prompt (Note that opening a command prompt from an administrator account does not give you an admin command prompt. Right-click on the command prompt icon and select "Run as administrator" to get an admin command prompt) and see if it works ? 
Can you also check the status of the MPICH2 process manager (Type "smpd -status" at the command prompt)? 

Regards, 
Jayesh 
----- Original Message ----- 
From: Arun Murthy <arun.murthy at fluidyn.com> To: Jayesh Krishna <jayesh at mcs.anl.gov> Cc: mpich-discuss at mcs.anl.gov Sent: Mon, 10 Jan 2011 01:33:41 -0600 (CST) 
Subject: Re: [mpich-discuss] MPICH2 On Windows 64 bit and Mingw-w64 compilers 

Hi Jayesh 

I tried that. It did not help. Here is the response: 

" 
C:\tmp>"C:\Program Files\MPICH2\bin"\mpiexec.exe -n 2 -localroot icpi.exe 

Unable to open the HKEY_LOCAL_MACHINE\SOFTWARE\MPICH\SMPD\process\6308 
registry key, error 5, Access is denied. 
Unable to open the HKEY_LOCAL_MACHINE\SOFTWARE\MPICH\SMPD\process\808 
registry k ey, error 5, Access is denied. 
" 

When I killed the job by<CTRL> C, the following messages appeared: 

" 
mpiexec aborting job... 
received suspend command for a pmi context that doesn't exist: unmatched 
id = 1 

job aborted: 
rank: node: exit code[: error message] 
0: Arun-PC: -1073741819: mpiexec aborting job 
1: Arun-PC: -1073741819 
Terminate batch job (Y/N)? y 
" 

When I tried the same thing on the pre-built "cpi.exe", I get the same 
messages that I got with "icpi.exe", but it still works: 

" 
C:\tmp>"C:\Program Files\MPICH2\bin"\mpiexec.exe -n 2 -localroot cpi 

Unable to open the HKEY_LOCAL_MACHINE\SOFTWARE\MPICH\SMPD\process\4544 
registry key, error 5, Access is denied. 
Unable to open the HKEY_LOCAL_MACHINE\SOFTWARE\MPICH\SMPD\process\7288 
registry key, error 5, Access is denied. 

Enter the number of intervals: (0 quits) 9 
pi is approximately 3.1426214565576127, Error is 0.0010288029678196 
wall clock time = 0.000077 

Enter the number of intervals: (0 quits) 
" 

When I killed this job by<CTRL> C, the following messages appeared: 

" 
mpiexec aborting job... 
SuspendThread failed with error 5 for process 
0:33FB034C-A281-4d45-9189-9DDCDC33C941:'cpi' 
unable to suspend process. 
unable to read the cmd header on the pmi context, Error = -1. 
Error posting readv, An existing connection was forcibly closed by the 
remote host.(10054) 

SuspendThread failed with error 5 for process 
1:33FB034C-A281-4d45-9189-9DDCDC33C941:'cpi' 
unable to suspend process. 
unable to read the cmd header on the pmi context, Error = -1. 
Error posting readv, An existing connection was forcibly closed by the 
remote host.(10054) 

received kill command for a pmi context that doesn't exist: unmatched id = 0 

job aborted: 
rank: node: exit code[: error message] 
0: Arun-PC: 123: process 0 exited without calling finalize 
1: Arun-PC: 123: process 1 exited without calling finalize 
Terminate batch job (Y/N)? y 
" 

Does it have anything to do with an incorrect node (-1073741819) on 
which mpiexec is trying to launch the processes? Thanks for your help. 

Best Regards 
Arun 


On 07-01-2011 22:11, Jayesh Krishna wrote: 

Hi, 
Can you try running your program with the "-localroot" option and let us know if it works for you (mpiexec -n 2 -localroot icpi.exe)? 

Regards, 
Jayesh 

----- Original Message ----- 
From: "Arun Murthy" <arun.murthy at fluidyn.com> To: mpich-discuss at mcs.anl.gov Sent: Friday, January 7, 2011 12:56:17 AM 
Subject: [mpich-discuss] MPICH2 On Windows 64 bit and Mingw-w64 compilers 

Hi 

I am trying to use MPICH2 on Windows 7 64bit (installed from 
mpich2-1.3.1-win-x86-64.msi) along with Mingw-w64 compiler suite 
(mingw-w64-1.0-bin_i686-mingw_20101129). 

I tried to compile-link the example "icpi.c" using following command: 

C:\MinGW\mingw-w64-1.0-bin_i686-mingw_20101129\bin\x86_64-w64-mingw32-gcc.exe 
-I"C:\Program Files\MPICH2\include" icpi.c -L"C:\Program 
Files\MPICH2\lib" -lmpi -o icpi.exe 

I could get the executable, but it doesn't run with any number of 
processors. When run with mpiexec, it aborts without any message. I 
could run the pre-built "cpi.exe" with any number of CPU's. I don't have 
MS Visual Studio on my machine. Can anyone help? 

By the way, the 32-bit version of MPICH1 (1.2.5 SDK.gcc) works well with 
Mingw-w32 compiler suite. 

Thanks 
Arun 


_______________________________________________ 
mpich-discuss mailing list mpich-discuss at mcs.anl.gov https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss 




_______________________________________________ 
mpich-discuss mailing list 
mpich-discuss at mcs.anl.gov 
https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss 




_______________________________________________
mpich-discuss mailing list
mpich-discuss at mcs.anl.gov
https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss


More information about the mpich-discuss mailing list