***LOOPING MAIL*** PetscInitialize problem?

ziemer at lncc.br ziemer at lncc.br
Tue Mar 14 06:03:06 CST 2006


This is part of the source code where the problem happens:

Thank you for your patience.

*****************************************************************
PROGRAM Premain
C     ------------------------------------------------------------------
!     Use ModuloLectura
      IMPLICIT REAL*8 (A-H,O-Z)
!
!     Parallel begin
!     petsc include files
#include "include/finclude/petsc.h"
!     Parallel end
!
      Logical Sym, NonLinearProblem,Iterative
      INTEGER ERR_ALLOC
      Parameter (Lch=16)
      Character Str*120
      double precision noMPI_Wtime
C
!     INTERFACE ReadMat
!     MODULE PROCEDURE ReadMat
!     END INTERFACE
!     INTERFACE ReadCoupling
!     MODULE PROCEDURE ReadCoupling
!     END INTERFACE
!     INTERFACE Dimen
!     MODULE PROCEDURE Dimen
!     END INTERFACE
C
      Allocatable X         (:)
      Allocatable Ie__Param (:)
      Allocatable Ie_JParam (:)
      Allocatable Param     (:)

!     Parallel begin
      call PetscInitialize (PETSC_NULL_CHARACTER, iError)
      if (iError.ne.0) then
         Write (6,*) "Can't initialize PETSC"
         Stop
      End if
!     Ask total number of proccesses
!
!     PROBLEM BEGINS IN THE NEXT FUNCTION - MPI_COMM_WORLD IS NOT SET!!
      call MPI_Comm_size (MPI_COMM_WORLD, iSize, iError)
!     ID of this proccess
      call MPI_Comm_rank (MPI_COMM_WORLD, iRank, iError)
!
**********************************************************


Quoting Satish Balay <balay at mcs.anl.gov>:

>
> You should be able to use either MPI_COMM_WORLD or PETSC_COMM_WORLD or
> any other communicator. There must be something else wrong in your
> code. Can't comment without looking at the code.
>
> Satish
>
> On Mon, 13 Mar 2006, ziemer at lncc.br wrote:
>
> > Hi,
> >
> > The Petsc installation examples run ok.
> >
> > The strange thing is if I change the parameter MPI_COMM_WORLD of the
> function
> > MPI_Comm_size() to PTESC_COMM_WORLD this function works, but at same time
> this
> > same strategy does not work with the MPI_Bcast() function.
> >
> > Thank you very much for your nice help.
> >
> > Paulo Ziemer.
> >
> >
> > Quoting Satish Balay <balay at mcs.anl.gov>:
> >
> > > According to the error message - the communicator is invalid.  You
> > > might want to check that..
> > >
> > > You should be able to call MPI_Comm_size() after PetscInitialize()
> > > Check src/sys/examples/tutorials/ex1.c for an example of this usage.
> > >
> > > BTW: Do PETSc examples run fine with your install?
> > >
> > > Satish
> > >
> > >
> > > On Mon, 13 Mar 2006, ziemer at lncc.br wrote:
> > >
> > > > Hello,
> > > >
> > > > I would be very glad if someone could give me some direction:
> > > >
> > > > After the MPI_Comm_size function is called, I got this error:
> > > >
> > > > aborting job:
> > > > Fatal error in MPI_Comm_size: Invalid communicator, error stack:
> > > > MPI_Comm_size(110): MPI_Comm_size(comm=0x1, size=0xbfffdf78) failed
> > > > MPI_Comm_size(69): Invalid communicator
> > > >
> > > > It seems that the MPI environment is not being correctly created by the
> > > function
> > > > PetscInitialize.
> > > >
> > > >
> > > > Does anyone have any idea?
> > > >
> > > >
> > > > Best Regards.
> > > >
> > > > ----------------------------------------------------------------
> > > > This message was sent using IMP, the Internet Messaging Program.
> > > >
> > > >
> > >
> >
> >
> >
> >
> > ----------------------------------------------------------------
> > This message was sent using IMP, the Internet Messaging Program.
> >
> >




----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.




More information about the petsc-users mailing list