I tried following code on my Windows 7 machine with compile command
"mpicxx hello.cpp":
hello.cpp
===================================
# include "mpi.h"
using namespace std;
int main ( int argc, char *argv[] )
{
int rank, size;
MPI::Init ( argc, argv );
size = MPI::COMM_WORLD.Get_size ( );
rank = MPI::COMM_WORLD.Get_rank ( );
printf("Rank # %d \n", rank);
MPI::Finalize ( );
return 0;
}
console output :
======================================
d:\work\OpenMPI\tests\CXX>mpicxx hello.cpp
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version
16.00.30319.01 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
hello.cpp
Microsoft (R) Incremental Linker Version 10.00.30319.01
Copyright (C) Microsoft Corporation. All rights reserved.
I compiled the simple code with "Microsoft Compute
Cluster Pack" on Windows and if I load its own loader
"mpiexec.exe" within its program folder, the program can work
correctly, however if I tried to use your loader "C:\Program
Files\OpenMPI_v1.5.3-win32\bin\mpiexec.exe" and "C:\Program
Files\OpenMPI_v1.5.3-win32\bin\mpirun.exe", the process it created
is always with rank "0". BTW, I compile the code with "Microsoft
Compute Cluster Pack" because the simple code can not be compiled
with the v1.5.3 release for windows, the compiler complains:
./src/mpi_test1.o: In
function `Intracomm':
C:/Program
Files/OpenMPI_v1.5.3-win32/include/openmpi/ompi/mpi/cxx/intracomm.h:25:
undefined reference to `MPI::Comm::Comm()'
./src/mpi_test1.o: In
function `Intracomm':
C:/Program
Files/OpenMPI_v1.5.3-win32/include/openmpi/ompi/mpi/cxx/intracomm_inln.h:23:
undefined reference to `MPI::Comm::Comm()'
./src/mpi_test1.o:C:/Program
Files/OpenMPI_v1.5.3-win32/include/openmpi/ompi/mpi/cxx/op_inln.h:122:
undefined reference to `ompi_mpi_cxx_op_intercept'
./src/mpi_test1.o:mpi_test1.cpp:(.rdata$_ZTVN3MPI3WinE[vtable
for MPI::Win]+0x24): undefined reference to
`MPI::Win::Free()'
./src/mpi_test1.o:mpi_test1.cpp:(.rdata$_ZTVN3MPI8DatatypeE[vtable
for MPI::Datatype]+0x3c): undefined reference to
`MPI::Datatype::Free()'
collect2: ld returned 1
exit status
make: *** [mpi_test1]
Error 1
When I tried CMake with GUI for version 1.4.3, no .sln file
generated, is there something I've missed?
I've solved the same weird error on Linux, but have
not tried Windows yet. The error recurs on Linux system,
when I firstly use mpich on my Linux, the program works
fine, then I uninstalled it and switched to your open-mpi,
the error came out without warning, and I tried to change
the compiler to mpic++ other than g++, the error remains.
So I doubt if the Boost.MPI is compatible with current MPI
system, I recompiled the Boost.MPI library and substituted
the old ones, the code with Boost library came back to
work. So I guess the old compiled Boost library depends on
other library like mpich, so it can't work with current
open-mpi because they are incompatible, however, I'm still
confused why simple code (In the last mail I sent to you)
which does not depend on Boost library(I never used mpich
on Windows before), can not work.
The code works for me under MinGW console with
the pre-compiled installer. Could you try "which
mpicc" to ensure that the correct Open MPI
commands are in path?
For building Open MPI by your self with CMake,
you have to configure it in the GUI and then
generate the sln files by pressing the generate
button. I don't recommend to use the other two
means, they haven't been tested for some while.
also goes with the same
rank "0" error, I think if there's
something wrong with the auxiliary
program "mpirun" ?
BTW, I tried all the
3 means on your http://svn.open-mpi.org/svn/ompi/trunk/README.WINDOWS.txt guideline
but none worked to compile my own
dll for http://www.open-mpi.org/software/ompi/v1.4/downloads/openmpi-1.4.3.tar.bz2,
the first approach failed because I
found no .sln file in the
distributed tarballs after
configuring with cmake, the second
mean I can not use is the lacking
of ompi-static.tgz
file,
the 3rd solution I tried does not
work neither, because I don't know
what the ash.exe
shell interpreter you
are actually pointing to, so I'd be
much appreciated if you can tell me
the a working approach. Thanks very
much.
I've never tried this Boost.MPI
with Open MPI on Windows. Does
it work without the Boost.MPI
library? Did you run your test
under MinGW?
Regards,
Shiqing
On 2011-08-08 5:31 PM,
renyong.yang wrote:
Run
time environment of
mine is Windows 7,
with the unstable OpenMPI_v1.5.3-2_win32.exe release
for Windows,
together with
Microsoft Compute
Cluster Pack.
Additionally I'm
using Boost.MPI
library v1.47
compiled by mingw, I
write those
following codes:
int
main(int argc,
char **argv)
{
mpi::environment env(argc, argv);
// Boost.MPI
class
boost::mpi::communicator worldCom;
// Boost.MPI
class