[petsc-users] Fortran Example problem with MPI_COMM_WORLD

Inge Gutheil i.gutheil at fz-juelich.de
Wed Jul 24 09:00:02 CDT 2013


Hello,
in

petsc-3.4.2/src/snes/examples/tests/ex12f.F it says
   8 !  In this example the application context is a Fortran integer array:
   9 !      ctx(1) = da    - distributed array
  10 !          2  = F     - global vector where the function is stored
  11 !          3  = xl    - local work vector
  12 !          4  = comm  - MPI communictor
  13 !          5  = unused
  14 !          6  = N     - system size

This array is declared as
34       PetscFortranAddr ctx(6)
thus for a 64-Bit machine this will be 8-Byte integer.  Now the address
of the distributed array and of the vector F should be 64-Bit, but comm,
the MPI communicator must not be 64Bit on many machines, for example on
BlueGene/Q, where it always results in an invalid communicator if you
have an
  INTEGER*8 ICOMM
  ICOMM=MPI_COMM_WORLD
  call MPI_COMM_SIZE(ICOMM,size,ierr)
The communicator must be given to the subroutines as INTEGER*4, even on
some 64-Bit machines.
Also the system size N is INTEGER *4 if you did not compile with
PETSC_INT=8, so I think you will need two arrays , one with the
addresses and one with the normal PetscInt for comm and N.

Regards
Inge Gutheil

--
--

Inge Gutheil
Juelich Supercomputing Centre
Institute for Advanced Simulation
Forschungszentrum Juelich GmbH
52425 Juelich, Germany

       Phone:   +49-2461-61-3135
       Fax:     +49-2461-61-6656
       E-mail:i.gutheil at fz-juelich.de



------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------

Das Forschungszentrum oeffnet seine Tueren am Sonntag, 29. September, von 10:00 bis 17:00 Uhr: http://www.tagderneugier.de


More information about the petsc-users mailing list