Re: [petsc-users] memory scalable AO
Thanks! pushed to maint - and merged to master. Satish On Thu, 18 Feb 2016, Randall Mackie wrote: > Hi Satish, > > This patch works now. > > Thanks very much to all of you for your patience and help. > > Randy > > > > On Feb 17, 2016, at 9:58 PM, Satish Balaywrote: > > > > 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: > > > > > > DMDAGetGlobalIndices(DM,PetscInt*,const PetscInt*[]) and > > DMDARestoreGlobalIndices(DM,PetscInt*,const PetscInt*[]) are removed, use > > DMGetLocalToGlobalMapping() to get this information > > > > > > 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 > >>> 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 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 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. > > > > >>> > >> > > > >
Re: [petsc-users] memory scalable AO
Hi Satish, This patch works now. Thanks very much to all of you for your patience and help. Randy > On Feb 17, 2016, at 9:58 PM, Satish Balaywrote: > > 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: > > > DMDAGetGlobalIndices(DM,PetscInt*,const PetscInt*[]) and > DMDARestoreGlobalIndices(DM,PetscInt*,const PetscInt*[]) are removed, use > DMGetLocalToGlobalMapping() to get this information > > > 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 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 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 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. > >>> >> >
Re: [petsc-users] memory scalable AO
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: DMDAGetGlobalIndices(DM,PetscInt*,const PetscInt*[]) and DMDARestoreGlobalIndices(DM,PetscInt*,const PetscInt*[]) are removed, use DMGetLocalToGlobalMapping() to get this information 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 Mackiewrote: > > > > 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 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 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. > >>> > >> > > > > 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 #include #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,); - *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,); -} -
Re: [petsc-users] memory scalable AO
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 Mackiewrote: > > 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 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 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. >>> >> >
Re: [petsc-users] memory scalable AO
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 Balaywrote: > > 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 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. >> >
Re: [petsc-users] memory scalable AO
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 Mackiewrites: > > > 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. > #include "petscsys.h" #include "petscfix.h" #include "petsc/private/fortranimpl.h" /* daindex.c */ /* Fortran interface file */ /* * This file was generated automatically by bfort from the C source * file. */ #ifdef PETSC_USE_POINTER_CONVERSION #if defined(__cplusplus) extern "C" { #endif extern void *PetscToPointer(void*); extern int PetscFromPointer(void *); extern void PetscRmPointer(void*); #if defined(__cplusplus) } #endif #else #define PetscToPointer(a) (*(PetscFortranAddr *)(a)) #define PetscFromPointer(a) (PetscFortranAddr)(a) #define PetscRmPointer(a) #endif #include "petscdmda.h" #ifdef PETSC_HAVE_FORTRAN_CAPS #define dmdagetao_ DMDAGETAO #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) && !defined(FORTRANDOUBLEUNDERSCORE) #define dmdagetao_ dmdagetao #endif /* Definitions of Fortran Wrapper routines */ #if defined(__cplusplus) extern "C" { #endif PETSC_EXTERN void PETSC_STDCALL dmdagetao_(DM da,AO *ao, int *__ierr ){ *__ierr = DMDAGetAO( (DM)PetscToPointer((da) ),ao); } #if defined(__cplusplus) } #endif #include #include #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 #define dmdasetaotype_ dmdasetaotype #endif PETSC_EXTERN void PETSC_STDCALL dmdasetaotype_(DM *da,CHAR type PETSC_MIXED_LEN(len), int *__ierr PETSC_END_LEN(len) ) { char *t; FIXCHAR(type,len,t); *ierr = DMDASetAOType(*da,t); FREECHAR(type,t); } PETSC_EXTERN void PETSC_STDCALL dmdagetglobalindices_(DM *da,PetscInt *n,PetscInt *indices,size_t *ia,PetscErrorCode *ierr) { const PetscInt *idx; *ierr = DMDAGetGlobalIndices(*da,n,); *ia = PetscIntAddressToFortran(indices,idx); } 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,); }
Re: [petsc-users] memory scalable AO
Randall Mackiewrites: > 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. signature.asc Description: PGP signature
Re: [petsc-users] memory scalable AO
this leads to the error ‘bin/maint/generatefortranstubs.py’ …No such file. there is no maint directory under bin. Randy > On Feb 17, 2016, at 7:05 PM, Jed Brownwrote: > > Randall Mackie writes: >> So it seems to be ignoring the dmdasetaotype_ in >> /src/dm/impls/da/ftn-custom/zdaindexf.c in favor of ../ftn-auto/daindexf.c > > Sounds like you need to generate your Fortran stubs so that the version > in ftn-auto/daindexf.c is fixed. > > make allfortranstubs
Re: [petsc-users] memory scalable AO
Randall Mackiewrites: > So it seems to be ignoring the dmdasetaotype_ in > /src/dm/impls/da/ftn-custom/zdaindexf.c in favor of ../ftn-auto/daindexf.c Sounds like you need to generate your Fortran stubs so that the version in ftn-auto/daindexf.c is fixed. make allfortranstubs signature.asc Description: PGP signature
Re: [petsc-users] memory scalable AO
> On Feb 17, 2016, at 8:58 PM, Randall Mackiewrote: > > If I remove lines 47-50 in daindexf.c (the PETSC_EXTERN …for dmdasetaotype_), > then when I try to compile the test code, it complains of an undefined > reference to dmdasetaotype_. > > So I put the lines back in, and with your patch applied, and then run in the > debugger, with a breakpoint at dmdasetaotype_, it stops at > /src/dm/impls/da/ftn-auto/daindexf.c. > > 3 steps later, at *__ierr = DMDASetAOType( > > is where it bombs out. > > > So it seems to be ignoring the dmdasetaotype_ in > /src/dm/impls/da/ftn-custom/zdaindexf.c in favor of ../ftn-auto/daindexf.c This makes no sense. Ok just try pasting the new definition in daindexf.c. instead of the old one, compile and run. Barry > > Randy > > >> On Feb 17, 2016, at 6:31 PM, Barry Smith wrote: >> >> >> It is probably my fault. Edit src/dm/impls/da/ftn-auto/daindexf.c and remove >> the function function from that file and then run make on the library again. >> If that does not work then run in the debugger and put a break point in >> dmdasetaotype_ once it is there in the debugger you can make sure it is the >> right function and step until it crashes to see what I have done wrong. >> >> Baryr >> >>> On Feb 17, 2016, at 7:29 PM, Randall Mackie wrote: >>> >>> Unfortunately I am getting exactly the same result. >>> >>> I applied the patch (patch -p1 < fix-fortran-dmdasetaotype.patch) >>> >>> Then I recompiled the library, and my code, but the error remains. >>> >>> Perhaps there is something else I’m missing? >>> >>> Randy >>> >>> On Feb 17, 2016, at 3:15 PM, Barry Smith wrote: Here is patch. If it works for you I'll put it in maint and master tomorrow. Barry > On Feb 17, 2016, at 3:46 PM, Randall Mackie wrote: > > The attached test program demonstrates the problem. When I run it, I get > the following output: > > [0]PETSC ERROR: > > [0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, > probably memory access out of range > [0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger > [0]PETSC ERROR: or see > http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind > [0]PETSC ERROR: or try http://valgrind.org on GNU/linux and Apple Mac OS > X to find memory corruption errors > [0]PETSC ERROR: likely location of problem given in stack below > [0]PETSC ERROR: - Stack Frames > > [0]PETSC ERROR: Note: The EXACT line numbers in the stack are not > available, > [0]PETSC ERROR: INSTEAD the line number of the start of the function > [0]PETSC ERROR: is given. > [0]PETSC ERROR: [0] PetscStrlen line 150 > /home/rmackie/PETSc/petsc-3.6.3/src/sys/utils/str.c > [0]PETSC ERROR: [0] PetscStrallocpy line 185 > /home/rmackie/PETSc/petsc-3.6.3/src/sys/utils/str.c > [0]PETSC ERROR: [0] DMDASetAOType line 84 > /home/rmackie/PETSc/petsc-3.6.3/src/dm/impls/da/daindex.c > [0]PETSC ERROR: - Error Message > -- > [0]PETSC ERROR: Signal received > [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html > for trouble shooting. > > > Randy > > >> On Feb 17, 2016, at 11:35 AM, Barry Smith wrote: >> >> >> Should be ok. Do you have implicit none and the correct include files so >> AOMEMORYSCALABLE is defined? >> >> I think you need to run in the debugger next to track why this happens. >> >> Barry >> >>> On Feb 17, 2016, at 11:33 AM, Randall Mackie >>> wrote: >>> >>> What is the correct way to set the AO for a DMDA to be the memory >>> scalable version? >>> >>> I have tried this: >>> >>> call DMDASetAOType(da,AOMEMORYSCALABLE,ierr) >>> call DMDAGetAO(da,ao,ierr) >>> >>> The code compiles fine, but I simply get a Segmentation Violation when >>> I run it: >>> >>> [3]PETSC ERROR: >>> >>> [3]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, >>> probably memory access out of range >>> [3]PETSC ERROR: Try option -start_in_debugger or >>> -on_error_attach_debugger >>> [3]PETSC ERROR: or see >>> http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind >>> [3]PETSC ERROR: or try http://valgrind.org on GNU/linux and Apple Mac >>> OS X to find memory corruption errors >>> [3]PETSC ERROR: configure using
Re: [petsc-users] memory scalable AO
If I remove lines 47-50 in daindexf.c (the PETSC_EXTERN …for dmdasetaotype_), then when I try to compile the test code, it complains of an undefined reference to dmdasetaotype_. So I put the lines back in, and with your patch applied, and then run in the debugger, with a breakpoint at dmdasetaotype_, it stops at /src/dm/impls/da/ftn-auto/daindexf.c. 3 steps later, at *__ierr = DMDASetAOType( is where it bombs out. So it seems to be ignoring the dmdasetaotype_ in /src/dm/impls/da/ftn-custom/zdaindexf.c in favor of ../ftn-auto/daindexf.c Randy > On Feb 17, 2016, at 6:31 PM, Barry Smithwrote: > > > It is probably my fault. Edit src/dm/impls/da/ftn-auto/daindexf.c and remove > the function function from that file and then run make on the library again. > If that does not work then run in the debugger and put a break point in > dmdasetaotype_ once it is there in the debugger you can make sure it is the > right function and step until it crashes to see what I have done wrong. > > Baryr > >> On Feb 17, 2016, at 7:29 PM, Randall Mackie wrote: >> >> Unfortunately I am getting exactly the same result. >> >> I applied the patch (patch -p1 < fix-fortran-dmdasetaotype.patch) >> >> Then I recompiled the library, and my code, but the error remains. >> >> Perhaps there is something else I’m missing? >> >> Randy >> >> >>> On Feb 17, 2016, at 3:15 PM, Barry Smith wrote: >>> >>> >>> Here is patch. >>> >>> If it works for you I'll put it in maint and master tomorrow. >>> >>> Barry >>> On Feb 17, 2016, at 3:46 PM, Randall Mackie wrote: The attached test program demonstrates the problem. When I run it, I get the following output: [0]PETSC ERROR: [0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range [0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger [0]PETSC ERROR: or see http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind [0]PETSC ERROR: or try http://valgrind.org on GNU/linux and Apple Mac OS X to find memory corruption errors [0]PETSC ERROR: likely location of problem given in stack below [0]PETSC ERROR: - Stack Frames [0]PETSC ERROR: Note: The EXACT line numbers in the stack are not available, [0]PETSC ERROR: INSTEAD the line number of the start of the function [0]PETSC ERROR: is given. [0]PETSC ERROR: [0] PetscStrlen line 150 /home/rmackie/PETSc/petsc-3.6.3/src/sys/utils/str.c [0]PETSC ERROR: [0] PetscStrallocpy line 185 /home/rmackie/PETSc/petsc-3.6.3/src/sys/utils/str.c [0]PETSC ERROR: [0] DMDASetAOType line 84 /home/rmackie/PETSc/petsc-3.6.3/src/dm/impls/da/daindex.c [0]PETSC ERROR: - Error Message -- [0]PETSC ERROR: Signal received [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for trouble shooting. Randy > On Feb 17, 2016, at 11:35 AM, Barry Smith wrote: > > > Should be ok. Do you have implicit none and the correct include files so > AOMEMORYSCALABLE is defined? > > I think you need to run in the debugger next to track why this happens. > > Barry > >> On Feb 17, 2016, at 11:33 AM, Randall Mackie >> wrote: >> >> What is the correct way to set the AO for a DMDA to be the memory >> scalable version? >> >> I have tried this: >> >> call DMDASetAOType(da,AOMEMORYSCALABLE,ierr) >> call DMDAGetAO(da,ao,ierr) >> >> The code compiles fine, but I simply get a Segmentation Violation when I >> run it: >> >> [3]PETSC ERROR: >> >> [3]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, >> probably memory access out of range >> [3]PETSC ERROR: Try option -start_in_debugger or >> -on_error_attach_debugger >> [3]PETSC ERROR: or see >> http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind >> [3]PETSC ERROR: or try http://valgrind.org on GNU/linux and Apple Mac OS >> X to find memory corruption errors >> [3]PETSC ERROR: configure using --with-debugging=yes, recompile, link, >> and run >> [3]PETSC ERROR: to get more information on the crash. >> [3]PETSC ERROR: - Error Message >> -- >> [3]PETSC ERROR: Signal received >> [3]PETSC ERROR: See
Re: [petsc-users] memory scalable AO
It is probably my fault. Edit src/dm/impls/da/ftn-auto/daindexf.c and remove the function function from that file and then run make on the library again. If that does not work then run in the debugger and put a break point in dmdasetaotype_ once it is there in the debugger you can make sure it is the right function and step until it crashes to see what I have done wrong. Baryr > On Feb 17, 2016, at 7:29 PM, Randall Mackiewrote: > > Unfortunately I am getting exactly the same result. > > I applied the patch (patch -p1 < fix-fortran-dmdasetaotype.patch) > > Then I recompiled the library, and my code, but the error remains. > > Perhaps there is something else I’m missing? > > Randy > > >> On Feb 17, 2016, at 3:15 PM, Barry Smith wrote: >> >> >> Here is patch. >> >> If it works for you I'll put it in maint and master tomorrow. >> >> Barry >> >>> On Feb 17, 2016, at 3:46 PM, Randall Mackie wrote: >>> >>> The attached test program demonstrates the problem. When I run it, I get >>> the following output: >>> >>> [0]PETSC ERROR: >>> >>> [0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, >>> probably memory access out of range >>> [0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger >>> [0]PETSC ERROR: or see >>> http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind >>> [0]PETSC ERROR: or try http://valgrind.org on GNU/linux and Apple Mac OS X >>> to find memory corruption errors >>> [0]PETSC ERROR: likely location of problem given in stack below >>> [0]PETSC ERROR: - Stack Frames >>> >>> [0]PETSC ERROR: Note: The EXACT line numbers in the stack are not available, >>> [0]PETSC ERROR: INSTEAD the line number of the start of the function >>> [0]PETSC ERROR: is given. >>> [0]PETSC ERROR: [0] PetscStrlen line 150 >>> /home/rmackie/PETSc/petsc-3.6.3/src/sys/utils/str.c >>> [0]PETSC ERROR: [0] PetscStrallocpy line 185 >>> /home/rmackie/PETSc/petsc-3.6.3/src/sys/utils/str.c >>> [0]PETSC ERROR: [0] DMDASetAOType line 84 >>> /home/rmackie/PETSc/petsc-3.6.3/src/dm/impls/da/daindex.c >>> [0]PETSC ERROR: - Error Message >>> -- >>> [0]PETSC ERROR: Signal received >>> [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for >>> trouble shooting. >>> >>> >>> Randy >>> >>> On Feb 17, 2016, at 11:35 AM, Barry Smith wrote: Should be ok. Do you have implicit none and the correct include files so AOMEMORYSCALABLE is defined? I think you need to run in the debugger next to track why this happens. Barry > On Feb 17, 2016, at 11:33 AM, Randall Mackie > wrote: > > What is the correct way to set the AO for a DMDA to be the memory > scalable version? > > I have tried this: > > call DMDASetAOType(da,AOMEMORYSCALABLE,ierr) > call DMDAGetAO(da,ao,ierr) > > The code compiles fine, but I simply get a Segmentation Violation when I > run it: > > [3]PETSC ERROR: > > [3]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, > probably memory access out of range > [3]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger > [3]PETSC ERROR: or see > http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind > [3]PETSC ERROR: or try http://valgrind.org on GNU/linux and Apple Mac OS > X to find memory corruption errors > [3]PETSC ERROR: configure using --with-debugging=yes, recompile, link, > and run > [3]PETSC ERROR: to get more information on the crash. > [3]PETSC ERROR: - Error Message > -- > [3]PETSC ERROR: Signal received > [3]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html > for trouble shooting. > [3]PETSC ERROR: Petsc Release Version 3.6.3, Dec, 03, 2015 > [3]PETSC ERROR: Configure options PETSC_ARCH=linux-gfortran-opt > --with-clean=1 --with-scalar-type=complex --with-debugging=0 > --with-fortran=1 --download-mpich=./mpich-3.1.3.tar.gz --FOPTFLAGS=-O3 > --COPTFLAGS=-O3 > [3]PETSC ERROR: #1 User provided function() line 0 in unknown file > application called MPI_Abort(MPI_COMM_WORLD, 59) - process 3 > [cli_3]: aborting job: > > > In fact, I get the same thing even if I set the AOType to AOBASIC, in > other words > > call DMDASetAOTYPE(da,AOBASIC,ierr) > > > Previously, I did not set an AOType, and only called DMDAGetAO, which >
Re: [petsc-users] memory scalable AO
Here is patch. fix-fortran-dmdasetaotype.patch Description: Binary data If it works for you I'll put it in maint and master tomorrow. Barry > On Feb 17, 2016, at 3:46 PM, Randall Mackiewrote: > > The attached test program demonstrates the problem. When I run it, I get the > following output: > > [0]PETSC ERROR: > > [0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, > probably memory access out of range > [0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger > [0]PETSC ERROR: or see > http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind > [0]PETSC ERROR: or try http://valgrind.org on GNU/linux and Apple Mac OS X to > find memory corruption errors > [0]PETSC ERROR: likely location of problem given in stack below > [0]PETSC ERROR: - Stack Frames > > [0]PETSC ERROR: Note: The EXACT line numbers in the stack are not available, > [0]PETSC ERROR: INSTEAD the line number of the start of the function > [0]PETSC ERROR: is given. > [0]PETSC ERROR: [0] PetscStrlen line 150 > /home/rmackie/PETSc/petsc-3.6.3/src/sys/utils/str.c > [0]PETSC ERROR: [0] PetscStrallocpy line 185 > /home/rmackie/PETSc/petsc-3.6.3/src/sys/utils/str.c > [0]PETSC ERROR: [0] DMDASetAOType line 84 > /home/rmackie/PETSc/petsc-3.6.3/src/dm/impls/da/daindex.c > [0]PETSC ERROR: - Error Message > -- > [0]PETSC ERROR: Signal received > [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for > trouble shooting. > > > Randy > > >> On Feb 17, 2016, at 11:35 AM, Barry Smith wrote: >> >> >> Should be ok. Do you have implicit none and the correct include files so >> AOMEMORYSCALABLE is defined? >> >> I think you need to run in the debugger next to track why this happens. >> >> Barry >> >>> On Feb 17, 2016, at 11:33 AM, Randall Mackie wrote: >>> >>> What is the correct way to set the AO for a DMDA to be the memory scalable >>> version? >>> >>> I have tried this: >>> >>> call DMDASetAOType(da,AOMEMORYSCALABLE,ierr) >>> call DMDAGetAO(da,ao,ierr) >>> >>> The code compiles fine, but I simply get a Segmentation Violation when I >>> run it: >>> >>> [3]PETSC ERROR: >>> >>> [3]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, >>> probably memory access out of range >>> [3]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger >>> [3]PETSC ERROR: or see >>> http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind >>> [3]PETSC ERROR: or try http://valgrind.org on GNU/linux and Apple Mac OS X >>> to find memory corruption errors >>> [3]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and >>> run >>> [3]PETSC ERROR: to get more information on the crash. >>> [3]PETSC ERROR: - Error Message >>> -- >>> [3]PETSC ERROR: Signal received >>> [3]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for >>> trouble shooting. >>> [3]PETSC ERROR: Petsc Release Version 3.6.3, Dec, 03, 2015 >>> [3]PETSC ERROR: Configure options PETSC_ARCH=linux-gfortran-opt >>> --with-clean=1 --with-scalar-type=complex --with-debugging=0 >>> --with-fortran=1 --download-mpich=./mpich-3.1.3.tar.gz --FOPTFLAGS=-O3 >>> --COPTFLAGS=-O3 >>> [3]PETSC ERROR: #1 User provided function() line 0 in unknown file >>> application called MPI_Abort(MPI_COMM_WORLD, 59) - process 3 >>> [cli_3]: aborting job: >>> >>> >>> In fact, I get the same thing even if I set the AOType to AOBASIC, in other >>> words >>> >>> call DMDASetAOTYPE(da,AOBASIC,ierr) >>> >>> >>> Previously, I did not set an AOType, and only called DMDAGetAO, which works >>> fine, and from what I can tell sets the type to basic. >>> >>> >>> Thanks, Randy M. >> >
Re: [petsc-users] memory scalable AO
Ahh, yes. This is our fault. Because this function takes a string it needs a custom Fortran stub which it does not have. We'll get you a patch soon. Barry > On Feb 17, 2016, at 3:46 PM, Randall Mackiewrote: > > The attached test program demonstrates the problem. When I run it, I get the > following output: > > [0]PETSC ERROR: > > [0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, > probably memory access out of range > [0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger > [0]PETSC ERROR: or see > http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind > [0]PETSC ERROR: or try http://valgrind.org on GNU/linux and Apple Mac OS X to > find memory corruption errors > [0]PETSC ERROR: likely location of problem given in stack below > [0]PETSC ERROR: - Stack Frames > > [0]PETSC ERROR: Note: The EXACT line numbers in the stack are not available, > [0]PETSC ERROR: INSTEAD the line number of the start of the function > [0]PETSC ERROR: is given. > [0]PETSC ERROR: [0] PetscStrlen line 150 > /home/rmackie/PETSc/petsc-3.6.3/src/sys/utils/str.c > [0]PETSC ERROR: [0] PetscStrallocpy line 185 > /home/rmackie/PETSc/petsc-3.6.3/src/sys/utils/str.c > [0]PETSC ERROR: [0] DMDASetAOType line 84 > /home/rmackie/PETSc/petsc-3.6.3/src/dm/impls/da/daindex.c > [0]PETSC ERROR: - Error Message > -- > [0]PETSC ERROR: Signal received > [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for > trouble shooting. > > > Randy > > >> On Feb 17, 2016, at 11:35 AM, Barry Smith wrote: >> >> >> Should be ok. Do you have implicit none and the correct include files so >> AOMEMORYSCALABLE is defined? >> >> I think you need to run in the debugger next to track why this happens. >> >> Barry >> >>> On Feb 17, 2016, at 11:33 AM, Randall Mackie wrote: >>> >>> What is the correct way to set the AO for a DMDA to be the memory scalable >>> version? >>> >>> I have tried this: >>> >>> call DMDASetAOType(da,AOMEMORYSCALABLE,ierr) >>> call DMDAGetAO(da,ao,ierr) >>> >>> The code compiles fine, but I simply get a Segmentation Violation when I >>> run it: >>> >>> [3]PETSC ERROR: >>> >>> [3]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, >>> probably memory access out of range >>> [3]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger >>> [3]PETSC ERROR: or see >>> http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind >>> [3]PETSC ERROR: or try http://valgrind.org on GNU/linux and Apple Mac OS X >>> to find memory corruption errors >>> [3]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and >>> run >>> [3]PETSC ERROR: to get more information on the crash. >>> [3]PETSC ERROR: - Error Message >>> -- >>> [3]PETSC ERROR: Signal received >>> [3]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for >>> trouble shooting. >>> [3]PETSC ERROR: Petsc Release Version 3.6.3, Dec, 03, 2015 >>> [3]PETSC ERROR: Configure options PETSC_ARCH=linux-gfortran-opt >>> --with-clean=1 --with-scalar-type=complex --with-debugging=0 >>> --with-fortran=1 --download-mpich=./mpich-3.1.3.tar.gz --FOPTFLAGS=-O3 >>> --COPTFLAGS=-O3 >>> [3]PETSC ERROR: #1 User provided function() line 0 in unknown file >>> application called MPI_Abort(MPI_COMM_WORLD, 59) - process 3 >>> [cli_3]: aborting job: >>> >>> >>> In fact, I get the same thing even if I set the AOType to AOBASIC, in other >>> words >>> >>> call DMDASetAOTYPE(da,AOBASIC,ierr) >>> >>> >>> Previously, I did not set an AOType, and only called DMDAGetAO, which works >>> fine, and from what I can tell sets the type to basic. >>> >>> >>> Thanks, Randy M. >> >
Re: [petsc-users] memory scalable AO
The attached test program demonstrates the problem. When I run it, I get the following output: [0]PETSC ERROR: [0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range [0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger [0]PETSC ERROR: or see http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind [0]PETSC ERROR: or try http://valgrind.org on GNU/linux and Apple Mac OS X to find memory corruption errors [0]PETSC ERROR: likely location of problem given in stack below [0]PETSC ERROR: - Stack Frames [0]PETSC ERROR: Note: The EXACT line numbers in the stack are not available, [0]PETSC ERROR: INSTEAD the line number of the start of the function [0]PETSC ERROR: is given. [0]PETSC ERROR: [0] PetscStrlen line 150 /home/rmackie/PETSc/petsc-3.6.3/src/sys/utils/str.c [0]PETSC ERROR: [0] PetscStrallocpy line 185 /home/rmackie/PETSc/petsc-3.6.3/src/sys/utils/str.c [0]PETSC ERROR: [0] DMDASetAOType line 84 /home/rmackie/PETSc/petsc-3.6.3/src/dm/impls/da/daindex.c [0]PETSC ERROR: - Error Message -- [0]PETSC ERROR: Signal received [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for trouble shooting. Randy > On Feb 17, 2016, at 11:35 AM, Barry Smithwrote: > > > Should be ok. Do you have implicit none and the correct include files so > AOMEMORYSCALABLE is defined? > > I think you need to run in the debugger next to track why this happens. > > Barry > >> On Feb 17, 2016, at 11:33 AM, Randall Mackie wrote: >> >> What is the correct way to set the AO for a DMDA to be the memory scalable >> version? >> >> I have tried this: >> >> call DMDASetAOType(da,AOMEMORYSCALABLE,ierr) >> call DMDAGetAO(da,ao,ierr) >> >> The code compiles fine, but I simply get a Segmentation Violation when I run >> it: >> >> [3]PETSC ERROR: >> >> [3]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, >> probably memory access out of range >> [3]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger >> [3]PETSC ERROR: or see >> http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind >> [3]PETSC ERROR: or try http://valgrind.org on GNU/linux and Apple Mac OS X >> to find memory corruption errors >> [3]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and >> run >> [3]PETSC ERROR: to get more information on the crash. >> [3]PETSC ERROR: - Error Message >> -- >> [3]PETSC ERROR: Signal received >> [3]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for >> trouble shooting. >> [3]PETSC ERROR: Petsc Release Version 3.6.3, Dec, 03, 2015 >> [3]PETSC ERROR: Configure options PETSC_ARCH=linux-gfortran-opt >> --with-clean=1 --with-scalar-type=complex --with-debugging=0 >> --with-fortran=1 --download-mpich=./mpich-3.1.3.tar.gz --FOPTFLAGS=-O3 >> --COPTFLAGS=-O3 >> [3]PETSC ERROR: #1 User provided function() line 0 in unknown file >> application called MPI_Abort(MPI_COMM_WORLD, 59) - process 3 >> [cli_3]: aborting job: >> >> >> In fact, I get the same thing even if I set the AOType to AOBASIC, in other >> words >> >> call DMDASetAOTYPE(da,AOBASIC,ierr) >> >> >> Previously, I did not set an AOType, and only called DMDAGetAO, which works >> fine, and from what I can tell sets the type to basic. >> >> >> Thanks, Randy M. > test.F90 Description: Binary data makefile Description: Binary data