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

In reply to OpenMPI and Perl by spadacciniweb

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.