http://www.perlmonks.org?node_id=808136

spadacciniweb has asked for the wisdom of the Perl Monks concerning the following question:

I have written some scripts (C/C++) for parallel computing with Open MPI.
Now, I have founded the Parallel::MPI module, but I have some problems.

Script init.pl

#!/usr/bin/perl use warnings; use strict; use Parallel::MPI::Simple qw(:all); MPI_Init() or die("Error: $!\n"); MPI_Finalize();

Over terminal I have typed
> perl -c init.pl Can't load '/usr/local/lib/perl/5.10.0/auto/Parallel/MPI/Simple/Simple +.so' for module Parallel::MPI::Simple: /usr/local/lib/perl/5.10.0/aut +o/Parallel/MPI/Simple/Simple.so: undefined symbol: ompi_mpi_char at / +usr/lib/perl/5.10/DynaLoader.pm line 196.
I think there is a problem with /usr/local/lib/perl/5.10.0/auto/Parallel/MPI/Simple/Simple.so, but
> ldd usr/local/lib/perl/5.10.0/auto/Parallel/MPI/Simple/Simple.so linux-gate.so.1 => (0xb8058000) libmpich-p4mpd.so.1.0 => /usr/lib/libmpich-p4mpd.so.1.0 (0xb7e +53000) libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7ccd000) libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0xb7cb3 +000) librt.so.1 => /lib/tls/i686/cmov/librt.so.1 (0xb7caa000) libgfortran.so.3 => /usr/lib/libgfortran.so.3 (0xb7bf6000) libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb7bd0000) libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb7bc1000) /lib/ld-linux.so.2 (0xb8059000)
and
> strings /usr/local/lib/perl/5.10.0/auto/Parallel/MPI/Simple/Simple.s +o | grep mpi ompi_mpi_comm_world ompi_mpi_comm_null ompi_mpi_int ompi_mpi_char libmpich-p4mpd.so.1.0
so I don't understand where is ther problem.

However I did a small change in script, so init.pl:
#!/usr/bin/perl use warnings; use strict; use Parallel::MPI qw(:all); MPI_Init() or die("Error: $!\n"); MPI_Finalize();
and
> perl -c init.pl init.pl syntax OK
and I am happy.

From this article, I launch my script (like c/c++)
> mpirun -np 2 perl init.pl MPI_Init: no arguments found in the argv at init.pl line 7. MPI_Init: no arguments found in the argv at init.pl line 7.

There is another problem. I don't know, but I type:
> mpirun -np 2 perl init.pl asdada Fatal error in MPI_Errhandler_set: Invalid communicator, error stack: MPI_Errhandler_set(121): MPI_Errhandler_set(comm=0x5b, errh=0x78) fail +ed MPI_Errhandler_set(72).: Invalid communicator[unset]: aborting job: Fatal error in MPI_Errhandler_set: Invalid communicator, error stack: MPI_Errhandler_set(121): MPI_Errhandler_set(comm=0x5b, errh=0x78) fail +ed MPI_Errhandler_set(72).: Invalid communicator Fatal error in MPI_Errhandler_set: Invalid communicator, error stack: MPI_Errhandler_set(121): MPI_Errhandler_set(comm=0x5b, errh=0x78) fail +ed MPI_Errhandler_set(72).: Invalid communicator[unset]: aborting job: Fatal error in MPI_Errhandler_set: Invalid communicator, error stack: MPI_Errhandler_set(121): MPI_Errhandler_set(comm=0x5b, errh=0x78) fail +ed MPI_Errhandler_set(72).: Invalid communicator

Over this monastery, I have founded only this
ok, mpi and Perl is issue too difficult for me. And for you? :-)

bye,
mariano

My OS is Ubuntu 9.04, Perl v5.10.0, OpeMPI v1.3.
(cluster test is only my host, one processor with 2 cores)

(($_="Mzz ojjdloobnf jt uvy5502383")=~y~b-zg2-5c96-81~a-z0-9~s)=~s~~~s; print