[petsc-users] memory scalable AO

Satish Balay balay at mcs.anl.gov
Wed Feb 17 23:58:35 CST 2016


Look like zdaindexf.c is not listed in makefile - so it never gets compiled.

Also it has code for dmdagetglobalindices_() dmdarestoreglobalindices_(). But then
src/docs/website/documentation/changes/35.html has:

>>>>
<li>DMDAGetGlobalIndices(DM,PetscInt*,const PetscInt*[]) and DMDARestoreGlobalIndices(DM,PetscInt*,const PetscInt*[]) are removed, use DMGetLocalToGlobalMapping() to get this information</li>
<<<<

So perhaps the attached modified patch should be used? [instead of the previous fix-fortran-dmdasetaotype.patch]

patch -Np1 -R < fix-fortran-dmdasetaotype.patch
patch -Np1 < dmdasetaotype-fixed.patch

Might be easier to use 'maint' branch from git..

Satish

On Wed, 17 Feb 2016, Barry Smith wrote:

> 
>   Randy,
> 
>   It is not suppose to be this hard!  When you ran the make gnumake after you applied the patch did it recompile the file zdaindexf.c (in fact that file and daindexf.c should be the only files that changed and hence the only files that got recompiled).  
> 
>   Barry
> 
> 
> 
> > On Feb 17, 2016, at 11:41 PM, Randall Mackie <rlmackie862 at gmail.com> wrote:
> > 
> > Satish, 
> > 
> > It is unclear from this email exchange if I am still suppose to do make allfortranstubs after updating these two files, or if these are the files that are suppose to result from that make operation.
> > 
> > Although these files looked the same as what I tried before with Barry’s suggestions, I dropped these in, recompiled petsc, but again, when I try to compile the test code I sent, it still complains about an unresolved symbol to dmdasetaotype_.
> > 
> > If I still need to do the make allfortranstubs, I’ll do that via a git clone tomorrow.
> > 
> > Thanks, Randy
> > 
> > 
> >> On Feb 17, 2016, at 8:54 PM, Satish Balay <balay at mcs.anl.gov> wrote:
> >> 
> >> Attached are the modified src/dm/impls/da/ftn-auto/daindexf.c and
> >> src/dm/impls/da/ftn-custom/zdaindexf.c files.
> >> 
> >> Satish
> >> 
> >> On Wed, 17 Feb 2016, Jed Brown wrote:
> >> 
> >>> Randall Mackie <rlmackie862 at gmail.com> writes:
> >>> 
> >>>> this leads to the error ‘bin/maint/generatefortranstubs.py’ …No such file.
> >>>> 
> >>>> there is no maint directory under bin.
> >>> 
> >>> Ah, I missed that you have a tarball, not a clone of the repository.
> >>> Then you'll have to fix the file manually.  I would start from a clean
> >>> tarball because we have no idea what state your source tree is in after
> >>> applying the match and manually editing files.  Note that this would be
> >>> easy and completely reliable if you used a clone instead of tarball.
> >>> 
> >> <daindexf.c><zdaindexf.c>
> > 
> 
> 
-------------- next part --------------
diff --git a/src/dm/impls/da/daindex.c b/src/dm/impls/da/daindex.c
index 81d6121..24816e1 100644
--- a/src/dm/impls/da/daindex.c
+++ b/src/dm/impls/da/daindex.c
@@ -53,7 +53,7 @@ PetscErrorCode DMDAGetNatural_Private(DM da,PetscInt *outNlocal,IS *isnatural)
 
 #undef __FUNCT__
 #define __FUNCT__ "DMDASetAOType"
-/*@
+/*@C
    DMDASetAOType - Sets the type of application ordering for a distributed array.
 
    Collective on DMDA
diff --git a/src/dm/impls/da/ftn-custom/makefile b/src/dm/impls/da/ftn-custom/makefile
index deb3081..767b409 100644
--- a/src/dm/impls/da/ftn-custom/makefile
+++ b/src/dm/impls/da/ftn-custom/makefile
@@ -4,7 +4,7 @@ ALL: lib
 
 CFLAGS   =
 FFLAGS   =
-SOURCEC  = zdaf.c zda1f.c zda2f.c zda3f.c zdacornf.c zdagetscatterf.c zdaviewf.c
+SOURCEC  = zdaf.c zda1f.c zda2f.c zda3f.c zdacornf.c zdagetscatterf.c zdaviewf.c zdaindexf.c
 SOURCEF  =
 SOURCEH  =
 LIBBASE  = libpetscdm
diff --git a/src/dm/impls/da/ftn-custom/zdaindexf.c b/src/dm/impls/da/ftn-custom/zdaindexf.c
index b5aa151..ab38d09 100644
--- a/src/dm/impls/da/ftn-custom/zdaindexf.c
+++ b/src/dm/impls/da/ftn-custom/zdaindexf.c
@@ -1,25 +1,16 @@
-
 #include <petsc/private/fortranimpl.h>
 #include <petscdmda.h>
 
 #if defined(PETSC_HAVE_FORTRAN_CAPS)
-#define dmdagetglobalindices_          DMDAGETGLOBALINDICES
-#define dmdarestoreglobalindices_      DMDARESTOREGLOBALINDICES
+#define dmdasetaotype_                 DMDASETAOTYPE
 #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE)
 #define dmdagetglobalindices_          dmdagetglobalindices
-#define dmdarestoreglobalindices_      dmdarestoreglobalindices
 #endif
 
-PETSC_EXTERN void PETSC_STDCALL dmdagetglobalindices_(DM *da,PetscInt *n,PetscInt *indices,size_t *ia,PetscErrorCode *ierr)
+PETSC_EXTERN void PETSC_STDCALL  dmdasetaotype_(DM *da,CHAR type PETSC_MIXED_LEN(len), PetscErrorCode *ierr PETSC_END_LEN(len) )
 {
-  const PetscInt *idx;
-  *ierr = DMDAGetGlobalIndices(*da,n,&idx);
-  *ia   = PetscIntAddressToFortran(indices,idx);
+  char *t;
+  FIXCHAR(type,len,t);
+  *ierr = DMDASetAOType(*da,t);
+  FREECHAR(type,t);
 }
-
-PETSC_EXTERN void PETSC_STDCALL dmdarestoreglobalindices_(DM *da,PetscInt *n,PetscInt *fa,size_t *ia,PetscErrorCode *ierr)
-{
-  const PetscInt *lx = PetscIntAddressFromFortran(fa,*ia);
-  *ierr = DMDARestoreGlobalIndices(*da,n,&lx);
-}
-


More information about the petsc-users mailing list