[petsc-dev] Deprecated PETSc functions and Fortran codes?

Richard Tran Mills rtm at eecs.utk.edu
Tue Jul 30 17:20:39 CDT 2013


Hi Folks,

Is there a way to deprecate PETSc functions that will work with Fortran 
codes?  In include/petscdmda.h I have

PETSC_DEPRECATED("Use DMLocalToLocalBegin()") PETSC_STATIC_INLINE 
PetscErrorCode DMDALocalToLocalBegin(DM dm,Vec g,InsertMode mode,Vec l) 
{return DMLocalToLocalBegin(dm,g,mode,l);}
PETSC_DEPRECATED("Use DMLocalToLocalEnd()") PETSC_STATIC_INLINE 
PetscErrorCode DMDALocalToLocalEnd(DM dm,Vec g,InsertMode mode,Vec l) 
{return DMLocalToLocalEnd(dm,g,mode,l);}

And this works fine with C examples:

/Users/rmills/proj/petsc-git/mac_gcc47_g/bin/mpicc -o ex7.o -c -fPIC -Wall 
-Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -g 
-I/Users/rmills/proj/petsc-git/include 
-I/Users/rmills/proj/petsc-git/mac_gcc47_g/include -I/opt/X11/include    
-D__INSDIR__=src/dm/examples/tests/ ex7.c
ex7.c: In function 'main':
ex7.c:72:3: warning: 'DMDALocalToLocalBegin' is deprecated (declared at 
/Users/rmills/proj/petsc-git/include/petscdmda.h:52): Use 
DMLocalToLocalBegin() [-Wdeprecated-declarations]
ex7.c:73:3: warning: 'DMDALocalToLocalEnd' is deprecated (declared at 
/Users/rmills/proj/petsc-git/include/petscdmda.h:53): Use 
DMLocalToLocalEnd() [-Wdeprecated-declarations]

But with a Fortran code (PFLOTRAN), I just get this at link time:

Undefined symbols for architecture x86_64:
   "_dmdalocaltolocalbegin_", referenced from:
       ___discretization_module_MOD_discretizationlocaltolocalbegin in 
discretization.o
       ___discretization_module_MOD_discretizationlocaltolocal in 
discretization.o
   "_dmdalocaltolocalend_", referenced from:
       ___discretization_module_MOD_discretizationlocaltolocalend in 
discretization.o
       ___discretization_module_MOD_discretizationlocaltolocal in 
discretization.o

Is there any good way to get the same behavior as with the C code? Not a 
huge issue of course, but it would be nice to have the consistency.

--Richard



-- 
Richard Tran Mills, Ph.D.
Computational Earth Scientist      | Joint Assistant Professor
Hydrogeochemical Dynamics Team     | EECS and Earth & Planetary Sciences
Oak Ridge National Laboratory      | University of Tennessee, Knoxville
E-mail: rmills at ornl.gov  V: 865-241-3198 http://climate.ornl.gov/~rmills




More information about the petsc-dev mailing list