[petsc-users] SGI compiler (mpt-2.11) and fortran interface
Satish Balay
balay at mcs.anl.gov
Wed Feb 11 13:31:29 CST 2015
I suspect its one of the following:
- missing including petscvec.h90 [i.e missing prototype for VecGetArrayF90().
- perhaps building PETSc with fortran-compiler-a -but attempt to use with fortran-compiler-b.
- unknown fortran compile that does crazy things with f90 pointers..
It would be best to reproduce the problem with a PETSc example -
perhaps one from the list below
http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Vec/VecGetArrayF90.html
BTW: looks like SGI mpt refers to MPI from SGI? - but then - you can
use either intel or gnu compilers with it.
http://www.nas.nasa.gov/hecc/support/kb/SGI-MPT_89.html
[and VecGetArrayF90 should work with both these compiler sets..]
Satish
On Wed, 11 Feb 2015, Barry Smith wrote:
>
> Oh, yes, sorry I should have read more clearly. Then I am not sure what the issue could be.
>
> Barry
>
> > On Feb 11, 2015, at 1:16 PM, Matteo Parsani <parsani.matteo at gmail.com> wrote:
> >
> > Hello,
> > I am already using VecGetArrayF90().
> >
> > I am waiting now for the IT help because the issue is only with the SGI compiler on our cluster. Once everything is set up I will try to run the fortran examples in PETSc and then I will let you know if the example work.
> >
> >
> >
> > On Wed, Feb 11, 2015 at 2:12 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:
> >
> > > On Feb 11, 2015, at 11:32 AM, Matteo Parsani <parsani.matteo at gmail.com> wrote:
> > >
> > > Dear Petsc Users and Developers,
> > > Recently, I have compiled my fortran code using the SGI compiler (mpt-2.11). Previously I was using openmpi 1.7.3 and everything worked fine.
> >
> > Almost for sure your code is now being compiled to check for out of bounds in array access. You need to turn that off if you use VecGetArray() you need to check the documentation for your compiler to find the flag to turn it off.
> >
> > Or you can switch to using VecGetArrayF90() which will also simplify your code slightly and is the post-f77 way of accessing arrays from PETSc vectors.
> >
> > Barry
> >
> > >
> > > Now, with when I run the code compiled with SGI I get the following error:
> > >
> > > At line 1921 of file mpi_module.F90
> > > Fortran runtime error: Array reference out of bounds for array 'xx_v', upper bound of dimension 1 exceeded (349921 > 1)
> > >
> > > Precisely the line that gives troubles is the following
> > >
> > > x_ghost(i_dir,i_loc) = xx_v(n_tot+3*(i_loc-1) + i_dir)
> > >
> > >
> > > The variables xx_v is a fortran pointer which I get using
> > >
> > > call VecGetArrayF90(x_local, xx_v, i_er)
> > >
> > > where i_err is defined as
> > >
> > > PetscErrorCode i_err
> > >
> > > Do you have any idea what I am doing wrong?
> > >
> > > Thank you!
> > >
> > > --
> > > Matteo
> >
> >
> >
> >
> > --
> > Matteo
>
>
More information about the petsc-users
mailing list