r1, MPI, and doof2d: What is Wrong?

Jeffrey Oldham oldham at codesourcery.com
Wed Oct 17 02:58:22 UTC 2001


Attached is the the r1 version of doof2d.  I have tried to run it
using MPI, but it keeps falling over, probably because I do not know
how to use MPI or I am too tired.

Is the problem and a solution obvious?

> mpirun -np 1 ./doof2d --comm MPI --nofieldcompression 400 1 > results_mpi_p1_400_1
MPI: MPI_COMM_WORLD rank 0 has terminated without calling MPI_Finalize()
MPI: aborting job
mpirun -np 1 ./doof2d --comm MPI --nofieldcompression 400 1 > results_mpi_p1_400_1 died at ./r1-Doof2d-tester.pl line 28.

> mpirun -np 4 ./doof2d --comm MPI --nofieldcompression 800 2 > results_mpi_p4_400_2
MPI: MPI_COMM_WORLD rank 3 has terminated without calling MPI_Finalize()
MPI: aborting job
mpirun -np 4 ./doof2d --comm MPI --nofieldcompression 800 2 > results_mpi_p4_400_2 died at ./r1-Doof2d-tester.pl line 28.

Pooma r1 was configured with './conf SGI64 KAI OPTIMIZE MPI'.

Thanks,
Jeffrey D. Oldham
oldham at codesourcery.com
-------------- next part --------------
/***************************************************************************
 *
 * The POOMA Framework
 * 
 * This program was prepared by the Regents of the University of
 * California at Los Alamos National Laboratory (the University) under
 * Contract No.  W-7405-ENG-36 with the U.S. Department of Energy (DOE).
 * The University has certain rights in the program pursuant to the
 * contract and the program should not be copied or distributed outside
 * your organization.  All rights in the program are reserved by the DOE
 * and the University.  Neither the U.S.  Government nor the University
 * makes any warranty, express or implied, or assumes any liability or
 * responsibility for the use of this software
 *
 * Visit http://www.acl.lanl.gov/POOMA for more details
 *
 ***************************************************************************/

#include <iostream.h>
#include <stdlib.h>
#include "Pooma.h"

// Command-line arguments:
// 0. executable name
// 1. N = sizeX = sizeY = size of a side of the domain
// 2. nuPatches = total number of patches in the entire domain

int main(int argc, char *argv[])
{
  Pooma pooma(argc,argv);
  Inform msg("doof2d");

  const int Parent = 0;

  if (argc < 3 && Pooma::Comm->myNode() == Parent) {
    msg << argv[0] << ": ... domain-size number-patches\n";
    return !0;
  }

  const int sizeX = strtol(argv[argc-2], static_cast<char **>(0), 0);
  const int nuPatches = strtol(argv[argc-1], static_cast<char **>(0), 0);
  const int sizeY = sizeX;
  const int centerX = sizeX / 2;
  const int centerY = sizeY / 2;
  const int iterations = 5;

  const unsigned Dim=2;
  Index I(sizeX);
  Index J(sizeY);
  FieldLayout<Dim> layout(I,J,PARALLEL,PARALLEL, nuPatches, nuPatches);
  Field<double,Dim> A(layout,GuardCellSizes<Dim>(1));
  Field<double,Dim> B(layout,GuardCellSizes<Dim>(1));

  A = 0.0;
  B = 0.0;
  B[centerX][centerY] = 1000.0;

  const double fact = 1.0/9.0;
  PoomaTimings::TimerRef val = PoomaTimings::getTimer("doof2d timer");
  PoomaTimings::startTimer(val);
  for(int iter = 0 ; iter < iterations ; iter++ ) 
  {
    assign(A[I][J], fact*(B[I+1][J+1] + B[I+1][J  ] + B[I+1][J-1] + 
                          B[I  ][J+1] + B[I  ][J  ] + B[I  ][J-1] + 
                          B[I-1][J+1] + B[I-1][J  ] + B[I-1][J-1]));
    assign(B[I][J], fact*(A[I+1][J+1] + A[I+1][J  ] + A[I+1][J-1] + 
                          A[I  ][J+1] + A[I  ][J  ] + A[I  ][J-1] + 
                          A[I-1][J+1] + A[I-1][J  ] + A[I-1][J-1]));
  }
  PoomaTimings::stopTimer(val);
  if (Pooma::Comm->myNode() == Parent) {
    msg << "Correctness value = " << B[centerX][centerY] << endl;
    PoomaTimings::print();
  }

  return 0;
}
/***************************************************************************
 * $RCSfile: doof2d.cpp,v $   $Author: julianc $
 * $Revision: 1.9 $   $Date: 1998/04/17 00:19:00 $
 * POOMA_VERSION_ID: $Id: doof2d.cpp,v 1.9 1998/04/17 00:19:00 julianc Exp $ 
 ***************************************************************************/


More information about the pooma-dev mailing list