Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

OpenMPI and Perl

by spadacciniweb (Deacon)
on Nov 19, 2009 at 12:00 UTC ( #808136=perlquestion: print w/ replies, xml ) Need Help??
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

Comment on OpenMPI and Perl
Select or Download Code
Re: OpenMPI and Perl
by almut (Canon) on Nov 19, 2009 at 12:31 UTC
    > strings /usr/local/lib/perl/5.10.0/auto/Parallel/MPI/Simple/Simple.s +o | grep mpi (...) ompi_mpi_char

    This just shows that the symbol appears in Simple.so, but it doesn't tell if that occurrence is the implementation (i.e. the instance of a variable, code of a function, etc.) of the symbol, or just a reference to an external implementation, which it very likely is in that particular case...

    Use objdump -tT, or nm on the other libs and look for the type of the symbol ("*UND*" means it's an undefined/external reference) to find out more. Presumably the symbol should be in defined/implemented in libmpich-p4mpd.so.1.0.

      Yes
      > objdump -tT /usr/local/lib/perl/5.10.0/auto/Parallel/MPI/Simple/Simp +le.so | grep ompi_mpi_char 00000000 *UND* 00000000 ompi_mpi_char 00000000 D *UND* 00000000 ompi_mpi_char

      but there isn't in others libs. So this is the problem, isn't true?

      Mariano

      (($_="Mzz ojjdloobnf jt uvy5502383")=~y~b-zg2-5c96-81~a-z0-9~s)=~s~~~s; print
        but there isn't in others libs. So this is the problem

        Looks like it, yes.  Maybe your MPI library is the wrong version (too old)? A quick grep through the current Open MPI sources shows the symbol is defined in ./ompi/datatype/dt_module.c.  But I'm no Open MPI expert, and can't tell from the top of my head if that symbol should end up in the lib libmpich-p4mpd.so.1.0 (which you seem to have), or in some other related lib...

        You could try compiling the sources yourself (unless you've already done so), and check every .so/.a file being created for the occurrence of the symbol.

Re: OpenMPI and Perl
by zentara (Archbishop) on Nov 19, 2009 at 13:23 UTC
    ...did you build the module yourself?..... or is it part of a prebuilt package from your distribution?

    .... if not, try building the module yourself, and see if any errors are thrown


    I'm not really a human, but I play one on earth.
    Old Perl Programmer Haiku
      I have downloaded module from CPAN, and build with
      perl Makefile.PL make make install

      I haven't seen any warnings or errors.
      However, I am recompiling the OpenMPI lib as almut has suggested.

      thank you,
      Mariano

      (($_="Mzz ojjdloobnf jt uvy5502383")=~y~b-zg2-5c96-81~a-z0-9~s)=~s~~~s; print
        Few later, update this question...

        As almut has written, I have recompiled OpenMPI lib, and it fix the problem.

        Thank you,
        Mariano

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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://808136]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (16)
As of 2014-09-19 13:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (138 votes), past polls