Hi,
I am trying to use the MPI module for the first time. I use the following command:
$>mpirun -np 1 mpitest.pl
and get the following error:
: bad interpreter: No such file or directorypitest.pl: /usr/local/bin/perl
The code is attached below:
#!/usr/bin/perl
use Parallel::MPI qw(:all);
# Start up MPI
MPI_Init();
# Find out process rank
$my_rank = MPI_Comm_rank(MPI_COMM_WORLD);
# Find out number of processes
$num_procs = MPI_Comm_size(MPI_COMM_WORLD);
$infilename = "sequences.txt";
open(INFILE, $infilename);
@sequences = <INFILE>;
close(INFILE);
$num_seq = $#sequences + 1;
$seq_per_file = int $num_seq / $num_procs;
$start_seq = $my_rank * $seq_per_file;
if ($my_rank < $num_procs)
{
$end_seq = ($my_rank + 1) * $seq_per_file - 1;
}
else #deal with last processor separately
{
$end_seq = $num_seq;
}
foreach ($start_seq..$end_seq)
{
; #Stuff to do with sequences
}
MPI_Finalize();
Any ideas about the problem are welcome.
Thanks
-Rachana
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.