views:

87

answers:

1

I am using mpiexec to run a couple of hello world executables. They each run, but the number of processes is always 1 where it looks like there should be 4 processes. Does someone understand why? Also I'm not sure why stty is giving me an invalid argument. Thanks!

Here is the output:

   /bin/stty: standard input: invalid argument
   Hello world from process 0 of 1
   Hello world from process 0 of 1
   Hello world from process 0 of 1
   Hello world from process 0 of 1

Here is the c file:

#include <stdio.h>
#include <mpi.h>

int main(int argc, char *argv[])
{
  int rank, size;
  MPI_Init (&argc, &argv);
  MPI_Comm_rank(MPI_COMM_WORLD, &rank);
  MPI_Comm_size(MPI_COMM_WORLD, &size);
  printf("Hello world from process %d of %d\n", rank, size);
  fflush(stdout);
  MPI_Finalize();
  return 0;
}

Here is the submission script:

#!/bin/bash

#PBS -N helloWorld
#PBS -l select=4:ncpus=2
#PBS -j oe
#PBS -o output
#PBS -l walltime=3:00
cd $PBS_O_WORKDIR


mpiexec ./helloWorld
+1  A: 

Steven:

The above should work; it looks like something along the line (PBS <-> MPI library <-> mpiexec) is misconfigured.

The first, most obvious guess -- is the mpiexec the same mpi launching program that corresponds to the library you compiled with? If you do a which mpiexec in your script, do you get something that corresponds to the which mpicc when you compile the program? Do you have to do anything like a "module load [mpi package]" before you compile?

Similarly, is your mpiexec PBS-aware? If not, you might have to specify a hostfile (${PBS_NODEFILE}) somehow, and the number of processors.

What mpi are you using, and what system are you running on -- is it a publically available system with documentation we can look at?

Jonathan Dursi
When I run which mpiexec mpicc I get /usr/bin/mpicc /usr/bin/mpiexec. So that looks good.I'm not sure what a "module load" is. I'm guessing I don't have one?I think the problem may be that my mpiexec isn't PBS aware. I'm not sure how to specify a host file, however.The system I'm running on is private, but the man pages point to this website for documentation: http://www.mcs.anl.gov/mpi/www
Steven Wexler
Ok. The module load stuff is often used at big computing sites where they have several MPIs installed; you'd know about it if you needed to use it. If you're using OpenMPI (mpiexec -V will give you version information), the syntax is `mpiexec -np 8 --hostfile $PBS_NODEFILE ./helloWorld`. If you're using MPICH2 (mpich2version will give you a bunch of information) the syntax should be `mpiexec -f $PBS_NODEFILE -np 8 ./helloWorld`. See if either of those give better results.
Jonathan Dursi
when running mpiexec -version i get:Version 0.83, configure options: '--prefix=/usr' '--with-default-comm=mpich2-pmi' '--with-pbs=/usr/pbs'Version 0.83, configure options: '--prefix=/usr' '--with-default-comm=mpich2-pmi' '--with-pbs=/usr/pbs'(when I run mpiexec -V or mpich2version I get nothing. -V is not a recognized tag. mpich2version command is not found. When i 'locate mpich2version' I also get nothing.)Neither command is of the correct syntax.Also, when I echo $PBS_NODEFILE I get nothing. I'm not sure if I should get something.
Steven Wexler
Jonathan Dursi
I inserted: echo $PBS_NODEFILE; cat $PBS_NODEFILEmpiexec -f $PBS_NODEFILE -np 8 ./helloWorldI get a syntax error with the -f tag.I also get when using the tag -mpich-p4-noshmem:mpiexec: Warning: parse_args: argument "-mpich-p4-[no-]shmem" ignored since communication library not MPICH/P4.
Steven Wexler
What did you get for $PBS_NODEFILE output? Was the error due to the -f because of the -f tag (And do you have a which mpiexec in the script itself? I'd still like to confirm that the mpiexec of the script is the same as in the interactive enironment) or because it was followed by -np ( unable to open host file: -np) -- that, is, $PBS_NODEFILE isn't being filled in?
Jonathan Dursi
From the error message, I suspect you may be running OSU's mpiexec - which is fine, and should be PBS aware,but I think is probably not configured properly with the mpi library you're using. Is there a sysadmin you can talk to about this, or can you rebuild the mpiexec (or just use the mpich2 one?)
Jonathan Dursi