From jedbrown at mcs.anl.gov Fri Mar 1 06:27:01 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Fri, 1 Mar 2013 07:27:01 -0500 Subject: [petsc-users] csqrt In-Reply-To: References: Message-ID: On Thu, Feb 28, 2013 at 5:08 PM, Hui Zhang wrote: > >> If you are using PETSc with complex numbers you might consider > changing the cluster software. > > > > presumably csqrt() is c99 - so c++ std:sqrt() is perhaps ok ok? [so one > could use --with-clanguage=cxx] > > Unfortunately, this does not work. Thanks any way! > You can install a functional libc as a user. PETSc is not in the business of implementing basic arithmetic for people that don't want to upgrade decade-old software. -------------- next part -------------- An HTML attachment was scrubbed... URL: From paulhuaizhang at gmail.com Fri Mar 1 11:02:42 2013 From: paulhuaizhang at gmail.com (paul zhang) Date: Fri, 1 Mar 2013 12:02:42 -0500 Subject: [petsc-users] PETSc library "libpetsc.so" missing Message-ID: Hi there, I tried to install PETSc 3.3-p8 on our DLX. But for some reason, I can not create the file "libpetsc.so" that I need. Can some one shed some lights? My configuration file is following: #!/bin/sh export PETSC_DIR=?pwd? export PETSC_ARCH=linux-gnu-intel MKLPATH=/share/apps/intel/ict/mkl/10.2.5.035/lib/em64t ./config/configure.py --prefix=$PETSC_DIR --with-vendor-compilers=intel --with-gnu-compilers=0 --with-blas-lapack-dir=$MKLPATH -lf2clapack -lf2cblas --COPTFLAGS=-O3 --CXXOPTFLAGS=-O3 --with-debugging=0 --with-precision=double --with-mpi=1 --with-mpi-dir="/share/cluster/RHEL6.2/x86_64/apps/openmpi/1.6.2" Many thanks, Paul -------------- next part -------------- An HTML attachment was scrubbed... URL: From balay at mcs.anl.gov Fri Mar 1 11:04:13 2013 From: balay at mcs.anl.gov (Satish Balay) Date: Fri, 1 Mar 2013 11:04:13 -0600 (CST) Subject: [petsc-users] PETSc library "libpetsc.so" missing In-Reply-To: References: Message-ID: Please don't repost same emails to petsc-maint & petsc-users. Just followup on installation issues on petsc-maint Satish On Fri, 1 Mar 2013, paul zhang wrote: > Hi there, > > I tried to install PETSc 3.3-p8 on our DLX. But for some reason, I can not > create the file "libpetsc.so" that I need. > Can some one shed some lights? > My configuration file is following: > > #!/bin/sh > export PETSC_DIR=?pwd? > export PETSC_ARCH=linux-gnu-intel > > MKLPATH=/share/apps/intel/ict/mkl/10.2.5.035/lib/em64t > > ./config/configure.py --prefix=$PETSC_DIR --with-vendor-compilers=intel > --with-gnu-compilers=0 --with-blas-lapack-dir=$MKLPATH -lf2clapack > -lf2cblas --COPTFLAGS=-O3 --CXXOPTFLAGS=-O3 --with-debugging=0 > --with-precision=double --with-mpi=1 > --with-mpi-dir="/share/cluster/RHEL6.2/x86_64/apps/openmpi/1.6.2" > > > > Many thanks, > Paul > > From paulhuaizhang at gmail.com Fri Mar 1 11:06:22 2013 From: paulhuaizhang at gmail.com (paul zhang) Date: Fri, 1 Mar 2013 12:06:22 -0500 Subject: [petsc-users] PETSc library "libpetsc.so" missing In-Reply-To: References: Message-ID: Sorry. I just subscribed the mailing list. Did not mean to do it. On Fri, Mar 1, 2013 at 12:04 PM, Satish Balay wrote: > Please don't repost same emails to petsc-maint & petsc-users. > > Just followup on installation issues on petsc-maint > > Satish > > On Fri, 1 Mar 2013, paul zhang wrote: > > > Hi there, > > > > I tried to install PETSc 3.3-p8 on our DLX. But for some reason, I can > not > > create the file "libpetsc.so" that I need. > > Can some one shed some lights? > > My configuration file is following: > > > > #!/bin/sh > > export PETSC_DIR=?pwd? > > export PETSC_ARCH=linux-gnu-intel > > > > MKLPATH=/share/apps/intel/ict/mkl/10.2.5.035/lib/em64t > > > > ./config/configure.py --prefix=$PETSC_DIR --with-vendor-compilers=intel > > --with-gnu-compilers=0 --with-blas-lapack-dir=$MKLPATH -lf2clapack > > -lf2cblas --COPTFLAGS=-O3 --CXXOPTFLAGS=-O3 --with-debugging=0 > > --with-precision=double --with-mpi=1 > > --with-mpi-dir="/share/cluster/RHEL6.2/x86_64/apps/openmpi/1.6.2" > > > > > > > > Many thanks, > > Paul > > > > -- Huaibao (Paul) Zhang *Gas Surface Interactions Lab* Department of Mechanical Engineering University of Kentucky, Lexington, KY, 40506-0503* Office*: 216 Ralph G. Anderson Building *Web*:gsil.engineering.uky.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: From james.j.ramsey14.civ at mail.mil Fri Mar 1 11:50:30 2013 From: james.j.ramsey14.civ at mail.mil (Ramsey, James J CIV (US)) Date: Fri, 1 Mar 2013 17:50:30 +0000 Subject: [petsc-users] "Exact-ish" preallocation for (mostly) unstructured mesh with periodic boundary conditions? Message-ID: I'm trying to get a better preallocation scheme. I noticed an earlier e-mail mentioning that "for finite elements with a normal cell division or finite differences with a normal vertex division, you need only count the nonzeros for rows you own since the partitions overlap on the boundary." Unfortunately, this doesn't quite work for me. Here's the latest attempt at a routine, with some details skipped: std::vector d_nnz(nLocalRows), o_nnz(nLocalRows); std::vector > d_nzInds(nLocalRows), o_nzInds(nLocalRows); for ( ... loop over elements ...) { wrapNodeIds(*mesh, nIdVec); // Accounts for periodic boundary conditions mesh->nodes2globalDOF(nIdVec, globalDOFsPerElem); std::vector::iterator gdBegin = globalDOFsPerElem.begin(); std::vector::iterator gdEnd = globalDOFsPerElem.end(); for (std::vector::iterator itrI = gdBegin; itrI != gdEnd; ++itrI) { PetscInt I = *itrI; if ((I >= minDOFId) && (I <= maxDOFId)) { PetscInt Ioffset = I - minDOFId; for (std::vector::iterator itrJ = gdBegin; itrJ != gdEnd; ++itrJ) { PetscInt J = *itrJ; if ((J >= minDOFId) && (J <= maxDOFId)) { // J will not be inserted if it is already in d_nzInds[Ioffset]. This avoids duplicates. d_nzInds[Ioffset].insert(J); } else { o_nzInds[Ioffset].insert(J); } } } } for (PetscInt i = 0; i < nLocalRows; ++i) { d_nnz[i] = d_nzInds[i].size(); o_nnz[i] = o_nzInds[i].size(); } For nodes in the interior, this seems to work well, but at the boundaries of the domain, the number of non-zeros is underestimated. It seems like parallel communication is unavoidable here, but I'm not sure how to do it, and I'm unsure if I really want to mess with relatively low-level MPI routines to get what I want. Any ideas? From jedbrown at mcs.anl.gov Fri Mar 1 13:07:36 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Fri, 1 Mar 2013 14:07:36 -0500 Subject: [petsc-users] MATNEST with shell matrices In-Reply-To: References: <5126A9FA.3060203@cims.nyu.edu> <5126B1DB.90103@cims.nyu.edu> <5126B4F8.8060408@cims.nyu.edu> <5126B6DB.4020207@cims.nyu.edu> <5126BA30.9090607@cims.nyu.edu> <5126C9C6.80306@cims.nyu.edu> <1ACA5F14-5B26-43BB-ACFE-1B48F7CAA06F@cims.nyu.edu> Message-ID: On Thu, Feb 28, 2013 at 3:39 PM, Amneet Bhalla wrote: > I am all for doing things the legal way :-) > > Where should this routine be added and how should it look like for shell > vectors? I had assumed that > such changes should be done in user defined MatGetVecs routine. Clearly > this is not happening. > Please explain. > Can you > comment on proper construction of duplicated Vecs which are needed by > Krylov solver of PETSc? The way I am > doing is : > > a) Create a wrapper Vec (x), which holds SAMRAI vector. > b) Define a x->ops->duplicatevector for this wrapper vector. > c) Create a VecNest (X) of these wrapper Vecs. > d) Define MatGetVecs routine, which will duplicate X by the call > VecDuplicate(X,left/right) > This much is fine. > > On Thu, Feb 28, 2013 at 2:27 PM, Jed Brown wrote: > >> This is calling VecValidValues() checks for vec->ops->getarray. Since >> VecGetArray_Nest() is implemented, it calls the routine. I'm inclined to >> add a vec->ops->validvalues() and _not_ try to hack it in terms of >> VecGetArray(). > > > > > > -- > Amneet > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jedbrown at mcs.anl.gov Fri Mar 1 13:25:25 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Fri, 1 Mar 2013 14:25:25 -0500 Subject: [petsc-users] Extracting Vec from VecNest In-Reply-To: References: Message-ID: On Wed, Feb 27, 2013 at 7:09 PM, Amneet Bhalla wrote: > static const int NO_COMPS = ...; > Vec array_x[NO_COMPS] = {.....}; > Vec x; > VecCreateNest(PETSC_COMM_WORLD, NO_COMPS, PETSC_NULL, array_x, &x); > > for(int n = 0; n < NO_COMPS; ++n) > { > Vec sub_x; > IS iset; > ISCreateGeneral(PETSC_COMM_WORLD, 1, &n, PETSC_COPY_VALUES, &iset); > The IS is supposed to address those entries in the Vec, not the blocking implied by the arguments to VecCreateNest. (Vec base does not have a concept of such "blocks".) Did you look at the examples I pointed you to? We discussed this already and since you are dedicated to not defining a global space, you'll have to use VecNestGetSubVec(). > > VecGetSubVector(x, iset, &sub_x); > //*ERROR: Index set not found in nested Vec!* > -------------- next part -------------- An HTML attachment was scrubbed... URL: From james.j.ramsey14.civ at mail.mil Fri Mar 1 14:06:56 2013 From: james.j.ramsey14.civ at mail.mil (Ramsey, James J CIV (US)) Date: Fri, 1 Mar 2013 20:06:56 +0000 Subject: [petsc-users] "Exact-ish" preallocation for (mostly) unstructured mesh with periodic boundary conditions? In-Reply-To: References: Message-ID: ________________________________________ for ( ... loop over elements ...) { wrapNodeIds(*mesh, nIdVec); // Accounts for periodic boundary conditions mesh->nodes2globalDOF(nIdVec, globalDOFsPerElem); ________________________________________ Sorry, in cutting and pasting snippets of code, I forgot to indicate that "nIdVec" here is the vector of node labels of the current element. From jedbrown at mcs.anl.gov Fri Mar 1 14:43:42 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Fri, 1 Mar 2013 15:43:42 -0500 Subject: [petsc-users] "Exact-ish" preallocation for (mostly) unstructured mesh with periodic boundary conditions? In-Reply-To: References: Message-ID: On Fri, Mar 1, 2013 at 12:50 PM, Ramsey, James J CIV (US) < james.j.ramsey14.civ at mail.mil> wrote: > I'm trying to get a better preallocation scheme. I noticed an earlier > e-mail < > https://lists.mcs.anl.gov/mailman/htdig/petsc-users/2010-September/006886.html> > mentioning that "for finite elements with a normal cell division or finite > differences with a normal vertex division, you need only count the nonzeros > for rows you own since the partitions overlap on the boundary." > Unfortunately, this doesn't quite work for me. I can't tell what your question is. It appears that you are not considering elements in the overlap. If you don't have any overlap in your mesh, you need to communicate. http://lists.mcs.anl.gov/pipermail/petsc-users/2008-May/003020.html > Here's the latest attempt at a routine, with some details skipped: > > std::vector d_nnz(nLocalRows), o_nnz(nLocalRows); > std::vector > d_nzInds(nLocalRows), > o_nzInds(nLocalRows); > > for ( ... loop over elements ...) { > > wrapNodeIds(*mesh, nIdVec); // Accounts for periodic boundary > conditions > mesh->nodes2globalDOF(nIdVec, globalDOFsPerElem); > > std::vector::iterator gdBegin = globalDOFsPerElem.begin(); > std::vector::iterator gdEnd = globalDOFsPerElem.end(); > > for (std::vector::iterator itrI = gdBegin; itrI != gdEnd; > ++itrI) { > > PetscInt I = *itrI; > > if ((I >= minDOFId) && (I <= maxDOFId)) { > PetscInt Ioffset = I - minDOFId; > > for (std::vector::iterator itrJ = gdBegin; itrJ != > gdEnd; ++itrJ) { > > PetscInt J = *itrJ; > > if ((J >= minDOFId) && (J <= maxDOFId)) { > // J will not be inserted if it is already in > d_nzInds[Ioffset]. This avoids duplicates. > d_nzInds[Ioffset].insert(J); > } > else { > o_nzInds[Ioffset].insert(J); > } > > } > > } > } > > for (PetscInt i = 0; i < nLocalRows; ++i) { > d_nnz[i] = d_nzInds[i].size(); > o_nnz[i] = o_nzInds[i].size(); > } > > For nodes in the interior, this seems to work well, but at the boundaries > of the domain, the number of non-zeros is underestimated. It seems like > parallel communication is unavoidable here, but I'm not sure how to do it, > and I'm unsure if I really want to mess with relatively low-level MPI > routines to get what I want. > > Any ideas? -------------- next part -------------- An HTML attachment was scrubbed... URL: From james.j.ramsey14.civ at mail.mil Fri Mar 1 15:06:13 2013 From: james.j.ramsey14.civ at mail.mil (Ramsey, James J CIV (US)) Date: Fri, 1 Mar 2013 21:06:13 +0000 Subject: [petsc-users] "Exact-ish" preallocation for (mostly) unstructured mesh with periodic boundary conditions? In-Reply-To: References: , Message-ID: From: petsc-users-bounces at mcs.anl.gov [petsc-users-bounces at mcs.anl.gov] on behalf of Jed Brown [jedbrown at mcs.anl.gov] > I can't tell what your question is. It appears that you are not considering elements in the overlap. If you don't have any overlap in your mesh, you need to communicate. Basically, I'm trying to figure out *how* to communicate in a reasonably sane manner. > http://lists.mcs.anl.gov/pipermail/petsc-users/2008-May/003020.html What's at that URL looks like it may answer my question. From mail2amneet at gmail.com Fri Mar 1 17:05:00 2013 From: mail2amneet at gmail.com (Amneet Bhalla) Date: Fri, 1 Mar 2013 17:05:00 -0600 Subject: [petsc-users] MATNEST with shell matrices In-Reply-To: References: <5126A9FA.3060203@cims.nyu.edu> <5126B1DB.90103@cims.nyu.edu> <5126B4F8.8060408@cims.nyu.edu> <5126B6DB.4020207@cims.nyu.edu> <5126BA30.9090607@cims.nyu.edu> <5126C9C6.80306@cims.nyu.edu> <1ACA5F14-5B26-43BB-ACFE-1B48F7CAA06F@cims.nyu.edu> Message-ID: Jed this is output from gdb: #0 0x0000000000000000 in ?? () #1 0x00000000009857fd in VecGetArrayRead (x=0x33ba0b0, a=0x7fff1f0cf100) at /home/amneet/SOFTWARES/LIBRARIESIBAMR/PETSc-3.3-Lite/include/petsc-private/vecimpl.h:350 #2 0x000000000098f67f in VecGetArray_Nest (X=0x33c0850, x=0x7fff1f0cf200) at /home/amneet/SOFTWARES/LIBRARIESIBAMR/PETSc-3.3-Lite/src/vec/vec/impls/nest/vecnest.c:719 #3 0x0000000000a3f4df in VecGetArrayRead (x=0x33c0850, a=0x7fff1f0cf200) at /home/amneet/SOFTWARES/LIBRARIESIBAMR/PETSc-3.3-Lite/include/petsc-private/vecimpl.h:350 #4 0x0000000000a51d83 in MatMult (mat=0x326e480, x=0x33150c0, y=0x33c0850) at /home/amneet/SOFTWARES/LIBRARIESIBAMR/PETSc-3.3-Lite/src/mat/interface/matrix.c:2092 #5 0x00000000012b2b78 in KSPInitialResidual (ksp=0x32f6bb0, vsoln=0x33150c0, vt1=0x33c0850, vt2=0x33d3c60, vres=0x33e6d30, vb=0x3328710) at /home/amneet/SOFTWARES/LIBRARIESIBAMR/PETSc-3.3-Lite/src/ksp/ksp/interface/itres.c:54 #6 0x0000000000da2faa in KSPSolve_GMRES (ksp=0x32f6bb0) at /home/amneet/SOFTWARES/LIBRARIESIBAMR/PETSc-3.3-Lite/src/ksp/ksp/impls/gmres/gmres.c:230 #7 0x0000000000d1ae6b in KSPSolve (ksp=0x32f6bb0, b=0x3328710, x=0x33150c0) at /home/amneet/SOFTWARES/LIBRARIESIBAMR/PETSc-3.3-Lite/src/ksp/ksp/interface/itfunc.c:446 #8 0x00000000006b8b0a in IBTK::PETScBlockKrylovLinearSolver::solveSystem (this=0x31f4310, x=0x329ed20, b=0x32b75d0) at PETScBlockKrylovLinearSolver.C:381 #9 0x00000000005777e3 in main (argc=5, argv=0x7fff1f0d3468) at main.C:274 In frame 5, there is call to function PetscErrorCode KSPInitialResidual(KSP ksp,Vec vsoln,Vec vt1,Vec vt2,Vec vres,Vec vb) which calls the matrix-vector function in frame 4, i.e, ierr = KSP_MatMult(ksp,Amat,vsoln,vt1);CHKERRQ(ierr); Now the error comes in frame 4, where there is call to VecValidValues(y,3,PETSC_FALSE); y being vt1, a temporary left Vec to hold value of user-defined matrix vector product. I have passed a user-defined function to tell MatShell how to create left/right Vec(s); where I also set left/right->ops->getarray = PETSC_NULL. If vt1 was created using this routine, there would not have been any error related to VecGetArrayRead routine and should have printed some tracer printf statements. So my guess is that this temporary vector is created by directly calling VecDuplicate routine which sets vec->ops->getarray = VecGetArray_Nest by default. On Fri, Mar 1, 2013 at 1:07 PM, Jed Brown wrote: > Where should this routine be added and how should it look like for shell >> vectors? I had assumed that >> such changes should be done in user defined MatGetVecs routine. Clearly >> this is not happening. >> > > Please explain. > -- Amneet -------------- next part -------------- An HTML attachment was scrubbed... URL: From dharmareddy84 at gmail.com Sat Mar 2 17:34:58 2013 From: dharmareddy84 at gmail.com (Dharmendar Reddy) Date: Sat, 2 Mar 2013 17:34:58 -0600 Subject: [petsc-users] DMMeshCreateMeshFromAdjacency Message-ID: Hello, I am trying to use DMMeshCreateMeshFromAdjacency in a Fortran code. I get undefined reference error. I include the following file in my program #include "finclude/petsc.h90" I see that fortran interface to DMMeshCreateMeshFromAdjacency is defined only in finclude/ftn-auto/petscdmmesh.h90 I am not able to figure out if PETSC_USE_FORTRAN_INTERFACES is defined. I did not compile the code. I am runing the code on TACC stampede. I tried adding #define PETSC_USE_FORTRAN_INTERFACES 1 in my program before the petsc inlcude line but i still get error. Thanks Reddy -- ----------------------------------------------------- Dharmendar Reddy Palle Graduate Student Microelectronics Research center, University of Texas at Austin, 10100 Burnet Road, Bldg. 160 MER 2.608F, TX 78758-4445 e-mail: dharmareddy84 at gmail.com Phone: +1-512-350-9082 United States of America. Homepage: https://webspace.utexas.edu/~dpr342 -------------- next part -------------- An HTML attachment was scrubbed... URL: From balay at mcs.anl.gov Sat Mar 2 19:10:39 2013 From: balay at mcs.anl.gov (Satish Balay) Date: Sat, 2 Mar 2013 19:10:39 -0600 (CST) Subject: [petsc-users] DMMeshCreateMeshFromAdjacency In-Reply-To: References: Message-ID: On Sat, 2 Mar 2013, Dharmendar Reddy wrote: > Hello, > I am trying to use DMMeshCreateMeshFromAdjacency in a Fortran code. > I get undefined reference error. What error? please copy/paste > I include the following file in my program > #include "finclude/petsc.h90" > > I see that fortran interface to DMMeshCreateMeshFromAdjacency is defined > only in > > finclude/ftn-auto/petscdmmesh.h90 > > I am not able to figure out if PETSC_USE_FORTRAN_INTERFACES is defined. I > did not compile the code. I am runing the code on TACC stampede. I tried > adding > > #define PETSC_USE_FORTRAN_INTERFACES 1 > in my program before the petsc inlcude line but i still get error. 1. again 'get error' doesn't tell us anything. And you shouldn't need PETSC_USE_FORTRAN_INTERFACES to use DMMeshCreateMeshFromAdjacency Satish > > > Thanks > Reddy > > From dharmareddy84 at gmail.com Sat Mar 2 19:51:56 2013 From: dharmareddy84 at gmail.com (Dharmendar Reddy) Date: Sat, 2 Mar 2013 19:51:56 -0600 Subject: [petsc-users] DMMeshCreateMeshFromAdjacency In-Reply-To: References: Message-ID: Hello, Sorry, I was going to create a test case. Anyways here is the error message petscDMTest_v2.o: In function `MAIN__': petscDMTest_v2.F90:(.text+0x354): undefined reference to `dmmeshcreatemeshfromad jacency_' make: [testDMMesh] Error 1 (ignored) I have attached a test case and makefile. make all should gen rate the executable. Thanks Reddy On Sat, Mar 2, 2013 at 7:10 PM, Satish Balay wrote: > On Sat, 2 Mar 2013, Dharmendar Reddy wrote: > > > Hello, > > I am trying to use DMMeshCreateMeshFromAdjacency in a Fortran > code. > > I get undefined reference error. > > What error? please copy/paste > > > I include the following file in my program > > #include "finclude/petsc.h90" > > > > I see that fortran interface to DMMeshCreateMeshFromAdjacency is defined > > only in > > > > finclude/ftn-auto/petscdmmesh.h90 > > > > I am not able to figure out if PETSC_USE_FORTRAN_INTERFACES is defined. I > > did not compile the code. I am runing the code on TACC stampede. I tried > > adding > > > > #define PETSC_USE_FORTRAN_INTERFACES 1 > > in my program before the petsc inlcude line but i still get error. > > 1. again 'get error' doesn't tell us anything. > > And you shouldn't need PETSC_USE_FORTRAN_INTERFACES to use > DMMeshCreateMeshFromAdjacency > > Satish > > > > > > > Thanks > > Reddy > > > > > > -- ----------------------------------------------------- Dharmendar Reddy Palle Graduate Student Microelectronics Research center, University of Texas at Austin, 10100 Burnet Road, Bldg. 160 MER 2.608F, TX 78758-4445 e-mail: dharmareddy84 at gmail.com Phone: +1-512-350-9082 United States of America. Homepage: https://webspace.utexas.edu/~dpr342 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Makefile Type: application/octet-stream Size: 569 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: petscDMTest_v2.F90 Type: application/octet-stream Size: 1183 bytes Desc: not available URL: From dharmareddy84 at gmail.com Sat Mar 2 19:54:04 2013 From: dharmareddy84 at gmail.com (Dharmendar Reddy) Date: Sat, 2 Mar 2013 19:54:04 -0600 Subject: [petsc-users] DMMeshCreateMeshFromAdjacency In-Reply-To: References: Message-ID: As you said, I do not need, PETSC_USE_FORTRAN_INTERFACES. The interface to dmmeshcreatefromadjacency is not defined in finclude/ftn-custom/petscdmmesh.h90 it is only defined in finclude/ftn-auto/petscdmmesh.h90 On Sat, Mar 2, 2013 at 7:51 PM, Dharmendar Reddy wrote: > Hello, > Sorry, I was going to create a test case. Anyways here is the > error message > > petscDMTest_v2.o: In function `MAIN__': > petscDMTest_v2.F90:(.text+0x354): undefined reference to > `dmmeshcreatemeshfromad > jacency_' > make: [testDMMesh] Error 1 (ignored) > > I have attached a test case and makefile. make all should gen rate the > executable. > > Thanks > Reddy > > > On Sat, Mar 2, 2013 at 7:10 PM, Satish Balay wrote: > >> On Sat, 2 Mar 2013, Dharmendar Reddy wrote: >> >> > Hello, >> > I am trying to use DMMeshCreateMeshFromAdjacency in a Fortran >> code. >> > I get undefined reference error. >> >> What error? please copy/paste >> >> > I include the following file in my program >> > #include "finclude/petsc.h90" >> > >> > I see that fortran interface to DMMeshCreateMeshFromAdjacency is defined >> > only in >> > >> > finclude/ftn-auto/petscdmmesh.h90 >> > >> > I am not able to figure out if PETSC_USE_FORTRAN_INTERFACES is defined. >> I >> > did not compile the code. I am runing the code on TACC stampede. I tried >> > adding >> > >> > #define PETSC_USE_FORTRAN_INTERFACES 1 >> > in my program before the petsc inlcude line but i still get error. >> >> 1. again 'get error' doesn't tell us anything. >> >> And you shouldn't need PETSC_USE_FORTRAN_INTERFACES to use >> DMMeshCreateMeshFromAdjacency >> >> Satish >> >> > >> > >> > Thanks >> > Reddy >> > >> > >> >> > > > -- > ----------------------------------------------------- > Dharmendar Reddy Palle > Graduate Student > Microelectronics Research center, > University of Texas at Austin, > 10100 Burnet Road, Bldg. 160 > MER 2.608F, TX 78758-4445 > e-mail: dharmareddy84 at gmail.com > Phone: +1-512-350-9082 > United States of America. > Homepage: https://webspace.utexas.edu/~dpr342 > -- ----------------------------------------------------- Dharmendar Reddy Palle Graduate Student Microelectronics Research center, University of Texas at Austin, 10100 Burnet Road, Bldg. 160 MER 2.608F, TX 78758-4445 e-mail: dharmareddy84 at gmail.com Phone: +1-512-350-9082 United States of America. Homepage: https://webspace.utexas.edu/~dpr342 -------------- next part -------------- An HTML attachment was scrubbed... URL: From balay at mcs.anl.gov Sat Mar 2 21:55:50 2013 From: balay at mcs.anl.gov (Satish Balay) Date: Sat, 2 Mar 2013 21:55:50 -0600 (CST) Subject: [petsc-users] DMMeshCreateMeshFromAdjacency In-Reply-To: References: Message-ID: Fortran compiler doesn't care about presence or absence of interface defintions. If they exist - then it does extra prototype checks. If they don't exist - it assumes f77 and chugs along]. Did you build petsc with sieve [and cxx]? send make.log for this petsc build. Also what do you get for: nm -Ao libpetsc.a |grep -i DMMeshCreateMeshFromAdjacency You can followup this issue [with logs] on petsc-maint. Satish On Sat, 2 Mar 2013, Dharmendar Reddy wrote: > As you said, I do not need, PETSC_USE_FORTRAN_INTERFACES. The interface to > dmmeshcreatefromadjacency is not defined in > > finclude/ftn-custom/petscdmmesh.h90 > > it is only defined in > > finclude/ftn-auto/petscdmmesh.h90 > > > On Sat, Mar 2, 2013 at 7:51 PM, Dharmendar Reddy wrote: > > > Hello, > > Sorry, I was going to create a test case. Anyways here is the > > error message > > > > petscDMTest_v2.o: In function `MAIN__': > > petscDMTest_v2.F90:(.text+0x354): undefined reference to > > `dmmeshcreatemeshfromad > > jacency_' > > make: [testDMMesh] Error 1 (ignored) > > > > I have attached a test case and makefile. make all should gen rate the > > executable. > > > > Thanks > > Reddy > > > > > > On Sat, Mar 2, 2013 at 7:10 PM, Satish Balay wrote: > > > >> On Sat, 2 Mar 2013, Dharmendar Reddy wrote: > >> > >> > Hello, > >> > I am trying to use DMMeshCreateMeshFromAdjacency in a Fortran > >> code. > >> > I get undefined reference error. > >> > >> What error? please copy/paste > >> > >> > I include the following file in my program > >> > #include "finclude/petsc.h90" > >> > > >> > I see that fortran interface to DMMeshCreateMeshFromAdjacency is defined > >> > only in > >> > > >> > finclude/ftn-auto/petscdmmesh.h90 > >> > > >> > I am not able to figure out if PETSC_USE_FORTRAN_INTERFACES is defined. > >> I > >> > did not compile the code. I am runing the code on TACC stampede. I tried > >> > adding > >> > > >> > #define PETSC_USE_FORTRAN_INTERFACES 1 > >> > in my program before the petsc inlcude line but i still get error. > >> > >> 1. again 'get error' doesn't tell us anything. > >> > >> And you shouldn't need PETSC_USE_FORTRAN_INTERFACES to use > >> DMMeshCreateMeshFromAdjacency > >> > >> Satish > >> > >> > > >> > > >> > Thanks > >> > Reddy > >> > > >> > > >> > >> > > > > > > -- > > ----------------------------------------------------- > > Dharmendar Reddy Palle > > Graduate Student > > Microelectronics Research center, > > University of Texas at Austin, > > 10100 Burnet Road, Bldg. 160 > > MER 2.608F, TX 78758-4445 > > e-mail: dharmareddy84 at gmail.com > > Phone: +1-512-350-9082 > > United States of America. > > Homepage: https://webspace.utexas.edu/~dpr342 > > > > > > From balay at mcs.anl.gov Sun Mar 3 00:23:14 2013 From: balay at mcs.anl.gov (Satish Balay) Date: Sun, 3 Mar 2013 00:23:14 -0600 (CST) Subject: [petsc-users] DMMeshCreateMeshFromAdjacency In-Reply-To: References: Message-ID: BTW: I don't get compile errors with this code using petsc-3.3 built with: --with-clanguage=cxx --with-sieve=1 --with-boost=1 [the code fails to run though..] Satish --------- asterix:/home/balay/download-pine>make PETSC_DIR=/home/balay/petsc-dist-test PETSC_ARCH=asterix64-sieve petscDMTest_v2 /home/balay/soft/linux64/mpich2-1.1/bin/mpif90 -c -fPIC -Wall -Wno-unused-variable -Wno-unused-dummy-argument -g -I/home/balay/petsc-dist-test/include -I/home/balay/petsc-dist-test/asterix64-sieve/include -I/home/balay/petsc-dist-test/include/sieve -I/home/balay/soft/linux64/mpich2-1.1/include -I/home/balay/soft/mpich2-1.5/include -o petscDMTest_v2.o petscDMTest_v2.F90 /home/balay/soft/linux64/mpich2-1.1/bin/mpif90 -fPIC -Wall -Wno-unused-variable -Wno-unused-dummy-argument -g -o petscDMTest_v2 petscDMTest_v2.o -Wl,-rpath,/home/balay/petsc-dist-test/asterix64-sieve/lib -L/home/balay/petsc-dist-test/asterix64-sieve/lib -lpetsc -lX11 -lpthread -llapack -lblas -lm -Wl,-rpath,/home/balay/soft/mpich2-1.5/lib -L/home/balay/soft/mpich2-1.5/lib -Wl,-rpath,/usr/lib/gcc/x86_64-redhat-linux/4.7.2 -L/usr/lib/gcc/x86_64-redhat-linux/4.7.2 -lmpichf90 -lgfortran -lm -lgfortran -lm -lquadmath -lm -lmpichcxx -lstdc++ -ldl -lmpich -lopa -lmpl -lrt -lgcc_s -ldl /usr/bin/rm -f petscDMTest_v2.o asterix:/home/balay/download-pine>./petscDMTest_v2 [0]PETSC ERROR: --------------------- Error Message ------------------------------------ [0]PETSC ERROR: No support for this operation for this object type! [0]PETSC ERROR: Interpolation (creation of faces and edges) is not yet supported.! [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: Petsc Release Version 3.3.0, Patch 6, unknown [0]PETSC ERROR: See docs/changes/index.html for recent updates. [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. [0]PETSC ERROR: See docs/index.html for manual pages. [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: ./petscDMTest_v2 on a asterix64 named asterix by balay Sun Mar 3 00:21:29 2013 [0]PETSC ERROR: Libraries linked from /home/balay/petsc-dist-test/asterix64-sieve/lib [0]PETSC ERROR: Configure run at Sun Mar 3 00:15:25 2013 [0]PETSC ERROR: Configure options --with-mpi-dir=/home/balay/soft/linux64/mpich2-1.1 --with-shared-libraries=1 --with-clanguage=cxx --with-sieve=1 PETSC_ARCH=asterix64-sieve --with-boost=1 [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: DMMeshCreateMeshFromAdjacency() line 312 in /home/balay/petsc-dist-test/src/dm/impls/mesh/meshcreate.c Surcessfully Loaded mesh into DM asterix:/home/balay/download-pine> On Sat, 2 Mar 2013, Satish Balay wrote: > Fortran compiler doesn't care about presence or absence of interface > defintions. If they exist - then it does extra prototype checks. If > they don't exist - it assumes f77 and chugs along]. > > Did you build petsc with sieve [and cxx]? send make.log for this > petsc build. Also what do you get for: > > nm -Ao libpetsc.a |grep -i DMMeshCreateMeshFromAdjacency > > You can followup this issue [with logs] on petsc-maint. > > Satish > > > On Sat, 2 Mar 2013, Dharmendar Reddy wrote: > > > As you said, I do not need, PETSC_USE_FORTRAN_INTERFACES. The interface to > > dmmeshcreatefromadjacency is not defined in > > > > finclude/ftn-custom/petscdmmesh.h90 > > > > it is only defined in > > > > finclude/ftn-auto/petscdmmesh.h90 > > > > > > On Sat, Mar 2, 2013 at 7:51 PM, Dharmendar Reddy wrote: > > > > > Hello, > > > Sorry, I was going to create a test case. Anyways here is the > > > error message > > > > > > petscDMTest_v2.o: In function `MAIN__': > > > petscDMTest_v2.F90:(.text+0x354): undefined reference to > > > `dmmeshcreatemeshfromad > > > jacency_' > > > make: [testDMMesh] Error 1 (ignored) > > > > > > I have attached a test case and makefile. make all should gen rate the > > > executable. > > > > > > Thanks > > > Reddy > > > > > > > > > On Sat, Mar 2, 2013 at 7:10 PM, Satish Balay wrote: > > > > > >> On Sat, 2 Mar 2013, Dharmendar Reddy wrote: > > >> > > >> > Hello, > > >> > I am trying to use DMMeshCreateMeshFromAdjacency in a Fortran > > >> code. > > >> > I get undefined reference error. > > >> > > >> What error? please copy/paste > > >> > > >> > I include the following file in my program > > >> > #include "finclude/petsc.h90" > > >> > > > >> > I see that fortran interface to DMMeshCreateMeshFromAdjacency is defined > > >> > only in > > >> > > > >> > finclude/ftn-auto/petscdmmesh.h90 > > >> > > > >> > I am not able to figure out if PETSC_USE_FORTRAN_INTERFACES is defined. > > >> I > > >> > did not compile the code. I am runing the code on TACC stampede. I tried > > >> > adding > > >> > > > >> > #define PETSC_USE_FORTRAN_INTERFACES 1 > > >> > in my program before the petsc inlcude line but i still get error. > > >> > > >> 1. again 'get error' doesn't tell us anything. > > >> > > >> And you shouldn't need PETSC_USE_FORTRAN_INTERFACES to use > > >> DMMeshCreateMeshFromAdjacency > > >> > > >> Satish > > >> > > >> > > > >> > > > >> > Thanks > > >> > Reddy > > >> > > > >> > > > >> > > >> > > > > > > > > > -- > > > ----------------------------------------------------- > > > Dharmendar Reddy Palle > > > Graduate Student > > > Microelectronics Research center, > > > University of Texas at Austin, > > > 10100 Burnet Road, Bldg. 160 > > > MER 2.608F, TX 78758-4445 > > > e-mail: dharmareddy84 at gmail.com > > > Phone: +1-512-350-9082 > > > United States of America. > > > Homepage: https://webspace.utexas.edu/~dpr342 > > > > > > > > > > > > > From ztdep at yahoo.com.cn Sun Mar 3 03:39:24 2013 From: ztdep at yahoo.com.cn (ztdep at yahoo.com.cn) Date: Sun, 3 Mar 2013 17:39:24 +0800 (CST) Subject: [petsc-users] (no subject) Message-ID: <1362303564.31524.YahooMailNeo@web15104.mail.cnb.yahoo.com> ????I am writting a parallel unstructured FVM solver for fluid flow problem, but i met some problems when i compute the gradient of a variable using Gauss's theorem. ? ? As we know,we need the values of a variable at all its neighboring cells, but if one of my neighbouring cell is not in the local processor, how to get it. ?Could you please give me some advices. Regards Your Sincerely -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Sun Mar 3 08:14:18 2013 From: knepley at gmail.com (Matthew Knepley) Date: Sun, 3 Mar 2013 09:14:18 -0500 Subject: [petsc-users] (no subject) In-Reply-To: <1362303564.31524.YahooMailNeo@web15104.mail.cnb.yahoo.com> References: <1362303564.31524.YahooMailNeo@web15104.mail.cnb.yahoo.com> Message-ID: On Sun, Mar 3, 2013 at 4:39 AM, wrote: > > I am writting a parallel unstructured FVM solver for fluid flow > problem, but i met some problems when i compute the gradient of a variable > using Gauss's theorem. > As we know,we need the values of a variable at all its neighboring > cells, but if one of my neighbouring cell is not in the local processor, > how to get it. > Could you please give me some advices. > You can see our example of a parallel unstructured FVM solver in TS ex11 in petsc-dev. Specifically, I can see several ways to do this. You could partition faces, and have ghost cells, which we can handles. Or you could partition cells, and assemble these kind of function over faces additively if they are linear, which I think yours is, which is what we do in ex11. It depends on your particular application, but we have the tools to do this. Thanks, Matt > Regards > Your Sincerely > > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From jedbrown at mcs.anl.gov Sun Mar 3 08:22:25 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Sun, 3 Mar 2013 08:22:25 -0600 Subject: [petsc-users] (no subject) In-Reply-To: References: <1362303564.31524.YahooMailNeo@web15104.mail.cnb.yahoo.com> Message-ID: On Sun, Mar 3, 2013 at 8:14 AM, Matthew Knepley wrote: > You can see our example of a parallel unstructured FVM solver in TS ex11 > in petsc-dev. > > Specifically, I can see several ways to do this. You could partition > faces, and have ghost cells, which we can handles. Or > you could partition cells, and assemble these kind of function over faces > additively if they are linear, which I think yours is, > which is what we do in ex11. It depends on your particular application, > but we have the tools to do this. > This isn't an accurate description of what ex11 does. We build a vector Grad on the owned cells, then communicate like this ierr = DMGlobalToLocalBegin(dmGrad,Grad,INSERT_VALUES,locGrad);CHKERRQ(ierr); ierr = DMGlobalToLocalEnd(dmGrad,Grad,INSERT_VALUES,locGrad);CHKERRQ(ierr); and evaluate fluxes using locGrad. -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Sun Mar 3 08:31:16 2013 From: knepley at gmail.com (Matthew Knepley) Date: Sun, 3 Mar 2013 09:31:16 -0500 Subject: [petsc-users] "Exact-ish" preallocation for (mostly) unstructured mesh with periodic boundary conditions? In-Reply-To: References: Message-ID: On Fri, Mar 1, 2013 at 12:50 PM, Ramsey, James J CIV (US) < james.j.ramsey14.civ at mail.mil> wrote: > I'm trying to get a better preallocation scheme. I noticed an earlier > e-mail < > https://lists.mcs.anl.gov/mailman/htdig/petsc-users/2010-September/006886.html> > mentioning that "for finite elements with a normal cell division or finite > differences with a normal vertex division, you need only count the nonzeros > for rows you own since the partitions overlap on the boundary." > Unfortunately, this doesn't quite work for me. Here's the latest attempt at > a routine, with some details skipped: > I understand the code you have below, but we have chosen to do it a complementary way. The way I understand FEM allocation, schematically, you Loop over all global unknowns u_i (coefficient of phi_i) Loop over global unknowns u_j (coefficient of phi_j) which have nonzero overlap with the function \phi_i Increment dnnz or onnz We have code to do this in PETSc right now. You need to specify your topology using DMPlex, and then just use DMCreateMatrix(). There is no getting around communication or ghosting when doing this operation. Matt > std::vector d_nnz(nLocalRows), o_nnz(nLocalRows); > std::vector > d_nzInds(nLocalRows), > o_nzInds(nLocalRows); > > for ( ... loop over elements ...) { > > wrapNodeIds(*mesh, nIdVec); // Accounts for periodic boundary > conditions > mesh->nodes2globalDOF(nIdVec, globalDOFsPerElem); > > std::vector::iterator gdBegin = globalDOFsPerElem.begin(); > std::vector::iterator gdEnd = globalDOFsPerElem.end(); > > for (std::vector::iterator itrI = gdBegin; itrI != gdEnd; > ++itrI) { > > PetscInt I = *itrI; > > if ((I >= minDOFId) && (I <= maxDOFId)) { > PetscInt Ioffset = I - minDOFId; > > for (std::vector::iterator itrJ = gdBegin; itrJ != > gdEnd; ++itrJ) { > > PetscInt J = *itrJ; > > if ((J >= minDOFId) && (J <= maxDOFId)) { > // J will not be inserted if it is already in > d_nzInds[Ioffset]. This avoids duplicates. > d_nzInds[Ioffset].insert(J); > } > else { > o_nzInds[Ioffset].insert(J); > } > > } > > } > } > > for (PetscInt i = 0; i < nLocalRows; ++i) { > d_nnz[i] = d_nzInds[i].size(); > o_nnz[i] = o_nzInds[i].size(); > } > > For nodes in the interior, this seems to work well, but at the boundaries > of the domain, the number of non-zeros is underestimated. It seems like > parallel communication is unavoidable here, but I'm not sure how to do it, > and I'm unsure if I really want to mess with relatively low-level MPI > routines to get what I want. > > Any ideas? -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From dharmareddy84 at gmail.com Sun Mar 3 13:37:45 2013 From: dharmareddy84 at gmail.com (Dharmendar Reddy) Date: Sun, 3 Mar 2013 13:37:45 -0600 Subject: [petsc-users] DMMeshCreateMeshFromAdjacency In-Reply-To: References: Message-ID: Hello, Thanks. I will have the code compiled with-cxx and with-sieve. The error is understandable when i look at the following line from meshcreate.c 312: if (interpolate) {SETERRQ (comm, PETSC_ERR_SUP, "Interpolation (creation of faces and edges) is not yet supported.");} Any idea if this feature will be implimented? I am trying to import mesh from gmsh. I have a Fortran code which will genrate list for faces and edges for a given mesh. Is there a DMMEsh interface through which i can input list of edges and faces ? Thanks Reddy On Sun, Mar 3, 2013 at 12:23 AM, Satish Balay wrote: > BTW: I don't get compile errors with this code using petsc-3.3 built with: > > --with-clanguage=cxx --with-sieve=1 --with-boost=1 > > [the code fails to run though..] > > Satish > > --------- > > asterix:/home/balay/download-pine>make > PETSC_DIR=/home/balay/petsc-dist-test PETSC_ARCH=asterix64-sieve > petscDMTest_v2 > /home/balay/soft/linux64/mpich2-1.1/bin/mpif90 -c -fPIC -Wall > -Wno-unused-variable -Wno-unused-dummy-argument -g > -I/home/balay/petsc-dist-test/include > -I/home/balay/petsc-dist-test/asterix64-sieve/include > -I/home/balay/petsc-dist-test/include/sieve > -I/home/balay/soft/linux64/mpich2-1.1/include > -I/home/balay/soft/mpich2-1.5/include -o petscDMTest_v2.o > petscDMTest_v2.F90 > /home/balay/soft/linux64/mpich2-1.1/bin/mpif90 -fPIC -Wall > -Wno-unused-variable -Wno-unused-dummy-argument -g -o petscDMTest_v2 > petscDMTest_v2.o > -Wl,-rpath,/home/balay/petsc-dist-test/asterix64-sieve/lib > -L/home/balay/petsc-dist-test/asterix64-sieve/lib -lpetsc -lX11 -lpthread > -llapack -lblas -lm -Wl,-rpath,/home/balay/soft/mpich2-1.5/lib > -L/home/balay/soft/mpich2-1.5/lib > -Wl,-rpath,/usr/lib/gcc/x86_64-redhat-linux/4.7.2 > -L/usr/lib/gcc/x86_64-redhat-linux/4.7.2 -lmpichf90 -lgfortran -lm > -lgfortran -lm -lquadmath -lm -lmpichcxx -lstdc++ -ldl -lmpich -lopa -lmpl > -lrt -lgcc_s -ldl > /usr/bin/rm -f petscDMTest_v2.o > asterix:/home/balay/download-pine>./petscDMTest_v2 > [0]PETSC ERROR: --------------------- Error Message > ------------------------------------ > [0]PETSC ERROR: No support for this operation for this object type! > [0]PETSC ERROR: Interpolation (creation of faces and edges) is not yet > supported.! > [0]PETSC ERROR: > ------------------------------------------------------------------------ > [0]PETSC ERROR: Petsc Release Version 3.3.0, Patch 6, unknown > [0]PETSC ERROR: See docs/changes/index.html for recent updates. > [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. > [0]PETSC ERROR: See docs/index.html for manual pages. > [0]PETSC ERROR: > ------------------------------------------------------------------------ > [0]PETSC ERROR: ./petscDMTest_v2 on a asterix64 named asterix by balay Sun > Mar 3 00:21:29 2013 > [0]PETSC ERROR: Libraries linked from > /home/balay/petsc-dist-test/asterix64-sieve/lib > [0]PETSC ERROR: Configure run at Sun Mar 3 00:15:25 2013 > [0]PETSC ERROR: Configure options > --with-mpi-dir=/home/balay/soft/linux64/mpich2-1.1 > --with-shared-libraries=1 --with-clanguage=cxx --with-sieve=1 > PETSC_ARCH=asterix64-sieve --with-boost=1 > [0]PETSC ERROR: > ------------------------------------------------------------------------ > [0]PETSC ERROR: DMMeshCreateMeshFromAdjacency() line 312 in > /home/balay/petsc-dist-test/src/dm/impls/mesh/meshcreate.c > Surcessfully Loaded mesh into DM > asterix:/home/balay/download-pine> > > > > > > On Sat, 2 Mar 2013, Satish Balay wrote: > > > Fortran compiler doesn't care about presence or absence of interface > > defintions. If they exist - then it does extra prototype checks. If > > they don't exist - it assumes f77 and chugs along]. > > > > Did you build petsc with sieve [and cxx]? send make.log for this > > petsc build. Also what do you get for: > > > > nm -Ao libpetsc.a |grep -i DMMeshCreateMeshFromAdjacency > > > > You can followup this issue [with logs] on petsc-maint. > > > > Satish > > > > > > On Sat, 2 Mar 2013, Dharmendar Reddy wrote: > > > > > As you said, I do not need, PETSC_USE_FORTRAN_INTERFACES. The > interface to > > > dmmeshcreatefromadjacency is not defined in > > > > > > finclude/ftn-custom/petscdmmesh.h90 > > > > > > it is only defined in > > > > > > finclude/ftn-auto/petscdmmesh.h90 > > > > > > > > > On Sat, Mar 2, 2013 at 7:51 PM, Dharmendar Reddy < > dharmareddy84 at gmail.com>wrote: > > > > > > > Hello, > > > > Sorry, I was going to create a test case. Anyways here is the > > > > error message > > > > > > > > petscDMTest_v2.o: In function `MAIN__': > > > > petscDMTest_v2.F90:(.text+0x354): undefined reference to > > > > `dmmeshcreatemeshfromad > > > > jacency_' > > > > make: [testDMMesh] Error 1 (ignored) > > > > > > > > I have attached a test case and makefile. make all should gen rate > the > > > > executable. > > > > > > > > Thanks > > > > Reddy > > > > > > > > > > > > On Sat, Mar 2, 2013 at 7:10 PM, Satish Balay > wrote: > > > > > > > >> On Sat, 2 Mar 2013, Dharmendar Reddy wrote: > > > >> > > > >> > Hello, > > > >> > I am trying to use DMMeshCreateMeshFromAdjacency in a > Fortran > > > >> code. > > > >> > I get undefined reference error. > > > >> > > > >> What error? please copy/paste > > > >> > > > >> > I include the following file in my program > > > >> > #include "finclude/petsc.h90" > > > >> > > > > >> > I see that fortran interface to DMMeshCreateMeshFromAdjacency is > defined > > > >> > only in > > > >> > > > > >> > finclude/ftn-auto/petscdmmesh.h90 > > > >> > > > > >> > I am not able to figure out if PETSC_USE_FORTRAN_INTERFACES is > defined. > > > >> I > > > >> > did not compile the code. I am runing the code on TACC stampede. > I tried > > > >> > adding > > > >> > > > > >> > #define PETSC_USE_FORTRAN_INTERFACES 1 > > > >> > in my program before the petsc inlcude line but i still get error. > > > >> > > > >> 1. again 'get error' doesn't tell us anything. > > > >> > > > >> And you shouldn't need PETSC_USE_FORTRAN_INTERFACES to use > > > >> DMMeshCreateMeshFromAdjacency > > > >> > > > >> Satish > > > >> > > > >> > > > > >> > > > > >> > Thanks > > > >> > Reddy > > > >> > > > > >> > > > > >> > > > >> > > > > > > > > > > > > -- > > > > ----------------------------------------------------- > > > > Dharmendar Reddy Palle > > > > Graduate Student > > > > Microelectronics Research center, > > > > University of Texas at Austin, > > > > 10100 Burnet Road, Bldg. 160 > > > > MER 2.608F, TX 78758-4445 > > > > e-mail: dharmareddy84 at gmail.com > > > > Phone: +1-512-350-9082 > > > > United States of America. > > > > Homepage: https://webspace.utexas.edu/~dpr342 > > > > > > > > > > > > > > > > > > > > > > -- ----------------------------------------------------- Dharmendar Reddy Palle Graduate Student Microelectronics Research center, University of Texas at Austin, 10100 Burnet Road, Bldg. 160 MER 2.608F, TX 78758-4445 e-mail: dharmareddy84 at gmail.com Phone: +1-512-350-9082 United States of America. Homepage: https://webspace.utexas.edu/~dpr342 -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Sun Mar 3 14:11:59 2013 From: knepley at gmail.com (Matthew Knepley) Date: Sun, 3 Mar 2013 15:11:59 -0500 Subject: [petsc-users] DMMeshCreateMeshFromAdjacency In-Reply-To: References: Message-ID: On Sun, Mar 3, 2013 at 2:37 PM, Dharmendar Reddy wrote: > Hello, > Thanks. I will have the code compiled with-cxx and with-sieve. > The error is understandable when i look at the following line from > meshcreate.c > > 312: if (interpolate) {SETERRQ (comm, PETSC_ERR_SUP, "Interpolation (creation of faces and edges) is not yet supported.");} > > Any idea if this feature will be implimented? I am trying to import mesh from gmsh. > I have a Fortran code which will genrate list for faces and edges for a given mesh. > Is there a DMMEsh interface through which i can input list of edges and faces ? > > DMMesh was an initial implementation of these ideas, but did not interface well with solvers, so it has been rewritten in C as DMPlex. The interface is almost exactly the same, and if you want increased functionality I would encourage you to switch. For example, DMMeshCreateMeshFromAdjacency() becomes DMPlexCreateFromCellList() and you can follow this with DMInterpolate() to automatically create the edges and faces. Thanks, Matt > Thanks > Reddy > > > > On Sun, Mar 3, 2013 at 12:23 AM, Satish Balay wrote: > >> BTW: I don't get compile errors with this code using petsc-3.3 built with: >> >> --with-clanguage=cxx --with-sieve=1 --with-boost=1 >> >> [the code fails to run though..] >> >> Satish >> >> --------- >> >> asterix:/home/balay/download-pine>make >> PETSC_DIR=/home/balay/petsc-dist-test PETSC_ARCH=asterix64-sieve >> petscDMTest_v2 >> /home/balay/soft/linux64/mpich2-1.1/bin/mpif90 -c -fPIC -Wall >> -Wno-unused-variable -Wno-unused-dummy-argument -g >> -I/home/balay/petsc-dist-test/include >> -I/home/balay/petsc-dist-test/asterix64-sieve/include >> -I/home/balay/petsc-dist-test/include/sieve >> -I/home/balay/soft/linux64/mpich2-1.1/include >> -I/home/balay/soft/mpich2-1.5/include -o petscDMTest_v2.o >> petscDMTest_v2.F90 >> /home/balay/soft/linux64/mpich2-1.1/bin/mpif90 -fPIC -Wall >> -Wno-unused-variable -Wno-unused-dummy-argument -g -o petscDMTest_v2 >> petscDMTest_v2.o >> -Wl,-rpath,/home/balay/petsc-dist-test/asterix64-sieve/lib >> -L/home/balay/petsc-dist-test/asterix64-sieve/lib -lpetsc -lX11 -lpthread >> -llapack -lblas -lm -Wl,-rpath,/home/balay/soft/mpich2-1.5/lib >> -L/home/balay/soft/mpich2-1.5/lib >> -Wl,-rpath,/usr/lib/gcc/x86_64-redhat-linux/4.7.2 >> -L/usr/lib/gcc/x86_64-redhat-linux/4.7.2 -lmpichf90 -lgfortran -lm >> -lgfortran -lm -lquadmath -lm -lmpichcxx -lstdc++ -ldl -lmpich -lopa -lmpl >> -lrt -lgcc_s -ldl >> /usr/bin/rm -f petscDMTest_v2.o >> asterix:/home/balay/download-pine>./petscDMTest_v2 >> [0]PETSC ERROR: --------------------- Error Message >> ------------------------------------ >> [0]PETSC ERROR: No support for this operation for this object type! >> [0]PETSC ERROR: Interpolation (creation of faces and edges) is not yet >> supported.! >> [0]PETSC ERROR: >> ------------------------------------------------------------------------ >> [0]PETSC ERROR: Petsc Release Version 3.3.0, Patch 6, unknown >> [0]PETSC ERROR: See docs/changes/index.html for recent updates. >> [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. >> [0]PETSC ERROR: See docs/index.html for manual pages. >> [0]PETSC ERROR: >> ------------------------------------------------------------------------ >> [0]PETSC ERROR: ./petscDMTest_v2 on a asterix64 named asterix by balay >> Sun Mar 3 00:21:29 2013 >> [0]PETSC ERROR: Libraries linked from >> /home/balay/petsc-dist-test/asterix64-sieve/lib >> [0]PETSC ERROR: Configure run at Sun Mar 3 00:15:25 2013 >> [0]PETSC ERROR: Configure options >> --with-mpi-dir=/home/balay/soft/linux64/mpich2-1.1 >> --with-shared-libraries=1 --with-clanguage=cxx --with-sieve=1 >> PETSC_ARCH=asterix64-sieve --with-boost=1 >> [0]PETSC ERROR: >> ------------------------------------------------------------------------ >> [0]PETSC ERROR: DMMeshCreateMeshFromAdjacency() line 312 in >> /home/balay/petsc-dist-test/src/dm/impls/mesh/meshcreate.c >> Surcessfully Loaded mesh into DM >> asterix:/home/balay/download-pine> >> >> >> >> >> >> On Sat, 2 Mar 2013, Satish Balay wrote: >> >> > Fortran compiler doesn't care about presence or absence of interface >> > defintions. If they exist - then it does extra prototype checks. If >> > they don't exist - it assumes f77 and chugs along]. >> > >> > Did you build petsc with sieve [and cxx]? send make.log for this >> > petsc build. Also what do you get for: >> > >> > nm -Ao libpetsc.a |grep -i DMMeshCreateMeshFromAdjacency >> > >> > You can followup this issue [with logs] on petsc-maint. >> > >> > Satish >> > >> > >> > On Sat, 2 Mar 2013, Dharmendar Reddy wrote: >> > >> > > As you said, I do not need, PETSC_USE_FORTRAN_INTERFACES. The >> interface to >> > > dmmeshcreatefromadjacency is not defined in >> > > >> > > finclude/ftn-custom/petscdmmesh.h90 >> > > >> > > it is only defined in >> > > >> > > finclude/ftn-auto/petscdmmesh.h90 >> > > >> > > >> > > On Sat, Mar 2, 2013 at 7:51 PM, Dharmendar Reddy < >> dharmareddy84 at gmail.com>wrote: >> > > >> > > > Hello, >> > > > Sorry, I was going to create a test case. Anyways here is >> the >> > > > error message >> > > > >> > > > petscDMTest_v2.o: In function `MAIN__': >> > > > petscDMTest_v2.F90:(.text+0x354): undefined reference to >> > > > `dmmeshcreatemeshfromad >> > > > jacency_' >> > > > make: [testDMMesh] Error 1 (ignored) >> > > > >> > > > I have attached a test case and makefile. make all should gen rate >> the >> > > > executable. >> > > > >> > > > Thanks >> > > > Reddy >> > > > >> > > > >> > > > On Sat, Mar 2, 2013 at 7:10 PM, Satish Balay >> wrote: >> > > > >> > > >> On Sat, 2 Mar 2013, Dharmendar Reddy wrote: >> > > >> >> > > >> > Hello, >> > > >> > I am trying to use DMMeshCreateMeshFromAdjacency in a >> Fortran >> > > >> code. >> > > >> > I get undefined reference error. >> > > >> >> > > >> What error? please copy/paste >> > > >> >> > > >> > I include the following file in my program >> > > >> > #include "finclude/petsc.h90" >> > > >> > >> > > >> > I see that fortran interface to DMMeshCreateMeshFromAdjacency is >> defined >> > > >> > only in >> > > >> > >> > > >> > finclude/ftn-auto/petscdmmesh.h90 >> > > >> > >> > > >> > I am not able to figure out if PETSC_USE_FORTRAN_INTERFACES is >> defined. >> > > >> I >> > > >> > did not compile the code. I am runing the code on TACC stampede. >> I tried >> > > >> > adding >> > > >> > >> > > >> > #define PETSC_USE_FORTRAN_INTERFACES 1 >> > > >> > in my program before the petsc inlcude line but i still get >> error. >> > > >> >> > > >> 1. again 'get error' doesn't tell us anything. >> > > >> >> > > >> And you shouldn't need PETSC_USE_FORTRAN_INTERFACES to use >> > > >> DMMeshCreateMeshFromAdjacency >> > > >> >> > > >> Satish >> > > >> >> > > >> > >> > > >> > >> > > >> > Thanks >> > > >> > Reddy >> > > >> > >> > > >> > >> > > >> >> > > >> >> > > > >> > > > >> > > > -- >> > > > ----------------------------------------------------- >> > > > Dharmendar Reddy Palle >> > > > Graduate Student >> > > > Microelectronics Research center, >> > > > University of Texas at Austin, >> > > > 10100 Burnet Road, Bldg. 160 >> > > > MER 2.608F, TX 78758-4445 >> > > > e-mail: dharmareddy84 at gmail.com >> > > > Phone: +1-512-350-9082 >> > > > United States of America. >> > > > Homepage: https://webspace.utexas.edu/~dpr342 >> > > > >> > > >> > > >> > > >> > > >> > >> > >> >> > > > -- > ----------------------------------------------------- > Dharmendar Reddy Palle > Graduate Student > Microelectronics Research center, > University of Texas at Austin, > 10100 Burnet Road, Bldg. 160 > MER 2.608F, TX 78758-4445 > e-mail: dharmareddy84 at gmail.com > Phone: +1-512-350-9082 > United States of America. > Homepage: https://webspace.utexas.edu/~dpr342 > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From dharmareddy84 at gmail.com Sun Mar 3 14:48:40 2013 From: dharmareddy84 at gmail.com (Dharmendar Reddy) Date: Sun, 3 Mar 2013 14:48:40 -0600 Subject: [petsc-users] DMMeshCreateMeshFromAdjacency In-Reply-To: References: Message-ID: So i should use petsc-dev ? I will try that. I there any way i can have access to submesh? Consider a this scenario. I have a two dimensional mesh in a rectangle with a uniform deltaX and deltaY gridding. Is there any way i can get submesh at say x = (i-1)*deltaX where say i = 1 to N. The dofs on the submesh will should be mapped to dofs on the original mesh. The submesh in this case will be a 1D mesh along y-axis. I can create each DM with input celllist and create maps after that but i am wondering if this can be done via DMgetsubDM kind of call ? Thanks Reddy On Sun, Mar 3, 2013 at 2:11 PM, Matthew Knepley wrote: > On Sun, Mar 3, 2013 at 2:37 PM, Dharmendar Reddy wrote: > >> Hello, >> >> Thanks. I will have the code compiled with-cxx and with-sieve. >> The error is understandable when i look at the following line from >> meshcreate.c >> >> 312: if (interpolate) {SETERRQ (comm, PETSC_ERR_SUP, "Interpolation (creation of faces and edges) is not yet supported.");} >> >> >> Any idea if this feature will be implimented? I am trying to import mesh from gmsh. >> I have a Fortran code which will genrate list for faces and edges for a given mesh. >> >> Is there a DMMEsh interface through which i can input list of edges and faces ? >> >> > DMMesh was an initial implementation of these ideas, but did not interface > well with > solvers, so it has been rewritten in C as DMPlex. The interface is almost > exactly the > same, and if you want increased functionality I would encourage you to > switch. For > example, DMMeshCreateMeshFromAdjacency() becomes > > DMPlexCreateFromCellList() > > and you can follow this with > > DMInterpolate() > > to automatically create the edges and faces. > > Thanks, > > Matt > > >> Thanks >> Reddy >> >> >> >> On Sun, Mar 3, 2013 at 12:23 AM, Satish Balay wrote: >> >>> BTW: I don't get compile errors with this code using petsc-3.3 built >>> with: >>> >>> --with-clanguage=cxx --with-sieve=1 --with-boost=1 >>> >>> [the code fails to run though..] >>> >>> Satish >>> >>> --------- >>> >>> asterix:/home/balay/download-pine>make >>> PETSC_DIR=/home/balay/petsc-dist-test PETSC_ARCH=asterix64-sieve >>> petscDMTest_v2 >>> /home/balay/soft/linux64/mpich2-1.1/bin/mpif90 -c -fPIC -Wall >>> -Wno-unused-variable -Wno-unused-dummy-argument -g >>> -I/home/balay/petsc-dist-test/include >>> -I/home/balay/petsc-dist-test/asterix64-sieve/include >>> -I/home/balay/petsc-dist-test/include/sieve >>> -I/home/balay/soft/linux64/mpich2-1.1/include >>> -I/home/balay/soft/mpich2-1.5/include -o petscDMTest_v2.o >>> petscDMTest_v2.F90 >>> /home/balay/soft/linux64/mpich2-1.1/bin/mpif90 -fPIC -Wall >>> -Wno-unused-variable -Wno-unused-dummy-argument -g -o petscDMTest_v2 >>> petscDMTest_v2.o >>> -Wl,-rpath,/home/balay/petsc-dist-test/asterix64-sieve/lib >>> -L/home/balay/petsc-dist-test/asterix64-sieve/lib -lpetsc -lX11 -lpthread >>> -llapack -lblas -lm -Wl,-rpath,/home/balay/soft/mpich2-1.5/lib >>> -L/home/balay/soft/mpich2-1.5/lib >>> -Wl,-rpath,/usr/lib/gcc/x86_64-redhat-linux/4.7.2 >>> -L/usr/lib/gcc/x86_64-redhat-linux/4.7.2 -lmpichf90 -lgfortran -lm >>> -lgfortran -lm -lquadmath -lm -lmpichcxx -lstdc++ -ldl -lmpich -lopa -lmpl >>> -lrt -lgcc_s -ldl >>> /usr/bin/rm -f petscDMTest_v2.o >>> asterix:/home/balay/download-pine>./petscDMTest_v2 >>> [0]PETSC ERROR: --------------------- Error Message >>> ------------------------------------ >>> [0]PETSC ERROR: No support for this operation for this object type! >>> [0]PETSC ERROR: Interpolation (creation of faces and edges) is not yet >>> supported.! >>> [0]PETSC ERROR: >>> ------------------------------------------------------------------------ >>> [0]PETSC ERROR: Petsc Release Version 3.3.0, Patch 6, unknown >>> [0]PETSC ERROR: See docs/changes/index.html for recent updates. >>> [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. >>> [0]PETSC ERROR: See docs/index.html for manual pages. >>> [0]PETSC ERROR: >>> ------------------------------------------------------------------------ >>> [0]PETSC ERROR: ./petscDMTest_v2 on a asterix64 named asterix by balay >>> Sun Mar 3 00:21:29 2013 >>> [0]PETSC ERROR: Libraries linked from >>> /home/balay/petsc-dist-test/asterix64-sieve/lib >>> [0]PETSC ERROR: Configure run at Sun Mar 3 00:15:25 2013 >>> [0]PETSC ERROR: Configure options >>> --with-mpi-dir=/home/balay/soft/linux64/mpich2-1.1 >>> --with-shared-libraries=1 --with-clanguage=cxx --with-sieve=1 >>> PETSC_ARCH=asterix64-sieve --with-boost=1 >>> [0]PETSC ERROR: >>> ------------------------------------------------------------------------ >>> [0]PETSC ERROR: DMMeshCreateMeshFromAdjacency() line 312 in >>> /home/balay/petsc-dist-test/src/dm/impls/mesh/meshcreate.c >>> Surcessfully Loaded mesh into DM >>> asterix:/home/balay/download-pine> >>> >>> >>> >>> >>> >>> On Sat, 2 Mar 2013, Satish Balay wrote: >>> >>> > Fortran compiler doesn't care about presence or absence of interface >>> > defintions. If they exist - then it does extra prototype checks. If >>> > they don't exist - it assumes f77 and chugs along]. >>> > >>> > Did you build petsc with sieve [and cxx]? send make.log for this >>> > petsc build. Also what do you get for: >>> > >>> > nm -Ao libpetsc.a |grep -i DMMeshCreateMeshFromAdjacency >>> > >>> > You can followup this issue [with logs] on petsc-maint. >>> > >>> > Satish >>> > >>> > >>> > On Sat, 2 Mar 2013, Dharmendar Reddy wrote: >>> > >>> > > As you said, I do not need, PETSC_USE_FORTRAN_INTERFACES. The >>> interface to >>> > > dmmeshcreatefromadjacency is not defined in >>> > > >>> > > finclude/ftn-custom/petscdmmesh.h90 >>> > > >>> > > it is only defined in >>> > > >>> > > finclude/ftn-auto/petscdmmesh.h90 >>> > > >>> > > >>> > > On Sat, Mar 2, 2013 at 7:51 PM, Dharmendar Reddy < >>> dharmareddy84 at gmail.com>wrote: >>> > > >>> > > > Hello, >>> > > > Sorry, I was going to create a test case. Anyways here is >>> the >>> > > > error message >>> > > > >>> > > > petscDMTest_v2.o: In function `MAIN__': >>> > > > petscDMTest_v2.F90:(.text+0x354): undefined reference to >>> > > > `dmmeshcreatemeshfromad >>> > > > jacency_' >>> > > > make: [testDMMesh] Error 1 (ignored) >>> > > > >>> > > > I have attached a test case and makefile. make all should gen >>> rate the >>> > > > executable. >>> > > > >>> > > > Thanks >>> > > > Reddy >>> > > > >>> > > > >>> > > > On Sat, Mar 2, 2013 at 7:10 PM, Satish Balay >>> wrote: >>> > > > >>> > > >> On Sat, 2 Mar 2013, Dharmendar Reddy wrote: >>> > > >> >>> > > >> > Hello, >>> > > >> > I am trying to use DMMeshCreateMeshFromAdjacency in a >>> Fortran >>> > > >> code. >>> > > >> > I get undefined reference error. >>> > > >> >>> > > >> What error? please copy/paste >>> > > >> >>> > > >> > I include the following file in my program >>> > > >> > #include "finclude/petsc.h90" >>> > > >> > >>> > > >> > I see that fortran interface to DMMeshCreateMeshFromAdjacency >>> is defined >>> > > >> > only in >>> > > >> > >>> > > >> > finclude/ftn-auto/petscdmmesh.h90 >>> > > >> > >>> > > >> > I am not able to figure out if PETSC_USE_FORTRAN_INTERFACES is >>> defined. >>> > > >> I >>> > > >> > did not compile the code. I am runing the code on TACC >>> stampede. I tried >>> > > >> > adding >>> > > >> > >>> > > >> > #define PETSC_USE_FORTRAN_INTERFACES 1 >>> > > >> > in my program before the petsc inlcude line but i still get >>> error. >>> > > >> >>> > > >> 1. again 'get error' doesn't tell us anything. >>> > > >> >>> > > >> And you shouldn't need PETSC_USE_FORTRAN_INTERFACES to use >>> > > >> DMMeshCreateMeshFromAdjacency >>> > > >> >>> > > >> Satish >>> > > >> >>> > > >> > >>> > > >> > >>> > > >> > Thanks >>> > > >> > Reddy >>> > > >> > >>> > > >> > >>> > > >> >>> > > >> >>> > > > >>> > > > >>> > > > -- >>> > > > ----------------------------------------------------- >>> > > > Dharmendar Reddy Palle >>> > > > Graduate Student >>> > > > Microelectronics Research center, >>> > > > University of Texas at Austin, >>> > > > 10100 Burnet Road, Bldg. 160 >>> > > > MER 2.608F, TX 78758-4445 >>> > > > e-mail: dharmareddy84 at gmail.com >>> > > > Phone: +1-512-350-9082 >>> > > > United States of America. >>> > > > Homepage: https://webspace.utexas.edu/~dpr342 >>> > > > >>> > > >>> > > >>> > > >>> > > >>> > >>> > >>> >>> >> >> >> -- >> ----------------------------------------------------- >> Dharmendar Reddy Palle >> Graduate Student >> Microelectronics Research center, >> University of Texas at Austin, >> 10100 Burnet Road, Bldg. 160 >> MER 2.608F, TX 78758-4445 >> e-mail: dharmareddy84 at gmail.com >> Phone: +1-512-350-9082 >> United States of America. >> Homepage: https://webspace.utexas.edu/~dpr342 >> > > > > -- > What most experimenters take for granted before they begin their > experiments is infinitely more interesting than any results to which their > experiments lead. > -- Norbert Wiener > -- ----------------------------------------------------- Dharmendar Reddy Palle Graduate Student Microelectronics Research center, University of Texas at Austin, 10100 Burnet Road, Bldg. 160 MER 2.608F, TX 78758-4445 e-mail: dharmareddy84 at gmail.com Phone: +1-512-350-9082 United States of America. Homepage: https://webspace.utexas.edu/~dpr342 -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Sun Mar 3 15:44:45 2013 From: knepley at gmail.com (Matthew Knepley) Date: Sun, 3 Mar 2013 16:44:45 -0500 Subject: [petsc-users] DMMeshCreateMeshFromAdjacency In-Reply-To: References: Message-ID: On Sun, Mar 3, 2013 at 3:48 PM, Dharmendar Reddy wrote: > So i should use petsc-dev ? I will try that. > > I there any way i can have access to submesh? Consider a this scenario. > I have a two dimensional mesh in a rectangle with a uniform deltaX and > deltaY gridding. Is there any way i can get submesh at say x = (i-1)*deltaX > where say i = 1 to N. The dofs on the submesh will should be mapped to > dofs on the original mesh. The submesh in this case will be a 1D mesh > along y-axis. > 1) If you have a Cartesian mesh, use DMDA. This is no point in an unstructured mesh. 2) Yes, you can extract a submesh based upon labeled vertices using DMPlexCreateSubmesh(). It will have a map between points in the submesh and original mesh. > I can create each DM with input celllist and create maps after that but i > am wondering if this can be done via DMgetsubDM kind of call ? > Matt > Thanks > Reddy > > On Sun, Mar 3, 2013 at 2:11 PM, Matthew Knepley wrote: > >> On Sun, Mar 3, 2013 at 2:37 PM, Dharmendar Reddy > > wrote: >> >>> Hello, >>> >>> Thanks. I will have the code compiled with-cxx and with-sieve. >>> The error is understandable when i look at the following line from >>> meshcreate.c >>> >>> 312: if (interpolate) {SETERRQ (comm, PETSC_ERR_SUP, "Interpolation (creation of faces and edges) is not yet supported.");} >>> >>> >>> >>> Any idea if this feature will be implimented? I am trying to import mesh from gmsh. >>> I have a Fortran code which will genrate list for faces and edges for a given mesh. >>> >>> >>> Is there a DMMEsh interface through which i can input list of edges and faces ? >>> >>> >> DMMesh was an initial implementation of these ideas, but did not >> interface well with >> solvers, so it has been rewritten in C as DMPlex. The interface is almost >> exactly the >> same, and if you want increased functionality I would encourage you to >> switch. For >> example, DMMeshCreateMeshFromAdjacency() becomes >> >> DMPlexCreateFromCellList() >> >> and you can follow this with >> >> DMInterpolate() >> >> to automatically create the edges and faces. >> >> Thanks, >> >> Matt >> >> >>> Thanks >>> Reddy >>> >>> >>> >>> On Sun, Mar 3, 2013 at 12:23 AM, Satish Balay wrote: >>> >>>> BTW: I don't get compile errors with this code using petsc-3.3 built >>>> with: >>>> >>>> --with-clanguage=cxx --with-sieve=1 --with-boost=1 >>>> >>>> [the code fails to run though..] >>>> >>>> Satish >>>> >>>> --------- >>>> >>>> asterix:/home/balay/download-pine>make >>>> PETSC_DIR=/home/balay/petsc-dist-test PETSC_ARCH=asterix64-sieve >>>> petscDMTest_v2 >>>> /home/balay/soft/linux64/mpich2-1.1/bin/mpif90 -c -fPIC -Wall >>>> -Wno-unused-variable -Wno-unused-dummy-argument -g >>>> -I/home/balay/petsc-dist-test/include >>>> -I/home/balay/petsc-dist-test/asterix64-sieve/include >>>> -I/home/balay/petsc-dist-test/include/sieve >>>> -I/home/balay/soft/linux64/mpich2-1.1/include >>>> -I/home/balay/soft/mpich2-1.5/include -o petscDMTest_v2.o >>>> petscDMTest_v2.F90 >>>> /home/balay/soft/linux64/mpich2-1.1/bin/mpif90 -fPIC -Wall >>>> -Wno-unused-variable -Wno-unused-dummy-argument -g -o petscDMTest_v2 >>>> petscDMTest_v2.o >>>> -Wl,-rpath,/home/balay/petsc-dist-test/asterix64-sieve/lib >>>> -L/home/balay/petsc-dist-test/asterix64-sieve/lib -lpetsc -lX11 -lpthread >>>> -llapack -lblas -lm -Wl,-rpath,/home/balay/soft/mpich2-1.5/lib >>>> -L/home/balay/soft/mpich2-1.5/lib >>>> -Wl,-rpath,/usr/lib/gcc/x86_64-redhat-linux/4.7.2 >>>> -L/usr/lib/gcc/x86_64-redhat-linux/4.7.2 -lmpichf90 -lgfortran -lm >>>> -lgfortran -lm -lquadmath -lm -lmpichcxx -lstdc++ -ldl -lmpich -lopa -lmpl >>>> -lrt -lgcc_s -ldl >>>> /usr/bin/rm -f petscDMTest_v2.o >>>> asterix:/home/balay/download-pine>./petscDMTest_v2 >>>> [0]PETSC ERROR: --------------------- Error Message >>>> ------------------------------------ >>>> [0]PETSC ERROR: No support for this operation for this object type! >>>> [0]PETSC ERROR: Interpolation (creation of faces and edges) is not yet >>>> supported.! >>>> [0]PETSC ERROR: >>>> ------------------------------------------------------------------------ >>>> [0]PETSC ERROR: Petsc Release Version 3.3.0, Patch 6, unknown >>>> [0]PETSC ERROR: See docs/changes/index.html for recent updates. >>>> [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. >>>> [0]PETSC ERROR: See docs/index.html for manual pages. >>>> [0]PETSC ERROR: >>>> ------------------------------------------------------------------------ >>>> [0]PETSC ERROR: ./petscDMTest_v2 on a asterix64 named asterix by balay >>>> Sun Mar 3 00:21:29 2013 >>>> [0]PETSC ERROR: Libraries linked from >>>> /home/balay/petsc-dist-test/asterix64-sieve/lib >>>> [0]PETSC ERROR: Configure run at Sun Mar 3 00:15:25 2013 >>>> [0]PETSC ERROR: Configure options >>>> --with-mpi-dir=/home/balay/soft/linux64/mpich2-1.1 >>>> --with-shared-libraries=1 --with-clanguage=cxx --with-sieve=1 >>>> PETSC_ARCH=asterix64-sieve --with-boost=1 >>>> [0]PETSC ERROR: >>>> ------------------------------------------------------------------------ >>>> [0]PETSC ERROR: DMMeshCreateMeshFromAdjacency() line 312 in >>>> /home/balay/petsc-dist-test/src/dm/impls/mesh/meshcreate.c >>>> Surcessfully Loaded mesh into DM >>>> asterix:/home/balay/download-pine> >>>> >>>> >>>> >>>> >>>> >>>> On Sat, 2 Mar 2013, Satish Balay wrote: >>>> >>>> > Fortran compiler doesn't care about presence or absence of interface >>>> > defintions. If they exist - then it does extra prototype checks. If >>>> > they don't exist - it assumes f77 and chugs along]. >>>> > >>>> > Did you build petsc with sieve [and cxx]? send make.log for this >>>> > petsc build. Also what do you get for: >>>> > >>>> > nm -Ao libpetsc.a |grep -i DMMeshCreateMeshFromAdjacency >>>> > >>>> > You can followup this issue [with logs] on petsc-maint. >>>> > >>>> > Satish >>>> > >>>> > >>>> > On Sat, 2 Mar 2013, Dharmendar Reddy wrote: >>>> > >>>> > > As you said, I do not need, PETSC_USE_FORTRAN_INTERFACES. The >>>> interface to >>>> > > dmmeshcreatefromadjacency is not defined in >>>> > > >>>> > > finclude/ftn-custom/petscdmmesh.h90 >>>> > > >>>> > > it is only defined in >>>> > > >>>> > > finclude/ftn-auto/petscdmmesh.h90 >>>> > > >>>> > > >>>> > > On Sat, Mar 2, 2013 at 7:51 PM, Dharmendar Reddy < >>>> dharmareddy84 at gmail.com>wrote: >>>> > > >>>> > > > Hello, >>>> > > > Sorry, I was going to create a test case. Anyways here is >>>> the >>>> > > > error message >>>> > > > >>>> > > > petscDMTest_v2.o: In function `MAIN__': >>>> > > > petscDMTest_v2.F90:(.text+0x354): undefined reference to >>>> > > > `dmmeshcreatemeshfromad >>>> > > > jacency_' >>>> > > > make: [testDMMesh] Error 1 (ignored) >>>> > > > >>>> > > > I have attached a test case and makefile. make all should gen >>>> rate the >>>> > > > executable. >>>> > > > >>>> > > > Thanks >>>> > > > Reddy >>>> > > > >>>> > > > >>>> > > > On Sat, Mar 2, 2013 at 7:10 PM, Satish Balay >>>> wrote: >>>> > > > >>>> > > >> On Sat, 2 Mar 2013, Dharmendar Reddy wrote: >>>> > > >> >>>> > > >> > Hello, >>>> > > >> > I am trying to use DMMeshCreateMeshFromAdjacency in a >>>> Fortran >>>> > > >> code. >>>> > > >> > I get undefined reference error. >>>> > > >> >>>> > > >> What error? please copy/paste >>>> > > >> >>>> > > >> > I include the following file in my program >>>> > > >> > #include "finclude/petsc.h90" >>>> > > >> > >>>> > > >> > I see that fortran interface to DMMeshCreateMeshFromAdjacency >>>> is defined >>>> > > >> > only in >>>> > > >> > >>>> > > >> > finclude/ftn-auto/petscdmmesh.h90 >>>> > > >> > >>>> > > >> > I am not able to figure out if PETSC_USE_FORTRAN_INTERFACES is >>>> defined. >>>> > > >> I >>>> > > >> > did not compile the code. I am runing the code on TACC >>>> stampede. I tried >>>> > > >> > adding >>>> > > >> > >>>> > > >> > #define PETSC_USE_FORTRAN_INTERFACES 1 >>>> > > >> > in my program before the petsc inlcude line but i still get >>>> error. >>>> > > >> >>>> > > >> 1. again 'get error' doesn't tell us anything. >>>> > > >> >>>> > > >> And you shouldn't need PETSC_USE_FORTRAN_INTERFACES to use >>>> > > >> DMMeshCreateMeshFromAdjacency >>>> > > >> >>>> > > >> Satish >>>> > > >> >>>> > > >> > >>>> > > >> > >>>> > > >> > Thanks >>>> > > >> > Reddy >>>> > > >> > >>>> > > >> > >>>> > > >> >>>> > > >> >>>> > > > >>>> > > > >>>> > > > -- >>>> > > > ----------------------------------------------------- >>>> > > > Dharmendar Reddy Palle >>>> > > > Graduate Student >>>> > > > Microelectronics Research center, >>>> > > > University of Texas at Austin, >>>> > > > 10100 Burnet Road, Bldg. 160 >>>> > > > MER 2.608F, TX 78758-4445 >>>> > > > e-mail: dharmareddy84 at gmail.com >>>> > > > Phone: +1-512-350-9082 >>>> > > > United States of America. >>>> > > > Homepage: https://webspace.utexas.edu/~dpr342 >>>> > > > >>>> > > >>>> > > >>>> > > >>>> > > >>>> > >>>> > >>>> >>>> >>> >>> >>> -- >>> ----------------------------------------------------- >>> Dharmendar Reddy Palle >>> Graduate Student >>> Microelectronics Research center, >>> University of Texas at Austin, >>> 10100 Burnet Road, Bldg. 160 >>> MER 2.608F, TX 78758-4445 >>> e-mail: dharmareddy84 at gmail.com >>> Phone: +1-512-350-9082 >>> United States of America. >>> Homepage: https://webspace.utexas.edu/~dpr342 >>> >> >> >> >> -- >> What most experimenters take for granted before they begin their >> experiments is infinitely more interesting than any results to which their >> experiments lead. >> -- Norbert Wiener >> > > > > -- > ----------------------------------------------------- > Dharmendar Reddy Palle > Graduate Student > Microelectronics Research center, > University of Texas at Austin, > 10100 Burnet Road, Bldg. 160 > MER 2.608F, TX 78758-4445 > e-mail: dharmareddy84 at gmail.com > Phone: +1-512-350-9082 > United States of America. > Homepage: https://webspace.utexas.edu/~dpr342 > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From dharmareddy84 at gmail.com Sun Mar 3 16:04:50 2013 From: dharmareddy84 at gmail.com (Dharmendar Reddy) Date: Sun, 3 Mar 2013 16:04:50 -0600 Subject: [petsc-users] DMMeshCreateMeshFromAdjacency In-Reply-To: References: Message-ID: Hello, We use cratisian mesh for certain problems only. The user gives the mesh file as one of the inputs. I do not know a-priori what mesh is created. On a related note, I am solving a system of equations where i need to use a fine cartisian mesh for one equation (Schrodinger) but i would prefer a coarse traiangular or tetrahedral element mesh for another eqaution(Poisson). Is there an interface to interpolate data from one mesh to another? If i create a DM with a coarse mesh, Can i give the mesh a set of vertices such that after re meshing the DM has the given vertices as mesh nodes ? I tried using the gmsh to create a mesh with give set of vertices inside a region but had no success. Thanks Reddy On Sun, Mar 3, 2013 at 3:44 PM, Matthew Knepley wrote: > On Sun, Mar 3, 2013 at 3:48 PM, Dharmendar Reddy wrote: > >> So i should use petsc-dev ? I will try that. >> >> I there any way i can have access to submesh? Consider a this scenario. >> I have a two dimensional mesh in a rectangle with a uniform deltaX and >> deltaY gridding. Is there any way i can get submesh at say x = (i-1)*deltaX >> where say i = 1 to N. The dofs on the submesh will should be mapped to >> dofs on the original mesh. The submesh in this case will be a 1D mesh >> along y-axis. >> > > 1) If you have a Cartesian mesh, use DMDA. This is no point in an > unstructured mesh. > > 2) Yes, you can extract a submesh based upon labeled vertices using > DMPlexCreateSubmesh(). It will have > a map between points in the submesh and original mesh. > > >> I can create each DM with input celllist and create maps after that but i >> am wondering if this can be done via DMgetsubDM kind of call ? >> > > Matt > > >> Thanks >> Reddy >> >> On Sun, Mar 3, 2013 at 2:11 PM, Matthew Knepley wrote: >> >>> On Sun, Mar 3, 2013 at 2:37 PM, Dharmendar Reddy < >>> dharmareddy84 at gmail.com> wrote: >>> >>>> Hello, >>>> >>>> Thanks. I will have the code compiled with-cxx and with-sieve. >>>> The error is understandable when i look at the following line from >>>> meshcreate.c >>>> >>>> 312: if (interpolate) {SETERRQ (comm, PETSC_ERR_SUP, "Interpolation (creation of faces and edges) is not yet supported.");} >>>> >>>> >>>> >>>> >>>> Any idea if this feature will be implimented? I am trying to import mesh from gmsh. >>>> I have a Fortran code which will genrate list for faces and edges for a given mesh. >>>> >>>> >>>> >>>> Is there a DMMEsh interface through which i can input list of edges and faces ? >>>> >>>> >>> DMMesh was an initial implementation of these ideas, but did not >>> interface well with >>> solvers, so it has been rewritten in C as DMPlex. The interface is >>> almost exactly the >>> same, and if you want increased functionality I would encourage you to >>> switch. For >>> example, DMMeshCreateMeshFromAdjacency() becomes >>> >>> DMPlexCreateFromCellList() >>> >>> and you can follow this with >>> >>> DMInterpolate() >>> >>> to automatically create the edges and faces. >>> >>> Thanks, >>> >>> Matt >>> >>> >>>> Thanks >>>> Reddy >>>> >>>> >>>> >>>> On Sun, Mar 3, 2013 at 12:23 AM, Satish Balay wrote: >>>> >>>>> BTW: I don't get compile errors with this code using petsc-3.3 built >>>>> with: >>>>> >>>>> --with-clanguage=cxx --with-sieve=1 --with-boost=1 >>>>> >>>>> [the code fails to run though..] >>>>> >>>>> Satish >>>>> >>>>> --------- >>>>> >>>>> asterix:/home/balay/download-pine>make >>>>> PETSC_DIR=/home/balay/petsc-dist-test PETSC_ARCH=asterix64-sieve >>>>> petscDMTest_v2 >>>>> /home/balay/soft/linux64/mpich2-1.1/bin/mpif90 -c -fPIC -Wall >>>>> -Wno-unused-variable -Wno-unused-dummy-argument -g >>>>> -I/home/balay/petsc-dist-test/include >>>>> -I/home/balay/petsc-dist-test/asterix64-sieve/include >>>>> -I/home/balay/petsc-dist-test/include/sieve >>>>> -I/home/balay/soft/linux64/mpich2-1.1/include >>>>> -I/home/balay/soft/mpich2-1.5/include -o petscDMTest_v2.o >>>>> petscDMTest_v2.F90 >>>>> /home/balay/soft/linux64/mpich2-1.1/bin/mpif90 -fPIC -Wall >>>>> -Wno-unused-variable -Wno-unused-dummy-argument -g -o petscDMTest_v2 >>>>> petscDMTest_v2.o >>>>> -Wl,-rpath,/home/balay/petsc-dist-test/asterix64-sieve/lib >>>>> -L/home/balay/petsc-dist-test/asterix64-sieve/lib -lpetsc -lX11 -lpthread >>>>> -llapack -lblas -lm -Wl,-rpath,/home/balay/soft/mpich2-1.5/lib >>>>> -L/home/balay/soft/mpich2-1.5/lib >>>>> -Wl,-rpath,/usr/lib/gcc/x86_64-redhat-linux/4.7.2 >>>>> -L/usr/lib/gcc/x86_64-redhat-linux/4.7.2 -lmpichf90 -lgfortran -lm >>>>> -lgfortran -lm -lquadmath -lm -lmpichcxx -lstdc++ -ldl -lmpich -lopa -lmpl >>>>> -lrt -lgcc_s -ldl >>>>> /usr/bin/rm -f petscDMTest_v2.o >>>>> asterix:/home/balay/download-pine>./petscDMTest_v2 >>>>> [0]PETSC ERROR: --------------------- Error Message >>>>> ------------------------------------ >>>>> [0]PETSC ERROR: No support for this operation for this object type! >>>>> [0]PETSC ERROR: Interpolation (creation of faces and edges) is not yet >>>>> supported.! >>>>> [0]PETSC ERROR: >>>>> ------------------------------------------------------------------------ >>>>> [0]PETSC ERROR: Petsc Release Version 3.3.0, Patch 6, unknown >>>>> [0]PETSC ERROR: See docs/changes/index.html for recent updates. >>>>> [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. >>>>> [0]PETSC ERROR: See docs/index.html for manual pages. >>>>> [0]PETSC ERROR: >>>>> ------------------------------------------------------------------------ >>>>> [0]PETSC ERROR: ./petscDMTest_v2 on a asterix64 named asterix by balay >>>>> Sun Mar 3 00:21:29 2013 >>>>> [0]PETSC ERROR: Libraries linked from >>>>> /home/balay/petsc-dist-test/asterix64-sieve/lib >>>>> [0]PETSC ERROR: Configure run at Sun Mar 3 00:15:25 2013 >>>>> [0]PETSC ERROR: Configure options >>>>> --with-mpi-dir=/home/balay/soft/linux64/mpich2-1.1 >>>>> --with-shared-libraries=1 --with-clanguage=cxx --with-sieve=1 >>>>> PETSC_ARCH=asterix64-sieve --with-boost=1 >>>>> [0]PETSC ERROR: >>>>> ------------------------------------------------------------------------ >>>>> [0]PETSC ERROR: DMMeshCreateMeshFromAdjacency() line 312 in >>>>> /home/balay/petsc-dist-test/src/dm/impls/mesh/meshcreate.c >>>>> Surcessfully Loaded mesh into DM >>>>> asterix:/home/balay/download-pine> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> On Sat, 2 Mar 2013, Satish Balay wrote: >>>>> >>>>> > Fortran compiler doesn't care about presence or absence of interface >>>>> > defintions. If they exist - then it does extra prototype checks. If >>>>> > they don't exist - it assumes f77 and chugs along]. >>>>> > >>>>> > Did you build petsc with sieve [and cxx]? send make.log for this >>>>> > petsc build. Also what do you get for: >>>>> > >>>>> > nm -Ao libpetsc.a |grep -i DMMeshCreateMeshFromAdjacency >>>>> > >>>>> > You can followup this issue [with logs] on petsc-maint. >>>>> > >>>>> > Satish >>>>> > >>>>> > >>>>> > On Sat, 2 Mar 2013, Dharmendar Reddy wrote: >>>>> > >>>>> > > As you said, I do not need, PETSC_USE_FORTRAN_INTERFACES. The >>>>> interface to >>>>> > > dmmeshcreatefromadjacency is not defined in >>>>> > > >>>>> > > finclude/ftn-custom/petscdmmesh.h90 >>>>> > > >>>>> > > it is only defined in >>>>> > > >>>>> > > finclude/ftn-auto/petscdmmesh.h90 >>>>> > > >>>>> > > >>>>> > > On Sat, Mar 2, 2013 at 7:51 PM, Dharmendar Reddy < >>>>> dharmareddy84 at gmail.com>wrote: >>>>> > > >>>>> > > > Hello, >>>>> > > > Sorry, I was going to create a test case. Anyways here >>>>> is the >>>>> > > > error message >>>>> > > > >>>>> > > > petscDMTest_v2.o: In function `MAIN__': >>>>> > > > petscDMTest_v2.F90:(.text+0x354): undefined reference to >>>>> > > > `dmmeshcreatemeshfromad >>>>> > > > jacency_' >>>>> > > > make: [testDMMesh] Error 1 (ignored) >>>>> > > > >>>>> > > > I have attached a test case and makefile. make all should gen >>>>> rate the >>>>> > > > executable. >>>>> > > > >>>>> > > > Thanks >>>>> > > > Reddy >>>>> > > > >>>>> > > > >>>>> > > > On Sat, Mar 2, 2013 at 7:10 PM, Satish Balay >>>>> wrote: >>>>> > > > >>>>> > > >> On Sat, 2 Mar 2013, Dharmendar Reddy wrote: >>>>> > > >> >>>>> > > >> > Hello, >>>>> > > >> > I am trying to use DMMeshCreateMeshFromAdjacency in a >>>>> Fortran >>>>> > > >> code. >>>>> > > >> > I get undefined reference error. >>>>> > > >> >>>>> > > >> What error? please copy/paste >>>>> > > >> >>>>> > > >> > I include the following file in my program >>>>> > > >> > #include "finclude/petsc.h90" >>>>> > > >> > >>>>> > > >> > I see that fortran interface to DMMeshCreateMeshFromAdjacency >>>>> is defined >>>>> > > >> > only in >>>>> > > >> > >>>>> > > >> > finclude/ftn-auto/petscdmmesh.h90 >>>>> > > >> > >>>>> > > >> > I am not able to figure out if PETSC_USE_FORTRAN_INTERFACES >>>>> is defined. >>>>> > > >> I >>>>> > > >> > did not compile the code. I am runing the code on TACC >>>>> stampede. I tried >>>>> > > >> > adding >>>>> > > >> > >>>>> > > >> > #define PETSC_USE_FORTRAN_INTERFACES 1 >>>>> > > >> > in my program before the petsc inlcude line but i still get >>>>> error. >>>>> > > >> >>>>> > > >> 1. again 'get error' doesn't tell us anything. >>>>> > > >> >>>>> > > >> And you shouldn't need PETSC_USE_FORTRAN_INTERFACES to use >>>>> > > >> DMMeshCreateMeshFromAdjacency >>>>> > > >> >>>>> > > >> Satish >>>>> > > >> >>>>> > > >> > >>>>> > > >> > >>>>> > > >> > Thanks >>>>> > > >> > Reddy >>>>> > > >> > >>>>> > > >> > >>>>> > > >> >>>>> > > >> >>>>> > > > >>>>> > > > >>>>> > > > -- >>>>> > > > ----------------------------------------------------- >>>>> > > > Dharmendar Reddy Palle >>>>> > > > Graduate Student >>>>> > > > Microelectronics Research center, >>>>> > > > University of Texas at Austin, >>>>> > > > 10100 Burnet Road, Bldg. 160 >>>>> > > > MER 2.608F, TX 78758-4445 >>>>> > > > e-mail: dharmareddy84 at gmail.com >>>>> > > > Phone: +1-512-350-9082 >>>>> > > > United States of America. >>>>> > > > Homepage: https://webspace.utexas.edu/~dpr342 >>>>> > > > >>>>> > > >>>>> > > >>>>> > > >>>>> > > >>>>> > >>>>> > >>>>> >>>>> >>>> >>>> >>>> -- >>>> ----------------------------------------------------- >>>> Dharmendar Reddy Palle >>>> Graduate Student >>>> Microelectronics Research center, >>>> University of Texas at Austin, >>>> 10100 Burnet Road, Bldg. 160 >>>> MER 2.608F, TX 78758-4445 >>>> e-mail: dharmareddy84 at gmail.com >>>> Phone: +1-512-350-9082 >>>> United States of America. >>>> Homepage: https://webspace.utexas.edu/~dpr342 >>>> >>> >>> >>> >>> -- >>> What most experimenters take for granted before they begin their >>> experiments is infinitely more interesting than any results to which their >>> experiments lead. >>> -- Norbert Wiener >>> >> >> >> >> -- >> ----------------------------------------------------- >> Dharmendar Reddy Palle >> Graduate Student >> Microelectronics Research center, >> University of Texas at Austin, >> 10100 Burnet Road, Bldg. 160 >> MER 2.608F, TX 78758-4445 >> e-mail: dharmareddy84 at gmail.com >> Phone: +1-512-350-9082 >> United States of America. >> Homepage: https://webspace.utexas.edu/~dpr342 >> > > > > -- > What most experimenters take for granted before they begin their > experiments is infinitely more interesting than any results to which their > experiments lead. > -- Norbert Wiener > -- ----------------------------------------------------- Dharmendar Reddy Palle Graduate Student Microelectronics Research center, University of Texas at Austin, 10100 Burnet Road, Bldg. 160 MER 2.608F, TX 78758-4445 e-mail: dharmareddy84 at gmail.com Phone: +1-512-350-9082 United States of America. Homepage: https://webspace.utexas.edu/~dpr342 -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Sun Mar 3 17:29:44 2013 From: knepley at gmail.com (Matthew Knepley) Date: Sun, 3 Mar 2013 18:29:44 -0500 Subject: [petsc-users] DMMeshCreateMeshFromAdjacency In-Reply-To: References: Message-ID: On Sun, Mar 3, 2013 at 5:04 PM, Dharmendar Reddy wrote: > Hello, > We use cratisian mesh for certain problems only. The user gives > the mesh file as one of the inputs. I do not know a-priori what mesh is > created. > > On a related note, I am solving a system of equations where i need to use > a fine cartisian mesh for one equation (Schrodinger) but i would prefer a > coarse traiangular or tetrahedral element mesh for another > eqaution(Poisson). Is there an interface to interpolate data from one mesh > to another? > There is an interface, which is just a Mat, but there is no infrastructure for calculating it. > If i create a DM with a coarse mesh, Can i give the mesh a set of vertices > such that after re meshing the DM has the given vertices as mesh nodes ? I > tried using the gmsh to create a mesh with give set of vertices inside a > region but had no success. > I do not understand the question. Thanks, Matt > Thanks > Reddy > > On Sun, Mar 3, 2013 at 3:44 PM, Matthew Knepley wrote: > >> On Sun, Mar 3, 2013 at 3:48 PM, Dharmendar Reddy > > wrote: >> >>> So i should use petsc-dev ? I will try that. >>> >>> I there any way i can have access to submesh? Consider a this scenario. >>> I have a two dimensional mesh in a rectangle with a uniform deltaX and >>> deltaY gridding. Is there any way i can get submesh at say x = (i-1)*deltaX >>> where say i = 1 to N. The dofs on the submesh will should be mapped to >>> dofs on the original mesh. The submesh in this case will be a 1D mesh >>> along y-axis. >>> >> >> 1) If you have a Cartesian mesh, use DMDA. This is no point in an >> unstructured mesh. >> >> 2) Yes, you can extract a submesh based upon labeled vertices using >> DMPlexCreateSubmesh(). It will have >> a map between points in the submesh and original mesh. >> >> >>> I can create each DM with input celllist and create maps after that but >>> i am wondering if this can be done via DMgetsubDM kind of call ? >>> >> >> Matt >> >> >>> Thanks >>> Reddy >>> >>> On Sun, Mar 3, 2013 at 2:11 PM, Matthew Knepley wrote: >>> >>>> On Sun, Mar 3, 2013 at 2:37 PM, Dharmendar Reddy < >>>> dharmareddy84 at gmail.com> wrote: >>>> >>>>> Hello, >>>>> >>>>> Thanks. I will have the code compiled with-cxx and with-sieve. >>>>> The error is understandable when i look at the following line from >>>>> meshcreate.c >>>>> >>>>> 312: if (interpolate) {SETERRQ (comm, PETSC_ERR_SUP, "Interpolation (creation of faces and edges) is not yet supported.");} >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> Any idea if this feature will be implimented? I am trying to import mesh from gmsh. >>>>> I have a Fortran code which will genrate list for faces and edges for a given mesh. >>>>> >>>>> >>>>> >>>>> >>>>> Is there a DMMEsh interface through which i can input list of edges and faces ? >>>>> >>>>> >>>> DMMesh was an initial implementation of these ideas, but did not >>>> interface well with >>>> solvers, so it has been rewritten in C as DMPlex. The interface is >>>> almost exactly the >>>> same, and if you want increased functionality I would encourage you to >>>> switch. For >>>> example, DMMeshCreateMeshFromAdjacency() becomes >>>> >>>> DMPlexCreateFromCellList() >>>> >>>> and you can follow this with >>>> >>>> DMInterpolate() >>>> >>>> to automatically create the edges and faces. >>>> >>>> Thanks, >>>> >>>> Matt >>>> >>>> >>>>> Thanks >>>>> Reddy >>>>> >>>>> >>>>> >>>>> On Sun, Mar 3, 2013 at 12:23 AM, Satish Balay wrote: >>>>> >>>>>> BTW: I don't get compile errors with this code using petsc-3.3 built >>>>>> with: >>>>>> >>>>>> --with-clanguage=cxx --with-sieve=1 --with-boost=1 >>>>>> >>>>>> [the code fails to run though..] >>>>>> >>>>>> Satish >>>>>> >>>>>> --------- >>>>>> >>>>>> asterix:/home/balay/download-pine>make >>>>>> PETSC_DIR=/home/balay/petsc-dist-test PETSC_ARCH=asterix64-sieve >>>>>> petscDMTest_v2 >>>>>> /home/balay/soft/linux64/mpich2-1.1/bin/mpif90 -c -fPIC -Wall >>>>>> -Wno-unused-variable -Wno-unused-dummy-argument -g >>>>>> -I/home/balay/petsc-dist-test/include >>>>>> -I/home/balay/petsc-dist-test/asterix64-sieve/include >>>>>> -I/home/balay/petsc-dist-test/include/sieve >>>>>> -I/home/balay/soft/linux64/mpich2-1.1/include >>>>>> -I/home/balay/soft/mpich2-1.5/include -o petscDMTest_v2.o >>>>>> petscDMTest_v2.F90 >>>>>> /home/balay/soft/linux64/mpich2-1.1/bin/mpif90 -fPIC -Wall >>>>>> -Wno-unused-variable -Wno-unused-dummy-argument -g -o petscDMTest_v2 >>>>>> petscDMTest_v2.o >>>>>> -Wl,-rpath,/home/balay/petsc-dist-test/asterix64-sieve/lib >>>>>> -L/home/balay/petsc-dist-test/asterix64-sieve/lib -lpetsc -lX11 -lpthread >>>>>> -llapack -lblas -lm -Wl,-rpath,/home/balay/soft/mpich2-1.5/lib >>>>>> -L/home/balay/soft/mpich2-1.5/lib >>>>>> -Wl,-rpath,/usr/lib/gcc/x86_64-redhat-linux/4.7.2 >>>>>> -L/usr/lib/gcc/x86_64-redhat-linux/4.7.2 -lmpichf90 -lgfortran -lm >>>>>> -lgfortran -lm -lquadmath -lm -lmpichcxx -lstdc++ -ldl -lmpich -lopa -lmpl >>>>>> -lrt -lgcc_s -ldl >>>>>> /usr/bin/rm -f petscDMTest_v2.o >>>>>> asterix:/home/balay/download-pine>./petscDMTest_v2 >>>>>> [0]PETSC ERROR: --------------------- Error Message >>>>>> ------------------------------------ >>>>>> [0]PETSC ERROR: No support for this operation for this object type! >>>>>> [0]PETSC ERROR: Interpolation (creation of faces and edges) is not >>>>>> yet supported.! >>>>>> [0]PETSC ERROR: >>>>>> ------------------------------------------------------------------------ >>>>>> [0]PETSC ERROR: Petsc Release Version 3.3.0, Patch 6, unknown >>>>>> [0]PETSC ERROR: See docs/changes/index.html for recent updates. >>>>>> [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. >>>>>> [0]PETSC ERROR: See docs/index.html for manual pages. >>>>>> [0]PETSC ERROR: >>>>>> ------------------------------------------------------------------------ >>>>>> [0]PETSC ERROR: ./petscDMTest_v2 on a asterix64 named asterix by >>>>>> balay Sun Mar 3 00:21:29 2013 >>>>>> [0]PETSC ERROR: Libraries linked from >>>>>> /home/balay/petsc-dist-test/asterix64-sieve/lib >>>>>> [0]PETSC ERROR: Configure run at Sun Mar 3 00:15:25 2013 >>>>>> [0]PETSC ERROR: Configure options >>>>>> --with-mpi-dir=/home/balay/soft/linux64/mpich2-1.1 >>>>>> --with-shared-libraries=1 --with-clanguage=cxx --with-sieve=1 >>>>>> PETSC_ARCH=asterix64-sieve --with-boost=1 >>>>>> [0]PETSC ERROR: >>>>>> ------------------------------------------------------------------------ >>>>>> [0]PETSC ERROR: DMMeshCreateMeshFromAdjacency() line 312 in >>>>>> /home/balay/petsc-dist-test/src/dm/impls/mesh/meshcreate.c >>>>>> Surcessfully Loaded mesh into DM >>>>>> asterix:/home/balay/download-pine> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> On Sat, 2 Mar 2013, Satish Balay wrote: >>>>>> >>>>>> > Fortran compiler doesn't care about presence or absence of interface >>>>>> > defintions. If they exist - then it does extra prototype checks. If >>>>>> > they don't exist - it assumes f77 and chugs along]. >>>>>> > >>>>>> > Did you build petsc with sieve [and cxx]? send make.log for this >>>>>> > petsc build. Also what do you get for: >>>>>> > >>>>>> > nm -Ao libpetsc.a |grep -i DMMeshCreateMeshFromAdjacency >>>>>> > >>>>>> > You can followup this issue [with logs] on petsc-maint. >>>>>> > >>>>>> > Satish >>>>>> > >>>>>> > >>>>>> > On Sat, 2 Mar 2013, Dharmendar Reddy wrote: >>>>>> > >>>>>> > > As you said, I do not need, PETSC_USE_FORTRAN_INTERFACES. The >>>>>> interface to >>>>>> > > dmmeshcreatefromadjacency is not defined in >>>>>> > > >>>>>> > > finclude/ftn-custom/petscdmmesh.h90 >>>>>> > > >>>>>> > > it is only defined in >>>>>> > > >>>>>> > > finclude/ftn-auto/petscdmmesh.h90 >>>>>> > > >>>>>> > > >>>>>> > > On Sat, Mar 2, 2013 at 7:51 PM, Dharmendar Reddy < >>>>>> dharmareddy84 at gmail.com>wrote: >>>>>> > > >>>>>> > > > Hello, >>>>>> > > > Sorry, I was going to create a test case. Anyways here >>>>>> is the >>>>>> > > > error message >>>>>> > > > >>>>>> > > > petscDMTest_v2.o: In function `MAIN__': >>>>>> > > > petscDMTest_v2.F90:(.text+0x354): undefined reference to >>>>>> > > > `dmmeshcreatemeshfromad >>>>>> > > > jacency_' >>>>>> > > > make: [testDMMesh] Error 1 (ignored) >>>>>> > > > >>>>>> > > > I have attached a test case and makefile. make all should gen >>>>>> rate the >>>>>> > > > executable. >>>>>> > > > >>>>>> > > > Thanks >>>>>> > > > Reddy >>>>>> > > > >>>>>> > > > >>>>>> > > > On Sat, Mar 2, 2013 at 7:10 PM, Satish Balay >>>>>> wrote: >>>>>> > > > >>>>>> > > >> On Sat, 2 Mar 2013, Dharmendar Reddy wrote: >>>>>> > > >> >>>>>> > > >> > Hello, >>>>>> > > >> > I am trying to use DMMeshCreateMeshFromAdjacency in >>>>>> a Fortran >>>>>> > > >> code. >>>>>> > > >> > I get undefined reference error. >>>>>> > > >> >>>>>> > > >> What error? please copy/paste >>>>>> > > >> >>>>>> > > >> > I include the following file in my program >>>>>> > > >> > #include "finclude/petsc.h90" >>>>>> > > >> > >>>>>> > > >> > I see that fortran interface to >>>>>> DMMeshCreateMeshFromAdjacency is defined >>>>>> > > >> > only in >>>>>> > > >> > >>>>>> > > >> > finclude/ftn-auto/petscdmmesh.h90 >>>>>> > > >> > >>>>>> > > >> > I am not able to figure out if PETSC_USE_FORTRAN_INTERFACES >>>>>> is defined. >>>>>> > > >> I >>>>>> > > >> > did not compile the code. I am runing the code on TACC >>>>>> stampede. I tried >>>>>> > > >> > adding >>>>>> > > >> > >>>>>> > > >> > #define PETSC_USE_FORTRAN_INTERFACES 1 >>>>>> > > >> > in my program before the petsc inlcude line but i still get >>>>>> error. >>>>>> > > >> >>>>>> > > >> 1. again 'get error' doesn't tell us anything. >>>>>> > > >> >>>>>> > > >> And you shouldn't need PETSC_USE_FORTRAN_INTERFACES to use >>>>>> > > >> DMMeshCreateMeshFromAdjacency >>>>>> > > >> >>>>>> > > >> Satish >>>>>> > > >> >>>>>> > > >> > >>>>>> > > >> > >>>>>> > > >> > Thanks >>>>>> > > >> > Reddy >>>>>> > > >> > >>>>>> > > >> > >>>>>> > > >> >>>>>> > > >> >>>>>> > > > >>>>>> > > > >>>>>> > > > -- >>>>>> > > > ----------------------------------------------------- >>>>>> > > > Dharmendar Reddy Palle >>>>>> > > > Graduate Student >>>>>> > > > Microelectronics Research center, >>>>>> > > > University of Texas at Austin, >>>>>> > > > 10100 Burnet Road, Bldg. 160 >>>>>> > > > MER 2.608F, TX 78758-4445 >>>>>> > > > e-mail: dharmareddy84 at gmail.com >>>>>> > > > Phone: +1-512-350-9082 >>>>>> > > > United States of America. >>>>>> > > > Homepage: https://webspace.utexas.edu/~dpr342 >>>>>> > > > >>>>>> > > >>>>>> > > >>>>>> > > >>>>>> > > >>>>>> > >>>>>> > >>>>>> >>>>>> >>>>> >>>>> >>>>> -- >>>>> ----------------------------------------------------- >>>>> Dharmendar Reddy Palle >>>>> Graduate Student >>>>> Microelectronics Research center, >>>>> University of Texas at Austin, >>>>> 10100 Burnet Road, Bldg. 160 >>>>> MER 2.608F, TX 78758-4445 >>>>> e-mail: dharmareddy84 at gmail.com >>>>> Phone: +1-512-350-9082 >>>>> United States of America. >>>>> Homepage: https://webspace.utexas.edu/~dpr342 >>>>> >>>> >>>> >>>> >>>> -- >>>> What most experimenters take for granted before they begin their >>>> experiments is infinitely more interesting than any results to which their >>>> experiments lead. >>>> -- Norbert Wiener >>>> >>> >>> >>> >>> -- >>> ----------------------------------------------------- >>> Dharmendar Reddy Palle >>> Graduate Student >>> Microelectronics Research center, >>> University of Texas at Austin, >>> 10100 Burnet Road, Bldg. 160 >>> MER 2.608F, TX 78758-4445 >>> e-mail: dharmareddy84 at gmail.com >>> Phone: +1-512-350-9082 >>> United States of America. >>> Homepage: https://webspace.utexas.edu/~dpr342 >>> >> >> >> >> -- >> What most experimenters take for granted before they begin their >> experiments is infinitely more interesting than any results to which their >> experiments lead. >> -- Norbert Wiener >> > > > > -- > ----------------------------------------------------- > Dharmendar Reddy Palle > Graduate Student > Microelectronics Research center, > University of Texas at Austin, > 10100 Burnet Road, Bldg. 160 > MER 2.608F, TX 78758-4445 > e-mail: dharmareddy84 at gmail.com > Phone: +1-512-350-9082 > United States of America. > Homepage: https://webspace.utexas.edu/~dpr342 > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From dharmareddy84 at gmail.com Sun Mar 3 17:41:09 2013 From: dharmareddy84 at gmail.com (Dharmendar Reddy) Date: Sun, 3 Mar 2013 17:41:09 -0600 Subject: [petsc-users] DMMeshCreateMeshFromAdjacency In-Reply-To: References: Message-ID: Let say I create triangular mesh in a square: (0,0) (0,1) (1,1) (0,1) I want (0,0.25) and (0.25,0) to be among the mesh nodes. It can have other nodes. On Sun, Mar 3, 2013 at 5:29 PM, Matthew Knepley wrote: > On Sun, Mar 3, 2013 at 5:04 PM, Dharmendar Reddy wrote: > >> Hello, >> >> We use cratisian mesh for certain problems only. The user gives >> the mesh file as one of the inputs. I do not know a-priori what mesh is >> created. >> >> On a related note, I am solving a system of equations where i need to use >> a fine cartisian mesh for one equation (Schrodinger) but i would prefer a >> coarse traiangular or tetrahedral element mesh for another >> eqaution(Poisson). Is there an interface to interpolate data from one mesh >> to another? >> > > There is an interface, which is just a Mat, but there is no infrastructure > for calculating it. > > >> If i create a DM with a coarse mesh, Can i give the mesh a set of >> vertices such that after re meshing the DM has the given vertices as mesh >> nodes ? I tried using the gmsh to create a mesh with give set of vertices >> inside a region but had no success. >> > > I do not understand the question. > > Thanks, > > Matt > > >> Thanks >> Reddy >> >> On Sun, Mar 3, 2013 at 3:44 PM, Matthew Knepley wrote: >> >>> On Sun, Mar 3, 2013 at 3:48 PM, Dharmendar Reddy < >>> dharmareddy84 at gmail.com> wrote: >>> >>>> So i should use petsc-dev ? I will try that. >>>> >>>> I there any way i can have access to submesh? Consider a this scenario. >>>> I have a two dimensional mesh in a rectangle with a uniform deltaX and >>>> deltaY gridding. Is there any way i can get submesh at say x = (i-1)*deltaX >>>> where say i = 1 to N. The dofs on the submesh will should be mapped to >>>> dofs on the original mesh. The submesh in this case will be a 1D mesh >>>> along y-axis. >>>> >>> >>> 1) If you have a Cartesian mesh, use DMDA. This is no point in an >>> unstructured mesh. >>> >>> 2) Yes, you can extract a submesh based upon labeled vertices using >>> DMPlexCreateSubmesh(). It will have >>> a map between points in the submesh and original mesh. >>> >>> >>>> I can create each DM with input celllist and create maps after that but >>>> i am wondering if this can be done via DMgetsubDM kind of call ? >>>> >>> >>> Matt >>> >>> >>>> Thanks >>>> Reddy >>>> >>>> On Sun, Mar 3, 2013 at 2:11 PM, Matthew Knepley wrote: >>>> >>>>> On Sun, Mar 3, 2013 at 2:37 PM, Dharmendar Reddy < >>>>> dharmareddy84 at gmail.com> wrote: >>>>> >>>>>> Hello, >>>>>> >>>>>> Thanks. I will have the code compiled with-cxx and >>>>>> with-sieve. >>>>>> The error is understandable when i look at the following line from >>>>>> meshcreate.c >>>>>> >>>>>> 312: if (interpolate) {SETERRQ (comm, PETSC_ERR_SUP, "Interpolation (creation of faces and edges) is not yet supported.");} >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> Any idea if this feature will be implimented? I am trying to import mesh from gmsh. >>>>>> I have a Fortran code which will genrate list for faces and edges for a given mesh. >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> Is there a DMMEsh interface through which i can input list of edges and faces ? >>>>>> >>>>>> >>>>> DMMesh was an initial implementation of these ideas, but did not >>>>> interface well with >>>>> solvers, so it has been rewritten in C as DMPlex. The interface is >>>>> almost exactly the >>>>> same, and if you want increased functionality I would encourage you to >>>>> switch. For >>>>> example, DMMeshCreateMeshFromAdjacency() becomes >>>>> >>>>> DMPlexCreateFromCellList() >>>>> >>>>> and you can follow this with >>>>> >>>>> DMInterpolate() >>>>> >>>>> to automatically create the edges and faces. >>>>> >>>>> Thanks, >>>>> >>>>> Matt >>>>> >>>>> >>>>>> Thanks >>>>>> Reddy >>>>>> >>>>>> >>>>>> >>>>>> On Sun, Mar 3, 2013 at 12:23 AM, Satish Balay wrote: >>>>>> >>>>>>> BTW: I don't get compile errors with this code using petsc-3.3 built >>>>>>> with: >>>>>>> >>>>>>> --with-clanguage=cxx --with-sieve=1 --with-boost=1 >>>>>>> >>>>>>> [the code fails to run though..] >>>>>>> >>>>>>> Satish >>>>>>> >>>>>>> --------- >>>>>>> >>>>>>> asterix:/home/balay/download-pine>make >>>>>>> PETSC_DIR=/home/balay/petsc-dist-test PETSC_ARCH=asterix64-sieve >>>>>>> petscDMTest_v2 >>>>>>> /home/balay/soft/linux64/mpich2-1.1/bin/mpif90 -c -fPIC -Wall >>>>>>> -Wno-unused-variable -Wno-unused-dummy-argument -g >>>>>>> -I/home/balay/petsc-dist-test/include >>>>>>> -I/home/balay/petsc-dist-test/asterix64-sieve/include >>>>>>> -I/home/balay/petsc-dist-test/include/sieve >>>>>>> -I/home/balay/soft/linux64/mpich2-1.1/include >>>>>>> -I/home/balay/soft/mpich2-1.5/include -o petscDMTest_v2.o >>>>>>> petscDMTest_v2.F90 >>>>>>> /home/balay/soft/linux64/mpich2-1.1/bin/mpif90 -fPIC -Wall >>>>>>> -Wno-unused-variable -Wno-unused-dummy-argument -g -o petscDMTest_v2 >>>>>>> petscDMTest_v2.o >>>>>>> -Wl,-rpath,/home/balay/petsc-dist-test/asterix64-sieve/lib >>>>>>> -L/home/balay/petsc-dist-test/asterix64-sieve/lib -lpetsc -lX11 -lpthread >>>>>>> -llapack -lblas -lm -Wl,-rpath,/home/balay/soft/mpich2-1.5/lib >>>>>>> -L/home/balay/soft/mpich2-1.5/lib >>>>>>> -Wl,-rpath,/usr/lib/gcc/x86_64-redhat-linux/4.7.2 >>>>>>> -L/usr/lib/gcc/x86_64-redhat-linux/4.7.2 -lmpichf90 -lgfortran -lm >>>>>>> -lgfortran -lm -lquadmath -lm -lmpichcxx -lstdc++ -ldl -lmpich -lopa -lmpl >>>>>>> -lrt -lgcc_s -ldl >>>>>>> /usr/bin/rm -f petscDMTest_v2.o >>>>>>> asterix:/home/balay/download-pine>./petscDMTest_v2 >>>>>>> [0]PETSC ERROR: --------------------- Error Message >>>>>>> ------------------------------------ >>>>>>> [0]PETSC ERROR: No support for this operation for this object type! >>>>>>> [0]PETSC ERROR: Interpolation (creation of faces and edges) is not >>>>>>> yet supported.! >>>>>>> [0]PETSC ERROR: >>>>>>> ------------------------------------------------------------------------ >>>>>>> [0]PETSC ERROR: Petsc Release Version 3.3.0, Patch 6, unknown >>>>>>> [0]PETSC ERROR: See docs/changes/index.html for recent updates. >>>>>>> [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. >>>>>>> [0]PETSC ERROR: See docs/index.html for manual pages. >>>>>>> [0]PETSC ERROR: >>>>>>> ------------------------------------------------------------------------ >>>>>>> [0]PETSC ERROR: ./petscDMTest_v2 on a asterix64 named asterix by >>>>>>> balay Sun Mar 3 00:21:29 2013 >>>>>>> [0]PETSC ERROR: Libraries linked from >>>>>>> /home/balay/petsc-dist-test/asterix64-sieve/lib >>>>>>> [0]PETSC ERROR: Configure run at Sun Mar 3 00:15:25 2013 >>>>>>> [0]PETSC ERROR: Configure options >>>>>>> --with-mpi-dir=/home/balay/soft/linux64/mpich2-1.1 >>>>>>> --with-shared-libraries=1 --with-clanguage=cxx --with-sieve=1 >>>>>>> PETSC_ARCH=asterix64-sieve --with-boost=1 >>>>>>> [0]PETSC ERROR: >>>>>>> ------------------------------------------------------------------------ >>>>>>> [0]PETSC ERROR: DMMeshCreateMeshFromAdjacency() line 312 in >>>>>>> /home/balay/petsc-dist-test/src/dm/impls/mesh/meshcreate.c >>>>>>> Surcessfully Loaded mesh into DM >>>>>>> asterix:/home/balay/download-pine> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> On Sat, 2 Mar 2013, Satish Balay wrote: >>>>>>> >>>>>>> > Fortran compiler doesn't care about presence or absence of >>>>>>> interface >>>>>>> > defintions. If they exist - then it does extra prototype checks. If >>>>>>> > they don't exist - it assumes f77 and chugs along]. >>>>>>> > >>>>>>> > Did you build petsc with sieve [and cxx]? send make.log for this >>>>>>> > petsc build. Also what do you get for: >>>>>>> > >>>>>>> > nm -Ao libpetsc.a |grep -i DMMeshCreateMeshFromAdjacency >>>>>>> > >>>>>>> > You can followup this issue [with logs] on petsc-maint. >>>>>>> > >>>>>>> > Satish >>>>>>> > >>>>>>> > >>>>>>> > On Sat, 2 Mar 2013, Dharmendar Reddy wrote: >>>>>>> > >>>>>>> > > As you said, I do not need, PETSC_USE_FORTRAN_INTERFACES. The >>>>>>> interface to >>>>>>> > > dmmeshcreatefromadjacency is not defined in >>>>>>> > > >>>>>>> > > finclude/ftn-custom/petscdmmesh.h90 >>>>>>> > > >>>>>>> > > it is only defined in >>>>>>> > > >>>>>>> > > finclude/ftn-auto/petscdmmesh.h90 >>>>>>> > > >>>>>>> > > >>>>>>> > > On Sat, Mar 2, 2013 at 7:51 PM, Dharmendar Reddy < >>>>>>> dharmareddy84 at gmail.com>wrote: >>>>>>> > > >>>>>>> > > > Hello, >>>>>>> > > > Sorry, I was going to create a test case. Anyways here >>>>>>> is the >>>>>>> > > > error message >>>>>>> > > > >>>>>>> > > > petscDMTest_v2.o: In function `MAIN__': >>>>>>> > > > petscDMTest_v2.F90:(.text+0x354): undefined reference to >>>>>>> > > > `dmmeshcreatemeshfromad >>>>>>> > > > jacency_' >>>>>>> > > > make: [testDMMesh] Error 1 (ignored) >>>>>>> > > > >>>>>>> > > > I have attached a test case and makefile. make all should gen >>>>>>> rate the >>>>>>> > > > executable. >>>>>>> > > > >>>>>>> > > > Thanks >>>>>>> > > > Reddy >>>>>>> > > > >>>>>>> > > > >>>>>>> > > > On Sat, Mar 2, 2013 at 7:10 PM, Satish Balay < >>>>>>> balay at mcs.anl.gov> wrote: >>>>>>> > > > >>>>>>> > > >> On Sat, 2 Mar 2013, Dharmendar Reddy wrote: >>>>>>> > > >> >>>>>>> > > >> > Hello, >>>>>>> > > >> > I am trying to use DMMeshCreateMeshFromAdjacency in >>>>>>> a Fortran >>>>>>> > > >> code. >>>>>>> > > >> > I get undefined reference error. >>>>>>> > > >> >>>>>>> > > >> What error? please copy/paste >>>>>>> > > >> >>>>>>> > > >> > I include the following file in my program >>>>>>> > > >> > #include "finclude/petsc.h90" >>>>>>> > > >> > >>>>>>> > > >> > I see that fortran interface to >>>>>>> DMMeshCreateMeshFromAdjacency is defined >>>>>>> > > >> > only in >>>>>>> > > >> > >>>>>>> > > >> > finclude/ftn-auto/petscdmmesh.h90 >>>>>>> > > >> > >>>>>>> > > >> > I am not able to figure out if PETSC_USE_FORTRAN_INTERFACES >>>>>>> is defined. >>>>>>> > > >> I >>>>>>> > > >> > did not compile the code. I am runing the code on TACC >>>>>>> stampede. I tried >>>>>>> > > >> > adding >>>>>>> > > >> > >>>>>>> > > >> > #define PETSC_USE_FORTRAN_INTERFACES 1 >>>>>>> > > >> > in my program before the petsc inlcude line but i still get >>>>>>> error. >>>>>>> > > >> >>>>>>> > > >> 1. again 'get error' doesn't tell us anything. >>>>>>> > > >> >>>>>>> > > >> And you shouldn't need PETSC_USE_FORTRAN_INTERFACES to use >>>>>>> > > >> DMMeshCreateMeshFromAdjacency >>>>>>> > > >> >>>>>>> > > >> Satish >>>>>>> > > >> >>>>>>> > > >> > >>>>>>> > > >> > >>>>>>> > > >> > Thanks >>>>>>> > > >> > Reddy >>>>>>> > > >> > >>>>>>> > > >> > >>>>>>> > > >> >>>>>>> > > >> >>>>>>> > > > >>>>>>> > > > >>>>>>> > > > -- >>>>>>> > > > ----------------------------------------------------- >>>>>>> > > > Dharmendar Reddy Palle >>>>>>> > > > Graduate Student >>>>>>> > > > Microelectronics Research center, >>>>>>> > > > University of Texas at Austin, >>>>>>> > > > 10100 Burnet Road, Bldg. 160 >>>>>>> > > > MER 2.608F, TX 78758-4445 >>>>>>> > > > e-mail: dharmareddy84 at gmail.com >>>>>>> > > > Phone: +1-512-350-9082 >>>>>>> > > > United States of America. >>>>>>> > > > Homepage: https://webspace.utexas.edu/~dpr342 >>>>>>> > > > >>>>>>> > > >>>>>>> > > >>>>>>> > > >>>>>>> > > >>>>>>> > >>>>>>> > >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> ----------------------------------------------------- >>>>>> Dharmendar Reddy Palle >>>>>> Graduate Student >>>>>> Microelectronics Research center, >>>>>> University of Texas at Austin, >>>>>> 10100 Burnet Road, Bldg. 160 >>>>>> MER 2.608F, TX 78758-4445 >>>>>> e-mail: dharmareddy84 at gmail.com >>>>>> Phone: +1-512-350-9082 >>>>>> United States of America. >>>>>> Homepage: https://webspace.utexas.edu/~dpr342 >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> What most experimenters take for granted before they begin their >>>>> experiments is infinitely more interesting than any results to which their >>>>> experiments lead. >>>>> -- Norbert Wiener >>>>> >>>> >>>> >>>> >>>> -- >>>> ----------------------------------------------------- >>>> Dharmendar Reddy Palle >>>> Graduate Student >>>> Microelectronics Research center, >>>> University of Texas at Austin, >>>> 10100 Burnet Road, Bldg. 160 >>>> MER 2.608F, TX 78758-4445 >>>> e-mail: dharmareddy84 at gmail.com >>>> Phone: +1-512-350-9082 >>>> United States of America. >>>> Homepage: https://webspace.utexas.edu/~dpr342 >>>> >>> >>> >>> >>> -- >>> What most experimenters take for granted before they begin their >>> experiments is infinitely more interesting than any results to which their >>> experiments lead. >>> -- Norbert Wiener >>> >> >> >> >> -- >> ----------------------------------------------------- >> Dharmendar Reddy Palle >> Graduate Student >> Microelectronics Research center, >> University of Texas at Austin, >> 10100 Burnet Road, Bldg. 160 >> MER 2.608F, TX 78758-4445 >> e-mail: dharmareddy84 at gmail.com >> Phone: +1-512-350-9082 >> United States of America. >> Homepage: https://webspace.utexas.edu/~dpr342 >> > > > > -- > What most experimenters take for granted before they begin their > experiments is infinitely more interesting than any results to which their > experiments lead. > -- Norbert Wiener > -- ----------------------------------------------------- Dharmendar Reddy Palle Graduate Student Microelectronics Research center, University of Texas at Austin, 10100 Burnet Road, Bldg. 160 MER 2.608F, TX 78758-4445 e-mail: dharmareddy84 at gmail.com Phone: +1-512-350-9082 United States of America. Homepage: https://webspace.utexas.edu/~dpr342 -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Sun Mar 3 17:45:31 2013 From: knepley at gmail.com (Matthew Knepley) Date: Sun, 3 Mar 2013 18:45:31 -0500 Subject: [petsc-users] DMMeshCreateMeshFromAdjacency In-Reply-To: References: Message-ID: On Sun, Mar 3, 2013 at 6:41 PM, Dharmendar Reddy wrote: > Let say I create triangular mesh in a square: (0,0) (0,1) (1,1) (0,1) > I want (0,0.25) and (0.25,0) to be among the mesh nodes. It can have other > nodes. > These explanations are too short. From the above, all I understand is that you would get a line between (0, 1/4) and (1/4, 0). Matt > On Sun, Mar 3, 2013 at 5:29 PM, Matthew Knepley wrote: > >> On Sun, Mar 3, 2013 at 5:04 PM, Dharmendar Reddy > > wrote: >> >>> Hello, >>> >>> We use cratisian mesh for certain problems only. The user gives >>> the mesh file as one of the inputs. I do not know a-priori what mesh is >>> created. >>> >>> On a related note, I am solving a system of equations where i need to >>> use a fine cartisian mesh for one equation (Schrodinger) but i would >>> prefer a coarse traiangular or tetrahedral element mesh for another >>> eqaution(Poisson). Is there an interface to interpolate data from one mesh >>> to another? >>> >> >> There is an interface, which is just a Mat, but there is no >> infrastructure for calculating it. >> >> >>> If i create a DM with a coarse mesh, Can i give the mesh a set of >>> vertices such that after re meshing the DM has the given vertices as mesh >>> nodes ? I tried using the gmsh to create a mesh with give set of vertices >>> inside a region but had no success. >>> >> >> I do not understand the question. >> >> Thanks, >> >> Matt >> >> >>> Thanks >>> Reddy >>> >>> On Sun, Mar 3, 2013 at 3:44 PM, Matthew Knepley wrote: >>> >>>> On Sun, Mar 3, 2013 at 3:48 PM, Dharmendar Reddy < >>>> dharmareddy84 at gmail.com> wrote: >>>> >>>>> So i should use petsc-dev ? I will try that. >>>>> >>>>> I there any way i can have access to submesh? Consider a this scenario. >>>>> I have a two dimensional mesh in a rectangle with a uniform deltaX and >>>>> deltaY gridding. Is there any way i can get submesh at say x = (i-1)*deltaX >>>>> where say i = 1 to N. The dofs on the submesh will should be mapped to >>>>> dofs on the original mesh. The submesh in this case will be a 1D mesh >>>>> along y-axis. >>>>> >>>> >>>> 1) If you have a Cartesian mesh, use DMDA. This is no point in an >>>> unstructured mesh. >>>> >>>> 2) Yes, you can extract a submesh based upon labeled vertices using >>>> DMPlexCreateSubmesh(). It will have >>>> a map between points in the submesh and original mesh. >>>> >>>> >>>>> I can create each DM with input celllist and create maps after that >>>>> but i am wondering if this can be done via DMgetsubDM kind of call ? >>>>> >>>> >>>> Matt >>>> >>>> >>>>> Thanks >>>>> Reddy >>>>> >>>>> On Sun, Mar 3, 2013 at 2:11 PM, Matthew Knepley wrote: >>>>> >>>>>> On Sun, Mar 3, 2013 at 2:37 PM, Dharmendar Reddy < >>>>>> dharmareddy84 at gmail.com> wrote: >>>>>> >>>>>>> Hello, >>>>>>> >>>>>>> Thanks. I will have the code compiled with-cxx and >>>>>>> with-sieve. >>>>>>> The error is understandable when i look at the following line from >>>>>>> meshcreate.c >>>>>>> >>>>>>> 312: if (interpolate) {SETERRQ (comm, PETSC_ERR_SUP, "Interpolation (creation of faces and edges) is not yet supported.");} >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> Any idea if this feature will be implimented? I am trying to import mesh from gmsh. >>>>>>> I have a Fortran code which will genrate list for faces and edges for a given mesh. >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> Is there a DMMEsh interface through which i can input list of edges and faces ? >>>>>>> >>>>>>> >>>>>> DMMesh was an initial implementation of these ideas, but did not >>>>>> interface well with >>>>>> solvers, so it has been rewritten in C as DMPlex. The interface is >>>>>> almost exactly the >>>>>> same, and if you want increased functionality I would encourage you >>>>>> to switch. For >>>>>> example, DMMeshCreateMeshFromAdjacency() becomes >>>>>> >>>>>> DMPlexCreateFromCellList() >>>>>> >>>>>> and you can follow this with >>>>>> >>>>>> DMInterpolate() >>>>>> >>>>>> to automatically create the edges and faces. >>>>>> >>>>>> Thanks, >>>>>> >>>>>> Matt >>>>>> >>>>>> >>>>>>> Thanks >>>>>>> Reddy >>>>>>> >>>>>>> >>>>>>> >>>>>>> On Sun, Mar 3, 2013 at 12:23 AM, Satish Balay wrote: >>>>>>> >>>>>>>> BTW: I don't get compile errors with this code using petsc-3.3 >>>>>>>> built with: >>>>>>>> >>>>>>>> --with-clanguage=cxx --with-sieve=1 --with-boost=1 >>>>>>>> >>>>>>>> [the code fails to run though..] >>>>>>>> >>>>>>>> Satish >>>>>>>> >>>>>>>> --------- >>>>>>>> >>>>>>>> asterix:/home/balay/download-pine>make >>>>>>>> PETSC_DIR=/home/balay/petsc-dist-test PETSC_ARCH=asterix64-sieve >>>>>>>> petscDMTest_v2 >>>>>>>> /home/balay/soft/linux64/mpich2-1.1/bin/mpif90 -c -fPIC -Wall >>>>>>>> -Wno-unused-variable -Wno-unused-dummy-argument -g >>>>>>>> -I/home/balay/petsc-dist-test/include >>>>>>>> -I/home/balay/petsc-dist-test/asterix64-sieve/include >>>>>>>> -I/home/balay/petsc-dist-test/include/sieve >>>>>>>> -I/home/balay/soft/linux64/mpich2-1.1/include >>>>>>>> -I/home/balay/soft/mpich2-1.5/include -o petscDMTest_v2.o >>>>>>>> petscDMTest_v2.F90 >>>>>>>> /home/balay/soft/linux64/mpich2-1.1/bin/mpif90 -fPIC -Wall >>>>>>>> -Wno-unused-variable -Wno-unused-dummy-argument -g -o petscDMTest_v2 >>>>>>>> petscDMTest_v2.o >>>>>>>> -Wl,-rpath,/home/balay/petsc-dist-test/asterix64-sieve/lib >>>>>>>> -L/home/balay/petsc-dist-test/asterix64-sieve/lib -lpetsc -lX11 -lpthread >>>>>>>> -llapack -lblas -lm -Wl,-rpath,/home/balay/soft/mpich2-1.5/lib >>>>>>>> -L/home/balay/soft/mpich2-1.5/lib >>>>>>>> -Wl,-rpath,/usr/lib/gcc/x86_64-redhat-linux/4.7.2 >>>>>>>> -L/usr/lib/gcc/x86_64-redhat-linux/4.7.2 -lmpichf90 -lgfortran -lm >>>>>>>> -lgfortran -lm -lquadmath -lm -lmpichcxx -lstdc++ -ldl -lmpich -lopa -lmpl >>>>>>>> -lrt -lgcc_s -ldl >>>>>>>> /usr/bin/rm -f petscDMTest_v2.o >>>>>>>> asterix:/home/balay/download-pine>./petscDMTest_v2 >>>>>>>> [0]PETSC ERROR: --------------------- Error Message >>>>>>>> ------------------------------------ >>>>>>>> [0]PETSC ERROR: No support for this operation for this object type! >>>>>>>> [0]PETSC ERROR: Interpolation (creation of faces and edges) is not >>>>>>>> yet supported.! >>>>>>>> [0]PETSC ERROR: >>>>>>>> ------------------------------------------------------------------------ >>>>>>>> [0]PETSC ERROR: Petsc Release Version 3.3.0, Patch 6, unknown >>>>>>>> [0]PETSC ERROR: See docs/changes/index.html for recent updates. >>>>>>>> [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. >>>>>>>> [0]PETSC ERROR: See docs/index.html for manual pages. >>>>>>>> [0]PETSC ERROR: >>>>>>>> ------------------------------------------------------------------------ >>>>>>>> [0]PETSC ERROR: ./petscDMTest_v2 on a asterix64 named asterix by >>>>>>>> balay Sun Mar 3 00:21:29 2013 >>>>>>>> [0]PETSC ERROR: Libraries linked from >>>>>>>> /home/balay/petsc-dist-test/asterix64-sieve/lib >>>>>>>> [0]PETSC ERROR: Configure run at Sun Mar 3 00:15:25 2013 >>>>>>>> [0]PETSC ERROR: Configure options >>>>>>>> --with-mpi-dir=/home/balay/soft/linux64/mpich2-1.1 >>>>>>>> --with-shared-libraries=1 --with-clanguage=cxx --with-sieve=1 >>>>>>>> PETSC_ARCH=asterix64-sieve --with-boost=1 >>>>>>>> [0]PETSC ERROR: >>>>>>>> ------------------------------------------------------------------------ >>>>>>>> [0]PETSC ERROR: DMMeshCreateMeshFromAdjacency() line 312 in >>>>>>>> /home/balay/petsc-dist-test/src/dm/impls/mesh/meshcreate.c >>>>>>>> Surcessfully Loaded mesh into DM >>>>>>>> asterix:/home/balay/download-pine> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> On Sat, 2 Mar 2013, Satish Balay wrote: >>>>>>>> >>>>>>>> > Fortran compiler doesn't care about presence or absence of >>>>>>>> interface >>>>>>>> > defintions. If they exist - then it does extra prototype checks. >>>>>>>> If >>>>>>>> > they don't exist - it assumes f77 and chugs along]. >>>>>>>> > >>>>>>>> > Did you build petsc with sieve [and cxx]? send make.log for this >>>>>>>> > petsc build. Also what do you get for: >>>>>>>> > >>>>>>>> > nm -Ao libpetsc.a |grep -i DMMeshCreateMeshFromAdjacency >>>>>>>> > >>>>>>>> > You can followup this issue [with logs] on petsc-maint. >>>>>>>> > >>>>>>>> > Satish >>>>>>>> > >>>>>>>> > >>>>>>>> > On Sat, 2 Mar 2013, Dharmendar Reddy wrote: >>>>>>>> > >>>>>>>> > > As you said, I do not need, PETSC_USE_FORTRAN_INTERFACES. The >>>>>>>> interface to >>>>>>>> > > dmmeshcreatefromadjacency is not defined in >>>>>>>> > > >>>>>>>> > > finclude/ftn-custom/petscdmmesh.h90 >>>>>>>> > > >>>>>>>> > > it is only defined in >>>>>>>> > > >>>>>>>> > > finclude/ftn-auto/petscdmmesh.h90 >>>>>>>> > > >>>>>>>> > > >>>>>>>> > > On Sat, Mar 2, 2013 at 7:51 PM, Dharmendar Reddy < >>>>>>>> dharmareddy84 at gmail.com>wrote: >>>>>>>> > > >>>>>>>> > > > Hello, >>>>>>>> > > > Sorry, I was going to create a test case. Anyways >>>>>>>> here is the >>>>>>>> > > > error message >>>>>>>> > > > >>>>>>>> > > > petscDMTest_v2.o: In function `MAIN__': >>>>>>>> > > > petscDMTest_v2.F90:(.text+0x354): undefined reference to >>>>>>>> > > > `dmmeshcreatemeshfromad >>>>>>>> > > > jacency_' >>>>>>>> > > > make: [testDMMesh] Error 1 (ignored) >>>>>>>> > > > >>>>>>>> > > > I have attached a test case and makefile. make all should >>>>>>>> gen rate the >>>>>>>> > > > executable. >>>>>>>> > > > >>>>>>>> > > > Thanks >>>>>>>> > > > Reddy >>>>>>>> > > > >>>>>>>> > > > >>>>>>>> > > > On Sat, Mar 2, 2013 at 7:10 PM, Satish Balay < >>>>>>>> balay at mcs.anl.gov> wrote: >>>>>>>> > > > >>>>>>>> > > >> On Sat, 2 Mar 2013, Dharmendar Reddy wrote: >>>>>>>> > > >> >>>>>>>> > > >> > Hello, >>>>>>>> > > >> > I am trying to use DMMeshCreateMeshFromAdjacency >>>>>>>> in a Fortran >>>>>>>> > > >> code. >>>>>>>> > > >> > I get undefined reference error. >>>>>>>> > > >> >>>>>>>> > > >> What error? please copy/paste >>>>>>>> > > >> >>>>>>>> > > >> > I include the following file in my program >>>>>>>> > > >> > #include "finclude/petsc.h90" >>>>>>>> > > >> > >>>>>>>> > > >> > I see that fortran interface to >>>>>>>> DMMeshCreateMeshFromAdjacency is defined >>>>>>>> > > >> > only in >>>>>>>> > > >> > >>>>>>>> > > >> > finclude/ftn-auto/petscdmmesh.h90 >>>>>>>> > > >> > >>>>>>>> > > >> > I am not able to figure out if >>>>>>>> PETSC_USE_FORTRAN_INTERFACES is defined. >>>>>>>> > > >> I >>>>>>>> > > >> > did not compile the code. I am runing the code on TACC >>>>>>>> stampede. I tried >>>>>>>> > > >> > adding >>>>>>>> > > >> > >>>>>>>> > > >> > #define PETSC_USE_FORTRAN_INTERFACES 1 >>>>>>>> > > >> > in my program before the petsc inlcude line but i still >>>>>>>> get error. >>>>>>>> > > >> >>>>>>>> > > >> 1. again 'get error' doesn't tell us anything. >>>>>>>> > > >> >>>>>>>> > > >> And you shouldn't need PETSC_USE_FORTRAN_INTERFACES to use >>>>>>>> > > >> DMMeshCreateMeshFromAdjacency >>>>>>>> > > >> >>>>>>>> > > >> Satish >>>>>>>> > > >> >>>>>>>> > > >> > >>>>>>>> > > >> > >>>>>>>> > > >> > Thanks >>>>>>>> > > >> > Reddy >>>>>>>> > > >> > >>>>>>>> > > >> > >>>>>>>> > > >> >>>>>>>> > > >> >>>>>>>> > > > >>>>>>>> > > > >>>>>>>> > > > -- >>>>>>>> > > > ----------------------------------------------------- >>>>>>>> > > > Dharmendar Reddy Palle >>>>>>>> > > > Graduate Student >>>>>>>> > > > Microelectronics Research center, >>>>>>>> > > > University of Texas at Austin, >>>>>>>> > > > 10100 Burnet Road, Bldg. 160 >>>>>>>> > > > MER 2.608F, TX 78758-4445 >>>>>>>> > > > e-mail: dharmareddy84 at gmail.com >>>>>>>> > > > Phone: +1-512-350-9082 >>>>>>>> > > > United States of America. >>>>>>>> > > > Homepage: https://webspace.utexas.edu/~dpr342 >>>>>>>> > > > >>>>>>>> > > >>>>>>>> > > >>>>>>>> > > >>>>>>>> > > >>>>>>>> > >>>>>>>> > >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> ----------------------------------------------------- >>>>>>> Dharmendar Reddy Palle >>>>>>> Graduate Student >>>>>>> Microelectronics Research center, >>>>>>> University of Texas at Austin, >>>>>>> 10100 Burnet Road, Bldg. 160 >>>>>>> MER 2.608F, TX 78758-4445 >>>>>>> e-mail: dharmareddy84 at gmail.com >>>>>>> Phone: +1-512-350-9082 >>>>>>> United States of America. >>>>>>> Homepage: https://webspace.utexas.edu/~dpr342 >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> What most experimenters take for granted before they begin their >>>>>> experiments is infinitely more interesting than any results to which their >>>>>> experiments lead. >>>>>> -- Norbert Wiener >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> ----------------------------------------------------- >>>>> Dharmendar Reddy Palle >>>>> Graduate Student >>>>> Microelectronics Research center, >>>>> University of Texas at Austin, >>>>> 10100 Burnet Road, Bldg. 160 >>>>> MER 2.608F, TX 78758-4445 >>>>> e-mail: dharmareddy84 at gmail.com >>>>> Phone: +1-512-350-9082 >>>>> United States of America. >>>>> Homepage: https://webspace.utexas.edu/~dpr342 >>>>> >>>> >>>> >>>> >>>> -- >>>> What most experimenters take for granted before they begin their >>>> experiments is infinitely more interesting than any results to which their >>>> experiments lead. >>>> -- Norbert Wiener >>>> >>> >>> >>> >>> -- >>> ----------------------------------------------------- >>> Dharmendar Reddy Palle >>> Graduate Student >>> Microelectronics Research center, >>> University of Texas at Austin, >>> 10100 Burnet Road, Bldg. 160 >>> MER 2.608F, TX 78758-4445 >>> e-mail: dharmareddy84 at gmail.com >>> Phone: +1-512-350-9082 >>> United States of America. >>> Homepage: https://webspace.utexas.edu/~dpr342 >>> >> >> >> >> -- >> What most experimenters take for granted before they begin their >> experiments is infinitely more interesting than any results to which their >> experiments lead. >> -- Norbert Wiener >> > > > > -- > ----------------------------------------------------- > Dharmendar Reddy Palle > Graduate Student > Microelectronics Research center, > University of Texas at Austin, > 10100 Burnet Road, Bldg. 160 > MER 2.608F, TX 78758-4445 > e-mail: dharmareddy84 at gmail.com > Phone: +1-512-350-9082 > United States of America. > Homepage: https://webspace.utexas.edu/~dpr342 > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From dharmareddy84 at gmail.com Sun Mar 3 18:03:35 2013 From: dharmareddy84 at gmail.com (Dharmendar Reddy) Date: Sun, 3 Mar 2013 18:03:35 -0600 Subject: [petsc-users] DMMeshCreateMeshFromAdjacency In-Reply-To: References: Message-ID: Sorry, I will try to present the problem in more detial. So i am trying to mesh a material region. The material is usually a crystal with atoms located as per the lattice defining the crystal. See for example the attached image which has silicon atoms (spheres) in the crystal unit cell which is a cuboid. Now if i have a cuboid region with 10 unit cells each in x, y and z direction. I need to mesh this region such that I have mesh nodes at atom locations. The can be more mesh nodes than the atom locations. On Sun, Mar 3, 2013 at 5:45 PM, Matthew Knepley wrote: > On Sun, Mar 3, 2013 at 6:41 PM, Dharmendar Reddy wrote: > >> Let say I create triangular mesh in a square: (0,0) (0,1) (1,1) (0,1) >> I want (0,0.25) and (0.25,0) to be among the mesh nodes. It can have >> other nodes. >> > > These explanations are too short. From the above, all I understand is that > you would get > a line between (0, 1/4) and (1/4, 0). > > Matt > > >> On Sun, Mar 3, 2013 at 5:29 PM, Matthew Knepley wrote: >> >>> On Sun, Mar 3, 2013 at 5:04 PM, Dharmendar Reddy < >>> dharmareddy84 at gmail.com> wrote: >>> >>>> Hello, >>>> >>>> We use cratisian mesh for certain problems only. The user gives >>>> the mesh file as one of the inputs. I do not know a-priori what mesh is >>>> created. >>>> >>>> On a related note, I am solving a system of equations where i need to >>>> use a fine cartisian mesh for one equation (Schrodinger) but i would >>>> prefer a coarse traiangular or tetrahedral element mesh for another >>>> eqaution(Poisson). Is there an interface to interpolate data from one mesh >>>> to another? >>>> >>> >>> There is an interface, which is just a Mat, but there is no >>> infrastructure for calculating it. >>> >>> >>>> If i create a DM with a coarse mesh, Can i give the mesh a set of >>>> vertices such that after re meshing the DM has the given vertices as mesh >>>> nodes ? I tried using the gmsh to create a mesh with give set of vertices >>>> inside a region but had no success. >>>> >>> >>> I do not understand the question. >>> >>> Thanks, >>> >>> Matt >>> >>> >>>> Thanks >>>> Reddy >>>> >>>> On Sun, Mar 3, 2013 at 3:44 PM, Matthew Knepley wrote: >>>> >>>>> On Sun, Mar 3, 2013 at 3:48 PM, Dharmendar Reddy < >>>>> dharmareddy84 at gmail.com> wrote: >>>>> >>>>>> So i should use petsc-dev ? I will try that. >>>>>> >>>>>> I there any way i can have access to submesh? Consider a this >>>>>> scenario. >>>>>> I have a two dimensional mesh in a rectangle with a uniform deltaX >>>>>> and deltaY gridding. Is there any way i can get submesh at say x = >>>>>> (i-1)*deltaX where say i = 1 to N. The dofs on the submesh will should be >>>>>> mapped to dofs on the original mesh. The submesh in this case will be a 1D >>>>>> mesh along y-axis. >>>>>> >>>>> >>>>> 1) If you have a Cartesian mesh, use DMDA. This is no point in an >>>>> unstructured mesh. >>>>> >>>>> 2) Yes, you can extract a submesh based upon labeled vertices using >>>>> DMPlexCreateSubmesh(). It will have >>>>> a map between points in the submesh and original mesh. >>>>> >>>>> >>>>>> I can create each DM with input celllist and create maps after that >>>>>> but i am wondering if this can be done via DMgetsubDM kind of call ? >>>>>> >>>>> >>>>> Matt >>>>> >>>>> >>>>>> Thanks >>>>>> Reddy >>>>>> >>>>>> On Sun, Mar 3, 2013 at 2:11 PM, Matthew Knepley wrote: >>>>>> >>>>>>> On Sun, Mar 3, 2013 at 2:37 PM, Dharmendar Reddy < >>>>>>> dharmareddy84 at gmail.com> wrote: >>>>>>> >>>>>>>> Hello, >>>>>>>> >>>>>>>> Thanks. I will have the code compiled with-cxx and >>>>>>>> with-sieve. >>>>>>>> The error is understandable when i look at the following line from >>>>>>>> meshcreate.c >>>>>>>> >>>>>>>> 312: if (interpolate) {SETERRQ (comm, PETSC_ERR_SUP, "Interpolation (creation of faces and edges) is not yet supported.");} >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> Any idea if this feature will be implimented? I am trying to import mesh from gmsh. >>>>>>>> I have a Fortran code which will genrate list for faces and edges for a given mesh. >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> Is there a DMMEsh interface through which i can input list of edges and faces ? >>>>>>>> >>>>>>>> >>>>>>> DMMesh was an initial implementation of these ideas, but did not >>>>>>> interface well with >>>>>>> solvers, so it has been rewritten in C as DMPlex. The interface is >>>>>>> almost exactly the >>>>>>> same, and if you want increased functionality I would encourage you >>>>>>> to switch. For >>>>>>> example, DMMeshCreateMeshFromAdjacency() becomes >>>>>>> >>>>>>> DMPlexCreateFromCellList() >>>>>>> >>>>>>> and you can follow this with >>>>>>> >>>>>>> DMInterpolate() >>>>>>> >>>>>>> to automatically create the edges and faces. >>>>>>> >>>>>>> Thanks, >>>>>>> >>>>>>> Matt >>>>>>> >>>>>>> >>>>>>>> Thanks >>>>>>>> Reddy >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> On Sun, Mar 3, 2013 at 12:23 AM, Satish Balay wrote: >>>>>>>> >>>>>>>>> BTW: I don't get compile errors with this code using petsc-3.3 >>>>>>>>> built with: >>>>>>>>> >>>>>>>>> --with-clanguage=cxx --with-sieve=1 --with-boost=1 >>>>>>>>> >>>>>>>>> [the code fails to run though..] >>>>>>>>> >>>>>>>>> Satish >>>>>>>>> >>>>>>>>> --------- >>>>>>>>> >>>>>>>>> asterix:/home/balay/download-pine>make >>>>>>>>> PETSC_DIR=/home/balay/petsc-dist-test PETSC_ARCH=asterix64-sieve >>>>>>>>> petscDMTest_v2 >>>>>>>>> /home/balay/soft/linux64/mpich2-1.1/bin/mpif90 -c -fPIC -Wall >>>>>>>>> -Wno-unused-variable -Wno-unused-dummy-argument -g >>>>>>>>> -I/home/balay/petsc-dist-test/include >>>>>>>>> -I/home/balay/petsc-dist-test/asterix64-sieve/include >>>>>>>>> -I/home/balay/petsc-dist-test/include/sieve >>>>>>>>> -I/home/balay/soft/linux64/mpich2-1.1/include >>>>>>>>> -I/home/balay/soft/mpich2-1.5/include -o petscDMTest_v2.o >>>>>>>>> petscDMTest_v2.F90 >>>>>>>>> /home/balay/soft/linux64/mpich2-1.1/bin/mpif90 -fPIC -Wall >>>>>>>>> -Wno-unused-variable -Wno-unused-dummy-argument -g -o petscDMTest_v2 >>>>>>>>> petscDMTest_v2.o >>>>>>>>> -Wl,-rpath,/home/balay/petsc-dist-test/asterix64-sieve/lib >>>>>>>>> -L/home/balay/petsc-dist-test/asterix64-sieve/lib -lpetsc -lX11 -lpthread >>>>>>>>> -llapack -lblas -lm -Wl,-rpath,/home/balay/soft/mpich2-1.5/lib >>>>>>>>> -L/home/balay/soft/mpich2-1.5/lib >>>>>>>>> -Wl,-rpath,/usr/lib/gcc/x86_64-redhat-linux/4.7.2 >>>>>>>>> -L/usr/lib/gcc/x86_64-redhat-linux/4.7.2 -lmpichf90 -lgfortran -lm >>>>>>>>> -lgfortran -lm -lquadmath -lm -lmpichcxx -lstdc++ -ldl -lmpich -lopa -lmpl >>>>>>>>> -lrt -lgcc_s -ldl >>>>>>>>> /usr/bin/rm -f petscDMTest_v2.o >>>>>>>>> asterix:/home/balay/download-pine>./petscDMTest_v2 >>>>>>>>> [0]PETSC ERROR: --------------------- Error Message >>>>>>>>> ------------------------------------ >>>>>>>>> [0]PETSC ERROR: No support for this operation for this object type! >>>>>>>>> [0]PETSC ERROR: Interpolation (creation of faces and edges) is not >>>>>>>>> yet supported.! >>>>>>>>> [0]PETSC ERROR: >>>>>>>>> ------------------------------------------------------------------------ >>>>>>>>> [0]PETSC ERROR: Petsc Release Version 3.3.0, Patch 6, unknown >>>>>>>>> [0]PETSC ERROR: See docs/changes/index.html for recent updates. >>>>>>>>> [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. >>>>>>>>> [0]PETSC ERROR: See docs/index.html for manual pages. >>>>>>>>> [0]PETSC ERROR: >>>>>>>>> ------------------------------------------------------------------------ >>>>>>>>> [0]PETSC ERROR: ./petscDMTest_v2 on a asterix64 named asterix by >>>>>>>>> balay Sun Mar 3 00:21:29 2013 >>>>>>>>> [0]PETSC ERROR: Libraries linked from >>>>>>>>> /home/balay/petsc-dist-test/asterix64-sieve/lib >>>>>>>>> [0]PETSC ERROR: Configure run at Sun Mar 3 00:15:25 2013 >>>>>>>>> [0]PETSC ERROR: Configure options >>>>>>>>> --with-mpi-dir=/home/balay/soft/linux64/mpich2-1.1 >>>>>>>>> --with-shared-libraries=1 --with-clanguage=cxx --with-sieve=1 >>>>>>>>> PETSC_ARCH=asterix64-sieve --with-boost=1 >>>>>>>>> [0]PETSC ERROR: >>>>>>>>> ------------------------------------------------------------------------ >>>>>>>>> [0]PETSC ERROR: DMMeshCreateMeshFromAdjacency() line 312 in >>>>>>>>> /home/balay/petsc-dist-test/src/dm/impls/mesh/meshcreate.c >>>>>>>>> Surcessfully Loaded mesh into DM >>>>>>>>> asterix:/home/balay/download-pine> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> On Sat, 2 Mar 2013, Satish Balay wrote: >>>>>>>>> >>>>>>>>> > Fortran compiler doesn't care about presence or absence of >>>>>>>>> interface >>>>>>>>> > defintions. If they exist - then it does extra prototype checks. >>>>>>>>> If >>>>>>>>> > they don't exist - it assumes f77 and chugs along]. >>>>>>>>> > >>>>>>>>> > Did you build petsc with sieve [and cxx]? send make.log for this >>>>>>>>> > petsc build. Also what do you get for: >>>>>>>>> > >>>>>>>>> > nm -Ao libpetsc.a |grep -i DMMeshCreateMeshFromAdjacency >>>>>>>>> > >>>>>>>>> > You can followup this issue [with logs] on petsc-maint. >>>>>>>>> > >>>>>>>>> > Satish >>>>>>>>> > >>>>>>>>> > >>>>>>>>> > On Sat, 2 Mar 2013, Dharmendar Reddy wrote: >>>>>>>>> > >>>>>>>>> > > As you said, I do not need, PETSC_USE_FORTRAN_INTERFACES. The >>>>>>>>> interface to >>>>>>>>> > > dmmeshcreatefromadjacency is not defined in >>>>>>>>> > > >>>>>>>>> > > finclude/ftn-custom/petscdmmesh.h90 >>>>>>>>> > > >>>>>>>>> > > it is only defined in >>>>>>>>> > > >>>>>>>>> > > finclude/ftn-auto/petscdmmesh.h90 >>>>>>>>> > > >>>>>>>>> > > >>>>>>>>> > > On Sat, Mar 2, 2013 at 7:51 PM, Dharmendar Reddy < >>>>>>>>> dharmareddy84 at gmail.com>wrote: >>>>>>>>> > > >>>>>>>>> > > > Hello, >>>>>>>>> > > > Sorry, I was going to create a test case. Anyways >>>>>>>>> here is the >>>>>>>>> > > > error message >>>>>>>>> > > > >>>>>>>>> > > > petscDMTest_v2.o: In function `MAIN__': >>>>>>>>> > > > petscDMTest_v2.F90:(.text+0x354): undefined reference to >>>>>>>>> > > > `dmmeshcreatemeshfromad >>>>>>>>> > > > jacency_' >>>>>>>>> > > > make: [testDMMesh] Error 1 (ignored) >>>>>>>>> > > > >>>>>>>>> > > > I have attached a test case and makefile. make all should >>>>>>>>> gen rate the >>>>>>>>> > > > executable. >>>>>>>>> > > > >>>>>>>>> > > > Thanks >>>>>>>>> > > > Reddy >>>>>>>>> > > > >>>>>>>>> > > > >>>>>>>>> > > > On Sat, Mar 2, 2013 at 7:10 PM, Satish Balay < >>>>>>>>> balay at mcs.anl.gov> wrote: >>>>>>>>> > > > >>>>>>>>> > > >> On Sat, 2 Mar 2013, Dharmendar Reddy wrote: >>>>>>>>> > > >> >>>>>>>>> > > >> > Hello, >>>>>>>>> > > >> > I am trying to use DMMeshCreateMeshFromAdjacency >>>>>>>>> in a Fortran >>>>>>>>> > > >> code. >>>>>>>>> > > >> > I get undefined reference error. >>>>>>>>> > > >> >>>>>>>>> > > >> What error? please copy/paste >>>>>>>>> > > >> >>>>>>>>> > > >> > I include the following file in my program >>>>>>>>> > > >> > #include "finclude/petsc.h90" >>>>>>>>> > > >> > >>>>>>>>> > > >> > I see that fortran interface to >>>>>>>>> DMMeshCreateMeshFromAdjacency is defined >>>>>>>>> > > >> > only in >>>>>>>>> > > >> > >>>>>>>>> > > >> > finclude/ftn-auto/petscdmmesh.h90 >>>>>>>>> > > >> > >>>>>>>>> > > >> > I am not able to figure out if >>>>>>>>> PETSC_USE_FORTRAN_INTERFACES is defined. >>>>>>>>> > > >> I >>>>>>>>> > > >> > did not compile the code. I am runing the code on TACC >>>>>>>>> stampede. I tried >>>>>>>>> > > >> > adding >>>>>>>>> > > >> > >>>>>>>>> > > >> > #define PETSC_USE_FORTRAN_INTERFACES 1 >>>>>>>>> > > >> > in my program before the petsc inlcude line but i still >>>>>>>>> get error. >>>>>>>>> > > >> >>>>>>>>> > > >> 1. again 'get error' doesn't tell us anything. >>>>>>>>> > > >> >>>>>>>>> > > >> And you shouldn't need PETSC_USE_FORTRAN_INTERFACES to use >>>>>>>>> > > >> DMMeshCreateMeshFromAdjacency >>>>>>>>> > > >> >>>>>>>>> > > >> Satish >>>>>>>>> > > >> >>>>>>>>> > > >> > >>>>>>>>> > > >> > >>>>>>>>> > > >> > Thanks >>>>>>>>> > > >> > Reddy >>>>>>>>> > > >> > >>>>>>>>> > > >> > >>>>>>>>> > > >> >>>>>>>>> > > >> >>>>>>>>> > > > >>>>>>>>> > > > >>>>>>>>> > > > -- >>>>>>>>> > > > ----------------------------------------------------- >>>>>>>>> > > > Dharmendar Reddy Palle >>>>>>>>> > > > Graduate Student >>>>>>>>> > > > Microelectronics Research center, >>>>>>>>> > > > University of Texas at Austin, >>>>>>>>> > > > 10100 Burnet Road, Bldg. 160 >>>>>>>>> > > > MER 2.608F, TX 78758-4445 >>>>>>>>> > > > e-mail: dharmareddy84 at gmail.com >>>>>>>>> > > > Phone: +1-512-350-9082 >>>>>>>>> > > > United States of America. >>>>>>>>> > > > Homepage: https://webspace.utexas.edu/~dpr342 >>>>>>>>> > > > >>>>>>>>> > > >>>>>>>>> > > >>>>>>>>> > > >>>>>>>>> > > >>>>>>>>> > >>>>>>>>> > >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> ----------------------------------------------------- >>>>>>>> Dharmendar Reddy Palle >>>>>>>> Graduate Student >>>>>>>> Microelectronics Research center, >>>>>>>> University of Texas at Austin, >>>>>>>> 10100 Burnet Road, Bldg. 160 >>>>>>>> MER 2.608F, TX 78758-4445 >>>>>>>> e-mail: dharmareddy84 at gmail.com >>>>>>>> Phone: +1-512-350-9082 >>>>>>>> United States of America. >>>>>>>> Homepage: https://webspace.utexas.edu/~dpr342 >>>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> What most experimenters take for granted before they begin their >>>>>>> experiments is infinitely more interesting than any results to which their >>>>>>> experiments lead. >>>>>>> -- Norbert Wiener >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> ----------------------------------------------------- >>>>>> Dharmendar Reddy Palle >>>>>> Graduate Student >>>>>> Microelectronics Research center, >>>>>> University of Texas at Austin, >>>>>> 10100 Burnet Road, Bldg. 160 >>>>>> MER 2.608F, TX 78758-4445 >>>>>> e-mail: dharmareddy84 at gmail.com >>>>>> Phone: +1-512-350-9082 >>>>>> United States of America. >>>>>> Homepage: https://webspace.utexas.edu/~dpr342 >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> What most experimenters take for granted before they begin their >>>>> experiments is infinitely more interesting than any results to which their >>>>> experiments lead. >>>>> -- Norbert Wiener >>>>> >>>> >>>> >>>> >>>> -- >>>> ----------------------------------------------------- >>>> Dharmendar Reddy Palle >>>> Graduate Student >>>> Microelectronics Research center, >>>> University of Texas at Austin, >>>> 10100 Burnet Road, Bldg. 160 >>>> MER 2.608F, TX 78758-4445 >>>> e-mail: dharmareddy84 at gmail.com >>>> Phone: +1-512-350-9082 >>>> United States of America. >>>> Homepage: https://webspace.utexas.edu/~dpr342 >>>> >>> >>> >>> >>> -- >>> What most experimenters take for granted before they begin their >>> experiments is infinitely more interesting than any results to which their >>> experiments lead. >>> -- Norbert Wiener >>> >> >> >> >> -- >> ----------------------------------------------------- >> Dharmendar Reddy Palle >> Graduate Student >> Microelectronics Research center, >> University of Texas at Austin, >> 10100 Burnet Road, Bldg. 160 >> MER 2.608F, TX 78758-4445 >> e-mail: dharmareddy84 at gmail.com >> Phone: +1-512-350-9082 >> United States of America. >> Homepage: https://webspace.utexas.edu/~dpr342 >> > > > > -- > What most experimenters take for granted before they begin their > experiments is infinitely more interesting than any results to which their > experiments lead. > -- Norbert Wiener > -- ----------------------------------------------------- Dharmendar Reddy Palle Graduate Student Microelectronics Research center, University of Texas at Austin, 10100 Burnet Road, Bldg. 160 MER 2.608F, TX 78758-4445 e-mail: dharmareddy84 at gmail.com Phone: +1-512-350-9082 United States of America. Homepage: https://webspace.utexas.edu/~dpr342 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: silicon.png Type: image/png Size: 157216 bytes Desc: not available URL: From knepley at gmail.com Sun Mar 3 19:59:20 2013 From: knepley at gmail.com (Matthew Knepley) Date: Sun, 3 Mar 2013 20:59:20 -0500 Subject: [petsc-users] DMMeshCreateMeshFromAdjacency In-Reply-To: References: Message-ID: On Sun, Mar 3, 2013 at 7:03 PM, Dharmendar Reddy wrote: > Sorry, I will try to present the problem in more detial. > So i am trying to mesh a material region. The material is usually a > crystal with atoms located as per the lattice defining the crystal. See for > example the attached image which has silicon atoms (spheres) in the crystal > unit cell which is a cuboid. > > Now if i have a cuboid region with 10 unit cells each in x, y and z > direction. I need to mesh this region such that I have mesh nodes at atom > locations. The can be more mesh nodes than the atom locations. > I believe there is a way to do this in TetGen, but I had not added that to the interface. I will look at it. I think you would just add these as isolated vertices to the boundary DM you pass into DMPlexGenerate(). Matt > On Sun, Mar 3, 2013 at 5:45 PM, Matthew Knepley wrote: > >> On Sun, Mar 3, 2013 at 6:41 PM, Dharmendar Reddy > > wrote: >> >>> Let say I create triangular mesh in a square: (0,0) (0,1) (1,1) (0,1) >>> I want (0,0.25) and (0.25,0) to be among the mesh nodes. It can have >>> other nodes. >>> >> >> These explanations are too short. From the above, all I understand is >> that you would get >> a line between (0, 1/4) and (1/4, 0). >> >> Matt >> >> >>> On Sun, Mar 3, 2013 at 5:29 PM, Matthew Knepley wrote: >>> >>>> On Sun, Mar 3, 2013 at 5:04 PM, Dharmendar Reddy < >>>> dharmareddy84 at gmail.com> wrote: >>>> >>>>> Hello, >>>>> >>>>> We use cratisian mesh for certain problems only. The user >>>>> gives the mesh file as one of the inputs. I do not know a-priori what mesh >>>>> is created. >>>>> >>>>> On a related note, I am solving a system of equations where i need to >>>>> use a fine cartisian mesh for one equation (Schrodinger) but i would >>>>> prefer a coarse traiangular or tetrahedral element mesh for another >>>>> eqaution(Poisson). Is there an interface to interpolate data from one mesh >>>>> to another? >>>>> >>>> >>>> There is an interface, which is just a Mat, but there is no >>>> infrastructure for calculating it. >>>> >>>> >>>>> If i create a DM with a coarse mesh, Can i give the mesh a set of >>>>> vertices such that after re meshing the DM has the given vertices as mesh >>>>> nodes ? I tried using the gmsh to create a mesh with give set of vertices >>>>> inside a region but had no success. >>>>> >>>> >>>> I do not understand the question. >>>> >>>> Thanks, >>>> >>>> Matt >>>> >>>> >>>>> Thanks >>>>> Reddy >>>>> >>>>> On Sun, Mar 3, 2013 at 3:44 PM, Matthew Knepley wrote: >>>>> >>>>>> On Sun, Mar 3, 2013 at 3:48 PM, Dharmendar Reddy < >>>>>> dharmareddy84 at gmail.com> wrote: >>>>>> >>>>>>> So i should use petsc-dev ? I will try that. >>>>>>> >>>>>>> I there any way i can have access to submesh? Consider a this >>>>>>> scenario. >>>>>>> I have a two dimensional mesh in a rectangle with a uniform deltaX >>>>>>> and deltaY gridding. Is there any way i can get submesh at say x = >>>>>>> (i-1)*deltaX where say i = 1 to N. The dofs on the submesh will should be >>>>>>> mapped to dofs on the original mesh. The submesh in this case will be a 1D >>>>>>> mesh along y-axis. >>>>>>> >>>>>> >>>>>> 1) If you have a Cartesian mesh, use DMDA. This is no point in an >>>>>> unstructured mesh. >>>>>> >>>>>> 2) Yes, you can extract a submesh based upon labeled vertices using >>>>>> DMPlexCreateSubmesh(). It will have >>>>>> a map between points in the submesh and original mesh. >>>>>> >>>>>> >>>>>>> I can create each DM with input celllist and create maps after that >>>>>>> but i am wondering if this can be done via DMgetsubDM kind of call ? >>>>>>> >>>>>> >>>>>> Matt >>>>>> >>>>>> >>>>>>> Thanks >>>>>>> Reddy >>>>>>> >>>>>>> On Sun, Mar 3, 2013 at 2:11 PM, Matthew Knepley wrote: >>>>>>> >>>>>>>> On Sun, Mar 3, 2013 at 2:37 PM, Dharmendar Reddy < >>>>>>>> dharmareddy84 at gmail.com> wrote: >>>>>>>> >>>>>>>>> Hello, >>>>>>>>> >>>>>>>>> Thanks. I will have the code compiled with-cxx and >>>>>>>>> with-sieve. >>>>>>>>> The error is understandable when i look at the following line from >>>>>>>>> meshcreate.c >>>>>>>>> >>>>>>>>> 312: if (interpolate) {SETERRQ (comm, PETSC_ERR_SUP, "Interpolation (creation of faces and edges) is not yet supported.");} >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> Any idea if this feature will be implimented? I am trying to import mesh from gmsh. >>>>>>>>> I have a Fortran code which will genrate list for faces and edges for a given mesh. >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> Is there a DMMEsh interface through which i can input list of edges and faces ? >>>>>>>>> >>>>>>>>> >>>>>>>> DMMesh was an initial implementation of these ideas, but did not >>>>>>>> interface well with >>>>>>>> solvers, so it has been rewritten in C as DMPlex. The interface is >>>>>>>> almost exactly the >>>>>>>> same, and if you want increased functionality I would encourage you >>>>>>>> to switch. For >>>>>>>> example, DMMeshCreateMeshFromAdjacency() becomes >>>>>>>> >>>>>>>> DMPlexCreateFromCellList() >>>>>>>> >>>>>>>> and you can follow this with >>>>>>>> >>>>>>>> DMInterpolate() >>>>>>>> >>>>>>>> to automatically create the edges and faces. >>>>>>>> >>>>>>>> Thanks, >>>>>>>> >>>>>>>> Matt >>>>>>>> >>>>>>>> >>>>>>>>> Thanks >>>>>>>>> Reddy >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> On Sun, Mar 3, 2013 at 12:23 AM, Satish Balay wrote: >>>>>>>>> >>>>>>>>>> BTW: I don't get compile errors with this code using petsc-3.3 >>>>>>>>>> built with: >>>>>>>>>> >>>>>>>>>> --with-clanguage=cxx --with-sieve=1 --with-boost=1 >>>>>>>>>> >>>>>>>>>> [the code fails to run though..] >>>>>>>>>> >>>>>>>>>> Satish >>>>>>>>>> >>>>>>>>>> --------- >>>>>>>>>> >>>>>>>>>> asterix:/home/balay/download-pine>make >>>>>>>>>> PETSC_DIR=/home/balay/petsc-dist-test PETSC_ARCH=asterix64-sieve >>>>>>>>>> petscDMTest_v2 >>>>>>>>>> /home/balay/soft/linux64/mpich2-1.1/bin/mpif90 -c -fPIC -Wall >>>>>>>>>> -Wno-unused-variable -Wno-unused-dummy-argument -g >>>>>>>>>> -I/home/balay/petsc-dist-test/include >>>>>>>>>> -I/home/balay/petsc-dist-test/asterix64-sieve/include >>>>>>>>>> -I/home/balay/petsc-dist-test/include/sieve >>>>>>>>>> -I/home/balay/soft/linux64/mpich2-1.1/include >>>>>>>>>> -I/home/balay/soft/mpich2-1.5/include -o petscDMTest_v2.o >>>>>>>>>> petscDMTest_v2.F90 >>>>>>>>>> /home/balay/soft/linux64/mpich2-1.1/bin/mpif90 -fPIC -Wall >>>>>>>>>> -Wno-unused-variable -Wno-unused-dummy-argument -g -o petscDMTest_v2 >>>>>>>>>> petscDMTest_v2.o >>>>>>>>>> -Wl,-rpath,/home/balay/petsc-dist-test/asterix64-sieve/lib >>>>>>>>>> -L/home/balay/petsc-dist-test/asterix64-sieve/lib -lpetsc -lX11 -lpthread >>>>>>>>>> -llapack -lblas -lm -Wl,-rpath,/home/balay/soft/mpich2-1.5/lib >>>>>>>>>> -L/home/balay/soft/mpich2-1.5/lib >>>>>>>>>> -Wl,-rpath,/usr/lib/gcc/x86_64-redhat-linux/4.7.2 >>>>>>>>>> -L/usr/lib/gcc/x86_64-redhat-linux/4.7.2 -lmpichf90 -lgfortran -lm >>>>>>>>>> -lgfortran -lm -lquadmath -lm -lmpichcxx -lstdc++ -ldl -lmpich -lopa -lmpl >>>>>>>>>> -lrt -lgcc_s -ldl >>>>>>>>>> /usr/bin/rm -f petscDMTest_v2.o >>>>>>>>>> asterix:/home/balay/download-pine>./petscDMTest_v2 >>>>>>>>>> [0]PETSC ERROR: --------------------- Error Message >>>>>>>>>> ------------------------------------ >>>>>>>>>> [0]PETSC ERROR: No support for this operation for this object >>>>>>>>>> type! >>>>>>>>>> [0]PETSC ERROR: Interpolation (creation of faces and edges) is >>>>>>>>>> not yet supported.! >>>>>>>>>> [0]PETSC ERROR: >>>>>>>>>> ------------------------------------------------------------------------ >>>>>>>>>> [0]PETSC ERROR: Petsc Release Version 3.3.0, Patch 6, unknown >>>>>>>>>> [0]PETSC ERROR: See docs/changes/index.html for recent updates. >>>>>>>>>> [0]PETSC ERROR: See docs/faq.html for hints about trouble >>>>>>>>>> shooting. >>>>>>>>>> [0]PETSC ERROR: See docs/index.html for manual pages. >>>>>>>>>> [0]PETSC ERROR: >>>>>>>>>> ------------------------------------------------------------------------ >>>>>>>>>> [0]PETSC ERROR: ./petscDMTest_v2 on a asterix64 named asterix by >>>>>>>>>> balay Sun Mar 3 00:21:29 2013 >>>>>>>>>> [0]PETSC ERROR: Libraries linked from >>>>>>>>>> /home/balay/petsc-dist-test/asterix64-sieve/lib >>>>>>>>>> [0]PETSC ERROR: Configure run at Sun Mar 3 00:15:25 2013 >>>>>>>>>> [0]PETSC ERROR: Configure options >>>>>>>>>> --with-mpi-dir=/home/balay/soft/linux64/mpich2-1.1 >>>>>>>>>> --with-shared-libraries=1 --with-clanguage=cxx --with-sieve=1 >>>>>>>>>> PETSC_ARCH=asterix64-sieve --with-boost=1 >>>>>>>>>> [0]PETSC ERROR: >>>>>>>>>> ------------------------------------------------------------------------ >>>>>>>>>> [0]PETSC ERROR: DMMeshCreateMeshFromAdjacency() line 312 in >>>>>>>>>> /home/balay/petsc-dist-test/src/dm/impls/mesh/meshcreate.c >>>>>>>>>> Surcessfully Loaded mesh into DM >>>>>>>>>> asterix:/home/balay/download-pine> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> On Sat, 2 Mar 2013, Satish Balay wrote: >>>>>>>>>> >>>>>>>>>> > Fortran compiler doesn't care about presence or absence of >>>>>>>>>> interface >>>>>>>>>> > defintions. If they exist - then it does extra prototype >>>>>>>>>> checks. If >>>>>>>>>> > they don't exist - it assumes f77 and chugs along]. >>>>>>>>>> > >>>>>>>>>> > Did you build petsc with sieve [and cxx]? send make.log for >>>>>>>>>> this >>>>>>>>>> > petsc build. Also what do you get for: >>>>>>>>>> > >>>>>>>>>> > nm -Ao libpetsc.a |grep -i DMMeshCreateMeshFromAdjacency >>>>>>>>>> > >>>>>>>>>> > You can followup this issue [with logs] on petsc-maint. >>>>>>>>>> > >>>>>>>>>> > Satish >>>>>>>>>> > >>>>>>>>>> > >>>>>>>>>> > On Sat, 2 Mar 2013, Dharmendar Reddy wrote: >>>>>>>>>> > >>>>>>>>>> > > As you said, I do not need, PETSC_USE_FORTRAN_INTERFACES. The >>>>>>>>>> interface to >>>>>>>>>> > > dmmeshcreatefromadjacency is not defined in >>>>>>>>>> > > >>>>>>>>>> > > finclude/ftn-custom/petscdmmesh.h90 >>>>>>>>>> > > >>>>>>>>>> > > it is only defined in >>>>>>>>>> > > >>>>>>>>>> > > finclude/ftn-auto/petscdmmesh.h90 >>>>>>>>>> > > >>>>>>>>>> > > >>>>>>>>>> > > On Sat, Mar 2, 2013 at 7:51 PM, Dharmendar Reddy < >>>>>>>>>> dharmareddy84 at gmail.com>wrote: >>>>>>>>>> > > >>>>>>>>>> > > > Hello, >>>>>>>>>> > > > Sorry, I was going to create a test case. Anyways >>>>>>>>>> here is the >>>>>>>>>> > > > error message >>>>>>>>>> > > > >>>>>>>>>> > > > petscDMTest_v2.o: In function `MAIN__': >>>>>>>>>> > > > petscDMTest_v2.F90:(.text+0x354): undefined reference to >>>>>>>>>> > > > `dmmeshcreatemeshfromad >>>>>>>>>> > > > jacency_' >>>>>>>>>> > > > make: [testDMMesh] Error 1 (ignored) >>>>>>>>>> > > > >>>>>>>>>> > > > I have attached a test case and makefile. make all should >>>>>>>>>> gen rate the >>>>>>>>>> > > > executable. >>>>>>>>>> > > > >>>>>>>>>> > > > Thanks >>>>>>>>>> > > > Reddy >>>>>>>>>> > > > >>>>>>>>>> > > > >>>>>>>>>> > > > On Sat, Mar 2, 2013 at 7:10 PM, Satish Balay < >>>>>>>>>> balay at mcs.anl.gov> wrote: >>>>>>>>>> > > > >>>>>>>>>> > > >> On Sat, 2 Mar 2013, Dharmendar Reddy wrote: >>>>>>>>>> > > >> >>>>>>>>>> > > >> > Hello, >>>>>>>>>> > > >> > I am trying to use DMMeshCreateMeshFromAdjacency >>>>>>>>>> in a Fortran >>>>>>>>>> > > >> code. >>>>>>>>>> > > >> > I get undefined reference error. >>>>>>>>>> > > >> >>>>>>>>>> > > >> What error? please copy/paste >>>>>>>>>> > > >> >>>>>>>>>> > > >> > I include the following file in my program >>>>>>>>>> > > >> > #include "finclude/petsc.h90" >>>>>>>>>> > > >> > >>>>>>>>>> > > >> > I see that fortran interface to >>>>>>>>>> DMMeshCreateMeshFromAdjacency is defined >>>>>>>>>> > > >> > only in >>>>>>>>>> > > >> > >>>>>>>>>> > > >> > finclude/ftn-auto/petscdmmesh.h90 >>>>>>>>>> > > >> > >>>>>>>>>> > > >> > I am not able to figure out if >>>>>>>>>> PETSC_USE_FORTRAN_INTERFACES is defined. >>>>>>>>>> > > >> I >>>>>>>>>> > > >> > did not compile the code. I am runing the code on TACC >>>>>>>>>> stampede. I tried >>>>>>>>>> > > >> > adding >>>>>>>>>> > > >> > >>>>>>>>>> > > >> > #define PETSC_USE_FORTRAN_INTERFACES 1 >>>>>>>>>> > > >> > in my program before the petsc inlcude line but i still >>>>>>>>>> get error. >>>>>>>>>> > > >> >>>>>>>>>> > > >> 1. again 'get error' doesn't tell us anything. >>>>>>>>>> > > >> >>>>>>>>>> > > >> And you shouldn't need PETSC_USE_FORTRAN_INTERFACES to use >>>>>>>>>> > > >> DMMeshCreateMeshFromAdjacency >>>>>>>>>> > > >> >>>>>>>>>> > > >> Satish >>>>>>>>>> > > >> >>>>>>>>>> > > >> > >>>>>>>>>> > > >> > >>>>>>>>>> > > >> > Thanks >>>>>>>>>> > > >> > Reddy >>>>>>>>>> > > >> > >>>>>>>>>> > > >> > >>>>>>>>>> > > >> >>>>>>>>>> > > >> >>>>>>>>>> > > > >>>>>>>>>> > > > >>>>>>>>>> > > > -- >>>>>>>>>> > > > ----------------------------------------------------- >>>>>>>>>> > > > Dharmendar Reddy Palle >>>>>>>>>> > > > Graduate Student >>>>>>>>>> > > > Microelectronics Research center, >>>>>>>>>> > > > University of Texas at Austin, >>>>>>>>>> > > > 10100 Burnet Road, Bldg. 160 >>>>>>>>>> > > > MER 2.608F, TX 78758-4445 >>>>>>>>>> > > > e-mail: dharmareddy84 at gmail.com >>>>>>>>>> > > > Phone: +1-512-350-9082 >>>>>>>>>> > > > United States of America. >>>>>>>>>> > > > Homepage: https://webspace.utexas.edu/~dpr342 >>>>>>>>>> > > > >>>>>>>>>> > > >>>>>>>>>> > > >>>>>>>>>> > > >>>>>>>>>> > > >>>>>>>>>> > >>>>>>>>>> > >>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> -- >>>>>>>>> ----------------------------------------------------- >>>>>>>>> Dharmendar Reddy Palle >>>>>>>>> Graduate Student >>>>>>>>> Microelectronics Research center, >>>>>>>>> University of Texas at Austin, >>>>>>>>> 10100 Burnet Road, Bldg. 160 >>>>>>>>> MER 2.608F, TX 78758-4445 >>>>>>>>> e-mail: dharmareddy84 at gmail.com >>>>>>>>> Phone: +1-512-350-9082 >>>>>>>>> United States of America. >>>>>>>>> Homepage: https://webspace.utexas.edu/~dpr342 >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> What most experimenters take for granted before they begin their >>>>>>>> experiments is infinitely more interesting than any results to which their >>>>>>>> experiments lead. >>>>>>>> -- Norbert Wiener >>>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> ----------------------------------------------------- >>>>>>> Dharmendar Reddy Palle >>>>>>> Graduate Student >>>>>>> Microelectronics Research center, >>>>>>> University of Texas at Austin, >>>>>>> 10100 Burnet Road, Bldg. 160 >>>>>>> MER 2.608F, TX 78758-4445 >>>>>>> e-mail: dharmareddy84 at gmail.com >>>>>>> Phone: +1-512-350-9082 >>>>>>> United States of America. >>>>>>> Homepage: https://webspace.utexas.edu/~dpr342 >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> What most experimenters take for granted before they begin their >>>>>> experiments is infinitely more interesting than any results to which their >>>>>> experiments lead. >>>>>> -- Norbert Wiener >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> ----------------------------------------------------- >>>>> Dharmendar Reddy Palle >>>>> Graduate Student >>>>> Microelectronics Research center, >>>>> University of Texas at Austin, >>>>> 10100 Burnet Road, Bldg. 160 >>>>> MER 2.608F, TX 78758-4445 >>>>> e-mail: dharmareddy84 at gmail.com >>>>> Phone: +1-512-350-9082 >>>>> United States of America. >>>>> Homepage: https://webspace.utexas.edu/~dpr342 >>>>> >>>> >>>> >>>> >>>> -- >>>> What most experimenters take for granted before they begin their >>>> experiments is infinitely more interesting than any results to which their >>>> experiments lead. >>>> -- Norbert Wiener >>>> >>> >>> >>> >>> -- >>> ----------------------------------------------------- >>> Dharmendar Reddy Palle >>> Graduate Student >>> Microelectronics Research center, >>> University of Texas at Austin, >>> 10100 Burnet Road, Bldg. 160 >>> MER 2.608F, TX 78758-4445 >>> e-mail: dharmareddy84 at gmail.com >>> Phone: +1-512-350-9082 >>> United States of America. >>> Homepage: https://webspace.utexas.edu/~dpr342 >>> >> >> >> >> -- >> What most experimenters take for granted before they begin their >> experiments is infinitely more interesting than any results to which their >> experiments lead. >> -- Norbert Wiener >> > > > > -- > ----------------------------------------------------- > Dharmendar Reddy Palle > Graduate Student > Microelectronics Research center, > University of Texas at Austin, > 10100 Burnet Road, Bldg. 160 > MER 2.608F, TX 78758-4445 > e-mail: dharmareddy84 at gmail.com > Phone: +1-512-350-9082 > United States of America. > Homepage: https://webspace.utexas.edu/~dpr342 > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From james.j.ramsey14.civ at mail.mil Mon Mar 4 07:11:01 2013 From: james.j.ramsey14.civ at mail.mil (Ramsey, James J CIV (US)) Date: Mon, 4 Mar 2013 13:11:01 +0000 Subject: [petsc-users] "Exact-ish" preallocation for (mostly) unstructured mesh with periodic boundary conditions? In-Reply-To: References: , Message-ID: -------------------------------------------------------------------------------------------- We have code to do this in PETSc right now. You need to specify your topology using DMPlex, and then just use DMCreateMatrix(). -------------------------------------------------------------------------------------------- Isn't DMPlex (as opposed to DMComplex?) is in petsc-dev rather than in the release versions of PETSc? From jedbrown at mcs.anl.gov Mon Mar 4 07:19:26 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Mon, 4 Mar 2013 07:19:26 -0600 Subject: [petsc-users] "Exact-ish" preallocation for (mostly) unstructured mesh with periodic boundary conditions? In-Reply-To: References: Message-ID: On Mon, Mar 4, 2013 at 7:11 AM, Ramsey, James J CIV (US) < james.j.ramsey14.civ at mail.mil> wrote: > Isn't DMPlex (as opposed to DMComplex?) is in petsc-dev rather than in the > release versions of PETSc? Yes, it was renamed to avoid confusion that it had something to do with complex numbers. The version in petsc-3.3 was really not ready for general use anyway. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dharmareddy84 at gmail.com Mon Mar 4 18:50:21 2013 From: dharmareddy84 at gmail.com (Dharmendar Reddy) Date: Mon, 4 Mar 2013 18:50:21 -0600 Subject: [petsc-users] DMPlex Fortran examples Message-ID: Hello, Is there a DMPlex based fortran example for solving a pde such as laplace ? Even a c example will do. I am not able to understand the terminology of chart, cone etc. Is there a paper or user guide to learn more about the definitions of terms such as chart cone stratum ? I remember reading a presentation file by mathew about sieve. Is there a newer tutorial with terminology mapped to the new DMPlex/DMMesh functions. Thanks Reddy -- ----------------------------------------------------- Dharmendar Reddy Palle Graduate Student Microelectronics Research center, University of Texas at Austin, 10100 Burnet Road, Bldg. 160 MER 2.608F, TX 78758-4445 e-mail: dharmareddy84 at gmail.com Phone: +1-512-350-9082 United States of America. Homepage: https://webspace.utexas.edu/~dpr342 -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Mon Mar 4 19:39:58 2013 From: knepley at gmail.com (Matthew Knepley) Date: Mon, 4 Mar 2013 20:39:58 -0500 Subject: [petsc-users] DMPlex Fortran examples In-Reply-To: References: Message-ID: On Mon, Mar 4, 2013 at 7:50 PM, Dharmendar Reddy wrote: > Hello, > Is there a DMPlex based fortran example for solving a pde such as > laplace ? Even a c example will do. I am not able to understand the > terminology of chart, cone etc. Is there a paper or user guide to learn > more about the definitions of terms such as chart cone stratum ? I remember > reading a presentation file by mathew about sieve. Is there a newer > tutorial with terminology mapped to the new DMPlex/DMMesh functions. > There is a fully worked out Stokes example (SNES ex62) and a Finite Volume example (TS ex11), and there are a few tests. You should not need much of that stuff for defining a problem. I am writing up a paper about ex11 right now. There is a short manual section on unstructured grids as well. I think the key thing to understand is how to define a data layout over the mesh using a PetscSection. Once that is done, all the DM functions work as normal, and the last hard part is coding your residual loop. I have support for FEM schemes, but its undocumented and slightly complex in order to allow GPU assembly, so you may be more comfortable with your own element loop to start. Thanks, Matt > Thanks > Reddy > > > -- > ----------------------------------------------------- > Dharmendar Reddy Palle > Graduate Student > Microelectronics Research center, > University of Texas at Austin, > 10100 Burnet Road, Bldg. 160 > MER 2.608F, TX 78758-4445 > e-mail: dharmareddy84 at gmail.com > Phone: +1-512-350-9082 > United States of America. > Homepage: https://webspace.utexas.edu/~dpr342 > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From dharmareddy84 at gmail.com Tue Mar 5 01:18:13 2013 From: dharmareddy84 at gmail.com (Dharmendar Reddy) Date: Tue, 5 Mar 2013 01:18:13 -0600 Subject: [petsc-users] DMPlex Fortran examples In-Reply-To: References: Message-ID: Hello, Trying to understand the DMPlexCreateSection first. I have created a test case, can you please have a look at it? Actually the code has a link error on my system with petsc-dev. I used DMPlexeCreateBoxMesh to create the mesh. Looks like there is no Fortran interface to that function. If i comment out the dmplexcreateboxmesh. It does create and executable. petscDMTest_v2.o: In function `MAIN__': petscDMTest_v2.F90:(.text+0x9b): undefined reference to `dmplexcreateboxmesh_' make: [testDMMeshv2] Error 1 (ignored) Also, If include finclude/petsc.h90 instead of finclude/petsch.h i get compile error : petscDMTest_v2.F90(73): error #6691: A pointer dummy argument may only be argument a ssociated with a pointer. [NUMCOMP] call DMPlexCreateSection(dmMesh, topologyDim, numField, numComp, numDof, & ----------------------------------------------------------^ petscDMTest_v2.F90(73): error #6691: A pointer dummy argument may only be argument a ssociated with a pointer. [NUMDOF] call DMPlexCreateSection(dmMesh, topologyDim, numField, numComp, numDof, & -------------------------------------------------------------------^ petscDMTest_v2.F90(74): error #6691: A pointer dummy argument may only be argument a ssociated with a pointer. [BCFIELD] numBC, bcField, bcPointIS,section,ierr) ----------------------------------^ petscDMTest_v2.F90(74): error #6691: A pointer dummy argument may only be argument a ssociated with a pointer. [BCPOINTIS] numBC, bcField, bcPointIS,section,ierr) -------------------------------------------^ Please have a look at the attached test case and Makefile On Mon, Mar 4, 2013 at 7:39 PM, Matthew Knepley wrote: > On Mon, Mar 4, 2013 at 7:50 PM, Dharmendar Reddy wrote: > >> Hello, >> Is there a DMPlex based fortran example for solving a pde such >> as laplace ? Even a c example will do. I am not able to understand the >> terminology of chart, cone etc. Is there a paper or user guide to learn >> more about the definitions of terms such as chart cone stratum ? I remember >> reading a presentation file by mathew about sieve. Is there a newer >> tutorial with terminology mapped to the new DMPlex/DMMesh functions. >> > > There is a fully worked out Stokes example (SNES ex62) and a Finite Volume > example (TS ex11), > and there are a few tests. You should not need much of that stuff for > defining a problem. I am > writing up a paper about ex11 right now. There is a short manual section > on unstructured grids as well. > > I think the key thing to understand is how to define a data layout over > the mesh using a PetscSection. > Once that is done, all the DM functions work as normal, and the last hard > part is coding your residual > loop. I have support for FEM schemes, but its undocumented and slightly > complex in order to allow > GPU assembly, so you may be more comfortable with your own element loop to > start. > > Thanks, > > Matt > > >> Thanks >> Reddy >> >> >> -- >> ----------------------------------------------------- >> Dharmendar Reddy Palle >> Graduate Student >> Microelectronics Research center, >> University of Texas at Austin, >> 10100 Burnet Road, Bldg. 160 >> MER 2.608F, TX 78758-4445 >> e-mail: dharmareddy84 at gmail.com >> Phone: +1-512-350-9082 >> United States of America. >> Homepage: https://webspace.utexas.edu/~dpr342 >> > > > > -- > What most experimenters take for granted before they begin their > experiments is infinitely more interesting than any results to which their > experiments lead. > -- Norbert Wiener > -- ----------------------------------------------------- Dharmendar Reddy Palle Graduate Student Microelectronics Research center, University of Texas at Austin, 10100 Burnet Road, Bldg. 160 MER 2.608F, TX 78758-4445 e-mail: dharmareddy84 at gmail.com Phone: +1-512-350-9082 United States of America. Homepage: https://webspace.utexas.edu/~dpr342 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: petscDMTest_v2.F90 Type: application/octet-stream Size: 3943 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Makefile Type: application/octet-stream Size: 506 bytes Desc: not available URL: From dharmareddy84 at gmail.com Tue Mar 5 01:30:30 2013 From: dharmareddy84 at gmail.com (Dharmendar Reddy) Date: Tue, 5 Mar 2013 01:30:30 -0600 Subject: [petsc-users] DMPlex Fortran examples In-Reply-To: References: Message-ID: On a related note, How does one handle auxilary data on the mesh ? Say in a Poisson problem, I want to assign dielectric constant to each cell. Of course i can create a indexset or vec tor but, I want the aux data to be distributed along with the mesh. On Tue, Mar 5, 2013 at 1:18 AM, Dharmendar Reddy wrote: > Hello, > Trying to understand the DMPlexCreateSection first. I have > created a test case, can you please have a look at it? Actually the code > has a link error on my system with petsc-dev. I used DMPlexeCreateBoxMesh > to create the mesh. Looks like there is no Fortran interface to that > function. If i comment out the dmplexcreateboxmesh. It does create and > executable. > > petscDMTest_v2.o: In function `MAIN__': > petscDMTest_v2.F90:(.text+0x9b): undefined reference to > `dmplexcreateboxmesh_' > make: [testDMMeshv2] Error 1 (ignored) > > Also, If include finclude/petsc.h90 instead of finclude/petsch.h i get > compile error : > > petscDMTest_v2.F90(73): error #6691: A pointer dummy argument may only be > argument a > ssociated with a pointer. [NUMCOMP] > call DMPlexCreateSection(dmMesh, topologyDim, numField, numComp, numDof, > & > ----------------------------------------------------------^ > petscDMTest_v2.F90(73): error #6691: A pointer dummy argument may only be > argument a > ssociated with a pointer. [NUMDOF] > call DMPlexCreateSection(dmMesh, topologyDim, numField, numComp, numDof, > & > -------------------------------------------------------------------^ > petscDMTest_v2.F90(74): error #6691: A pointer dummy argument may only be > argument a > ssociated with a pointer. [BCFIELD] > numBC, bcField, bcPointIS,section,ierr) > ----------------------------------^ > petscDMTest_v2.F90(74): error #6691: A pointer dummy argument may only be > argument a > ssociated with a pointer. [BCPOINTIS] > numBC, bcField, bcPointIS,section,ierr) > -------------------------------------------^ > > Please have a look at the attached test case and Makefile > > > On Mon, Mar 4, 2013 at 7:39 PM, Matthew Knepley wrote: > >> On Mon, Mar 4, 2013 at 7:50 PM, Dharmendar Reddy > > wrote: >> >>> Hello, >>> Is there a DMPlex based fortran example for solving a pde such >>> as laplace ? Even a c example will do. I am not able to understand the >>> terminology of chart, cone etc. Is there a paper or user guide to learn >>> more about the definitions of terms such as chart cone stratum ? I remember >>> reading a presentation file by mathew about sieve. Is there a newer >>> tutorial with terminology mapped to the new DMPlex/DMMesh functions. >>> >> >> There is a fully worked out Stokes example (SNES ex62) and a Finite >> Volume example (TS ex11), >> and there are a few tests. You should not need much of that stuff for >> defining a problem. I am >> writing up a paper about ex11 right now. There is a short manual section >> on unstructured grids as well. >> >> I think the key thing to understand is how to define a data layout over >> the mesh using a PetscSection. >> Once that is done, all the DM functions work as normal, and the last hard >> part is coding your residual >> loop. I have support for FEM schemes, but its undocumented and slightly >> complex in order to allow >> GPU assembly, so you may be more comfortable with your own element loop >> to start. >> >> Thanks, >> >> Matt >> >> >>> Thanks >>> Reddy >>> >>> >>> -- >>> ----------------------------------------------------- >>> Dharmendar Reddy Palle >>> Graduate Student >>> Microelectronics Research center, >>> University of Texas at Austin, >>> 10100 Burnet Road, Bldg. 160 >>> MER 2.608F, TX 78758-4445 >>> e-mail: dharmareddy84 at gmail.com >>> Phone: +1-512-350-9082 >>> United States of America. >>> Homepage: https://webspace.utexas.edu/~dpr342 >>> >> >> >> >> -- >> What most experimenters take for granted before they begin their >> experiments is infinitely more interesting than any results to which their >> experiments lead. >> -- Norbert Wiener >> > > > > -- > ----------------------------------------------------- > Dharmendar Reddy Palle > Graduate Student > Microelectronics Research center, > University of Texas at Austin, > 10100 Burnet Road, Bldg. 160 > MER 2.608F, TX 78758-4445 > e-mail: dharmareddy84 at gmail.com > Phone: +1-512-350-9082 > United States of America. > Homepage: https://webspace.utexas.edu/~dpr342 > -- ----------------------------------------------------- Dharmendar Reddy Palle Graduate Student Microelectronics Research center, University of Texas at Austin, 10100 Burnet Road, Bldg. 160 MER 2.608F, TX 78758-4445 e-mail: dharmareddy84 at gmail.com Phone: +1-512-350-9082 United States of America. Homepage: https://webspace.utexas.edu/~dpr342 -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Tue Mar 5 04:44:53 2013 From: knepley at gmail.com (Matthew Knepley) Date: Tue, 5 Mar 2013 05:44:53 -0500 Subject: [petsc-users] DMPlex Fortran examples In-Reply-To: References: Message-ID: On Tue, Mar 5, 2013 at 2:18 AM, Dharmendar Reddy wrote: > Hello, > Trying to understand the DMPlexCreateSection first. I have > created a test case, can you please have a look at it? Actually the code > has a link error on my system with petsc-dev. I used DMPlexeCreateBoxMesh > to create the mesh. Looks like there is no Fortran interface to that > function. If i comment out the dmplexcreateboxmesh. It does create and > executable. > I pushed a Fortran binding for that function. > petscDMTest_v2.o: In function `MAIN__': > petscDMTest_v2.F90:(.text+0x9b): undefined reference to > `dmplexcreateboxmesh_' > make: [testDMMeshv2] Error 1 (ignored) > > Also, If include finclude/petsc.h90 instead of finclude/petsch.h i get > compile error : > I have also pushed a Fortran binding for this function. You can't use F90 arrays here, but need normal F77 arrays. We can make a version that uses F90 arrays if that is what you need. Matt > petscDMTest_v2.F90(73): error #6691: A pointer dummy argument may only be > argument a > ssociated with a pointer. [NUMCOMP] > call DMPlexCreateSection(dmMesh, topologyDim, numField, numComp, numDof, > & > ----------------------------------------------------------^ > petscDMTest_v2.F90(73): error #6691: A pointer dummy argument may only be > argument a > ssociated with a pointer. [NUMDOF] > call DMPlexCreateSection(dmMesh, topologyDim, numField, numComp, numDof, > & > -------------------------------------------------------------------^ > petscDMTest_v2.F90(74): error #6691: A pointer dummy argument may only be > argument a > ssociated with a pointer. [BCFIELD] > numBC, bcField, bcPointIS,section,ierr) > ----------------------------------^ > petscDMTest_v2.F90(74): error #6691: A pointer dummy argument may only be > argument a > ssociated with a pointer. [BCPOINTIS] > numBC, bcField, bcPointIS,section,ierr) > -------------------------------------------^ > > Please have a look at the attached test case and Makefile > > On Mon, Mar 4, 2013 at 7:39 PM, Matthew Knepley wrote: > >> On Mon, Mar 4, 2013 at 7:50 PM, Dharmendar Reddy > > wrote: >> >>> Hello, >>> Is there a DMPlex based fortran example for solving a pde such >>> as laplace ? Even a c example will do. I am not able to understand the >>> terminology of chart, cone etc. Is there a paper or user guide to learn >>> more about the definitions of terms such as chart cone stratum ? I remember >>> reading a presentation file by mathew about sieve. Is there a newer >>> tutorial with terminology mapped to the new DMPlex/DMMesh functions. >>> >> >> There is a fully worked out Stokes example (SNES ex62) and a Finite >> Volume example (TS ex11), >> and there are a few tests. You should not need much of that stuff for >> defining a problem. I am >> writing up a paper about ex11 right now. There is a short manual section >> on unstructured grids as well. >> >> I think the key thing to understand is how to define a data layout over >> the mesh using a PetscSection. >> Once that is done, all the DM functions work as normal, and the last hard >> part is coding your residual >> loop. I have support for FEM schemes, but its undocumented and slightly >> complex in order to allow >> GPU assembly, so you may be more comfortable with your own element loop >> to start. >> >> Thanks, >> >> Matt >> >> >>> Thanks >>> Reddy >>> >>> >>> -- >>> ----------------------------------------------------- >>> Dharmendar Reddy Palle >>> Graduate Student >>> Microelectronics Research center, >>> University of Texas at Austin, >>> 10100 Burnet Road, Bldg. 160 >>> MER 2.608F, TX 78758-4445 >>> e-mail: dharmareddy84 at gmail.com >>> Phone: +1-512-350-9082 >>> United States of America. >>> Homepage: https://webspace.utexas.edu/~dpr342 >>> >> >> >> >> -- >> What most experimenters take for granted before they begin their >> experiments is infinitely more interesting than any results to which their >> experiments lead. >> -- Norbert Wiener >> > > > > -- > ----------------------------------------------------- > Dharmendar Reddy Palle > Graduate Student > Microelectronics Research center, > University of Texas at Austin, > 10100 Burnet Road, Bldg. 160 > MER 2.608F, TX 78758-4445 > e-mail: dharmareddy84 at gmail.com > Phone: +1-512-350-9082 > United States of America. > Homepage: https://webspace.utexas.edu/~dpr342 > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Tue Mar 5 04:55:47 2013 From: knepley at gmail.com (Matthew Knepley) Date: Tue, 5 Mar 2013 05:55:47 -0500 Subject: [petsc-users] DMPlex Fortran examples In-Reply-To: References: Message-ID: On Tue, Mar 5, 2013 at 2:30 AM, Dharmendar Reddy wrote: > On a related note, How does one handle auxilary data on the mesh ? Say in > a Poisson problem, I want to assign dielectric constant to each cell. Of > course i can create a indexset or vec tor but, I want the aux data to be > distributed along with the mesh. 1) I have created an F90 version of DMPlexCreateSection() 2) My plan was to have them assigned on the distributed mesh, since this is scalable. However, assigning them on the serial mesh will be straightforward. You will use DMPlexDistributeField(). The only thing you will need is the PetscSF created during distribution, which I will preserve, since right now it is destroyed at the end. Thanks, Matt > On Tue, Mar 5, 2013 at 1:18 AM, Dharmendar Reddy wrote: > >> Hello, >> Trying to understand the DMPlexCreateSection first. I have >> created a test case, can you please have a look at it? Actually the code >> has a link error on my system with petsc-dev. I used DMPlexeCreateBoxMesh >> to create the mesh. Looks like there is no Fortran interface to that >> function. If i comment out the dmplexcreateboxmesh. It does create and >> executable. >> >> petscDMTest_v2.o: In function `MAIN__': >> petscDMTest_v2.F90:(.text+0x9b): undefined reference to >> `dmplexcreateboxmesh_' >> make: [testDMMeshv2] Error 1 (ignored) >> >> Also, If include finclude/petsc.h90 instead of finclude/petsch.h i get >> compile error : >> >> petscDMTest_v2.F90(73): error #6691: A pointer dummy argument may only be >> argument a >> ssociated with a pointer. [NUMCOMP] >> call DMPlexCreateSection(dmMesh, topologyDim, numField, numComp, >> numDof, & >> ----------------------------------------------------------^ >> petscDMTest_v2.F90(73): error #6691: A pointer dummy argument may only be >> argument a >> ssociated with a pointer. [NUMDOF] >> call DMPlexCreateSection(dmMesh, topologyDim, numField, numComp, >> numDof, & >> -------------------------------------------------------------------^ >> petscDMTest_v2.F90(74): error #6691: A pointer dummy argument may only be >> argument a >> ssociated with a pointer. [BCFIELD] >> numBC, bcField, bcPointIS,section,ierr) >> ----------------------------------^ >> petscDMTest_v2.F90(74): error #6691: A pointer dummy argument may only be >> argument a >> ssociated with a pointer. [BCPOINTIS] >> numBC, bcField, bcPointIS,section,ierr) >> -------------------------------------------^ >> >> Please have a look at the attached test case and Makefile >> >> >> On Mon, Mar 4, 2013 at 7:39 PM, Matthew Knepley wrote: >> >>> On Mon, Mar 4, 2013 at 7:50 PM, Dharmendar Reddy < >>> dharmareddy84 at gmail.com> wrote: >>> >>>> Hello, >>>> Is there a DMPlex based fortran example for solving a pde such >>>> as laplace ? Even a c example will do. I am not able to understand the >>>> terminology of chart, cone etc. Is there a paper or user guide to learn >>>> more about the definitions of terms such as chart cone stratum ? I remember >>>> reading a presentation file by mathew about sieve. Is there a newer >>>> tutorial with terminology mapped to the new DMPlex/DMMesh functions. >>>> >>> >>> There is a fully worked out Stokes example (SNES ex62) and a Finite >>> Volume example (TS ex11), >>> and there are a few tests. You should not need much of that stuff for >>> defining a problem. I am >>> writing up a paper about ex11 right now. There is a short manual section >>> on unstructured grids as well. >>> >>> I think the key thing to understand is how to define a data layout over >>> the mesh using a PetscSection. >>> Once that is done, all the DM functions work as normal, and the last >>> hard part is coding your residual >>> loop. I have support for FEM schemes, but its undocumented and slightly >>> complex in order to allow >>> GPU assembly, so you may be more comfortable with your own element loop >>> to start. >>> >>> Thanks, >>> >>> Matt >>> >>> >>>> Thanks >>>> Reddy >>>> >>>> >>>> -- >>>> ----------------------------------------------------- >>>> Dharmendar Reddy Palle >>>> Graduate Student >>>> Microelectronics Research center, >>>> University of Texas at Austin, >>>> 10100 Burnet Road, Bldg. 160 >>>> MER 2.608F, TX 78758-4445 >>>> e-mail: dharmareddy84 at gmail.com >>>> Phone: +1-512-350-9082 >>>> United States of America. >>>> Homepage: https://webspace.utexas.edu/~dpr342 >>>> >>> >>> >>> >>> -- >>> What most experimenters take for granted before they begin their >>> experiments is infinitely more interesting than any results to which their >>> experiments lead. >>> -- Norbert Wiener >>> >> >> >> >> -- >> ----------------------------------------------------- >> Dharmendar Reddy Palle >> Graduate Student >> Microelectronics Research center, >> University of Texas at Austin, >> 10100 Burnet Road, Bldg. 160 >> MER 2.608F, TX 78758-4445 >> e-mail: dharmareddy84 at gmail.com >> Phone: +1-512-350-9082 >> United States of America. >> Homepage: https://webspace.utexas.edu/~dpr342 >> > > > > -- > ----------------------------------------------------- > Dharmendar Reddy Palle > Graduate Student > Microelectronics Research center, > University of Texas at Austin, > 10100 Burnet Road, Bldg. 160 > MER 2.608F, TX 78758-4445 > e-mail: dharmareddy84 at gmail.com > Phone: +1-512-350-9082 > United States of America. > Homepage: https://webspace.utexas.edu/~dpr342 > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Tue Mar 5 09:06:15 2013 From: knepley at gmail.com (Matthew Knepley) Date: Tue, 5 Mar 2013 10:06:15 -0500 Subject: [petsc-users] DMPlex Fortran examples In-Reply-To: References: Message-ID: On Tue, Mar 5, 2013 at 2:18 AM, Dharmendar Reddy wrote: > Hello, > Trying to understand the DMPlexCreateSection first. I have > created a test case, can you please have a look at it? Actually the code > has a link error on my system with petsc-dev. I used DMPlexeCreateBoxMesh > to create the mesh. Looks like there is no Fortran interface to that > function. If i comment out the dmplexcreateboxmesh. It does create and > executable. > I have now pushed your example, slightly changed, to the repository: src/dm/impls/plex/examples/tutorials/ex1.c/ex1f90.F and you can run with -dim 2 or -dim 3. Thanks, Matt > petscDMTest_v2.o: In function `MAIN__': > petscDMTest_v2.F90:(.text+0x9b): undefined reference to > `dmplexcreateboxmesh_' > make: [testDMMeshv2] Error 1 (ignored) > > Also, If include finclude/petsc.h90 instead of finclude/petsch.h i get > compile error : > > petscDMTest_v2.F90(73): error #6691: A pointer dummy argument may only be > argument a > ssociated with a pointer. [NUMCOMP] > call DMPlexCreateSection(dmMesh, topologyDim, numField, numComp, numDof, > & > ----------------------------------------------------------^ > petscDMTest_v2.F90(73): error #6691: A pointer dummy argument may only be > argument a > ssociated with a pointer. [NUMDOF] > call DMPlexCreateSection(dmMesh, topologyDim, numField, numComp, numDof, > & > -------------------------------------------------------------------^ > petscDMTest_v2.F90(74): error #6691: A pointer dummy argument may only be > argument a > ssociated with a pointer. [BCFIELD] > numBC, bcField, bcPointIS,section,ierr) > ----------------------------------^ > petscDMTest_v2.F90(74): error #6691: A pointer dummy argument may only be > argument a > ssociated with a pointer. [BCPOINTIS] > numBC, bcField, bcPointIS,section,ierr) > -------------------------------------------^ > > Please have a look at the attached test case and Makefile > > > On Mon, Mar 4, 2013 at 7:39 PM, Matthew Knepley wrote: > >> On Mon, Mar 4, 2013 at 7:50 PM, Dharmendar Reddy > > wrote: >> >>> Hello, >>> Is there a DMPlex based fortran example for solving a pde such >>> as laplace ? Even a c example will do. I am not able to understand the >>> terminology of chart, cone etc. Is there a paper or user guide to learn >>> more about the definitions of terms such as chart cone stratum ? I remember >>> reading a presentation file by mathew about sieve. Is there a newer >>> tutorial with terminology mapped to the new DMPlex/DMMesh functions. >>> >> >> There is a fully worked out Stokes example (SNES ex62) and a Finite >> Volume example (TS ex11), >> and there are a few tests. You should not need much of that stuff for >> defining a problem. I am >> writing up a paper about ex11 right now. There is a short manual section >> on unstructured grids as well. >> >> I think the key thing to understand is how to define a data layout over >> the mesh using a PetscSection. >> Once that is done, all the DM functions work as normal, and the last hard >> part is coding your residual >> loop. I have support for FEM schemes, but its undocumented and slightly >> complex in order to allow >> GPU assembly, so you may be more comfortable with your own element loop >> to start. >> >> Thanks, >> >> Matt >> >> >>> Thanks >>> Reddy >>> >>> >>> -- >>> ----------------------------------------------------- >>> Dharmendar Reddy Palle >>> Graduate Student >>> Microelectronics Research center, >>> University of Texas at Austin, >>> 10100 Burnet Road, Bldg. 160 >>> MER 2.608F, TX 78758-4445 >>> e-mail: dharmareddy84 at gmail.com >>> Phone: +1-512-350-9082 >>> United States of America. >>> Homepage: https://webspace.utexas.edu/~dpr342 >>> >> >> >> >> -- >> What most experimenters take for granted before they begin their >> experiments is infinitely more interesting than any results to which their >> experiments lead. >> -- Norbert Wiener >> > > > > -- > ----------------------------------------------------- > Dharmendar Reddy Palle > Graduate Student > Microelectronics Research center, > University of Texas at Austin, > 10100 Burnet Road, Bldg. 160 > MER 2.608F, TX 78758-4445 > e-mail: dharmareddy84 at gmail.com > Phone: +1-512-350-9082 > United States of America. > Homepage: https://webspace.utexas.edu/~dpr342 > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From dharmareddy84 at gmail.com Tue Mar 5 09:20:31 2013 From: dharmareddy84 at gmail.com (Dharmendar Reddy) Date: Tue, 5 Mar 2013 09:20:31 -0600 Subject: [petsc-users] DMPlex Fortran examples In-Reply-To: References: Message-ID: Thanks, so numDof is basically number of dof per topological entity of a cell. Did i get this right ? +! Let u be defined on vertices + numDof(0*(dim+1)+1) = 1 (should not be number of nodes) +! Let v be defined on cells + numDof(1*(dim+1)+dim+1) = dim +! Let v be defined on faces + numDof(2*(dim+1)+dim) = dim-1 (similarly, should not be number of faces time (dim-1)) On Tue, Mar 5, 2013 at 9:06 AM, Matthew Knepley wrote: > On Tue, Mar 5, 2013 at 2:18 AM, Dharmendar Reddy wrote: > >> Hello, >> >> Trying to understand the DMPlexCreateSection first. I have >> created a test case, can you please have a look at it? Actually the code >> has a link error on my system with petsc-dev. I used DMPlexeCreateBoxMesh >> to create the mesh. Looks like there is no Fortran interface to that >> function. If i comment out the dmplexcreateboxmesh. It does create and >> executable. >> > > I have now pushed your example, slightly changed, to the repository: > > src/dm/impls/plex/examples/tutorials/ex1.c/ex1f90.F > > and you can run with -dim 2 or -dim 3. > > Thanks, > > Matt > > >> petscDMTest_v2.o: In function `MAIN__': >> petscDMTest_v2.F90:(.text+0x9b): undefined reference to >> `dmplexcreateboxmesh_' >> make: [testDMMeshv2] Error 1 (ignored) >> >> Also, If include finclude/petsc.h90 instead of finclude/petsch.h i get >> compile error : >> >> petscDMTest_v2.F90(73): error #6691: A pointer dummy argument may only be >> argument a >> ssociated with a pointer. [NUMCOMP] >> call DMPlexCreateSection(dmMesh, topologyDim, numField, numComp, >> numDof, & >> ----------------------------------------------------------^ >> petscDMTest_v2.F90(73): error #6691: A pointer dummy argument may only be >> argument a >> ssociated with a pointer. [NUMDOF] >> call DMPlexCreateSection(dmMesh, topologyDim, numField, numComp, >> numDof, & >> -------------------------------------------------------------------^ >> petscDMTest_v2.F90(74): error #6691: A pointer dummy argument may only be >> argument a >> ssociated with a pointer. [BCFIELD] >> numBC, bcField, bcPointIS,section,ierr) >> ----------------------------------^ >> petscDMTest_v2.F90(74): error #6691: A pointer dummy argument may only be >> argument a >> ssociated with a pointer. [BCPOINTIS] >> numBC, bcField, bcPointIS,section,ierr) >> -------------------------------------------^ >> >> Please have a look at the attached test case and Makefile >> >> >> On Mon, Mar 4, 2013 at 7:39 PM, Matthew Knepley wrote: >> >>> On Mon, Mar 4, 2013 at 7:50 PM, Dharmendar Reddy < >>> dharmareddy84 at gmail.com> wrote: >>> >>>> Hello, >>>> Is there a DMPlex based fortran example for solving a pde such >>>> as laplace ? Even a c example will do. I am not able to understand the >>>> terminology of chart, cone etc. Is there a paper or user guide to learn >>>> more about the definitions of terms such as chart cone stratum ? I remember >>>> reading a presentation file by mathew about sieve. Is there a newer >>>> tutorial with terminology mapped to the new DMPlex/DMMesh functions. >>>> >>> >>> There is a fully worked out Stokes example (SNES ex62) and a Finite >>> Volume example (TS ex11), >>> and there are a few tests. You should not need much of that stuff for >>> defining a problem. I am >>> writing up a paper about ex11 right now. There is a short manual section >>> on unstructured grids as well. >>> >>> I think the key thing to understand is how to define a data layout over >>> the mesh using a PetscSection. >>> Once that is done, all the DM functions work as normal, and the last >>> hard part is coding your residual >>> loop. I have support for FEM schemes, but its undocumented and slightly >>> complex in order to allow >>> GPU assembly, so you may be more comfortable with your own element loop >>> to start. >>> >>> Thanks, >>> >>> Matt >>> >>> >>>> Thanks >>>> Reddy >>>> >>>> >>>> -- >>>> ----------------------------------------------------- >>>> Dharmendar Reddy Palle >>>> Graduate Student >>>> Microelectronics Research center, >>>> University of Texas at Austin, >>>> 10100 Burnet Road, Bldg. 160 >>>> MER 2.608F, TX 78758-4445 >>>> e-mail: dharmareddy84 at gmail.com >>>> Phone: +1-512-350-9082 >>>> United States of America. >>>> Homepage: https://webspace.utexas.edu/~dpr342 >>>> >>> >>> >>> >>> -- >>> What most experimenters take for granted before they begin their >>> experiments is infinitely more interesting than any results to which their >>> experiments lead. >>> -- Norbert Wiener >>> >> >> >> >> -- >> ----------------------------------------------------- >> Dharmendar Reddy Palle >> Graduate Student >> Microelectronics Research center, >> University of Texas at Austin, >> 10100 Burnet Road, Bldg. 160 >> MER 2.608F, TX 78758-4445 >> e-mail: dharmareddy84 at gmail.com >> Phone: +1-512-350-9082 >> United States of America. >> Homepage: https://webspace.utexas.edu/~dpr342 >> > > > > -- > What most experimenters take for granted before they begin their > experiments is infinitely more interesting than any results to which their > experiments lead. > -- Norbert Wiener > -- ----------------------------------------------------- Dharmendar Reddy Palle Graduate Student Microelectronics Research center, University of Texas at Austin, 10100 Burnet Road, Bldg. 160 MER 2.608F, TX 78758-4445 e-mail: dharmareddy84 at gmail.com Phone: +1-512-350-9082 United States of America. Homepage: https://webspace.utexas.edu/~dpr342 -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Tue Mar 5 09:22:25 2013 From: knepley at gmail.com (Matthew Knepley) Date: Tue, 5 Mar 2013 10:22:25 -0500 Subject: [petsc-users] DMPlex Fortran examples In-Reply-To: References: Message-ID: On Tue, Mar 5, 2013 at 10:20 AM, Dharmendar Reddy wrote: > Thanks, so numDof is basically number of dof per topological entity of a > cell. Did i get this right ? > Yes, dof per field per topological entity (sieve point depth). Matt > +! Let u be defined on vertices > > + numDof(0*(dim+1)+1) = 1 (should not be number of nodes) > > +! Let v be defined on cells > > + numDof(1*(dim+1)+dim+1) = dim > > +! Let v be defined on faces > > + numDof(2*(dim+1)+dim) = dim-1 (similarly, should not be number of faces time (dim-1)) > > > > > On Tue, Mar 5, 2013 at 9:06 AM, Matthew Knepley wrote: > >> On Tue, Mar 5, 2013 at 2:18 AM, Dharmendar Reddy > > wrote: >> >>> Hello, >>> >>> Trying to understand the DMPlexCreateSection first. I have >>> created a test case, can you please have a look at it? Actually the code >>> has a link error on my system with petsc-dev. I used DMPlexeCreateBoxMesh >>> to create the mesh. Looks like there is no Fortran interface to that >>> function. If i comment out the dmplexcreateboxmesh. It does create and >>> executable. >>> >> >> I have now pushed your example, slightly changed, to the repository: >> >> src/dm/impls/plex/examples/tutorials/ex1.c/ex1f90.F >> >> and you can run with -dim 2 or -dim 3. >> >> Thanks, >> >> Matt >> >> >>> petscDMTest_v2.o: In function `MAIN__': >>> petscDMTest_v2.F90:(.text+0x9b): undefined reference to >>> `dmplexcreateboxmesh_' >>> make: [testDMMeshv2] Error 1 (ignored) >>> >>> Also, If include finclude/petsc.h90 instead of finclude/petsch.h i get >>> compile error : >>> >>> petscDMTest_v2.F90(73): error #6691: A pointer dummy argument may only >>> be argument a >>> ssociated with a pointer. [NUMCOMP] >>> call DMPlexCreateSection(dmMesh, topologyDim, numField, numComp, >>> numDof, & >>> ----------------------------------------------------------^ >>> petscDMTest_v2.F90(73): error #6691: A pointer dummy argument may only >>> be argument a >>> ssociated with a pointer. [NUMDOF] >>> call DMPlexCreateSection(dmMesh, topologyDim, numField, numComp, >>> numDof, & >>> -------------------------------------------------------------------^ >>> petscDMTest_v2.F90(74): error #6691: A pointer dummy argument may only >>> be argument a >>> ssociated with a pointer. [BCFIELD] >>> numBC, bcField, bcPointIS,section,ierr) >>> ----------------------------------^ >>> petscDMTest_v2.F90(74): error #6691: A pointer dummy argument may only >>> be argument a >>> ssociated with a pointer. [BCPOINTIS] >>> numBC, bcField, bcPointIS,section,ierr) >>> -------------------------------------------^ >>> >>> Please have a look at the attached test case and Makefile >>> >>> >>> On Mon, Mar 4, 2013 at 7:39 PM, Matthew Knepley wrote: >>> >>>> On Mon, Mar 4, 2013 at 7:50 PM, Dharmendar Reddy < >>>> dharmareddy84 at gmail.com> wrote: >>>> >>>>> Hello, >>>>> Is there a DMPlex based fortran example for solving a pde >>>>> such as laplace ? Even a c example will do. I am not able to understand the >>>>> terminology of chart, cone etc. Is there a paper or user guide to learn >>>>> more about the definitions of terms such as chart cone stratum ? I remember >>>>> reading a presentation file by mathew about sieve. Is there a newer >>>>> tutorial with terminology mapped to the new DMPlex/DMMesh functions. >>>>> >>>> >>>> There is a fully worked out Stokes example (SNES ex62) and a Finite >>>> Volume example (TS ex11), >>>> and there are a few tests. You should not need much of that stuff for >>>> defining a problem. I am >>>> writing up a paper about ex11 right now. There is a short manual >>>> section on unstructured grids as well. >>>> >>>> I think the key thing to understand is how to define a data layout over >>>> the mesh using a PetscSection. >>>> Once that is done, all the DM functions work as normal, and the last >>>> hard part is coding your residual >>>> loop. I have support for FEM schemes, but its undocumented and slightly >>>> complex in order to allow >>>> GPU assembly, so you may be more comfortable with your own element loop >>>> to start. >>>> >>>> Thanks, >>>> >>>> Matt >>>> >>>> >>>>> Thanks >>>>> Reddy >>>>> >>>>> >>>>> -- >>>>> ----------------------------------------------------- >>>>> Dharmendar Reddy Palle >>>>> Graduate Student >>>>> Microelectronics Research center, >>>>> University of Texas at Austin, >>>>> 10100 Burnet Road, Bldg. 160 >>>>> MER 2.608F, TX 78758-4445 >>>>> e-mail: dharmareddy84 at gmail.com >>>>> Phone: +1-512-350-9082 >>>>> United States of America. >>>>> Homepage: https://webspace.utexas.edu/~dpr342 >>>>> >>>> >>>> >>>> >>>> -- >>>> What most experimenters take for granted before they begin their >>>> experiments is infinitely more interesting than any results to which their >>>> experiments lead. >>>> -- Norbert Wiener >>>> >>> >>> >>> >>> -- >>> ----------------------------------------------------- >>> Dharmendar Reddy Palle >>> Graduate Student >>> Microelectronics Research center, >>> University of Texas at Austin, >>> 10100 Burnet Road, Bldg. 160 >>> MER 2.608F, TX 78758-4445 >>> e-mail: dharmareddy84 at gmail.com >>> Phone: +1-512-350-9082 >>> United States of America. >>> Homepage: https://webspace.utexas.edu/~dpr342 >>> >> >> >> >> -- >> What most experimenters take for granted before they begin their >> experiments is infinitely more interesting than any results to which their >> experiments lead. >> -- Norbert Wiener >> > > > > -- > ----------------------------------------------------- > Dharmendar Reddy Palle > Graduate Student > Microelectronics Research center, > University of Texas at Austin, > 10100 Burnet Road, Bldg. 160 > MER 2.608F, TX 78758-4445 > e-mail: dharmareddy84 at gmail.com > Phone: +1-512-350-9082 > United States of America. > Homepage: https://webspace.utexas.edu/~dpr342 > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From dharmareddy84 at gmail.com Tue Mar 5 14:23:26 2013 From: dharmareddy84 at gmail.com (Dharmendar Reddy) Date: Tue, 5 Mar 2013 14:23:26 -0600 Subject: [petsc-users] AMD interlagos optimization flags Message-ID: Hello, Has any one installed petsc on the AMD 6200 series processor systems? I have a small cluster with quad socket AMD 6274 (16Core) processors. Should i use any special optimization flags or let petsc configure script decide ? I would like have two flavors of the instillation: 1. intel 13.2 compilers using intel mpi and intel MKL 11.0 2. intel 13.2 compilers using intel mpi and ACML 5.3 compile with intel. Now ACML has a weird organization of the libraries. It has same names for both the 64bit and 32 bit integer libraries but saved in different folders. Should i link to single thread or multithreaded acml ? -- ----------------------------------------------------- Dharmendar Reddy Palle Graduate Student Microelectronics Research center, University of Texas at Austin, 10100 Burnet Road, Bldg. 160 MER 2.608F, TX 78758-4445 e-mail: dharmareddy84 at gmail.com Phone: +1-512-350-9082 United States of America. Homepage: https://webspace.utexas.edu/~dpr342 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jedbrown at mcs.anl.gov Tue Mar 5 14:59:15 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Tue, 5 Mar 2013 14:59:15 -0600 Subject: [petsc-users] AMD interlagos optimization flags In-Reply-To: References: Message-ID: On Tue, Mar 5, 2013 at 2:23 PM, Dharmendar Reddy wrote: > Hello, > Has any one installed petsc on the AMD 6200 series processor > systems? I have a small cluster with quad socket AMD 6274 (16Core) > processors. Should i use any special optimization flags or let petsc > configure script decide ? > > I would like have two flavors of the instillation: > > 1. intel 13.2 compilers using intel mpi and intel MKL 11.0 > 2. intel 13.2 compilers using intel mpi and ACML 5.3 compile with > intel. Now ACML has a weird organization of the libraries. It has same > names for both the 64bit and 32 bit integer libraries but saved in > different folders. Should i link to single thread or multithreaded acml ? > > Single-threaded. No special optimization flags, but bear in mind that Intel compilers (and MKL) have the "run slower on AMD" feature. Compiler optimizations usually do not affect PETSc too much because most operations are memory bandwidth limited and the compute kernels are written in a form that is easy to optimize. -------------- next part -------------- An HTML attachment was scrubbed... URL: From popov at uni-mainz.de Tue Mar 5 16:02:24 2013 From: popov at uni-mainz.de (Anton Popov) Date: Tue, 5 Mar 2013 23:02:24 +0100 Subject: [petsc-users] AMD interlagos optimization flags In-Reply-To: References: Message-ID: <51366B70.9060108@uni-mainz.de> On 3/5/13 9:23 PM, Dharmendar Reddy wrote: > Hello, > Has any one installed petsc on the AMD 6200 series processor > systems? I have a small cluster with quad socket AMD 6274 (16Core) > processors. Should i use any special optimization flags or let petsc > configure script decide ? > > I would like have two flavors of the instillation: > > 1. intel 13.2 compilers using intel mpi and intel MKL 11.0 > 2. intel 13.2 compilers using intel mpi and ACML 5.3 compile with > intel. Now ACML has a weird organization of the libraries. It has > same names for both the 64bit and 32 bit integer libraries but > saved in different folders. Should i link to single thread or > multithreaded acml ? > Dharmendar, I use --COPTFLAGS="-mavx -mfma4 -O3" --FOPTFLAGS="-mavx -mfma4 -O3" and single-threaded ACML optimized for fma4 instruction set ( i.e. gfortran64_fma4/lib/libacml.a) Obviously, I use gcc and gfortran. All works fine. No need for Intel on this machine. If you think gcc is much slower, just try with optimization. > 1. > > > > -- > ----------------------------------------------------- > Dharmendar Reddy Palle > Graduate Student > Microelectronics Research center, > University of Texas at Austin, > 10100 Burnet Road, Bldg. 160 > MER 2.608F, TX 78758-4445 > e-mail: dharmareddy84 at gmail.com > Phone: +1-512-350-9082 > United States of America. > Homepage: https://webspace.utexas.edu/~dpr342 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dharmareddy84 at gmail.com Tue Mar 5 16:38:29 2013 From: dharmareddy84 at gmail.com (Dharmendar Reddy) Date: Tue, 5 Mar 2013 16:38:29 -0600 Subject: [petsc-users] AMD interlagos optimization flags In-Reply-To: <51366B70.9060108@uni-mainz.de> References: <51366B70.9060108@uni-mainz.de> Message-ID: Hello Anton, For me the problem is with gfortran. I use certain object oriented features available in Fortran 2003. When i last tested few months agao, my code does not compile with gfortran. I guess it is required/suggested to use the same compiler for petsc and the external code which uses petsc. Am i right ? My code relies heavily on zgemm which i use via direct call to lapack or via petsc. ACML also has ifort64_fma4 i was hoping they tweaked it to optimal performance on the new AMD processors. Thanks Reddy On Tue, Mar 5, 2013 at 4:02 PM, Anton Popov wrote: > > On 3/5/13 9:23 PM, Dharmendar Reddy wrote: > > Hello, > Has any one installed petsc on the AMD 6200 series processor > systems? I have a small cluster with quad socket AMD 6274 (16Core) > processors. Should i use any special optimization flags or let petsc > configure script decide ? > > I would like have two flavors of the instillation: > > 1. intel 13.2 compilers using intel mpi and intel MKL 11.0 > 2. intel 13.2 compilers using intel mpi and ACML 5.3 compile with > intel. Now ACML has a weird organization of the libraries. It has same > names for both the 64bit and 32 bit integer libraries but saved in > different folders. Should i link to single thread or multithreaded acml ? > > Dharmendar, > > I use > --COPTFLAGS="-mavx -mfma4 -O3" > --FOPTFLAGS="-mavx -mfma4 -O3" > > and single-threaded ACML optimized for fma4 instruction set ( i.e. > gfortran64_fma4/lib/libacml.a) > Obviously, I use gcc and gfortran. All works fine. No need for Intel on > this machine. If you think gcc is much slower, just try with optimization. > > > 1. > > > > -- > ----------------------------------------------------- > Dharmendar Reddy Palle > Graduate Student > Microelectronics Research center, > University of Texas at Austin, > 10100 Burnet Road, Bldg. 160 > MER 2.608F, TX 78758-4445 > e-mail: dharmareddy84 at gmail.com > Phone: +1-512-350-9082 > United States of America. > Homepage: https://webspace.utexas.edu/~dpr342 > > > -- ----------------------------------------------------- Dharmendar Reddy Palle Graduate Student Microelectronics Research center, University of Texas at Austin, 10100 Burnet Road, Bldg. 160 MER 2.608F, TX 78758-4445 e-mail: dharmareddy84 at gmail.com Phone: +1-512-350-9082 United States of America. Homepage: https://webspace.utexas.edu/~dpr342 -------------- next part -------------- An HTML attachment was scrubbed... URL: From popov at uni-mainz.de Tue Mar 5 17:13:51 2013 From: popov at uni-mainz.de (Anton Popov) Date: Wed, 6 Mar 2013 00:13:51 +0100 Subject: [petsc-users] AMD interlagos optimization flags In-Reply-To: References: <51366B70.9060108@uni-mainz.de> Message-ID: <51367C2F.8070800@uni-mainz.de> On 3/5/13 11:38 PM, Dharmendar Reddy wrote: > Hello Anton, > > For me the problem is with gfortran. I use certain object oriented > features available in Fortran 2003. When i last tested few months > agao, my code does not compile with gfortran. I guess it is > required/suggested to use the same compiler for petsc and the external > code which uses petsc. Am i right ? My code relies heavily on zgemm > which i use via direct call to lapack or via petsc. ACML also has > ifort64_fma4 i was hoping they tweaked it to optimal performance on > the new AMD processors. > > Thanks > Reddy Dharmendar, indeed, it's better to use the same compiler for everything. Which gfortran version are you using? What is the option that is still missing? According to this page http://fortranwiki.org/fortran/show/Fortran+2003+status the Fortran 2003 standard support is fairly extensive. We use gfortran 4.7.2 and a few features of Fortran 2003 in one of the applications. Also the -std=f2003 -ffree-form options should not be forgotten. > > On Tue, Mar 5, 2013 at 4:02 PM, Anton Popov > wrote: > > > On 3/5/13 9:23 PM, Dharmendar Reddy wrote: >> Hello, >> Has any one installed petsc on the AMD 6200 series >> processor systems? I have a small cluster with quad socket AMD >> 6274 (16Core) processors. Should i use any special optimization >> flags or let petsc configure script decide ? >> >> I would like have two flavors of the instillation: >> >> 1. intel 13.2 compilers using intel mpi and intel MKL 11.0 >> 2. intel 13.2 compilers using intel mpi and ACML 5.3 compile >> with intel. Now ACML has a weird organization of the >> libraries. It has same names for both the 64bit and 32 bit >> integer libraries but saved in different folders. Should i >> link to single thread or multithreaded acml ? >> > Dharmendar, > > I use > --COPTFLAGS="-mavx -mfma4 -O3" > --FOPTFLAGS="-mavx -mfma4 -O3" > > and single-threaded ACML optimized for fma4 instruction set ( i.e. > gfortran64_fma4/lib/libacml.a) > Obviously, I use gcc and gfortran. All works fine. No need for > Intel on this machine. If you think gcc is much slower, just try > with optimization. > >> 1. >> >> >> >> >> -- >> ----------------------------------------------------- >> Dharmendar Reddy Palle >> Graduate Student >> Microelectronics Research center, >> University of Texas at Austin, >> 10100 Burnet Road, Bldg. 160 >> MER 2.608F, TX 78758-4445 >> e-mail: dharmareddy84 at gmail.com >> Phone: +1-512-350-9082 >> United States of America. >> Homepage: https://webspace.utexas.edu/~dpr342 >> > > > > > -- > ----------------------------------------------------- > Dharmendar Reddy Palle > Graduate Student > Microelectronics Research center, > University of Texas at Austin, > 10100 Burnet Road, Bldg. 160 > MER 2.608F, TX 78758-4445 > e-mail: dharmareddy84 at gmail.com > Phone: +1-512-350-9082 > United States of America. > Homepage: https://webspace.utexas.edu/~dpr342 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dharmareddy84 at gmail.com Tue Mar 5 17:28:44 2013 From: dharmareddy84 at gmail.com (Dharmendar Reddy) Date: Tue, 5 Mar 2013 17:28:44 -0600 Subject: [petsc-users] AMD interlagos optimization flags In-Reply-To: <51367C2F.8070800@uni-mainz.de> References: <51366B70.9060108@uni-mainz.de> <51367C2F.8070800@uni-mainz.de> Message-ID: > indeed, it's better to use the same compiler for everything. Which > gfortran version are you using? What is the option that is still missing? > According to this page > http://fortranwiki.org/fortran/show/Fortran+2003+status the Fortran 2003 > standard support is fairly extensive. We use gfortran 4.7.2 and a few > features of Fortran 2003 in one of the applications. > > Also the -std=f2003 -ffree-form options should not be forgotten. > > > I use Finalization, class(*), Select Type, sourced allocation for polymorphic objects......They seem to be only partially supported (what ever that means). I think i should try again with the 4.7 compilers. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dharmareddy84 at gmail.com Tue Mar 5 21:52:02 2013 From: dharmareddy84 at gmail.com (Dharmendar Reddy) Date: Tue, 5 Mar 2013 21:52:02 -0600 Subject: [petsc-users] DMPlex Fortran examples In-Reply-To: References: Message-ID: Hello, I am having trouble with a couple of DMPlex routines. I was doing tests on various function calls that i may need to write a test Poisson problem. First issue is with DMPlexComputeCellGeometry. For a rectangle cell geometry, I get , v0, J, invJ, and detJ as zero. DMPlexGetConeSize gives run time error DMPlexVecGetClosure gives runtime error, Should not this call be DMPlexVecGetClosureF90 ? is there such interface ? I remember doing a procedure like VecGetArrayF90 and VecRestoreArrayF90 when i had to pass pointer which need to be restored. I have attached test case with the make file and error.log. Please have a look at it. you need to run: make all debug=0 ./testDMView Also, I have trouble compiling the code with debug=1 which uses petsc configured in debug mode everything else being same (you can see the configure options in the error.log). I get this error message: login1$ make all debug=1 make: *** /home1/00924/Reddy135/LocalApps/petsc-dev/mpi_rScalar: Is a directory. Stop . On Tue, Mar 5, 2013 at 9:22 AM, Matthew Knepley wrote: > On Tue, Mar 5, 2013 at 10:20 AM, Dharmendar Reddy > wrote: > >> Thanks, so numDof is basically number of dof per topological entity of a >> cell. Did i get this right ? >> > > Yes, dof per field per topological entity (sieve point depth). > > Matt > > >> +! Let u be defined on vertices >> >> + numDof(0*(dim+1)+1) = 1 (should not be number of nodes) >> >> +! Let v be defined on cells >> >> + numDof(1*(dim+1)+dim+1) = dim >> >> +! Let v be defined on faces >> >> + numDof(2*(dim+1)+dim) = dim-1 (similarly, should not be number of faces time (dim-1)) >> >> >> >> >> On Tue, Mar 5, 2013 at 9:06 AM, Matthew Knepley wrote: >> >>> On Tue, Mar 5, 2013 at 2:18 AM, Dharmendar Reddy < >>> dharmareddy84 at gmail.com> wrote: >>> >>>> Hello, >>>> >>>> Trying to understand the DMPlexCreateSection first. I have >>>> created a test case, can you please have a look at it? Actually the code >>>> has a link error on my system with petsc-dev. I used DMPlexeCreateBoxMesh >>>> to create the mesh. Looks like there is no Fortran interface to that >>>> function. If i comment out the dmplexcreateboxmesh. It does create and >>>> executable. >>>> >>> >>> I have now pushed your example, slightly changed, to the repository: >>> >>> src/dm/impls/plex/examples/tutorials/ex1.c/ex1f90.F >>> >>> and you can run with -dim 2 or -dim 3. >>> >>> Thanks, >>> >>> Matt >>> >>> >>>> petscDMTest_v2.o: In function `MAIN__': >>>> petscDMTest_v2.F90:(.text+0x9b): undefined reference to >>>> `dmplexcreateboxmesh_' >>>> make: [testDMMeshv2] Error 1 (ignored) >>>> >>>> Also, If include finclude/petsc.h90 instead of finclude/petsch.h i get >>>> compile error : >>>> >>>> petscDMTest_v2.F90(73): error #6691: A pointer dummy argument may only >>>> be argument a >>>> ssociated with a pointer. [NUMCOMP] >>>> call DMPlexCreateSection(dmMesh, topologyDim, numField, numComp, >>>> numDof, & >>>> ----------------------------------------------------------^ >>>> petscDMTest_v2.F90(73): error #6691: A pointer dummy argument may only >>>> be argument a >>>> ssociated with a pointer. [NUMDOF] >>>> call DMPlexCreateSection(dmMesh, topologyDim, numField, numComp, >>>> numDof, & >>>> -------------------------------------------------------------------^ >>>> petscDMTest_v2.F90(74): error #6691: A pointer dummy argument may only >>>> be argument a >>>> ssociated with a pointer. [BCFIELD] >>>> numBC, bcField, bcPointIS,section,ierr) >>>> ----------------------------------^ >>>> petscDMTest_v2.F90(74): error #6691: A pointer dummy argument may only >>>> be argument a >>>> ssociated with a pointer. [BCPOINTIS] >>>> numBC, bcField, bcPointIS,section,ierr) >>>> -------------------------------------------^ >>>> >>>> Please have a look at the attached test case and Makefile >>>> >>>> >>>> On Mon, Mar 4, 2013 at 7:39 PM, Matthew Knepley wrote: >>>> >>>>> On Mon, Mar 4, 2013 at 7:50 PM, Dharmendar Reddy < >>>>> dharmareddy84 at gmail.com> wrote: >>>>> >>>>>> Hello, >>>>>> Is there a DMPlex based fortran example for solving a pde >>>>>> such as laplace ? Even a c example will do. I am not able to understand the >>>>>> terminology of chart, cone etc. Is there a paper or user guide to learn >>>>>> more about the definitions of terms such as chart cone stratum ? I remember >>>>>> reading a presentation file by mathew about sieve. Is there a newer >>>>>> tutorial with terminology mapped to the new DMPlex/DMMesh functions. >>>>>> >>>>> >>>>> There is a fully worked out Stokes example (SNES ex62) and a Finite >>>>> Volume example (TS ex11), >>>>> and there are a few tests. You should not need much of that stuff for >>>>> defining a problem. I am >>>>> writing up a paper about ex11 right now. There is a short manual >>>>> section on unstructured grids as well. >>>>> >>>>> I think the key thing to understand is how to define a data layout >>>>> over the mesh using a PetscSection. >>>>> Once that is done, all the DM functions work as normal, and the last >>>>> hard part is coding your residual >>>>> loop. I have support for FEM schemes, but its undocumented and >>>>> slightly complex in order to allow >>>>> GPU assembly, so you may be more comfortable with your own element >>>>> loop to start. >>>>> >>>>> Thanks, >>>>> >>>>> Matt >>>>> >>>>> >>>>>> Thanks >>>>>> Reddy >>>>>> >>>>>> >>>>>> -- >>>>>> ----------------------------------------------------- >>>>>> Dharmendar Reddy Palle >>>>>> Graduate Student >>>>>> Microelectronics Research center, >>>>>> University of Texas at Austin, >>>>>> 10100 Burnet Road, Bldg. 160 >>>>>> MER 2.608F, TX 78758-4445 >>>>>> e-mail: dharmareddy84 at gmail.com >>>>>> Phone: +1-512-350-9082 >>>>>> United States of America. >>>>>> Homepage: https://webspace.utexas.edu/~dpr342 >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> What most experimenters take for granted before they begin their >>>>> experiments is infinitely more interesting than any results to which their >>>>> experiments lead. >>>>> -- Norbert Wiener >>>>> >>>> >>>> >>>> >>>> -- >>>> ----------------------------------------------------- >>>> Dharmendar Reddy Palle >>>> Graduate Student >>>> Microelectronics Research center, >>>> University of Texas at Austin, >>>> 10100 Burnet Road, Bldg. 160 >>>> MER 2.608F, TX 78758-4445 >>>> e-mail: dharmareddy84 at gmail.com >>>> Phone: +1-512-350-9082 >>>> United States of America. >>>> Homepage: https://webspace.utexas.edu/~dpr342 >>>> >>> >>> >>> >>> -- >>> What most experimenters take for granted before they begin their >>> experiments is infinitely more interesting than any results to which their >>> experiments lead. >>> -- Norbert Wiener >>> >> >> >> >> -- >> ----------------------------------------------------- >> Dharmendar Reddy Palle >> Graduate Student >> Microelectronics Research center, >> University of Texas at Austin, >> 10100 Burnet Road, Bldg. 160 >> MER 2.608F, TX 78758-4445 >> e-mail: dharmareddy84 at gmail.com >> Phone: +1-512-350-9082 >> United States of America. >> Homepage: https://webspace.utexas.edu/~dpr342 >> > > > > -- > What most experimenters take for granted before they begin their > experiments is infinitely more interesting than any results to which their > experiments lead. > -- Norbert Wiener > -- ----------------------------------------------------- Dharmendar Reddy Palle Graduate Student Microelectronics Research center, University of Texas at Austin, 10100 Burnet Road, Bldg. 160 MER 2.608F, TX 78758-4445 e-mail: dharmareddy84 at gmail.com Phone: +1-512-350-9082 United States of America. Homepage: https://webspace.utexas.edu/~dpr342 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Makefile Type: application/octet-stream Size: 1138 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: testDMView.F90 Type: application/octet-stream Size: 4083 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: error.log Type: application/octet-stream Size: 2997 bytes Desc: not available URL: From dharmareddy84 at gmail.com Wed Mar 6 01:43:10 2013 From: dharmareddy84 at gmail.com (Dharmendar Reddy) Date: Wed, 6 Mar 2013 01:43:10 -0600 Subject: [petsc-users] DMPlex Fortran examples In-Reply-To: References: Message-ID: I think i caught the issues, please see the reply inline below. It is not clear to me for which DMPlex i should include petsc.h90 or petsc.h Still need to fix the DMPlexComputeCellGeometry though On Tue, Mar 5, 2013 at 9:52 PM, Dharmendar Reddy wrote: > Hello, > I am having trouble with a couple of DMPlex routines. > I was doing tests on various function calls that i may need to write a > test Poisson problem. > > First issue is with DMPlexComputeCellGeometry. For a rectangle cell > geometry, I get , v0, J, invJ, and detJ as zero. > > DMPlexGetConeSize gives run time error > > I had to include petsc.h90 to fix this. > DMPlexVecGetClosure gives runtime error, Should not this call be > DMPlexVecGetClosureF90 ? is there such interface ? I remember doing a > procedure like VecGetArrayF90 and VecRestoreArrayF90 when i had to pass > pointer which need to be restored. > > Looks like there is an inconsistency in interface defined on petsc-dev manual page. and the interface defined in finclude/ftn-custom/petscdmplex.h90 Fortran interface does not have the csize parameter defined below PetscErrorCode DMPlexVecGetClosure(DM dm, PetscSection section, Vec v, PetscInt point, PetscInt *csize, const PetscScalar *values[]) I have attached test case with the make file and error.log. Please have a > look at it. > you need to run: > make all debug=0 > ./testDMView > > Also, I have trouble compiling the code with debug=1 which uses petsc > configured in debug mode everything else being same (you can see the > configure options in the error.log). > I get this error message: > login1$ make all debug=1 > make: *** /home1/00924/Reddy135/LocalApps/petsc-dev/mpi_rScalar: Is a > directory. Stop > . > > > > On Tue, Mar 5, 2013 at 9:22 AM, Matthew Knepley wrote: > >> On Tue, Mar 5, 2013 at 10:20 AM, Dharmendar Reddy < >> dharmareddy84 at gmail.com> wrote: >> >>> Thanks, so numDof is basically number of dof per topological entity of a >>> cell. Did i get this right ? >>> >> >> Yes, dof per field per topological entity (sieve point depth). >> >> Matt >> >> >>> +! Let u be defined on vertices >>> >>> + numDof(0*(dim+1)+1) = 1 (should not be number of nodes) >>> >>> +! Let v be defined on cells >>> >>> + numDof(1*(dim+1)+dim+1) = dim >>> >>> +! Let v be defined on faces >>> >>> + numDof(2*(dim+1)+dim) = dim-1 (similarly, should not be number of faces time (dim-1)) >>> >>> >>> >>> >>> On Tue, Mar 5, 2013 at 9:06 AM, Matthew Knepley wrote: >>> >>>> On Tue, Mar 5, 2013 at 2:18 AM, Dharmendar Reddy < >>>> dharmareddy84 at gmail.com> wrote: >>>> >>>>> Hello, >>>>> >>>>> Trying to understand the DMPlexCreateSection first. I have >>>>> created a test case, can you please have a look at it? Actually the code >>>>> has a link error on my system with petsc-dev. I used DMPlexeCreateBoxMesh >>>>> to create the mesh. Looks like there is no Fortran interface to that >>>>> function. If i comment out the dmplexcreateboxmesh. It does create and >>>>> executable. >>>>> >>>> >>>> I have now pushed your example, slightly changed, to the repository: >>>> >>>> src/dm/impls/plex/examples/tutorials/ex1.c/ex1f90.F >>>> >>>> and you can run with -dim 2 or -dim 3. >>>> >>>> Thanks, >>>> >>>> Matt >>>> >>>> >>>>> petscDMTest_v2.o: In function `MAIN__': >>>>> petscDMTest_v2.F90:(.text+0x9b): undefined reference to >>>>> `dmplexcreateboxmesh_' >>>>> make: [testDMMeshv2] Error 1 (ignored) >>>>> >>>>> Also, If include finclude/petsc.h90 instead of finclude/petsch.h i get >>>>> compile error : >>>>> >>>>> petscDMTest_v2.F90(73): error #6691: A pointer dummy argument may only >>>>> be argument a >>>>> ssociated with a pointer. [NUMCOMP] >>>>> call DMPlexCreateSection(dmMesh, topologyDim, numField, numComp, >>>>> numDof, & >>>>> ----------------------------------------------------------^ >>>>> petscDMTest_v2.F90(73): error #6691: A pointer dummy argument may only >>>>> be argument a >>>>> ssociated with a pointer. [NUMDOF] >>>>> call DMPlexCreateSection(dmMesh, topologyDim, numField, numComp, >>>>> numDof, & >>>>> -------------------------------------------------------------------^ >>>>> petscDMTest_v2.F90(74): error #6691: A pointer dummy argument may only >>>>> be argument a >>>>> ssociated with a pointer. [BCFIELD] >>>>> numBC, bcField, bcPointIS,section,ierr) >>>>> ----------------------------------^ >>>>> petscDMTest_v2.F90(74): error #6691: A pointer dummy argument may only >>>>> be argument a >>>>> ssociated with a pointer. [BCPOINTIS] >>>>> numBC, bcField, bcPointIS,section,ierr) >>>>> -------------------------------------------^ >>>>> >>>>> Please have a look at the attached test case and Makefile >>>>> >>>>> >>>>> On Mon, Mar 4, 2013 at 7:39 PM, Matthew Knepley wrote: >>>>> >>>>>> On Mon, Mar 4, 2013 at 7:50 PM, Dharmendar Reddy < >>>>>> dharmareddy84 at gmail.com> wrote: >>>>>> >>>>>>> Hello, >>>>>>> Is there a DMPlex based fortran example for solving a pde >>>>>>> such as laplace ? Even a c example will do. I am not able to understand the >>>>>>> terminology of chart, cone etc. Is there a paper or user guide to learn >>>>>>> more about the definitions of terms such as chart cone stratum ? I remember >>>>>>> reading a presentation file by mathew about sieve. Is there a newer >>>>>>> tutorial with terminology mapped to the new DMPlex/DMMesh functions. >>>>>>> >>>>>> >>>>>> There is a fully worked out Stokes example (SNES ex62) and a Finite >>>>>> Volume example (TS ex11), >>>>>> and there are a few tests. You should not need much of that stuff for >>>>>> defining a problem. I am >>>>>> writing up a paper about ex11 right now. There is a short manual >>>>>> section on unstructured grids as well. >>>>>> >>>>>> I think the key thing to understand is how to define a data layout >>>>>> over the mesh using a PetscSection. >>>>>> Once that is done, all the DM functions work as normal, and the last >>>>>> hard part is coding your residual >>>>>> loop. I have support for FEM schemes, but its undocumented and >>>>>> slightly complex in order to allow >>>>>> GPU assembly, so you may be more comfortable with your own element >>>>>> loop to start. >>>>>> >>>>>> Thanks, >>>>>> >>>>>> Matt >>>>>> >>>>>> >>>>>>> Thanks >>>>>>> Reddy >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> ----------------------------------------------------- >>>>>>> Dharmendar Reddy Palle >>>>>>> Graduate Student >>>>>>> Microelectronics Research center, >>>>>>> University of Texas at Austin, >>>>>>> 10100 Burnet Road, Bldg. 160 >>>>>>> MER 2.608F, TX 78758-4445 >>>>>>> e-mail: dharmareddy84 at gmail.com >>>>>>> Phone: +1-512-350-9082 >>>>>>> United States of America. >>>>>>> Homepage: https://webspace.utexas.edu/~dpr342 >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> What most experimenters take for granted before they begin their >>>>>> experiments is infinitely more interesting than any results to which their >>>>>> experiments lead. >>>>>> -- Norbert Wiener >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> ----------------------------------------------------- >>>>> Dharmendar Reddy Palle >>>>> Graduate Student >>>>> Microelectronics Research center, >>>>> University of Texas at Austin, >>>>> 10100 Burnet Road, Bldg. 160 >>>>> MER 2.608F, TX 78758-4445 >>>>> e-mail: dharmareddy84 at gmail.com >>>>> Phone: +1-512-350-9082 >>>>> United States of America. >>>>> Homepage: https://webspace.utexas.edu/~dpr342 >>>>> >>>> >>>> >>>> >>>> -- >>>> What most experimenters take for granted before they begin their >>>> experiments is infinitely more interesting than any results to which their >>>> experiments lead. >>>> -- Norbert Wiener >>>> >>> >>> >>> >>> -- >>> ----------------------------------------------------- >>> Dharmendar Reddy Palle >>> Graduate Student >>> Microelectronics Research center, >>> University of Texas at Austin, >>> 10100 Burnet Road, Bldg. 160 >>> MER 2.608F, TX 78758-4445 >>> e-mail: dharmareddy84 at gmail.com >>> Phone: +1-512-350-9082 >>> United States of America. >>> Homepage: https://webspace.utexas.edu/~dpr342 >>> >> >> >> >> -- >> What most experimenters take for granted before they begin their >> experiments is infinitely more interesting than any results to which their >> experiments lead. >> -- Norbert Wiener >> > > > > -- > ----------------------------------------------------- > Dharmendar Reddy Palle > Graduate Student > Microelectronics Research center, > University of Texas at Austin, > 10100 Burnet Road, Bldg. 160 > MER 2.608F, TX 78758-4445 > e-mail: dharmareddy84 at gmail.com > Phone: +1-512-350-9082 > United States of America. > Homepage: https://webspace.utexas.edu/~dpr342 > -- ----------------------------------------------------- Dharmendar Reddy Palle Graduate Student Microelectronics Research center, University of Texas at Austin, 10100 Burnet Road, Bldg. 160 MER 2.608F, TX 78758-4445 e-mail: dharmareddy84 at gmail.com Phone: +1-512-350-9082 United States of America. Homepage: https://webspace.utexas.edu/~dpr342 -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Wed Mar 6 04:51:53 2013 From: knepley at gmail.com (Matthew Knepley) Date: Wed, 6 Mar 2013 05:51:53 -0500 Subject: [petsc-users] DMPlex Fortran examples In-Reply-To: References: Message-ID: On Wed, Mar 6, 2013 at 2:43 AM, Dharmendar Reddy wrote: > I think i caught the issues, please see the reply inline below. It is not > clear to me for which DMPlex i should include petsc.h90 or petsc.h > > Still need to fix the DMPlexComputeCellGeometry though > > > On Tue, Mar 5, 2013 at 9:52 PM, Dharmendar Reddy wrote: > >> Hello, >> >> I am having trouble with a couple of DMPlex routines. >> I was doing tests on various function calls that i may need to write a >> test Poisson problem. >> >> First issue is with DMPlexComputeCellGeometry. For a rectangle cell >> geometry, I get , v0, J, invJ, and detJ as zero. >> > Geometric primitives of course depend on the way you specify a cell. Simplicies are nice in that you can only change the orientation, but hexes are harder. I specify quads so that the vertices go counter-clockwise around the boundary. Do you do this? If so, can you send a small example test that I can add to PETSc. > DMPlexGetConeSize gives run time error >> >> I had to include petsc.h90 to fix this. > I have fixed the manpage documentation to reflect this. > > DMPlexVecGetClosure gives runtime error, Should not this call be >> DMPlexVecGetClosureF90 ? is there such interface ? I remember doing a >> procedure like VecGetArrayF90 and VecRestoreArrayF90 when i had to pass >> pointer which need to be restored. >> >> Looks like there is an inconsistency in interface defined on petsc-dev > manual page. and the interface defined in > finclude/ftn-custom/petscdmplex.h90 > Fortran interface does not have the csize parameter defined below > > PetscErrorCode DMPlexVecGetClosure(DM dm, PetscSection section, Vec v, PetscInt point, PetscInt *csize, const PetscScalar *values[]) > > I have noted this on the manpage. Did you look at src/dm/impls/plex/examples/tests/ex2f90.F? It tests many of these operations. Thanks, Matt > > > I have attached test case with the make file and error.log. Please have a >> look at it. >> you need to run: >> make all debug=0 >> ./testDMView >> >> Also, I have trouble compiling the code with debug=1 which uses petsc >> configured in debug mode everything else being same (you can see the >> configure options in the error.log). >> I get this error message: >> login1$ make all debug=1 >> make: *** /home1/00924/Reddy135/LocalApps/petsc-dev/mpi_rScalar: Is a >> directory. Stop >> . >> >> >> >> On Tue, Mar 5, 2013 at 9:22 AM, Matthew Knepley wrote: >> >>> On Tue, Mar 5, 2013 at 10:20 AM, Dharmendar Reddy < >>> dharmareddy84 at gmail.com> wrote: >>> >>>> Thanks, so numDof is basically number of dof per topological entity of >>>> a cell. Did i get this right ? >>>> >>> >>> Yes, dof per field per topological entity (sieve point depth). >>> >>> Matt >>> >>> >>>> +! Let u be defined on vertices >>>> >>>> + numDof(0*(dim+1)+1) = 1 (should not be number of nodes) >>>> >>>> +! Let v be defined on cells >>>> >>>> + numDof(1*(dim+1)+dim+1) = dim >>>> >>>> +! Let v be defined on faces >>>> >>>> + numDof(2*(dim+1)+dim) = dim-1 (similarly, should not be number of faces time (dim-1)) >>>> >>>> >>>> >>>> >>>> On Tue, Mar 5, 2013 at 9:06 AM, Matthew Knepley wrote: >>>> >>>>> On Tue, Mar 5, 2013 at 2:18 AM, Dharmendar Reddy < >>>>> dharmareddy84 at gmail.com> wrote: >>>>> >>>>>> Hello, >>>>>> >>>>>> Trying to understand the DMPlexCreateSection first. I have >>>>>> created a test case, can you please have a look at it? Actually the code >>>>>> has a link error on my system with petsc-dev. I used DMPlexeCreateBoxMesh >>>>>> to create the mesh. Looks like there is no Fortran interface to that >>>>>> function. If i comment out the dmplexcreateboxmesh. It does create and >>>>>> executable. >>>>>> >>>>> >>>>> I have now pushed your example, slightly changed, to the repository: >>>>> >>>>> src/dm/impls/plex/examples/tutorials/ex1.c/ex1f90.F >>>>> >>>>> and you can run with -dim 2 or -dim 3. >>>>> >>>>> Thanks, >>>>> >>>>> Matt >>>>> >>>>> >>>>>> petscDMTest_v2.o: In function `MAIN__': >>>>>> petscDMTest_v2.F90:(.text+0x9b): undefined reference to >>>>>> `dmplexcreateboxmesh_' >>>>>> make: [testDMMeshv2] Error 1 (ignored) >>>>>> >>>>>> Also, If include finclude/petsc.h90 instead of finclude/petsch.h i >>>>>> get compile error : >>>>>> >>>>>> petscDMTest_v2.F90(73): error #6691: A pointer dummy argument may >>>>>> only be argument a >>>>>> ssociated with a pointer. [NUMCOMP] >>>>>> call DMPlexCreateSection(dmMesh, topologyDim, numField, numComp, >>>>>> numDof, & >>>>>> ----------------------------------------------------------^ >>>>>> petscDMTest_v2.F90(73): error #6691: A pointer dummy argument may >>>>>> only be argument a >>>>>> ssociated with a pointer. [NUMDOF] >>>>>> call DMPlexCreateSection(dmMesh, topologyDim, numField, numComp, >>>>>> numDof, & >>>>>> -------------------------------------------------------------------^ >>>>>> petscDMTest_v2.F90(74): error #6691: A pointer dummy argument may >>>>>> only be argument a >>>>>> ssociated with a pointer. [BCFIELD] >>>>>> numBC, bcField, bcPointIS,section,ierr) >>>>>> ----------------------------------^ >>>>>> petscDMTest_v2.F90(74): error #6691: A pointer dummy argument may >>>>>> only be argument a >>>>>> ssociated with a pointer. [BCPOINTIS] >>>>>> numBC, bcField, bcPointIS,section,ierr) >>>>>> -------------------------------------------^ >>>>>> >>>>>> Please have a look at the attached test case and Makefile >>>>>> >>>>>> >>>>>> On Mon, Mar 4, 2013 at 7:39 PM, Matthew Knepley wrote: >>>>>> >>>>>>> On Mon, Mar 4, 2013 at 7:50 PM, Dharmendar Reddy < >>>>>>> dharmareddy84 at gmail.com> wrote: >>>>>>> >>>>>>>> Hello, >>>>>>>> Is there a DMPlex based fortran example for solving a pde >>>>>>>> such as laplace ? Even a c example will do. I am not able to understand the >>>>>>>> terminology of chart, cone etc. Is there a paper or user guide to learn >>>>>>>> more about the definitions of terms such as chart cone stratum ? I remember >>>>>>>> reading a presentation file by mathew about sieve. Is there a newer >>>>>>>> tutorial with terminology mapped to the new DMPlex/DMMesh functions. >>>>>>>> >>>>>>> >>>>>>> There is a fully worked out Stokes example (SNES ex62) and a Finite >>>>>>> Volume example (TS ex11), >>>>>>> and there are a few tests. You should not need much of that stuff >>>>>>> for defining a problem. I am >>>>>>> writing up a paper about ex11 right now. There is a short manual >>>>>>> section on unstructured grids as well. >>>>>>> >>>>>>> I think the key thing to understand is how to define a data layout >>>>>>> over the mesh using a PetscSection. >>>>>>> Once that is done, all the DM functions work as normal, and the last >>>>>>> hard part is coding your residual >>>>>>> loop. I have support for FEM schemes, but its undocumented and >>>>>>> slightly complex in order to allow >>>>>>> GPU assembly, so you may be more comfortable with your own element >>>>>>> loop to start. >>>>>>> >>>>>>> Thanks, >>>>>>> >>>>>>> Matt >>>>>>> >>>>>>> >>>>>>>> Thanks >>>>>>>> Reddy >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> ----------------------------------------------------- >>>>>>>> Dharmendar Reddy Palle >>>>>>>> Graduate Student >>>>>>>> Microelectronics Research center, >>>>>>>> University of Texas at Austin, >>>>>>>> 10100 Burnet Road, Bldg. 160 >>>>>>>> MER 2.608F, TX 78758-4445 >>>>>>>> e-mail: dharmareddy84 at gmail.com >>>>>>>> Phone: +1-512-350-9082 >>>>>>>> United States of America. >>>>>>>> Homepage: https://webspace.utexas.edu/~dpr342 >>>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> What most experimenters take for granted before they begin their >>>>>>> experiments is infinitely more interesting than any results to which their >>>>>>> experiments lead. >>>>>>> -- Norbert Wiener >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> ----------------------------------------------------- >>>>>> Dharmendar Reddy Palle >>>>>> Graduate Student >>>>>> Microelectronics Research center, >>>>>> University of Texas at Austin, >>>>>> 10100 Burnet Road, Bldg. 160 >>>>>> MER 2.608F, TX 78758-4445 >>>>>> e-mail: dharmareddy84 at gmail.com >>>>>> Phone: +1-512-350-9082 >>>>>> United States of America. >>>>>> Homepage: https://webspace.utexas.edu/~dpr342 >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> What most experimenters take for granted before they begin their >>>>> experiments is infinitely more interesting than any results to which their >>>>> experiments lead. >>>>> -- Norbert Wiener >>>>> >>>> >>>> >>>> >>>> -- >>>> ----------------------------------------------------- >>>> Dharmendar Reddy Palle >>>> Graduate Student >>>> Microelectronics Research center, >>>> University of Texas at Austin, >>>> 10100 Burnet Road, Bldg. 160 >>>> MER 2.608F, TX 78758-4445 >>>> e-mail: dharmareddy84 at gmail.com >>>> Phone: +1-512-350-9082 >>>> United States of America. >>>> Homepage: https://webspace.utexas.edu/~dpr342 >>>> >>> >>> >>> >>> -- >>> What most experimenters take for granted before they begin their >>> experiments is infinitely more interesting than any results to which their >>> experiments lead. >>> -- Norbert Wiener >>> >> >> >> >> -- >> ----------------------------------------------------- >> Dharmendar Reddy Palle >> Graduate Student >> Microelectronics Research center, >> University of Texas at Austin, >> 10100 Burnet Road, Bldg. 160 >> MER 2.608F, TX 78758-4445 >> e-mail: dharmareddy84 at gmail.com >> Phone: +1-512-350-9082 >> United States of America. >> Homepage: https://webspace.utexas.edu/~dpr342 >> > > > > -- > ----------------------------------------------------- > Dharmendar Reddy Palle > Graduate Student > Microelectronics Research center, > University of Texas at Austin, > 10100 Burnet Road, Bldg. 160 > MER 2.608F, TX 78758-4445 > e-mail: dharmareddy84 at gmail.com > Phone: +1-512-350-9082 > United States of America. > Homepage: https://webspace.utexas.edu/~dpr342 > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From bhatiamanav at gmail.com Wed Mar 6 09:30:14 2013 From: bhatiamanav at gmail.com (Manav Bhatia) Date: Wed, 6 Mar 2013 10:30:14 -0500 Subject: [petsc-users] compiling with complex Message-ID: <4D513AE9-E88E-4A3F-9889-E68E17B5B0EB@gmail.com> Hi, I am attempting to build pets 3.1-p8 on a mac 10.8 machine with complex support, but am running into trouble at compile time. Attached is the make.log. Any insight would be appreciated. Thanks, Manav -------------- next part -------------- A non-text attachment was scrubbed... Name: make.log Type: application/octet-stream Size: 40732 bytes Desc: not available URL: From jedbrown at mcs.anl.gov Wed Mar 6 09:34:56 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Wed, 6 Mar 2013 09:34:56 -0600 Subject: [petsc-users] compiling with complex In-Reply-To: <4D513AE9-E88E-4A3F-9889-E68E17B5B0EB@gmail.com> References: <4D513AE9-E88E-4A3F-9889-E68E17B5B0EB@gmail.com> Message-ID: On Wed, Mar 6, 2013 at 9:30 AM, Manav Bhatia wrote: > Hi, > > > I am attempting to build pets 3.1-p8 on a mac 10.8 machine with complex > support, but am running into trouble at compile time. Attached is the > make.log. > It looks like your mpi.h is messed up, but we can't support such old versions of PETSc. Please upgrade to petsc-3.3 and send configure.log and make.log to petsc-maint at mcs.anl.gov if you have problems. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bhatiamanav at gmail.com Wed Mar 6 09:39:02 2013 From: bhatiamanav at gmail.com (Manav Bhatia) Date: Wed, 6 Mar 2013 10:39:02 -0500 Subject: [petsc-users] compiling with complex In-Reply-To: References: <4D513AE9-E88E-4A3F-9889-E68E17B5B0EB@gmail.com> Message-ID: Thanks Jed. 3.3 compiles fine on my machine with complex support. However, the reason I am not using it is the modified NaN handling between 3.1 and 3.3. Seems like for a vector with some NaNs 3.1 returned an L2 norm as a NaN. But, 3.3 throws an exception. I would prefer to handle the NaN occurrence within my code, which is still forcing me to stick to 3.1. Is there a way to turn off this behavior in 3.3? Any other suggestions would be welcome. Thanks, Manav On Mar 6, 2013, at 10:34 AM, Jed Brown wrote: > On Wed, Mar 6, 2013 at 9:30 AM, Manav Bhatia wrote: > Hi, > > > I am attempting to build pets 3.1-p8 on a mac 10.8 machine with complex support, but am running into trouble at compile time. Attached is the make.log. > > It looks like your mpi.h is messed up, but we can't support such old versions of PETSc. > > Please upgrade to petsc-3.3 and send configure.log and make.log to petsc-maint at mcs.anl.gov if you have problems. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jedbrown at mcs.anl.gov Wed Mar 6 09:42:20 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Wed, 6 Mar 2013 09:42:20 -0600 Subject: [petsc-users] compiling with complex In-Reply-To: References: <4D513AE9-E88E-4A3F-9889-E68E17B5B0EB@gmail.com> Message-ID: On Wed, Mar 6, 2013 at 9:39 AM, Manav Bhatia wrote: > Thanks Jed. > > 3.3 compiles fine on my machine with complex support. However, the reason > I am not using it is the modified NaN handling between 3.1 and 3.3. > Seems like for a vector with some NaNs 3.1 returned an L2 norm as a NaN. > But, 3.3 throws an exception. I would prefer to handle the NaN occurrence > within my code, which is still forcing me to stick to 3.1. > > Is there a way to turn off this behavior in 3.3? Any other suggestions > would be welcome. > Use petsc-3.3 from here. https://bitbucket.org/petsc/petsc-3.3 -------------- next part -------------- An HTML attachment was scrubbed... URL: From balay at mcs.anl.gov Wed Mar 6 09:45:41 2013 From: balay at mcs.anl.gov (Satish Balay) Date: Wed, 6 Mar 2013 09:45:41 -0600 (CST) Subject: [petsc-users] compiling with complex In-Reply-To: References: <4D513AE9-E88E-4A3F-9889-E68E17B5B0EB@gmail.com> Message-ID: On Wed, 6 Mar 2013, Jed Brown wrote: > On Wed, Mar 6, 2013 at 9:39 AM, Manav Bhatia wrote: > > > Thanks Jed. > > > > 3.3 compiles fine on my machine with complex support. However, the reason > > I am not using it is the modified NaN handling between 3.1 and 3.3. > > Seems like for a vector with some NaNs 3.1 returned an L2 norm as a NaN. > > But, 3.3 throws an exception. I would prefer to handle the NaN occurrence > > within my code, which is still forcing me to stick to 3.1. > > > > Is there a way to turn off this behavior in 3.3? Any other suggestions > > would be welcome. > > > > Use petsc-3.3 from here. > > https://bitbucket.org/petsc/petsc-3.3 Or grab the patch https://bitbucket.org/petsc/petsc-3.3/commits/4332ca421e80103c166f952c3405d34098901a96 and apply to your sources Satish From bhatiamanav at gmail.com Wed Mar 6 09:46:00 2013 From: bhatiamanav at gmail.com (Manav Bhatia) Date: Wed, 6 Mar 2013 10:46:00 -0500 Subject: [petsc-users] compiling with complex In-Reply-To: References: <4D513AE9-E88E-4A3F-9889-E68E17B5B0EB@gmail.com> Message-ID: Should I just grab the "tip"? On Mar 6, 2013, at 10:42 AM, Jed Brown wrote: > On Wed, Mar 6, 2013 at 9:39 AM, Manav Bhatia wrote: > Thanks Jed. > > 3.3 compiles fine on my machine with complex support. However, the reason I am not using it is the modified NaN handling between 3.1 and 3.3. > Seems like for a vector with some NaNs 3.1 returned an L2 norm as a NaN. But, 3.3 throws an exception. I would prefer to handle the NaN occurrence within my code, which is still forcing me to stick to 3.1. > > Is there a way to turn off this behavior in 3.3? Any other suggestions would be welcome. > > Use petsc-3.3 from here. > > https://bitbucket.org/petsc/petsc-3.3 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jedbrown at mcs.anl.gov Wed Mar 6 09:47:26 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Wed, 6 Mar 2013 09:47:26 -0600 Subject: [petsc-users] compiling with complex In-Reply-To: References: <4D513AE9-E88E-4A3F-9889-E68E17B5B0EB@gmail.com> Message-ID: On Wed, Mar 6, 2013 at 9:46 AM, Manav Bhatia wrote: > Should I just grab the "tip"? Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.adams at columbia.edu Wed Mar 6 11:25:48 2013 From: mark.adams at columbia.edu (Mark F. Adams) Date: Wed, 6 Mar 2013 12:25:48 -0500 Subject: [petsc-users] odd SNES behavior Message-ID: <46F46D6E-0F42-4AE1-B794-AA9A97D40EF1@columbia.edu> I have a SNES solve if I switch the pc_type between gamg and hypre I get some odd results: 1) The gamg solve takes two more Newton iterations and converges for a different reason. This could be OK, but it seems odd. 2) The more mystifying issue is that the gamg solve seems to take just a few more total linear solve iterations but does about 5x as many function evaluations. I've attached two log files. Any ideas what is going on here? It seems like it should be impossible for the choice of PC to effect the nonlinear solve like this. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: log_petsc_gamg Type: application/octet-stream Size: 58469 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: log_petsc_hypre Type: application/octet-stream Size: 19988 bytes Desc: not available URL: From bsmith at mcs.anl.gov Wed Mar 6 12:21:48 2013 From: bsmith at mcs.anl.gov (Barry Smith) Date: Wed, 6 Mar 2013 12:21:48 -0600 Subject: [petsc-users] odd SNES behavior In-Reply-To: <46F46D6E-0F42-4AE1-B794-AA9A97D40EF1@columbia.edu> References: <46F46D6E-0F42-4AE1-B794-AA9A97D40EF1@columbia.edu> Message-ID: <70A47955-0555-467F-A33F-F67265C79FE6@mcs.anl.gov> hypre run Linear solve converged due to CONVERGED_RTOL iterations 8 9 SNES Function norm 4.819210383260e+04 Nonlinear solve converged due to CONVERGED_SNORM_RELATIVE iterations 9 gang run 9 SNES Function norm 4.895122815462e+04 So they are tracking each other well per Newton step: hypre slightly above but also doing more iterations per Newton so probably reasonable. It is interesting that the hypre run hits the "small Newton step size" limit, but the gamg does not (this explains why the hypre "takes" less Newton steps). You can run with -snes_linesearch_monitor also (my guess is that it is being triggered more with gamg hence more function evaluations). Barry On Mar 6, 2013, at 11:25 AM, "Mark F. Adams" wrote: > I have a SNES solve if I switch the pc_type between gamg and hypre I get some odd results: > > 1) The gamg solve takes two more Newton iterations and converges for a different reason. This could be OK, but it seems odd. > > 2) The more mystifying issue is that the gamg solve seems to take just a few more total linear solve iterations but does about 5x as many function evaluations. > > I've attached two log files. Any ideas what is going on here? It seems like it should be impossible for the choice of PC to effect the nonlinear solve like this. > > Mark > From prbrune at gmail.com Wed Mar 6 13:21:05 2013 From: prbrune at gmail.com (Peter Brune) Date: Wed, 6 Mar 2013 13:21:05 -0600 Subject: [petsc-users] odd SNES behavior In-Reply-To: <46F46D6E-0F42-4AE1-B794-AA9A97D40EF1@columbia.edu> References: <46F46D6E-0F42-4AE1-B794-AA9A97D40EF1@columbia.edu> Message-ID: Mark - I can reproduce on a simple single processor example. It appears that the MatMFFD is being used within GAMG instead of the preconditioning matrix. Therefore, SNESComputeFunction is being called at each chebychev iteration on the coarse grid. For instance, I get backtraces like: #0 SNESComputeFunction (snes=0x870250, x=0xb1a020, y=0xc5e150) at /home/prbrune/packages/petsc-dev/src/snes/interface/snes.c:1993 #1 0x00007ffff68964cf in MatMult_MFFD (mat=0xa82e30, a=0xc54350, y=0xc5e150) at /home/prbrune/packages/petsc-dev/src/mat/impls/mffd/mffd.c:404 #2 0x00007ffff6692070 in MatMult (mat=0xa82e30, x=0xc54350, y=0xc5e150) at /home/prbrune/packages/petsc-dev/src/mat/interface/matrix.c:2156 #3 0x00007ffff705fa81 in KSP_MatMult (ksp=0xbf6410, A=0xa82e30, x=0xc54350, y=0xc5e150) at /home/prbrune/packages/petsc-dev/include/petsc-private/kspimpl.h:198 #4 0x00007ffff706686d in KSPSolve_Chebyshev (ksp=0xbf6410) at /home/prbrune/packages/petsc-dev/src/ksp/ksp/impls/cheby/cheby.c:502 #5 0x00007ffff6f7c53c in KSPSolve (ksp=0xbf6410, b=0xa6e9a0, x=0xb41990) at /home/prbrune/packages/petsc-dev/src/ksp/ksp/interface/itfunc.c:430 #6 0x00007ffff6f4d9ae in PCMGMCycle_Private (pc=0xa22bf0, mglevelsin=0xbd72c8, reason=0x0) at /home/prbrune/packages/petsc-dev/src/ksp/pc/impls/mg/mg.c:19 #7 0x00007ffff6f52280 in PCApply_MG (pc=0xa22bf0, b=0xa6e9a0, x=0xb41990) at /home/prbrune/packages/petsc-dev/src/ksp/pc/impls/mg/mg.c:330 #8 0x00007ffff6e32b23 in PCApply (pc=0xa22bf0, x=0xa6e9a0, y=0xb41990) at /home/prbrune/packages/petsc-dev/src/ksp/pc/interface/precon.c:390 #9 0x00007ffff6fa8a4d in KSP_PCApply (ksp=0x9e60f0, x=0xa6e9a0, y=0xb41990) at /home/prbrune/packages/petsc-dev/include/petsc-private/kspimpl.h:221 #10 0x00007ffff6fa98f3 in KSPInitialResidual (ksp=0x9e60f0, vsoln=0xa79030, vt1=0xb2d4f0, vt2=0xb37b90, vres=0xb41990, vb=0xa6e9a0) at /home/prbrune/packages/petsc-dev/src/ksp/ksp/interface/itres.c:64 #11 0x00007ffff7031a88 in KSPSolve_GMRES (ksp=0x9e60f0) at /home/prbrune/packages/petsc-dev/src/ksp/ksp/impls/gmres/gmres.c:234 #12 0x00007ffff6f7c53c in KSPSolve (ksp=0x9e60f0, b=0xa6e9a0, x=0xa79030) at /home/prbrune/packages/petsc-dev/src/ksp/ksp/interface/itfunc.c:430 #13 0x00007ffff714b1ea in SNES_KSPSolve (snes=0x870250, ksp=0x9e60f0, b=0xa6e9a0, x=0xa79030) at /home/prbrune/packages/petsc-dev/src/snes/interface/snes.c:4418 #14 0x00007ffff70d8ec5 in SNESSolve_NEWTONLS (snes=0x870250) at /home/prbrune/packages/petsc-dev/src/snes/impls/ls/ls.c:217 #15 0x00007ffff7142e9b in SNESSolve (snes=0x870250, b=0x0, x=0xa24840) at /home/prbrune/packages/petsc-dev/src/snes/interface/snes.c:3649 #16 0x0000000000402c83 in main (argc=9, argv=0x7fffffffde08) at ex5.c:157 Is the wrong matrix getting sent to the smoothers somewhere? - Peter On Wed, Mar 6, 2013 at 11:25 AM, Mark F. Adams wrote: > I have a SNES solve if I switch the pc_type between gamg and hypre I get > some odd results: > > 1) The gamg solve takes two more Newton iterations and converges for a > different reason. This could be OK, but it seems odd. > > 2) The more mystifying issue is that the gamg solve seems to take just a > few more total linear solve iterations but does about 5x as many function > evaluations. > > I've attached two log files. Any ideas what is going on here? It seems > like it should be impossible for the choice of PC to effect the nonlinear > solve like this. > > Mark > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.adams at columbia.edu Wed Mar 6 13:25:52 2013 From: mark.adams at columbia.edu (Mark F. Adams) Date: Wed, 6 Mar 2013 14:25:52 -0500 Subject: [petsc-users] odd SNES behavior In-Reply-To: <70A47955-0555-467F-A33F-F67265C79FE6@mcs.anl.gov> References: <46F46D6E-0F42-4AE1-B794-AA9A97D40EF1@columbia.edu> <70A47955-0555-467F-A33F-F67265C79FE6@mcs.anl.gov> Message-ID: > > > You can run with -snes_linesearch_monitor also (my guess is that it is being triggered more with gamg hence more function evaluations). snes_linesearch_monitor did not seem to tell me much (see appended). The GAMG and HYPRE output was similar (as one would hope). Should I perhaps run something like '-info snes' to see where these guys diverge? GAMG: 4 KSP Residual norm 8.240636524364e+02 5 KSP Residual norm 6.859873473208e+02 6 KSP Residual norm 6.187746494615e+02 7 KSP Residual norm 5.378415356008e+02 Linear solve converged due to CONVERGED_RTOL iterations 7 Line search: Using full step: fnorm 2.835772370452e+05 gnorm 4.895281520389e+04 9 SNES Function norm 4.895281520389e+04 0 KSP Residual norm 4.895281520389e+04 1 KSP Residual norm 3.145172880926e+03 2 KSP Residual norm 7.147989028232e+02 3 KSP Residual norm 4.982303798687e+02 4 KSP Residual norm 4.405892793165e+02 5 KSP Residual norm 4.003228476498e+02 6 KSP Residual norm 3.299993998722e+02 7 KSP Residual norm 2.203595473306e+02 8 KSP Residual norm 1.293543888554e+02 9 KSP Residual norm 8.203517750619e+01 Linear solve converged due to CONVERGED_RTOL iterations 9 Line search: Using full step: fnorm 4.895281520389e+04 gnorm 8.668206596295e+03 10 SNES Function norm 8.668206596295e+03 0 KSP Residual norm 8.668206596295e+03 1 KSP Residual norm 4.557232270362e+02 2 KSP Residual norm 8.211391243357e+01 3 KSP Residual norm 6.017999632904e+01 4 KSP Residual norm 5.160935079494e+01 5 KSP Residual norm 4.575984742586e+01 6 KSP Residual norm 3.965459823946e+01 7 KSP Residual norm 3.314109315152e+01 8 KSP Residual norm 2.564475175103e+01 9 KSP Residual norm 1.764923610559e+01 10 KSP Residual norm 1.267831683136e+01 Linear solve converged due to CONVERGED_RTOL iterations 10 Line search: Using full step: fnorm 8.668206596295e+03 gnorm 1.763432524435e+02 11 SNES Function norm 1.763432524435e+02 Nonlinear solve converged due to CONVERGED_FNORM_RELATIVE iterations 11 HYPRE: 5 KSP Residual norm 3.110704123273e+03 6 KSP Residual norm 1.609993784143e+03 7 KSP Residual norm 8.500755950825e+02 8 KSP Residual norm 5.335192138320e+02 Linear solve converged due to CONVERGED_RTOL iterations 8 Line search: Using full step: fnorm 2.796443368363e+05 gnorm 4.819210383260e+04 9 SNES Function norm 4.819210383260e+04 Nonlinear solve converged due to CONVERGED_SNORM_RELATIVE iterations 9 From mark.adams at columbia.edu Wed Mar 6 14:03:02 2013 From: mark.adams at columbia.edu (Mark F. Adams) Date: Wed, 6 Mar 2013 15:03:02 -0500 Subject: [petsc-users] odd SNES behavior In-Reply-To: References: <46F46D6E-0F42-4AE1-B794-AA9A97D40EF1@columbia.edu> Message-ID: Good catch Peter, I seem to be able to fix this by "redoing" the PC each solve (see below). I see this when '-pc_gamg_reuse_interpolation false': MatMult 5552 1.0 2.4250e+02 1.0 1.16e+09 1.0 2.9e+04 1.8e+03 7.5e+03 95 27 66 63 55 95 27 66 63 55 19 MatMultAdd 501 1.0 1.8848e-01 1.2 9.73e+07 1.0 3.2e+03 8.9e+02 0.0e+00 0 2 7 3 0 0 2 7 3 0 2055 and this with '-pc_gamg_reuse_interpolation true': MatMult MF 1940 1.0 2.4999e+02 1.0 5.68e+08 1.0 0.0e+00 0.0e+00 7.7e+03 96 12 0 0 81 96 12 0 0 81 9 MatMult 6038 1.0 2.5118e+02 1.0 1.33e+09 1.0 3.3e+04 1.9e+03 7.7e+03 96 28 79 79 81 96 28 79 79 81 21 The offending GAMG code is appended. It looks like the code in the first 'else' clause is causing the problem. Do you see what is causing this problem? I am marching up the grids redoing the Galerkin coarse grids. Mark redo_mesh_setup = (PetscBool)(!pc_gamg->reuse_prol); if (pc_gamg->setup_count++ > 0) { if (redo_mesh_setup) { /* reset everything */ ierr = PCReset_MG(pc);CHKERRQ(ierr); pc->setupcalled = 0; } else { PC_MG_Levels **mglevels = mg->levels; /* just do Galerkin grids */ Mat B,dA,dB; if (!pc->setupcalled) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_PLIB,"PCSetUp() has not been called yet"); if (pc_gamg->Nlevels > 1) { /* currently only handle case where mat and pmat are the same on coarser levels */ ierr = KSPGetOperators(mglevels[pc_gamg->Nlevels-1]->smoothd,&dA,&dB,NULL);CHKERRQ(ierr); /* (re)set to get dirty flag */ ierr = KSPSetOperators(mglevels[pc_gamg->Nlevels-1]->smoothd,dA,dB,SAME_NONZERO_PATTERN);CHKERRQ(ierr); for (level=pc_gamg->Nlevels-2; level>=0; level--) { /* the first time through the matrix structure has changed from repartitioning */ if (pc_gamg->setup_count==2 && (pc_gamg->repart || level==0)) { ierr = MatPtAP(dB,mglevels[level+1]->interpolate,MAT_INITIAL_MATRIX,1.0,&B);CHKERRQ(ierr); ierr = MatDestroy(&mglevels[level]->A);CHKERRQ(ierr); mglevels[level]->A = B; } else { ierr = KSPGetOperators(mglevels[level]->smoothd,NULL,&B,NULL);CHKERRQ(ierr); ierr = MatPtAP(dB,mglevels[level+1]->interpolate,MAT_REUSE_MATRIX,1.0,&B);CHKERRQ(ierr); } ierr = KSPSetOperators(mglevels[level]->smoothd,B,B,SAME_NONZERO_PATTERN);CHKERRQ(ierr); dB = B; } } ierr = PCSetUp_MG(pc);CHKERRQ(ierr); /* PCSetUp_MG seems to insists on setting this to GMRES */ ierr = KSPSetType(mglevels[0]->smoothd, KSPPREONLY);CHKERRQ(ierr); PetscFunctionReturn(0); } } From bsmith at mcs.anl.gov Wed Mar 6 15:29:38 2013 From: bsmith at mcs.anl.gov (Barry Smith) Date: Wed, 6 Mar 2013 15:29:38 -0600 Subject: [petsc-users] odd SNES behavior In-Reply-To: References: <46F46D6E-0F42-4AE1-B794-AA9A97D40EF1@columbia.edu> Message-ID: <238DC882-A981-46F4-B3A7-12A2D6D0ABCA@mcs.anl.gov> On Mar 6, 2013, at 2:03 PM, "Mark F. Adams" wrote: > Good catch Peter, > > I seem to be able to fix this by "redoing" the PC each solve (see below). I see this when '-pc_gamg_reuse_interpolation false': > > MatMult 5552 1.0 2.4250e+02 1.0 1.16e+09 1.0 2.9e+04 1.8e+03 7.5e+03 95 27 66 63 55 95 27 66 63 55 19 > MatMultAdd 501 1.0 1.8848e-01 1.2 9.73e+07 1.0 3.2e+03 8.9e+02 0.0e+00 0 2 7 3 0 0 2 7 3 0 2055 > > and this with '-pc_gamg_reuse_interpolation true': > > MatMult MF 1940 1.0 2.4999e+02 1.0 5.68e+08 1.0 0.0e+00 0.0e+00 7.7e+03 96 12 0 0 81 96 12 0 0 81 9 > MatMult 6038 1.0 2.5118e+02 1.0 1.33e+09 1.0 3.3e+04 1.9e+03 7.7e+03 96 28 79 79 81 96 28 79 79 81 21 > > The offending GAMG code is appended. It looks like the code in the first 'else' clause is causing the problem. Do you see what is causing this problem? I am marching up the grids redoing the Galerkin coarse grids. Yikes, the logic of SNES and MG (with dm etc) is getting a bit too convoluted. I would run in the debugger with a break point for MatCreate_MFFD() this will give a hint why it is being used. Barry > > Mark > > redo_mesh_setup = (PetscBool)(!pc_gamg->reuse_prol); > > if (pc_gamg->setup_count++ > 0) { > if (redo_mesh_setup) { > /* reset everything */ > ierr = PCReset_MG(pc);CHKERRQ(ierr); > pc->setupcalled = 0; > } else { > PC_MG_Levels **mglevels = mg->levels; > /* just do Galerkin grids */ > Mat B,dA,dB; > > if (!pc->setupcalled) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_PLIB,"PCSetUp() has not been called yet"); > if (pc_gamg->Nlevels > 1) { > /* currently only handle case where mat and pmat are the same on coarser levels */ > ierr = KSPGetOperators(mglevels[pc_gamg->Nlevels-1]->smoothd,&dA,&dB,NULL);CHKERRQ(ierr); > /* (re)set to get dirty flag */ > ierr = KSPSetOperators(mglevels[pc_gamg->Nlevels-1]->smoothd,dA,dB,SAME_NONZERO_PATTERN);CHKERRQ(ierr); > > for (level=pc_gamg->Nlevels-2; level>=0; level--) { > /* the first time through the matrix structure has changed from repartitioning */ > if (pc_gamg->setup_count==2 && (pc_gamg->repart || level==0)) { > ierr = MatPtAP(dB,mglevels[level+1]->interpolate,MAT_INITIAL_MATRIX,1.0,&B);CHKERRQ(ierr); > ierr = MatDestroy(&mglevels[level]->A);CHKERRQ(ierr); > > mglevels[level]->A = B; > } else { > ierr = KSPGetOperators(mglevels[level]->smoothd,NULL,&B,NULL);CHKERRQ(ierr); > ierr = MatPtAP(dB,mglevels[level+1]->interpolate,MAT_REUSE_MATRIX,1.0,&B);CHKERRQ(ierr); > } > ierr = KSPSetOperators(mglevels[level]->smoothd,B,B,SAME_NONZERO_PATTERN);CHKERRQ(ierr); > dB = B; > } > } > > ierr = PCSetUp_MG(pc);CHKERRQ(ierr); > > /* PCSetUp_MG seems to insists on setting this to GMRES */ > ierr = KSPSetType(mglevels[0]->smoothd, KSPPREONLY);CHKERRQ(ierr); > PetscFunctionReturn(0); > } > } > From mark.adams at columbia.edu Wed Mar 6 15:44:53 2013 From: mark.adams at columbia.edu (Mark F. Adams) Date: Wed, 6 Mar 2013 16:44:53 -0500 Subject: [petsc-users] odd SNES behavior In-Reply-To: <238DC882-A981-46F4-B3A7-12A2D6D0ABCA@mcs.anl.gov> References: <46F46D6E-0F42-4AE1-B794-AA9A97D40EF1@columbia.edu> <238DC882-A981-46F4-B3A7-12A2D6D0ABCA@mcs.anl.gov> Message-ID: <4F8532EE-09D7-411F-92AB-561634EA64A8@columbia.edu> > > Yikes, the logic of SNES and MG (with dm etc) is getting a bit too convoluted. I would run in the debugger with a break point for MatCreate_MFFD() this will give a hint why it is being used. > #0 0x0000000100fca059 in MatCreate_MFFD () #1 0x0000000100eedc34 in MatSetType () #2 0x0000000100fc7bc3 in MatCreateMFFD () #3 0x00000001012acc90 in MatCreateSNESMF () #4 0x00000001012c092e in SNESSetUp () #5 0x00000001012c277b in SNESSolve () I will keep digging. This is the first one and it is not in the PC ... From bsmith at mcs.anl.gov Wed Mar 6 15:47:57 2013 From: bsmith at mcs.anl.gov (Barry Smith) Date: Wed, 6 Mar 2013 15:47:57 -0600 Subject: [petsc-users] odd SNES behavior In-Reply-To: <4F8532EE-09D7-411F-92AB-561634EA64A8@columbia.edu> References: <46F46D6E-0F42-4AE1-B794-AA9A97D40EF1@columbia.edu> <238DC882-A981-46F4-B3A7-12A2D6D0ABCA@mcs.anl.gov> <4F8532EE-09D7-411F-92AB-561634EA64A8@columbia.edu> Message-ID: On Mar 6, 2013, at 3:44 PM, "Mark F. Adams" wrote: >> >> Yikes, the logic of SNES and MG (with dm etc) is getting a bit too convoluted. I would run in the debugger with a break point for MatCreate_MFFD() this will give a hint why it is being used. >> > > #0 0x0000000100fca059 in MatCreate_MFFD () > #1 0x0000000100eedc34 in MatSetType () > #2 0x0000000100fc7bc3 in MatCreateMFFD () > #3 0x00000001012acc90 in MatCreateSNESMF () > #4 0x00000001012c092e in SNESSetUp () > #5 0x00000001012c277b in SNESSolve () > > I will keep digging. This is the first one and it is not in the PC ? It looks like SNES is not getting set it's "master" Jacobian. If you run the same code with hypre does it also hit this create? Barry From prbrune at gmail.com Wed Mar 6 15:48:52 2013 From: prbrune at gmail.com (Peter Brune) Date: Wed, 6 Mar 2013 15:48:52 -0600 Subject: [petsc-users] odd SNES behavior In-Reply-To: <4F8532EE-09D7-411F-92AB-561634EA64A8@columbia.edu> References: <46F46D6E-0F42-4AE1-B794-AA9A97D40EF1@columbia.edu> <238DC882-A981-46F4-B3A7-12A2D6D0ABCA@mcs.anl.gov> <4F8532EE-09D7-411F-92AB-561634EA64A8@columbia.edu> Message-ID: That's the thing; you WANT a MFFD matrix in the snes->jacobian slot but not the snes->jacobian_pre slot. Somewhere the PC's getting the wrong one and putting it on the smoother. - Peter On Wed, Mar 6, 2013 at 3:44 PM, Mark F. Adams wrote: > > > > Yikes, the logic of SNES and MG (with dm etc) is getting a bit too > convoluted. I would run in the debugger with a break point for > MatCreate_MFFD() this will give a hint why it is being used. > > > > #0 0x0000000100fca059 in MatCreate_MFFD () > #1 0x0000000100eedc34 in MatSetType () > #2 0x0000000100fc7bc3 in MatCreateMFFD () > #3 0x00000001012acc90 in MatCreateSNESMF () > #4 0x00000001012c092e in SNESSetUp () > #5 0x00000001012c277b in SNESSolve () > > I will keep digging. This is the first one and it is not in the PC ... -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.adams at columbia.edu Wed Mar 6 16:11:04 2013 From: mark.adams at columbia.edu (Mark F. Adams) Date: Wed, 6 Mar 2013 17:11:04 -0500 Subject: [petsc-users] odd SNES behavior In-Reply-To: References: <46F46D6E-0F42-4AE1-B794-AA9A97D40EF1@columbia.edu> <238DC882-A981-46F4-B3A7-12A2D6D0ABCA@mcs.anl.gov> <4F8532EE-09D7-411F-92AB-561634EA64A8@columbia.edu> Message-ID: <701E0628-80FD-4962-B7AD-58133FD1373E@columbia.edu> I see that the fine grid smoother is calling my matrix free formFunction routine: (gdb) frame 11 #11 0x00000001020f6cbe in PCMGMCycle_Private (pc=0x1096b2270, mglevelsin=0x112183098, reason=0x0) at mg.c:19 warning: Source file is more recent than executable. 19 ierr = KSPSolve(mglevels->smoothd,mglevels->b,mglevels->x);CHKERRQ(ierr); /* pre-smooth */ Current language: auto; currently c (gdb) list 14 PetscErrorCode ierr; 15 PetscInt cycles = (mglevels->level == 1) ? 1 : (PetscInt) mglevels->cycles; 16 17 PetscFunctionBegin; 18 if (mglevels->eventsmoothsolve) {ierr = PetscLogEventBegin(mglevels->eventsmoothsolve,0,0,0,0);CHKERRQ(ierr);} 19 ierr = KSPSolve(mglevels->smoothd,mglevels->b,mglevels->x);CHKERRQ(ierr); /* pre-smooth */ 20 if (mglevels->eventsmoothsolve) {ierr = PetscLogEventEnd(mglevels->eventsmoothsolve,0,0,0,0);CHKERRQ(ierr);} 21 if (mglevels->level) { /* not the coarsest grid */ 22 if (mglevels->eventresidual) {ierr = PetscLogEventBegin(mglevels->eventresidual,0,0,0,0);CHKERRQ(ierr);} 23 ierr = (*mglevels->residual)(mglevels->A,mglevels->b,mglevels->x,mglevels->r);CHKERRQ(ierr); (gdb) p mglevels->level $1 = 5 gamg.c sets all the operators with the same matrix, as far as I can see. Could SNES be setting the matrix type somehow? Mark On Mar 6, 2013, at 4:48 PM, Peter Brune wrote: > That's the thing; you WANT a MFFD matrix in the snes->jacobian slot but not the snes->jacobian_pre slot. > > Somewhere the PC's getting the wrong one and putting it on the smoother. > > - Peter > > > On Wed, Mar 6, 2013 at 3:44 PM, Mark F. Adams wrote: > > > > Yikes, the logic of SNES and MG (with dm etc) is getting a bit too convoluted. I would run in the debugger with a break point for MatCreate_MFFD() this will give a hint why it is being used. > > > > #0 0x0000000100fca059 in MatCreate_MFFD () > #1 0x0000000100eedc34 in MatSetType () > #2 0x0000000100fc7bc3 in MatCreateMFFD () > #3 0x00000001012acc90 in MatCreateSNESMF () > #4 0x00000001012c092e in SNESSetUp () > #5 0x00000001012c277b in SNESSolve () > > I will keep digging. This is the first one and it is not in the PC ... > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.adams at columbia.edu Wed Mar 6 16:17:53 2013 From: mark.adams at columbia.edu (Mark F. Adams) Date: Wed, 6 Mar 2013 17:17:53 -0500 Subject: [petsc-users] odd SNES behavior In-Reply-To: References: <46F46D6E-0F42-4AE1-B794-AA9A97D40EF1@columbia.edu> <238DC882-A981-46F4-B3A7-12A2D6D0ABCA@mcs.anl.gov> <4F8532EE-09D7-411F-92AB-561634EA64A8@columbia.edu> Message-ID: <6FCBA96F-7327-4EFB-AB57-FED7155DF2D9@columbia.edu> > > It looks like SNES is not getting set it's "master" Jacobian. If you run the same code with hypre does it also hit this create? Hypre hits the create but it only calls MatMult_MFFD once per iteration, whereas gamg is calling it in the smoother. From dharmareddy84 at gmail.com Wed Mar 6 16:30:36 2013 From: dharmareddy84 at gmail.com (Dharmendar Reddy) Date: Wed, 6 Mar 2013 16:30:36 -0600 Subject: [petsc-users] DMPlex Fortran examples In-Reply-To: References: Message-ID: Hello Mathew, I created an example (tutorial like) for creating DM using cell list of a box mesh with quad cells (anti clockwise orientation for cell nodes). The Box mesh is created locally. I also included in comments explanations of cells, dimension, co-dimension based on my understanding. May be you can add some explanation for understanding the idea of stratum. I find that DMPlexComputeCellGeometry gives incorrect results for J, detJ and InvJ where as the same code that you used in DMPlexComputeRectangleGeometry_private gives correct answers when i evaluated those steps locally in the example code. Can you tell me how i should go about this: I create mesh in gmsh for my problem. The output of node coordinates, and connectivity which i use via DMcreateFromcelllist to create a DM. In gmsh i also assign physical ids to blokcs for region which i need to use for assigning material properties, boundary conditions. How do i include this information into DMPlex ? I understood how to create a Petscsection for Feild data layout. Now i need to be able to access some auxilary data which is usually mesh positon dependent but given information. I have design my code interface such that the user needs to write the linear and blinear form with the DM, cell and basis functions as input. All the data dof and aux data is to be access via DM Please give me some pointers, i will digg to learn more. Thanks Reddy On Wed, Mar 6, 2013 at 4:51 AM, Matthew Knepley wrote: > On Wed, Mar 6, 2013 at 2:43 AM, Dharmendar Reddy wrote: > >> I think i caught the issues, please see the reply inline below. It is not >> clear to me for which DMPlex i should include petsc.h90 or petsc.h >> >> Still need to fix the DMPlexComputeCellGeometry though >> >> >> On Tue, Mar 5, 2013 at 9:52 PM, Dharmendar Reddy > > wrote: >> >>> Hello, >>> >>> I am having trouble with a couple of DMPlex routines. >>> I was doing tests on various function calls that i may need to write a >>> test Poisson problem. >>> >>> First issue is with DMPlexComputeCellGeometry. For a rectangle cell >>> geometry, I get , v0, J, invJ, and detJ as zero. >>> >> > Geometric primitives of course depend on the way you specify a cell. > Simplicies are nice in > that you can only change the orientation, but hexes are harder. I specify > quads so that the > vertices go counter-clockwise around the boundary. Do you do this? If so, > can you send > a small example test that I can add to PETSc. > > >> DMPlexGetConeSize gives run time error >>> >>> I had to include petsc.h90 to fix this. >> > > I have fixed the manpage documentation to reflect this. > > >> >> DMPlexVecGetClosure gives runtime error, Should not this call be >>> DMPlexVecGetClosureF90 ? is there such interface ? I remember doing a >>> procedure like VecGetArrayF90 and VecRestoreArrayF90 when i had to pass >>> pointer which need to be restored. >>> >>> Looks like there is an inconsistency in interface defined on >> petsc-dev manual page. and the interface defined in >> finclude/ftn-custom/petscdmplex.h90 >> Fortran interface does not have the csize parameter defined below >> >> PetscErrorCode DMPlexVecGetClosure(DM dm, PetscSection section, Vec v, PetscInt point, PetscInt *csize, const PetscScalar *values[]) >> >> I have noted this on the manpage. > > Did you look at src/dm/impls/plex/examples/tests/ex2f90.F? It tests many > of these operations. > > Thanks, > > Matt > > >> >> >> I have attached test case with the make file and error.log. Please have a >>> look at it. >>> you need to run: >>> make all debug=0 >>> ./testDMView >>> >>> Also, I have trouble compiling the code with debug=1 which uses petsc >>> configured in debug mode everything else being same (you can see the >>> configure options in the error.log). >>> I get this error message: >>> login1$ make all debug=1 >>> make: *** /home1/00924/Reddy135/LocalApps/petsc-dev/mpi_rScalar: Is a >>> directory. Stop >>> . >>> >>> >>> >>> On Tue, Mar 5, 2013 at 9:22 AM, Matthew Knepley wrote: >>> >>>> On Tue, Mar 5, 2013 at 10:20 AM, Dharmendar Reddy < >>>> dharmareddy84 at gmail.com> wrote: >>>> >>>>> Thanks, so numDof is basically number of dof per topological entity of >>>>> a cell. Did i get this right ? >>>>> >>>> >>>> Yes, dof per field per topological entity (sieve point depth). >>>> >>>> Matt >>>> >>>> >>>>> +! Let u be defined on vertices >>>>> >>>>> + numDof(0*(dim+1)+1) = 1 (should not be number of nodes) >>>>> >>>>> +! Let v be defined on cells >>>>> >>>>> + numDof(1*(dim+1)+dim+1) = dim >>>>> >>>>> +! Let v be defined on faces >>>>> >>>>> + numDof(2*(dim+1)+dim) = dim-1 (similarly, should not be number of faces time (dim-1)) >>>>> >>>>> >>>>> >>>>> >>>>> On Tue, Mar 5, 2013 at 9:06 AM, Matthew Knepley wrote: >>>>> >>>>>> On Tue, Mar 5, 2013 at 2:18 AM, Dharmendar Reddy < >>>>>> dharmareddy84 at gmail.com> wrote: >>>>>> >>>>>>> Hello, >>>>>>> >>>>>>> Trying to understand the DMPlexCreateSection first. I have >>>>>>> created a test case, can you please have a look at it? Actually the code >>>>>>> has a link error on my system with petsc-dev. I used DMPlexeCreateBoxMesh >>>>>>> to create the mesh. Looks like there is no Fortran interface to that >>>>>>> function. If i comment out the dmplexcreateboxmesh. It does create and >>>>>>> executable. >>>>>>> >>>>>> >>>>>> I have now pushed your example, slightly changed, to the repository: >>>>>> >>>>>> src/dm/impls/plex/examples/tutorials/ex1.c/ex1f90.F >>>>>> >>>>>> and you can run with -dim 2 or -dim 3. >>>>>> >>>>>> Thanks, >>>>>> >>>>>> Matt >>>>>> >>>>>> >>>>>>> petscDMTest_v2.o: In function `MAIN__': >>>>>>> petscDMTest_v2.F90:(.text+0x9b): undefined reference to >>>>>>> `dmplexcreateboxmesh_' >>>>>>> make: [testDMMeshv2] Error 1 (ignored) >>>>>>> >>>>>>> Also, If include finclude/petsc.h90 instead of finclude/petsch.h i >>>>>>> get compile error : >>>>>>> >>>>>>> petscDMTest_v2.F90(73): error #6691: A pointer dummy argument may >>>>>>> only be argument a >>>>>>> ssociated with a pointer. [NUMCOMP] >>>>>>> call DMPlexCreateSection(dmMesh, topologyDim, numField, numComp, >>>>>>> numDof, & >>>>>>> ----------------------------------------------------------^ >>>>>>> petscDMTest_v2.F90(73): error #6691: A pointer dummy argument may >>>>>>> only be argument a >>>>>>> ssociated with a pointer. [NUMDOF] >>>>>>> call DMPlexCreateSection(dmMesh, topologyDim, numField, numComp, >>>>>>> numDof, & >>>>>>> -------------------------------------------------------------------^ >>>>>>> petscDMTest_v2.F90(74): error #6691: A pointer dummy argument may >>>>>>> only be argument a >>>>>>> ssociated with a pointer. [BCFIELD] >>>>>>> numBC, bcField, bcPointIS,section,ierr) >>>>>>> ----------------------------------^ >>>>>>> petscDMTest_v2.F90(74): error #6691: A pointer dummy argument may >>>>>>> only be argument a >>>>>>> ssociated with a pointer. [BCPOINTIS] >>>>>>> numBC, bcField, bcPointIS,section,ierr) >>>>>>> -------------------------------------------^ >>>>>>> >>>>>>> Please have a look at the attached test case and Makefile >>>>>>> >>>>>>> >>>>>>> On Mon, Mar 4, 2013 at 7:39 PM, Matthew Knepley wrote: >>>>>>> >>>>>>>> On Mon, Mar 4, 2013 at 7:50 PM, Dharmendar Reddy < >>>>>>>> dharmareddy84 at gmail.com> wrote: >>>>>>>> >>>>>>>>> Hello, >>>>>>>>> Is there a DMPlex based fortran example for solving a pde >>>>>>>>> such as laplace ? Even a c example will do. I am not able to understand the >>>>>>>>> terminology of chart, cone etc. Is there a paper or user guide to learn >>>>>>>>> more about the definitions of terms such as chart cone stratum ? I remember >>>>>>>>> reading a presentation file by mathew about sieve. Is there a newer >>>>>>>>> tutorial with terminology mapped to the new DMPlex/DMMesh functions. >>>>>>>>> >>>>>>>> >>>>>>>> There is a fully worked out Stokes example (SNES ex62) and a Finite >>>>>>>> Volume example (TS ex11), >>>>>>>> and there are a few tests. You should not need much of that stuff >>>>>>>> for defining a problem. I am >>>>>>>> writing up a paper about ex11 right now. There is a short manual >>>>>>>> section on unstructured grids as well. >>>>>>>> >>>>>>>> I think the key thing to understand is how to define a data layout >>>>>>>> over the mesh using a PetscSection. >>>>>>>> Once that is done, all the DM functions work as normal, and the >>>>>>>> last hard part is coding your residual >>>>>>>> loop. I have support for FEM schemes, but its undocumented and >>>>>>>> slightly complex in order to allow >>>>>>>> GPU assembly, so you may be more comfortable with your own element >>>>>>>> loop to start. >>>>>>>> >>>>>>>> Thanks, >>>>>>>> >>>>>>>> Matt >>>>>>>> >>>>>>>> >>>>>>>>> Thanks >>>>>>>>> Reddy >>>>>>>>> >>>>>>>>> >>>>>>>>> -- >>>>>>>>> ----------------------------------------------------- >>>>>>>>> Dharmendar Reddy Palle >>>>>>>>> Graduate Student >>>>>>>>> Microelectronics Research center, >>>>>>>>> University of Texas at Austin, >>>>>>>>> 10100 Burnet Road, Bldg. 160 >>>>>>>>> MER 2.608F, TX 78758-4445 >>>>>>>>> e-mail: dharmareddy84 at gmail.com >>>>>>>>> Phone: +1-512-350-9082 >>>>>>>>> United States of America. >>>>>>>>> Homepage: https://webspace.utexas.edu/~dpr342 >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> What most experimenters take for granted before they begin their >>>>>>>> experiments is infinitely more interesting than any results to which their >>>>>>>> experiments lead. >>>>>>>> -- Norbert Wiener >>>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> ----------------------------------------------------- >>>>>>> Dharmendar Reddy Palle >>>>>>> Graduate Student >>>>>>> Microelectronics Research center, >>>>>>> University of Texas at Austin, >>>>>>> 10100 Burnet Road, Bldg. 160 >>>>>>> MER 2.608F, TX 78758-4445 >>>>>>> e-mail: dharmareddy84 at gmail.com >>>>>>> Phone: +1-512-350-9082 >>>>>>> United States of America. >>>>>>> Homepage: https://webspace.utexas.edu/~dpr342 >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> What most experimenters take for granted before they begin their >>>>>> experiments is infinitely more interesting than any results to which their >>>>>> experiments lead. >>>>>> -- Norbert Wiener >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> ----------------------------------------------------- >>>>> Dharmendar Reddy Palle >>>>> Graduate Student >>>>> Microelectronics Research center, >>>>> University of Texas at Austin, >>>>> 10100 Burnet Road, Bldg. 160 >>>>> MER 2.608F, TX 78758-4445 >>>>> e-mail: dharmareddy84 at gmail.com >>>>> Phone: +1-512-350-9082 >>>>> United States of America. >>>>> Homepage: https://webspace.utexas.edu/~dpr342 >>>>> >>>> >>>> >>>> >>>> -- >>>> What most experimenters take for granted before they begin their >>>> experiments is infinitely more interesting than any results to which their >>>> experiments lead. >>>> -- Norbert Wiener >>>> >>> >>> >>> >>> -- >>> ----------------------------------------------------- >>> Dharmendar Reddy Palle >>> Graduate Student >>> Microelectronics Research center, >>> University of Texas at Austin, >>> 10100 Burnet Road, Bldg. 160 >>> MER 2.608F, TX 78758-4445 >>> e-mail: dharmareddy84 at gmail.com >>> Phone: +1-512-350-9082 >>> United States of America. >>> Homepage: https://webspace.utexas.edu/~dpr342 >>> >> >> >> >> -- >> ----------------------------------------------------- >> Dharmendar Reddy Palle >> Graduate Student >> Microelectronics Research center, >> University of Texas at Austin, >> 10100 Burnet Road, Bldg. 160 >> MER 2.608F, TX 78758-4445 >> e-mail: dharmareddy84 at gmail.com >> Phone: +1-512-350-9082 >> United States of America. >> Homepage: https://webspace.utexas.edu/~dpr342 >> > > > > -- > What most experimenters take for granted before they begin their > experiments is infinitely more interesting than any results to which their > experiments lead. > -- Norbert Wiener > -- ----------------------------------------------------- Dharmendar Reddy Palle Graduate Student Microelectronics Research center, University of Texas at Austin, 10100 Burnet Road, Bldg. 160 MER 2.608F, TX 78758-4445 e-mail: dharmareddy84 at gmail.com Phone: +1-512-350-9082 United States of America. Homepage: https://webspace.utexas.edu/~dpr342 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: testDMView.F90 Type: application/octet-stream Size: 8113 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Makefile Type: application/octet-stream Size: 1138 bytes Desc: not available URL: From mark.adams at columbia.edu Wed Mar 6 16:31:18 2013 From: mark.adams at columbia.edu (Mark F. Adams) Date: Wed, 6 Mar 2013 17:31:18 -0500 Subject: [petsc-users] odd SNES behavior In-Reply-To: References: <46F46D6E-0F42-4AE1-B794-AA9A97D40EF1@columbia.edu> <238DC882-A981-46F4-B3A7-12A2D6D0ABCA@mcs.anl.gov> <4F8532EE-09D7-411F-92AB-561634EA64A8@columbia.edu> Message-ID: > > It looks like SNES is not getting set it's "master" Jacobian. If you run the same code with hypre does it also hit this create? MatCreate_MFFD is called just once with gamg and hypre. It looks like Cheby is using the outside operator instead of the pre_op. This could be desirable but I don't want it here. I'll keep digging. From prbrune at gmail.com Wed Mar 6 17:04:29 2013 From: prbrune at gmail.com (Peter Brune) Date: Wed, 6 Mar 2013 17:04:29 -0600 Subject: [petsc-users] odd SNES behavior In-Reply-To: References: <46F46D6E-0F42-4AE1-B794-AA9A97D40EF1@columbia.edu> <238DC882-A981-46F4-B3A7-12A2D6D0ABCA@mcs.anl.gov> <4F8532EE-09D7-411F-92AB-561634EA64A8@columbia.edu> Message-ID: This is a likely culprit: (gdb) bt #0 KSPSetOperators (ksp=0xbf6410, Amat=0xa82e30, Pmat=0xaac190, flag=DIFFERENT_NONZERO_PATTERN) at /home/prbrune/packages/petsc-dev/src/ksp/ksp/interface/itcreate.c:540 #1 0x00007ffff6f554cf in PCSetUp_MG (pc=0xa22bf0) at /home/prbrune/packages/petsc-dev/src/ksp/pc/impls/mg/mg.c:572 #2 0x00007ffff6ef2f07 in PCSetUp_GAMG (pc=0xa22bf0) at /home/prbrune/packages/petsc-dev/src/ksp/pc/impls/gamg/gamg.c:974 #3 0x00007ffff6e3936e in PCSetUp (pc=0xa22bf0) at /home/prbrune/packages/petsc-dev/src/ksp/pc/interface/precon.c:838 #4 0x00007ffff6f7adb7 in KSPSetUp (ksp=0x9e60f0) at /home/prbrune/packages/petsc-dev/src/ksp/ksp/interface/itfunc.c:278 #5 0x00007ffff6f7bc7d in KSPSolve (ksp=0x9e60f0, b=0xa6e9a0, x=0xa79030) at /home/prbrune/packages/petsc-dev/src/ksp/ksp/interface/itfunc.c:388 #6 0x00007ffff714b1ea in SNES_KSPSolve (snes=0x870250, ksp=0x9e60f0, b=0xa6e9a0, x=0xa79030) at /home/prbrune/packages/petsc-dev/src/snes/interface/snes.c:4418 #7 0x00007ffff70d8ec5 in SNESSolve_NEWTONLS (snes=0x870250) at /home/prbrune/packages/petsc-dev/src/snes/impls/ls/ls.c:217 #8 0x00007ffff7142e9b in SNESSolve (snes=0x870250, b=0x0, x=0xa24840) at /home/prbrune/packages/petsc-dev/src/snes/interface/snes.c:3649 #9 0x0000000000402c83 in main (argc=9, argv=0x7fffffffde08) at ex5.c:157 (gdb) up #1 0x00007ffff6f554cf in PCSetUp_MG (pc=0xa22bf0) at /home/prbrune/packages/petsc-dev/src/ksp/pc/impls/mg/mg.c:572 572 ierr = KSPSetOperators(mglevels[n-1]->smoothd,pc->mat,pc->pmat,pc->flag);CHKERRQ(ierr); The matrix on the smoother gets RESET to the non-preconditioner matrix in the final call to PCSetUp_MG in PCSetUp_GAMG. You could just reset it after that, like you do with the PC type. - Peter On Wed, Mar 6, 2013 at 4:31 PM, Mark F. Adams wrote: > > > > It looks like SNES is not getting set it's "master" Jacobian. If you > run the same code with hypre does it also hit this create? > > > MatCreate_MFFD is called just once with gamg and hypre. It looks like > Cheby is using the outside operator instead of the pre_op. This could be > desirable but I don't want it here. I'll keep digging. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bsmith at mcs.anl.gov Wed Mar 6 17:32:39 2013 From: bsmith at mcs.anl.gov (Barry Smith) Date: Wed, 6 Mar 2013 17:32:39 -0600 Subject: [petsc-users] odd SNES behavior In-Reply-To: References: <46F46D6E-0F42-4AE1-B794-AA9A97D40EF1@columbia.edu> <238DC882-A981-46F4-B3A7-12A2D6D0ABCA@mcs.anl.gov> <4F8532EE-09D7-411F-92AB-561634EA64A8@columbia.edu> Message-ID: <38A5C64A-B600-4395-843A-6DC4CE7D8D31@mcs.anl.gov> On Mar 6, 2013, at 4:31 PM, "Mark F. Adams" wrote: >> >> It looks like SNES is not getting set it's "master" Jacobian. If you run the same code with hypre does it also hit this create? > > > MatCreate_MFFD is called just once with gamg and hypre. It looks like Cheby is using the outside operator instead of the pre_op. This could be desirable but I don't want it here. I'll keep digging. PCSetUp_MG() has the following chunk of code /* If user did not provide fine grid operators OR operator was not updated since last global KSPSetOperators() */ /* so use those from global PC */ /* Is this what we always want? What if user wants to keep old one? */ ierr = KSPGetOperatorsSet(mglevels[n-1]->smoothd,NULL,&opsset);CHKERRQ(ierr); if (opsset) { Mat mmat; ierr = KSPGetOperators(mglevels[n-1]->smoothd,NULL,&mmat,NULL);CHKERRQ(ierr); if (mmat == pc->pmat) opsset = PETSC_FALSE; } if (!opsset) { ierr = PetscInfo(pc,"Using outer operators to define finest grid operator \n because PCMGGetSmoother(pc,nlevels-1,&ksp);KSPSetOperators(ksp,...); was not called.\n");CHKERRQ(ierr); ierr = KSPSetOperators(mglevels[n-1]->smoothd,pc->mat,pc->pmat,pc->flag);CHKERRQ(ierr); } Presumbly when you call PCReset() it zeros out all the pointers. If you do not set the operators on the finest level again then it will use the "outer" operator on the smoothest level. Is this the problem? Barry From mark.adams at columbia.edu Wed Mar 6 21:36:43 2013 From: mark.adams at columbia.edu (Mark F. Adams) Date: Wed, 6 Mar 2013 22:36:43 -0500 Subject: [petsc-users] odd SNES behavior In-Reply-To: <38A5C64A-B600-4395-843A-6DC4CE7D8D31@mcs.anl.gov> References: <46F46D6E-0F42-4AE1-B794-AA9A97D40EF1@columbia.edu> <238DC882-A981-46F4-B3A7-12A2D6D0ABCA@mcs.anl.gov> <4F8532EE-09D7-411F-92AB-561634EA64A8@columbia.edu> <38A5C64A-B600-4395-843A-6DC4CE7D8D31@mcs.anl.gov> Message-ID: <99C18346-3C6E-4B2F-9443-1BBF671A7EAF@columbia.edu> > > Presumbly when you call PCReset() it zeros out all the pointers. If you do not set the operators on the finest level again then it will use the "outer" operator on the smoothest level. Is this the problem? This is not a problem but it should be a choice, right? This app has an expensive nonlinear 'formFunction' but many apps will have fast matrix free apply-operator methods, in which case the current behavior with gamg is desired. And having this choice being made by whether a PC is well integrated with PETSc (e.g., not hypre) is pretty awful semantics. Is there an option that will make this happen or should I add one? If so where should I add it? It should be in PC_MG I would think. -pc_mg_levels_fine_use_op -pc_mg_levels_fine_use_preop From bsmith at mcs.anl.gov Wed Mar 6 22:05:43 2013 From: bsmith at mcs.anl.gov (Barry Smith) Date: Wed, 6 Mar 2013 22:05:43 -0600 Subject: [petsc-users] odd SNES behavior In-Reply-To: <99C18346-3C6E-4B2F-9443-1BBF671A7EAF@columbia.edu> References: <46F46D6E-0F42-4AE1-B794-AA9A97D40EF1@columbia.edu> <238DC882-A981-46F4-B3A7-12A2D6D0ABCA@mcs.anl.gov> <4F8532EE-09D7-411F-92AB-561634EA64A8@columbia.edu> <38A5C64A-B600-4395-843A-6DC4CE7D8D31@mcs.anl.gov> <99C18346-3C6E-4B2F-9443-1BBF671A7EAF@columbia.edu> Message-ID: On Mar 6, 2013, at 9:36 PM, "Mark F. Adams" wrote: >> >> Presumbly when you call PCReset() it zeros out all the pointers. If you do not set the operators on the finest level again then it will use the "outer" operator on the smoothest level. Is this the problem? > > This is not a problem but it should be a choice, right? > This app has an expensive nonlinear 'formFunction' but many apps will have fast matrix free apply-operator methods, in which case the current behavior with gamg is desired. And having this choice being made by whether a PC is well integrated with PETSc (e.g., not hypre) is pretty awful semantics. > > Is there an option that will make this happen or should I add one? If so where should I add it? It should be in PC_MG I would think. > > -pc_mg_levels_fine_use_op > -pc_mg_levels_fine_use_preop Mark, This same issue comes up in several preconditioners. We use the term True to indicate this (yes maybe not the best term) Barrys-MacBook-Pro:petsc-dev barrysmith$ grep True include/petscpc.h PETSC_EXTERN PetscErrorCode PCBJacobiSetUseTrueLocal(PC); -pc_bjacobi_truelocal PETSC_EXTERN PetscErrorCode PCKSPSetUseTrue(PC); -pc_ksp_true PETSC_EXTERN PetscErrorCode PCCompositeSetUseTrue(PC); -pc_composite_true There are possibly other PCs that could have this functionality but do not because we haven't realized it. It makes sense in any PC that internally has to apply the "full" (or part of the full) operator somewhere inside the application of the PC. So you could add PCMGSetUseTrue(PC) and -pc_mg_true that would trigger setting the true (outer) operator inside the PCSetUp_MG() even if it was already set. You would still change/fix the current GAMG to always set the operators on the finest level using the pmat (which could be overwritten by the user with the PCMGSetUseTrue() or -pc_mg_true option. It may also make sense to move the use true flag and functionality up to the PC level (out of the subclasses) thus unifying its usage (or not)? PCSetUseTrue(), -pc_true.** Suggestions to alternatives to "True" (that are concise yet descriptive) are also solicited. Barry ** note that in some complicated PCs there may be several different applications of the full (or part of the full) operator inside the application of the PC. Conceivably one may want to use True on some and not on others but we've never dealt with that. From karpeev at mcs.anl.gov Wed Mar 6 22:09:53 2013 From: karpeev at mcs.anl.gov (Dmitry Karpeev) Date: Wed, 6 Mar 2013 22:09:53 -0600 Subject: [petsc-users] odd SNES behavior In-Reply-To: References: <46F46D6E-0F42-4AE1-B794-AA9A97D40EF1@columbia.edu> <238DC882-A981-46F4-B3A7-12A2D6D0ABCA@mcs.anl.gov> <4F8532EE-09D7-411F-92AB-561634EA64A8@columbia.edu> <38A5C64A-B600-4395-843A-6DC4CE7D8D31@mcs.anl.gov> <99C18346-3C6E-4B2F-9443-1BBF671A7EAF@columbia.edu> Message-ID: On Mar 6, 2013 10:05 PM, "Barry Smith" wrote: > > > On Mar 6, 2013, at 9:36 PM, "Mark F. Adams" wrote: > > >> > >> Presumbly when you call PCReset() it zeros out all the pointers. If you do not set the operators on the finest level again then it will use the "outer" operator on the smoothest level. Is this the problem? > > > > This is not a problem but it should be a choice, right? > > > This app has an expensive nonlinear 'formFunction' but many apps will have fast matrix free apply-operator methods, in which case the current behavior with gamg is desired. And having this choice being made by whether a PC is well integrated with PETSc (e.g., not hypre) is pretty awful semantics. > > > > Is there an option that will make this happen or should I add one? If so where should I add it? It should be in PC_MG I would think. > > > > -pc_mg_levels_fine_use_op > > -pc_mg_levels_fine_use_preop > > Mark, > > This same issue comes up in several preconditioners. We use the term True to indicate this (yes maybe not the best term) > > Barrys-MacBook-Pro:petsc-dev barrysmith$ grep True include/petscpc.h > PETSC_EXTERN PetscErrorCode PCBJacobiSetUseTrueLocal(PC); -pc_bjacobi_truelocal > PETSC_EXTERN PetscErrorCode PCKSPSetUseTrue(PC); -pc_ksp_true > PETSC_EXTERN PetscErrorCode PCCompositeSetUseTrue(PC); -pc_composite_true > > There are possibly other PCs that could have this functionality but do not because we haven't realized it. It makes sense in any PC that internally has to apply the "full" (or part of the full) operator somewhere inside the application of the PC. > > So you could add PCMGSetUseTrue(PC) and -pc_mg_true that would trigger setting the true (outer) operator inside the PCSetUp_MG() even if it was already set. You would still change/fix the current GAMG to always set the operators on the finest level using the pmat (which could be overwritten by the user with the PCMGSetUseTrue() or -pc_mg_true option. > > It may also make sense to move the use true flag and functionality up to the PC level (out of the subclasses) thus unifying its usage (or not)? PCSetUseTrue(), -pc_true.** > > Suggestions to alternatives to "True" (that are concise yet descriptive) are also solicited. 'exact'? > > > Barry > > ** note that in some complicated PCs there may be several different applications of the full (or part of the full) operator inside the application of the PC. Conceivably one may want to use True on some and not on others but we've never dealt with that. > > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jedbrown at mcs.anl.gov Wed Mar 6 22:19:35 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Wed, 6 Mar 2013 22:19:35 -0600 Subject: [petsc-users] odd SNES behavior In-Reply-To: References: <46F46D6E-0F42-4AE1-B794-AA9A97D40EF1@columbia.edu> <238DC882-A981-46F4-B3A7-12A2D6D0ABCA@mcs.anl.gov> <4F8532EE-09D7-411F-92AB-561634EA64A8@columbia.edu> <38A5C64A-B600-4395-843A-6DC4CE7D8D31@mcs.anl.gov> <99C18346-3C6E-4B2F-9443-1BBF671A7EAF@columbia.edu> Message-ID: On Wed, Mar 6, 2013 at 10:05 PM, Barry Smith wrote: > This same issue comes up in several preconditioners. We use the term True > to indicate this (yes maybe not the best term) > > Barrys-MacBook-Pro:petsc-dev barrysmith$ grep True include/petscpc.h > PETSC_EXTERN PetscErrorCode PCBJacobiSetUseTrueLocal(PC); > -pc_bjacobi_truelocal > PETSC_EXTERN PetscErrorCode PCKSPSetUseTrue(PC); > -pc_ksp_true > PETSC_EXTERN PetscErrorCode PCCompositeSetUseTrue(PC); > -pc_composite_true > > There are possibly other PCs that could have this functionality but do > not because we haven't realized it. It makes sense in any PC that > internally has to apply the "full" (or part of the full) operator somewhere > inside the application of the PC. > ierr = PetscOptionsBool("-pc_fieldsplit_real_diagonal","Use diagonal blocks of the operator","PCFieldSplitSetRealDiagonal",jac->realdiagonal,&jac->realdiagonal,NULL);CHKERRQ(ierr); Surely this should be renamed and the programmatic interface should be added. -------------- next part -------------- An HTML attachment was scrubbed... URL: From karpeev at mcs.anl.gov Wed Mar 6 22:40:55 2013 From: karpeev at mcs.anl.gov (Dmitry Karpeev) Date: Wed, 6 Mar 2013 22:40:55 -0600 Subject: [petsc-users] odd SNES behavior In-Reply-To: <674CFF0D-3679-42D5-966E-A8979E130B79@mcs.anl.gov> References: <46F46D6E-0F42-4AE1-B794-AA9A97D40EF1@columbia.edu> <238DC882-A981-46F4-B3A7-12A2D6D0ABCA@mcs.anl.gov> <4F8532EE-09D7-411F-92AB-561634EA64A8@columbia.edu> <38A5C64A-B600-4395-843A-6DC4CE7D8D31@mcs.anl.gov> <99C18346-3C6E-4B2F-9443-1BBF671A7EAF@columbia.edu> <86B10F5C-6660-4F60-862B-A14C3644FCAC@mcs.anl.gov> <674CFF0D-3679-42D5-966E-A8979E130B79@mcs.anl.gov> Message-ID: On Mar 6, 2013 10:29 PM, "Barry Smith" wrote: > > > On Mar 6, 2013, at 10:19 PM, Dmitry Karpeev wrote: > > > I suggested using 'exact' in place of 'true'. I guess it might have gotten folded into "quoted text" or otherwise squeezed out. > > Ok, thanks. > > It also is problematic since the mat is not necessarily "exact", it just might be "better" than the pmat. This is a small thing, but it would be good to come up with consistent terminology for naming mat and pmat in general. Saying 'preconditioner', when meaning 'pmat', is rather common, but incorrect. Using 'preconditioner matrix' or something similar to distinguish pmat from the PC is too verbose. That naming convention would also take care of the specific use being discussed here. I like Mark's 'op' and 'preop'. Dmitry. > > Barry > > > > > Dmitry. > > > > On Mar 6, 2013 10:16 PM, "Barry Smith" wrote: > > > > Dmitry > > > > Did you have something to say? Nothing appeared new appeared in the email you sent. > > > > Barry > > > > On Mar 6, 2013, at 10:09 PM, Dmitry Karpeev wrote: > > > > > > > > On Mar 6, 2013 10:05 PM, "Barry Smith" wrote: > > > > > > > > > > > > On Mar 6, 2013, at 9:36 PM, "Mark F. Adams" wrote: > > > > > > > > >> > > > > >> Presumbly when you call PCReset() it zeros out all the pointers. If you do not set the operators on the finest level again then it will use the "outer" operator on the smoothest level. Is this the problem? > > > > > > > > > > This is not a problem but it should be a choice, right? > > > > > > > > > This app has an expensive nonlinear 'formFunction' but many apps will have fast matrix free apply-operator methods, in which case the current behavior with gamg is desired. And having this choice being made by whether a PC is well integrated with PETSc (e.g., not hypre) is pretty awful semantics. > > > > > > > > > > Is there an option that will make this happen or should I add one? If so where should I add it? It should be in PC_MG I would think. > > > > > > > > > > -pc_mg_levels_fine_use_op > > > > > -pc_mg_levels_fine_use_preop > > > > > > > > Mark, > > > > > > > > This same issue comes up in several preconditioners. We use the term True to indicate this (yes maybe not the best term) > > > > > > > > Barrys-MacBook-Pro:petsc-dev barrysmith$ grep True include/petscpc.h > > > > PETSC_EXTERN PetscErrorCode PCBJacobiSetUseTrueLocal(PC); -pc_bjacobi_truelocal > > > > PETSC_EXTERN PetscErrorCode PCKSPSetUseTrue(PC); -pc_ksp_true > > > > PETSC_EXTERN PetscErrorCode PCCompositeSetUseTrue(PC); -pc_composite_true > > > > > > > > There are possibly other PCs that could have this functionality but do not because we haven't realized it. It makes sense in any PC that internally has to apply the "full" (or part of the full) operator somewhere inside the application of the PC. > > > > > > > > So you could add PCMGSetUseTrue(PC) and -pc_mg_true that would trigger setting the true (outer) operator inside the PCSetUp_MG() even if it was already set. You would still change/fix the current GAMG to always set the operators on the finest level using the pmat (which could be overwritten by the user with the PCMGSetUseTrue() or -pc_mg_true option. > > > > > > > > It may also make sense to move the use true flag and functionality up to the PC level (out of the subclasses) thus unifying its usage (or not)? PCSetUseTrue(), -pc_true.** > > > > > > > > Suggestions to alternatives to "True" (that are concise yet descriptive) are also solicited. > > > 'exact'? > > > > > > > > > > > > Barry > > > > > > > > ** note that in some complicated PCs there may be several different applications of the full (or part of the full) operator inside the application of the PC. Conceivably one may want to use True on some and not on others but we've never dealt with that. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bsmith at mcs.anl.gov Thu Mar 7 02:02:33 2013 From: bsmith at mcs.anl.gov (Barry Smith) Date: Thu, 7 Mar 2013 02:02:33 -0600 Subject: [petsc-users] odd SNES behavior In-Reply-To: References: <46F46D6E-0F42-4AE1-B794-AA9A97D40EF1@columbia.edu> <238DC882-A981-46F4-B3A7-12A2D6D0ABCA@mcs.anl.gov> <4F8532EE-09D7-411F-92AB-561634EA64A8@columbia.edu> <38A5C64A-B600-4395-843A-6DC4CE7D8D31@mcs.anl.gov> <99C18346-3C6E-4B2F-9443-1BBF671A7EAF@columbia.edu> <86B10F5C-6660-4F60-862B-A14C3644FCAC@mcs.anl.gov> <674CFF0D-3679-42D5-966E-A8979E130B79@mcs.anl.gov> Message-ID: <39FE3AC8-1425-47EF-845E-9A50015F712F@mcs.anl.gov> On Mar 6, 2013, at 10:40 PM, Dmitry Karpeev wrote: > > On Mar 6, 2013 10:29 PM, "Barry Smith" wrote: > > > > > > On Mar 6, 2013, at 10:19 PM, Dmitry Karpeev wrote: > > > > > I suggested using 'exact' in place of 'true'. I guess it might have gotten folded into "quoted text" or otherwise squeezed out. > > > > Ok, thanks. > > > > It also is problematic since the mat is not necessarily "exact", it just might be "better" than the pmat. > > This is a small thing, but it would be good to come up with consistent terminology for naming mat and pmat in general. Saying 'preconditioner', when meaning 'pmat', is rather common, but incorrect. Using 'preconditioner matrix' or something similar to distinguish pmat from the PC is too verbose. That naming convention would also take care of the specific use being discussed here. You are absolutely correct. This is the stumbling block. They are (Linear) Operator that defines the linear system and (Linear) Operator (usually an explicitly stored matrix) from which the preconditioner is constructed It also doesn't help that we use different variable names and wording of what they are (generally too imprecise) for PCSetOperators(), KSPSetOperators(), SNESSetJacobian(), SNESSetPicard(), TSSetRHSJacobian() and TSSetIJacobian() :-(. I have at least fixed the wording and variable names to be consistent (but not in the users manual :-(). Yikes, it is worse then that, there are all the XXXGetYYY() versions each again with its own unique names and wording. Damn I haven't fixed them except for PCGetOperators(). > I like Mark's 'op' and 'preop'. I don't particularly, but they are nice and short. The code I made common I named the variables Amat and Pmat (can be easily changed if better names appear). Barry > Dmitry. > > > > Barry > > > > > > > > Dmitry. > > > > > > On Mar 6, 2013 10:16 PM, "Barry Smith" wrote: > > > > > > Dmitry > > > > > > Did you have something to say? Nothing appeared new appeared in the email you sent. > > > > > > Barry > > > > > > On Mar 6, 2013, at 10:09 PM, Dmitry Karpeev wrote: > > > > > > > > > > > On Mar 6, 2013 10:05 PM, "Barry Smith" wrote: > > > > > > > > > > > > > > > On Mar 6, 2013, at 9:36 PM, "Mark F. Adams" wrote: > > > > > > > > > > >> > > > > > >> Presumbly when you call PCReset() it zeros out all the pointers. If you do not set the operators on the finest level again then it will use the "outer" operator on the smoothest level. Is this the problem? > > > > > > > > > > > > This is not a problem but it should be a choice, right? > > > > > > > > > > > This app has an expensive nonlinear 'formFunction' but many apps will have fast matrix free apply-operator methods, in which case the current behavior with gamg is desired. And having this choice being made by whether a PC is well integrated with PETSc (e.g., not hypre) is pretty awful semantics. > > > > > > > > > > > > Is there an option that will make this happen or should I add one? If so where should I add it? It should be in PC_MG I would think. > > > > > > > > > > > > -pc_mg_levels_fine_use_op > > > > > > -pc_mg_levels_fine_use_preop > > > > > > > > > > Mark, > > > > > > > > > > This same issue comes up in several preconditioners. We use the term True to indicate this (yes maybe not the best term) > > > > > > > > > > Barrys-MacBook-Pro:petsc-dev barrysmith$ grep True include/petscpc.h > > > > > PETSC_EXTERN PetscErrorCode PCBJacobiSetUseTrueLocal(PC); -pc_bjacobi_truelocal > > > > > PETSC_EXTERN PetscErrorCode PCKSPSetUseTrue(PC); -pc_ksp_true > > > > > PETSC_EXTERN PetscErrorCode PCCompositeSetUseTrue(PC); -pc_composite_true > > > > > > > > > > There are possibly other PCs that could have this functionality but do not because we haven't realized it. It makes sense in any PC that internally has to apply the "full" (or part of the full) operator somewhere inside the application of the PC. > > > > > > > > > > So you could add PCMGSetUseTrue(PC) and -pc_mg_true that would trigger setting the true (outer) operator inside the PCSetUp_MG() even if it was already set. You would still change/fix the current GAMG to always set the operators on the finest level using the pmat (which could be overwritten by the user with the PCMGSetUseTrue() or -pc_mg_true option. > > > > > > > > > > It may also make sense to move the use true flag and functionality up to the PC level (out of the subclasses) thus unifying its usage (or not)? PCSetUseTrue(), -pc_true.** > > > > > > > > > > Suggestions to alternatives to "True" (that are concise yet descriptive) are also solicited. > > > > 'exact'? > > > > > > > > > > > > > > > Barry > > > > > > > > > > ** note that in some complicated PCs there may be several different applications of the full (or part of the full) operator inside the application of the PC. Conceivably one may want to use True on some and not on others but we've never dealt with that. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > From mark.adams at columbia.edu Thu Mar 7 10:08:23 2013 From: mark.adams at columbia.edu (Mark F. Adams) Date: Thu, 7 Mar 2013 11:08:23 -0500 Subject: [petsc-users] odd SNES behavior In-Reply-To: References: <46F46D6E-0F42-4AE1-B794-AA9A97D40EF1@columbia.edu> <238DC882-A981-46F4-B3A7-12A2D6D0ABCA@mcs.anl.gov> <4F8532EE-09D7-411F-92AB-561634EA64A8@columbia.edu> <38A5C64A-B600-4395-843A-6DC4CE7D8D31@mcs.anl.gov> <99C18346-3C6E-4B2F-9443-1BBF671A7EAF@columbia.edu> Message-ID: > > > So you could add PCMGSetUseTrue(PC) and -pc_mg_true that would trigger setting the true (outer) operator inside the PCSetUp_MG() even if it was already set. You would still change/fix the current GAMG to always set the operators on the finest level using the pmat (which could be overwritten by the user with the PCMGSetUseTrue() or -pc_mg_true option. > > It may also make sense to move the use true flag and functionality up to the PC level (out of the subclasses) thus unifying its usage (or not)? PCSetUseTrue(), -pc_true.** > This seems like it should be in PC to me. Some PCs will want to give finer grain control but this will work for many (e.g., me, for now). I prefer the default to be !true so that the semantics match hypre, etc. I can set it manually before GetOptions if we do not want this to be the default for everyone ? although that would make -help not correct. -pc_true is pretty ambiguous. how about -pc_true_op ? or if you prefer. > Suggestions to alternatives to "True" (that are concise yet descriptive) are also solicited. > > > Barry > > ** note that in some complicated PCs there may be several different applications of the full (or part of the full) operator inside the application of the PC. Conceivably one may want to use True on some and not on others but we've never dealt with that. > > > > > > > > > From karpeev at mcs.anl.gov Thu Mar 7 10:53:05 2013 From: karpeev at mcs.anl.gov (Dmitry Karpeev) Date: Thu, 7 Mar 2013 10:53:05 -0600 Subject: [petsc-users] odd SNES behavior In-Reply-To: References: <46F46D6E-0F42-4AE1-B794-AA9A97D40EF1@columbia.edu> <238DC882-A981-46F4-B3A7-12A2D6D0ABCA@mcs.anl.gov> <4F8532EE-09D7-411F-92AB-561634EA64A8@columbia.edu> <38A5C64A-B600-4395-843A-6DC4CE7D8D31@mcs.anl.gov> <99C18346-3C6E-4B2F-9443-1BBF671A7EAF@columbia.edu> Message-ID: On Thu, Mar 7, 2013 at 10:08 AM, Mark F. Adams wrote: > > > > > > So you could add PCMGSetUseTrue(PC) and -pc_mg_true that would trigger > setting the true (outer) operator inside the PCSetUp_MG() even if it was > already set. You would still change/fix the current GAMG to always set the > operators on the finest level using the pmat (which could be overwritten by > the user with the PCMGSetUseTrue() or -pc_mg_true option. > > > > It may also make sense to move the use true flag and functionality up > to the PC level (out of the subclasses) thus unifying its usage (or not)? > PCSetUseTrue(), -pc_true.** > > > > This seems like it should be in PC to me. Some PCs will want to give > finer grain control but this will work for many (e.g., me, for now). > > I prefer the default to be !true so that the semantics match hypre, etc. > I can set it manually before GetOptions if we do not want this to be the > default for everyone ? although that would make -help not correct. > > -pc_true is pretty ambiguous. how about > > -pc_true_op > > ? or if you prefer. > Name the two matrices kspop and pcop and then -pc_use_kspop? > > > > > Suggestions to alternatives to "True" (that are concise yet > descriptive) are also solicited. > > > > > > Barry > > > > ** note that in some complicated PCs there may be several different > applications of the full (or part of the full) operator inside the > application of the PC. Conceivably one may want to use True on some and not > on others but we've never dealt with that. > > > > > > > > > > > > > > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jedbrown at mcs.anl.gov Thu Mar 7 11:00:46 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Thu, 7 Mar 2013 11:00:46 -0600 Subject: [petsc-users] odd SNES behavior In-Reply-To: References: <46F46D6E-0F42-4AE1-B794-AA9A97D40EF1@columbia.edu> <238DC882-A981-46F4-B3A7-12A2D6D0ABCA@mcs.anl.gov> <4F8532EE-09D7-411F-92AB-561634EA64A8@columbia.edu> <38A5C64A-B600-4395-843A-6DC4CE7D8D31@mcs.anl.gov> <99C18346-3C6E-4B2F-9443-1BBF671A7EAF@columbia.edu> Message-ID: On Thu, Mar 7, 2013 at 10:53 AM, Dmitry Karpeev wrote: > -pc_true is pretty ambiguous. how about >> >> -pc_true_op >> >> ? or if you prefer. >> > Name the two matrices kspop and pcop and then -pc_use_kspop? > "op" historically means "operation", as in MATOP_*. -------------- next part -------------- An HTML attachment was scrubbed... URL: From karpeev at mcs.anl.gov Thu Mar 7 11:20:58 2013 From: karpeev at mcs.anl.gov (Dmitry Karpeev) Date: Thu, 7 Mar 2013 11:20:58 -0600 Subject: [petsc-users] odd SNES behavior In-Reply-To: References: <46F46D6E-0F42-4AE1-B794-AA9A97D40EF1@columbia.edu> <238DC882-A981-46F4-B3A7-12A2D6D0ABCA@mcs.anl.gov> <4F8532EE-09D7-411F-92AB-561634EA64A8@columbia.edu> <38A5C64A-B600-4395-843A-6DC4CE7D8D31@mcs.anl.gov> <99C18346-3C6E-4B2F-9443-1BBF671A7EAF@columbia.edu> Message-ID: On Thu, Mar 7, 2013 at 11:00 AM, Jed Brown wrote: > > On Thu, Mar 7, 2013 at 10:53 AM, Dmitry Karpeev wrote: > >> -pc_true is pretty ambiguous. how about >>> >>> -pc_true_op >>> >>> ? or if you prefer. >>> >> Name the two matrices kspop and pcop and then -pc_use_kspop? >> > > "op" historically means "operation", as in MATOP_*. > Then, perhaps, it should be the somewhat verbose but virtually unambiguous kspoperator and pcoperator. -------------- next part -------------- An HTML attachment was scrubbed... URL: From garnet.vaz at gmail.com Thu Mar 7 14:56:47 2013 From: garnet.vaz at gmail.com (Garnet Vaz) Date: Thu, 7 Mar 2013 12:56:47 -0800 Subject: [petsc-users] Numbering of DMPlexGetCellNumbering Message-ID: Hi, For an small distributed unstructured mesh with overlap 1 which is *not* interpolated yet, if I do a DMPlexGetCellNumbering() I obtain an IS as follows: [0] Number of indices in set 6 [0] 0 -6 [0] 1 0 [0] 2 -8 [0] 3 1 [0] 4 2 [0] 5 3 [1] Number of indices in set 6 [1] 0 4 [1] 1 5 [1] 2 6 [1] 3 -1 [1] 4 7 [1] 5 -4. Running the same example but by DMPlexInterpolate() and then DMPlexGetCellNumbering() provides instead the output: [0] Number of indices in set 6 [0] 0 0 [0] 1 1 [0] 2 2 [0] 3 3 [0] 4 4 [0] 5 5 [1] Number of indices in set 6 [1] 0 6 [1] 1 7 [1] 2 8 [1] 3 9 [1] 4 10 [1] 5 11 The former result I find very useful since it provides the number of ghost cells on each processor (the negative IS values) and moreover the negative IS values also indicate the global numbering of the ghost cells. Eg: On the first processor the cell 0 is a ghost cell with its global numbering 5. The behavior of DMPlexGetCellNumbering() after the interpolation does not bother me but I would like to know in the former case if the output is the right output i.e, it is not merely a side effect which might get changed later on. Thank You. -- Regards, Garnet From bsmith at mcs.anl.gov Thu Mar 7 18:08:29 2013 From: bsmith at mcs.anl.gov (Barry Smith) Date: Thu, 7 Mar 2013 18:08:29 -0600 Subject: [petsc-users] odd SNES behavior In-Reply-To: References: <46F46D6E-0F42-4AE1-B794-AA9A97D40EF1@columbia.edu> <238DC882-A981-46F4-B3A7-12A2D6D0ABCA@mcs.anl.gov> <4F8532EE-09D7-411F-92AB-561634EA64A8@columbia.edu> <38A5C64A-B600-4395-843A-6DC4CE7D8D31@mcs.anl.gov> <99C18346-3C6E-4B2F-9443-1BBF671A7EAF@columbia.edu> <86B10F5C-6660-4F60-862B-A14C3644FCAC@mcs.anl.gov> <674CFF0D-3679-42D5-966E-A8979E130B79@mcs.anl.gov> Message-ID: On Mar 6, 2013, at 10:40 PM, Dmitry Karpeev wrote: > > On Mar 6, 2013 10:29 PM, "Barry Smith" wrote: > > > > > > On Mar 6, 2013, at 10:19 PM, Dmitry Karpeev wrote: > > > > > I suggested using 'exact' in place of 'true'. I guess it might have gotten folded into "quoted text" or otherwise squeezed out. > > > > Ok, thanks. > > > > It also is problematic since the mat is not necessarily "exact", it just might be "better" than the pmat. > > This is a small thing, but it would be good to come up with consistent terminology for naming mat and pmat in general. Saying 'preconditioner', when meaning 'pmat', is rather common, but incorrect. Using 'preconditioner matrix' or something similar to distinguish pmat from the PC is too verbose. That naming convention would also take care of the specific use being discussed here. I like Mark's 'op' and 'preop'. > Dmitry. I have merged PCBJacobiSetUseTrueLocal(), -pc_bjacobi_true_local, PCKSPSetUseTrue(), -pc_ksp_true, PCCompositeSetUseTrue() -pc_composite_true to PCSetUserAmat(), -pc_use_amat in petsc-dev. Note that other preconditioners, PCMG, PCFieldSplit, PCASM, PCGASM should adopt the same flag but I will leave that to Mark and Jed. Yes, Amat is not great, but I don't like op and preop since we never use that terminology anywhere else in PETSc. Barry > > > > Barry > > > > > > > > Dmitry. > > > > > > On Mar 6, 2013 10:16 PM, "Barry Smith" wrote: > > > > > > Dmitry > > > > > > Did you have something to say? Nothing appeared new appeared in the email you sent. > > > > > > Barry > > > > > > On Mar 6, 2013, at 10:09 PM, Dmitry Karpeev wrote: > > > > > > > > > > > On Mar 6, 2013 10:05 PM, "Barry Smith" wrote: > > > > > > > > > > > > > > > On Mar 6, 2013, at 9:36 PM, "Mark F. Adams" wrote: > > > > > > > > > > >> > > > > > >> Presumbly when you call PCReset() it zeros out all the pointers. If you do not set the operators on the finest level again then it will use the "outer" operator on the smoothest level. Is this the problem? > > > > > > > > > > > > This is not a problem but it should be a choice, right? > > > > > > > > > > > This app has an expensive nonlinear 'formFunction' but many apps will have fast matrix free apply-operator methods, in which case the current behavior with gamg is desired. And having this choice being made by whether a PC is well integrated with PETSc (e.g., not hypre) is pretty awful semantics. > > > > > > > > > > > > Is there an option that will make this happen or should I add one? If so where should I add it? It should be in PC_MG I would think. > > > > > > > > > > > > -pc_mg_levels_fine_use_op > > > > > > -pc_mg_levels_fine_use_preop > > > > > > > > > > Mark, > > > > > > > > > > This same issue comes up in several preconditioners. We use the term True to indicate this (yes maybe not the best term) > > > > > > > > > > Barrys-MacBook-Pro:petsc-dev barrysmith$ grep True include/petscpc.h > > > > > PETSC_EXTERN PetscErrorCode PCBJacobiSetUseTrueLocal(PC); -pc_bjacobi_truelocal > > > > > PETSC_EXTERN PetscErrorCode PCKSPSetUseTrue(PC); -pc_ksp_true > > > > > PETSC_EXTERN PetscErrorCode PCCompositeSetUseTrue(PC); -pc_composite_true > > > > > > > > > > There are possibly other PCs that could have this functionality but do not because we haven't realized it. It makes sense in any PC that internally has to apply the "full" (or part of the full) operator somewhere inside the application of the PC. > > > > > > > > > > So you could add PCMGSetUseTrue(PC) and -pc_mg_true that would trigger setting the true (outer) operator inside the PCSetUp_MG() even if it was already set. You would still change/fix the current GAMG to always set the operators on the finest level using the pmat (which could be overwritten by the user with the PCMGSetUseTrue() or -pc_mg_true option. > > > > > > > > > > It may also make sense to move the use true flag and functionality up to the PC level (out of the subclasses) thus unifying its usage (or not)? PCSetUseTrue(), -pc_true.** > > > > > > > > > > Suggestions to alternatives to "True" (that are concise yet descriptive) are also solicited. > > > > 'exact'? > > > > > > > > > > > > > > > Barry > > > > > > > > > > ** note that in some complicated PCs there may be several different applications of the full (or part of the full) operator inside the application of the PC. Conceivably one may want to use True on some and not on others but we've never dealt with that. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > From mark.adams at columbia.edu Fri Mar 8 09:23:34 2013 From: mark.adams at columbia.edu (Mark F. Adams) Date: Fri, 8 Mar 2013 09:23:34 -0600 Subject: [petsc-users] odd SNES behavior In-Reply-To: References: <46F46D6E-0F42-4AE1-B794-AA9A97D40EF1@columbia.edu> <238DC882-A981-46F4-B3A7-12A2D6D0ABCA@mcs.anl.gov> <4F8532EE-09D7-411F-92AB-561634EA64A8@columbia.edu> <38A5C64A-B600-4395-843A-6DC4CE7D8D31@mcs.anl.gov> <99C18346-3C6E-4B2F-9443-1BBF671A7EAF@columbia.edu> <86B10F5C-6660-4F60-862B-A14C3644FCAC@mcs.anl.gov> <674CFF0D-3679-42D5-966E-A8979E130B79@mcs.anl.gov> Message-ID: <51EA347E-5969-4101-B903-CB21DEBAB1D9@columbia.edu> > > I have merged PCBJacobiSetUseTrueLocal(), -pc_bjacobi_true_local, PCKSPSetUseTrue(), -pc_ksp_true, PCCompositeSetUseTrue() -pc_composite_true to PCSetUserAmat(), -pc_use_amat in petsc-dev. > > Note that other preconditioners, PCMG, PCFieldSplit, PCASM, PCGASM should adopt the same flag but I will leave that to Mark and Jed. GAMG's problem comes from PCMG, do I need to do anything? other than make '-pc_use_amat false' because I would like to match hypre semantics by default. From bsmith at mcs.anl.gov Fri Mar 8 09:27:27 2013 From: bsmith at mcs.anl.gov (Barry Smith) Date: Fri, 8 Mar 2013 09:27:27 -0600 Subject: [petsc-users] odd SNES behavior In-Reply-To: <51EA347E-5969-4101-B903-CB21DEBAB1D9@columbia.edu> References: <46F46D6E-0F42-4AE1-B794-AA9A97D40EF1@columbia.edu> <238DC882-A981-46F4-B3A7-12A2D6D0ABCA@mcs.anl.gov> <4F8532EE-09D7-411F-92AB-561634EA64A8@columbia.edu> <38A5C64A-B600-4395-843A-6DC4CE7D8D31@mcs.anl.gov> <99C18346-3C6E-4B2F-9443-1BBF671A7EAF@columbia.edu> <86B10F5C-6660-4F60-862B-A14C3644FCAC@mcs.anl.gov> <674CFF0D-3679-42D5-966E-A8979E130B79@mcs.anl.gov> <51EA347E-5969-4101-B903-CB21DEBAB1D9@columbia.edu> Message-ID: On Mar 8, 2013, at 9:23 AM, "Mark F. Adams" wrote: >> >> I have merged PCBJacobiSetUseTrueLocal(), -pc_bjacobi_true_local, PCKSPSetUseTrue(), -pc_ksp_true, PCCompositeSetUseTrue() -pc_composite_true to PCSetUserAmat(), -pc_use_amat in petsc-dev. >> >> Note that other preconditioners, PCMG, PCFieldSplit, PCASM, PCGASM should adopt the same flag but I will leave that to Mark and Jed. > > GAMG's problem comes from PCMG, do I need to do anything? Yes, modify the PCMG :-). > > other than make '-pc_use_amat false' because I would like to match hypre semantics by default. It will be false by default. Barry From john.fettig at gmail.com Fri Mar 8 14:54:49 2013 From: john.fettig at gmail.com (John Fettig) Date: Fri, 8 Mar 2013 15:54:49 -0500 Subject: [petsc-users] Using PETSc with CMake on Windows Message-ID: Looking through the mailing list archives, I found a pointer to Jed's CMake module FindPETSc.cmake. Has this been tested on windows? Should this work when PETSc has been installed via make install? The directions given at the end of that say ==================================== Install complete. It is useable with PETSC_DIR=/path/to/my/petsc/install [and no more PETSC_ARCH]. Now to check if the libraries are working do (in current directory): make PETSC_DIR=/path/to/my/petsc/install test ==================================== However, when I only set PETSC_DIR, CMake bails with CMake Error at FindPETSc.cmake:118 (message): The pair PETSC_DIR=/path/to/my/petsc/install PETSC_ARCH= do not specify a valid PETSc installation Call Stack (most recent call first): CMakeLists.txt:9 (include) -- PETSc could not be found. Be sure to set PETSC_DIR and PETSC_ARCH. (missing: PETSC_INCLUDES PETSC_LIBRARIES PETSC_EXECUTABLE_RUNS) Thanks for any help, John From jedbrown at mcs.anl.gov Fri Mar 8 15:40:33 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Fri, 8 Mar 2013 15:40:33 -0600 Subject: [petsc-users] Using PETSc with CMake on Windows In-Reply-To: References: Message-ID: I have not tested it on Windows so I would not be surprised if it does not work. It should not be difficult to make work and I would happily accept patches. On Mar 8, 2013 2:55 PM, "John Fettig" wrote: > Looking through the mailing list archives, I found a pointer to Jed's > CMake module FindPETSc.cmake. Has this been tested on windows? > Should this work when PETSc has been installed via make install? The > directions given at the end of that say > > ==================================== > Install complete. It is useable with > PETSC_DIR=/path/to/my/petsc/install [and no more PETSC_ARCH]. > Now to check if the libraries are working do (in current directory): > make PETSC_DIR=/path/to/my/petsc/install test > ==================================== > > However, when I only set PETSC_DIR, CMake bails with > > CMake Error at FindPETSc.cmake:118 (message): > The pair > PETSC_DIR=/path/to/my/petsc/install > PETSC_ARCH= do not specify a valid PETSc installation > Call Stack (most recent call first): > CMakeLists.txt:9 (include) > > > -- PETSc could not be found. Be sure to set PETSC_DIR and PETSC_ARCH. > (missing: PETSC_INCLUDES PETSC_LIBRARIES PETSC_EXECUTABLE_RUNS) > > > Thanks for any help, > John > -------------- next part -------------- An HTML attachment was scrubbed... URL: From john.fettig at gmail.com Fri Mar 8 15:53:21 2013 From: john.fettig at gmail.com (John Fettig) Date: Fri, 8 Mar 2013 16:53:21 -0500 Subject: [petsc-users] Using PETSc with CMake on Windows In-Reply-To: References: Message-ID: Ah, ok. I'll have a crack at it. Thanks, John On Fri, Mar 8, 2013 at 4:40 PM, Jed Brown wrote: > I have not tested it on Windows so I would not be surprised if it does not > work. It should not be difficult to make work and I would happily accept > patches. > > On Mar 8, 2013 2:55 PM, "John Fettig" wrote: >> >> Looking through the mailing list archives, I found a pointer to Jed's >> CMake module FindPETSc.cmake. Has this been tested on windows? >> Should this work when PETSc has been installed via make install? The >> directions given at the end of that say >> >> ==================================== >> Install complete. It is useable with >> PETSC_DIR=/path/to/my/petsc/install [and no more PETSC_ARCH]. >> Now to check if the libraries are working do (in current directory): >> make PETSC_DIR=/path/to/my/petsc/install test >> ==================================== >> >> However, when I only set PETSC_DIR, CMake bails with >> >> CMake Error at FindPETSc.cmake:118 (message): >> The pair >> PETSC_DIR=/path/to/my/petsc/install >> PETSC_ARCH= do not specify a valid PETSc installation >> Call Stack (most recent call first): >> CMakeLists.txt:9 (include) >> >> >> -- PETSc could not be found. Be sure to set PETSC_DIR and PETSC_ARCH. >> (missing: PETSC_INCLUDES PETSC_LIBRARIES PETSC_EXECUTABLE_RUNS) >> >> >> Thanks for any help, >> John From NPrewitt at drc.com Fri Mar 8 17:06:32 2013 From: NPrewitt at drc.com (Prewitt . Nathan) Date: Fri, 8 Mar 2013 23:06:32 +0000 Subject: [petsc-users] Error from ex42 Message-ID: <39441D859473614183E4A4AAC377552E630C89B3@EXMB01.drc.com> I have run PETSc example ex42.c using the ex42-fsschur.opts options without error. However, if I try to use ex42-mgfs.opts, ex42-mgfs2.opts, or ex42-mgschur.opts, I get the error PETSC ERROR: Arguments are incompatible PETSC ERROR: MatPtAP requires A, mpiaij, to be compatible with P, mpimaij Do you have any suggestions what might cause this error? Thanks, Nathan ________________________________ This electronic message transmission and any attachments that accompany it contain information from DRC? (Dynamics Research Corporation) or its subsidiaries, or the intended recipient, which is privileged, proprietary, business confidential, or otherwise protected from disclosure and is the exclusive property of DRC and/or the intended recipient. The information in this email is solely intended for the use of the individual or entity that is the intended recipient. If you are not the intended recipient, any use, dissemination, distribution, retention, or copying of this communication, attachments, or substance is prohibited. If you have received this electronic transmission in error, please immediately reply to the author via email that you received the message by mistake and also promptly and permanently delete this message and all copies of this email and any attachments. We thank you for your assistance and apologize for any inconvenience. From wumengda at gmail.com Fri Mar 8 18:01:21 2013 From: wumengda at gmail.com (Mengda Wu) Date: Fri, 8 Mar 2013 19:01:21 -0500 Subject: [petsc-users] Nonconforming object sizes with KSPSolve Message-ID: Hi all, I am trying to use KSPLSQR to solve an overdetermined system. I am NOT using MPI. I got an error "Nonconforming object sizes!" in KSPSolve. It is very weird because this happens after the iterations are converged. Please see the following messages. ================================================================== 159 KSP Residual norm 1.808481783605e-004 Linear solve converged due to CONVERGED_RTOL_NORMAL iterations 159 [0]PETSC ERROR: --------------------- Error Message ---------------------------- -------- [0]PETSC ERROR: Nonconforming object sizes! [0]PETSC ERROR: Mat mat,Vec y: global dim 4012 1452! [0]PETSC ERROR: ---------------------------------------------------------------- -------- [0]PETSC ERROR: Petsc Release Version 3.3.0, Patch 6, Mon Feb 11 12:26:34 CST 20 13 [0]PETSC ERROR: See docs/changes/index.html for recent updates. [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. [0]PETSC ERROR: See docs/index.html for manual pages. [0]PETSC ERROR: ---------------------------------------------------------------- -------- [0]PETSC ERROR: MCMeshSeg on a arch-mswi named pcs by wmd00 Fri Mar 08 18:50:53 2013 [0]PETSC ERROR: Libraries linked from /cygdrive/d/Library/PETSc/petsc-3.3-p6/arc h-mswin-c-opt/lib [0]PETSC ERROR: Configure run at Thu Feb 14 19:42:41 2013 [0]PETSC ERROR: Configure options --with-cc=cl --with-fc=0 --with-cxx=cl --with- mpi=0 --with-debugging=0 --download-f2cblaslapack=/cygdrive/d/Library/PETSc/down load/f2cblaslapack-3.4.1.q.tar.gz --with-sowing=0 --with-c2html=0 -CFLAGS="-MD - wd4996" -CXXFLAGS="-MD -wd4996" --useThreads=0 [0]PETSC ERROR: ---------------------------------------------------------------- -------- [0]PETSC ERROR: MatMult() line 2082 in src/mat/interface/D:\Library\PETSc\PETSC- ~2.3-P\src\mat\INTERF~1\matrix.c [0]PETSC ERROR: KSPSolve() line 632 in src/ksp/ksp/interface/D:\Library\PETSc\PE TSC-~2.3-P\src\ksp\ksp\INTERF~1\itfunc.c [0]PETSC ERROR: User provided function() line 1200 in "unknowndirectory/"..\..\g uiMeshSeg\MCMeshSeg.cpp ================================================================== I created the matrix and vector with the following code: int MatrixCreate(size_t row, size_t col, Vec& vecsol, Vec& vecrhs, Mat& matA, KSP& ksp) { if( !isMeshLoaded ) return 1; if( !isSolverInitialized ) SolverInitialize(); PetscErrorCode ierr; ierr = VecCreateSeq(PETSC_COMM_SELF,col,&vecsol);CHKERRQ(ierr); ierr = VecCreateSeq(PETSC_COMM_SELF,row,&vecrhs);CHKERRQ(ierr); ierr = MatCreateSeqAIJ(PETSC_COMM_SELF,row,col,10,PETSC_NULL,&matA);CHKERRQ(ierr); ierr = KSPCreate(PETSC_COMM_SELF,&ksp);CHKERRQ(ierr); ierr = KSPSetType(ksp,KSPLSQR);CHKERRQ(ierr); PC pc; ierr = KSPGetPC(ksp,&pc);CHKERRQ(ierr); ierr = PCSetType(pc,PCNONE);CHKERRQ(ierr); ierr = KSPSetTolerances(ksp,1.0e-6,PETSC_DEFAULT,PETSC_DEFAULT,5000);CHKERRQ(ierr); ierr = KSPSetFromOptions(ksp);CHKERRQ(ierr); return 0; } And I solved the system using: ierr = KSPSetInitialGuessNonzero(ksp, PETSC_FALSE);CHKERRQ(ierr); ierr = KSPSetOperators(ksp,matA,matA,DIFFERENT_NONZERO_PATTERN);CHKERRQ(ierr); ierr = KSPSolve(ksp,vecrhs,vecsol);CHKERRQ(ierr); ierr = VecGetArray(vecsol,&avecsol);CHKERRQ(ierr); Where is the problem? Thanks, Mengda -------------- next part -------------- An HTML attachment was scrubbed... URL: From bsmith at mcs.anl.gov Fri Mar 8 19:17:09 2013 From: bsmith at mcs.anl.gov (Barry Smith) Date: Fri, 8 Mar 2013 19:17:09 -0600 Subject: [petsc-users] Nonconforming object sizes with KSPSolve In-Reply-To: References: Message-ID: <23657FA0-177B-4DF1-8FF4-A1C99E44CB71@mcs.anl.gov> Mengda, Thanks for reporting this. You have found a bug triggered by the -ksp_final_residual option, sorry about that. We are sloppy in the code and duplicate the solution vector to get a work vector for the computation but should have duplicated the right hand side vector. I have fixed the master copy of 3.3 and it will be in the next patch. For now just don't use the -ksp_final_residual you get that information from -ksp_monitor anyways. Barry On Mar 8, 2013, at 6:01 PM, Mengda Wu wrote: > Hi all, > > I am trying to use KSPLSQR to solve an overdetermined system. I am NOT using MPI. I got an error "Nonconforming object sizes!" in KSPSolve. It is very weird because this happens after the iterations are converged. Please see the following messages. > > ================================================================== > 159 KSP Residual norm 1.808481783605e-004 > Linear solve converged due to CONVERGED_RTOL_NORMAL iterations 159 > [0]PETSC ERROR: --------------------- Error Message ---------------------------- > -------- > [0]PETSC ERROR: Nonconforming object sizes! > [0]PETSC ERROR: Mat mat,Vec y: global dim 4012 1452! > [0]PETSC ERROR: ---------------------------------------------------------------- > -------- > [0]PETSC ERROR: Petsc Release Version 3.3.0, Patch 6, Mon Feb 11 12:26:34 CST 20 > 13 > [0]PETSC ERROR: See docs/changes/index.html for recent updates. > [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. > [0]PETSC ERROR: See docs/index.html for manual pages. > [0]PETSC ERROR: ---------------------------------------------------------------- > -------- > [0]PETSC ERROR: MCMeshSeg on a arch-mswi named pcs by wmd00 Fri Mar > 08 18:50:53 2013 > [0]PETSC ERROR: Libraries linked from /cygdrive/d/Library/PETSc/petsc-3.3-p6/arc > h-mswin-c-opt/lib > [0]PETSC ERROR: Configure run at Thu Feb 14 19:42:41 2013 > [0]PETSC ERROR: Configure options --with-cc=cl --with-fc=0 --with-cxx=cl --with- > mpi=0 --with-debugging=0 --download-f2cblaslapack=/cygdrive/d/Library/PETSc/down > load/f2cblaslapack-3.4.1.q.tar.gz --with-sowing=0 --with-c2html=0 -CFLAGS="-MD - > wd4996" -CXXFLAGS="-MD -wd4996" --useThreads=0 > [0]PETSC ERROR: ---------------------------------------------------------------- > -------- > [0]PETSC ERROR: MatMult() line 2082 in src/mat/interface/D:\Library\PETSc\PETSC- > ~2.3-P\src\mat\INTERF~1\matrix.c > [0]PETSC ERROR: KSPSolve() line 632 in src/ksp/ksp/interface/D:\Library\PETSc\PE > TSC-~2.3-P\src\ksp\ksp\INTERF~1\itfunc.c > [0]PETSC ERROR: User provided function() line 1200 in "unknowndirectory/"..\..\g > uiMeshSeg\MCMeshSeg.cpp > > ================================================================== > > I created the matrix and vector with the following code: > int MatrixCreate(size_t row, size_t col, Vec& vecsol, Vec& vecrhs, Mat& matA, KSP& ksp) > { > if( !isMeshLoaded ) return 1; > > if( !isSolverInitialized ) SolverInitialize(); > > PetscErrorCode ierr; > > ierr = VecCreateSeq(PETSC_COMM_SELF,col,&vecsol);CHKERRQ(ierr); > ierr = VecCreateSeq(PETSC_COMM_SELF,row,&vecrhs);CHKERRQ(ierr); > ierr = MatCreateSeqAIJ(PETSC_COMM_SELF,row,col,10,PETSC_NULL,&matA);CHKERRQ(ierr); > > ierr = KSPCreate(PETSC_COMM_SELF,&ksp);CHKERRQ(ierr); > > ierr = KSPSetType(ksp,KSPLSQR);CHKERRQ(ierr); > PC pc; > ierr = KSPGetPC(ksp,&pc);CHKERRQ(ierr); > ierr = PCSetType(pc,PCNONE);CHKERRQ(ierr); > ierr = KSPSetTolerances(ksp,1.0e-6,PETSC_DEFAULT,PETSC_DEFAULT,5000);CHKERRQ(ierr); > > ierr = KSPSetFromOptions(ksp);CHKERRQ(ierr); > > return 0; > } > > And I solved the system using: > ierr = KSPSetInitialGuessNonzero(ksp, PETSC_FALSE);CHKERRQ(ierr); > ierr = KSPSetOperators(ksp,matA,matA,DIFFERENT_NONZERO_PATTERN);CHKERRQ(ierr); > ierr = KSPSolve(ksp,vecrhs,vecsol);CHKERRQ(ierr); > ierr = VecGetArray(vecsol,&avecsol);CHKERRQ(ierr); > > Where is the problem? > > Thanks, > Mengda > From knepley at gmail.com Sat Mar 9 15:57:24 2013 From: knepley at gmail.com (Matthew Knepley) Date: Sat, 9 Mar 2013 16:57:24 -0500 Subject: [petsc-users] Numbering of DMPlexGetCellNumbering In-Reply-To: References: Message-ID: On Thu, Mar 7, 2013 at 3:56 PM, Garnet Vaz wrote: > Hi, > > For an small distributed unstructured mesh with overlap 1 > which is *not* interpolated yet, if I do a DMPlexGetCellNumbering() > I obtain an IS as follows: > > [0] Number of indices in set 6 > [0] 0 -6 > [0] 1 0 > [0] 2 -8 > [0] 3 1 > [0] 4 2 > [0] 5 3 > [1] Number of indices in set 6 > [1] 0 4 > [1] 1 5 > [1] 2 6 > [1] 3 -1 > [1] 4 7 > [1] 5 -4. > > Running the same example but by DMPlexInterpolate() and then > DMPlexGetCellNumbering() provides instead the output: > > [0] Number of indices in set 6 > [0] 0 0 > [0] 1 1 > [0] 2 2 > [0] 3 3 > [0] 4 4 > [0] 5 5 > [1] Number of indices in set 6 > [1] 0 6 > [1] 1 7 > [1] 2 8 > [1] 3 9 > [1] 4 10 > [1] 5 11 > There is something wrong with this result. It has to do with the order in which you created things. Right now, I do not have DMInterpolate() update the communication structures, since it would involve coordination between processes. Thus you should call DMInterpolate() before DMDistribute(). Thanks, Matt > The former result I find very useful since it provides the number of > ghost cells on each processor (the negative IS values) and moreover > the negative IS values also indicate the global numbering of the > ghost cells. Eg: On the first processor the cell 0 is a ghost cell with > its global numbering 5. > > The behavior of DMPlexGetCellNumbering() after the interpolation does > not bother me but I would like to know in the former case if the output > is the right output i.e, it is not merely a side effect which might get > changed later on. > > Thank You. > > -- > Regards, > Garnet > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From john.fettig at gmail.com Sun Mar 10 13:21:06 2013 From: john.fettig at gmail.com (John Fettig) Date: Sun, 10 Mar 2013 14:21:06 -0400 Subject: [petsc-users] Using PETSc with CMake on Windows In-Reply-To: References: Message-ID: Jed, There was some conversion necessary on the paths, since the windows compilers expect msdos style paths. Since PETSc already requires cygwin, I figured it was a safe assumption that "cygpath" was available. Also, Windows compilers need the whole library name (e.g. "libfoo" instead of "foo" on linux). Finally, there is some nonsense required if PETSc was built with the static runtime library. The commit is here: https://github.com/johnfettig/cmake-modules/commit/53ed281a37bfc1bfebdf5d6c0133de3e7901cba7 Let me know if you have any trouble with it. It works well with the NMake generator. I was unable to test the Visual Studio generator because I built PETSc with icl and CMake's Visual Studio generator doesn't like that. For anybody else interested in using this, here is my CMakeLists.txt for building one of the PETSc examples: ###### cmake_minimum_required (VERSION 2.6) project (example) set(PETSC_DIR $ENV{PETSC_DIR}) set(PETSC_ARCH $ENV{PETSC_ARCH}) set(CMAKE_MODULE_PATH C:/path/to/cmake-modules) include(FindPETSc) include_directories(${PETSC_INCLUDES}) add_executable(ex2 ex2.c) target_link_libraries(ex2 ${PETSC_LIBRARIES}) ###### Regards, John On Fri, Mar 8, 2013 at 4:53 PM, John Fettig wrote: > Ah, ok. I'll have a crack at it. > > Thanks, > John > > On Fri, Mar 8, 2013 at 4:40 PM, Jed Brown wrote: > > I have not tested it on Windows so I would not be surprised if it does > not > > work. It should not be difficult to make work and I would happily accept > > patches. > > > > On Mar 8, 2013 2:55 PM, "John Fettig" wrote: > >> > >> Looking through the mailing list archives, I found a pointer to Jed's > >> CMake module FindPETSc.cmake. Has this been tested on windows? > >> Should this work when PETSc has been installed via make install? The > >> directions given at the end of that say > >> > >> ==================================== > >> Install complete. It is useable with > >> PETSC_DIR=/path/to/my/petsc/install [and no more PETSC_ARCH]. > >> Now to check if the libraries are working do (in current directory): > >> make PETSC_DIR=/path/to/my/petsc/install test > >> ==================================== > >> > >> However, when I only set PETSC_DIR, CMake bails with > >> > >> CMake Error at FindPETSc.cmake:118 (message): > >> The pair > >> PETSC_DIR=/path/to/my/petsc/install > >> PETSC_ARCH= do not specify a valid PETSc installation > >> Call Stack (most recent call first): > >> CMakeLists.txt:9 (include) > >> > >> > >> -- PETSc could not be found. Be sure to set PETSC_DIR and PETSC_ARCH. > >> (missing: PETSC_INCLUDES PETSC_LIBRARIES PETSC_EXECUTABLE_RUNS) > >> > >> > >> Thanks for any help, > >> John > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gideon.simpson at gmail.com Sun Mar 10 13:41:44 2013 From: gideon.simpson at gmail.com (Gideon Simpson) Date: Sun, 10 Mar 2013 13:41:44 -0500 Subject: [petsc-users] solving sub problems serially Message-ID: I'm working on a monte carlo problem where each node needs the same solution of a small scale eigenvalue problem. I have in mind to use slepc to to use to get the solution, since it has all the necessary algorithms, but I am trying to understand how to get my code to have that problem solved locally, serially, within the context of a larger parallel problem. Is it sufficient to just declare the matrix associated with the eigenvalue problem to be of sequential type? -gideon -------------- next part -------------- An HTML attachment was scrubbed... URL: From jedbrown at mcs.anl.gov Sun Mar 10 13:42:58 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Sun, 10 Mar 2013 13:42:58 -0500 Subject: [petsc-users] solving sub problems serially In-Reply-To: References: Message-ID: On Sun, Mar 10, 2013 at 1:41 PM, Gideon Simpson wrote: > I'm working on a monte carlo problem where each node needs the same > solution of a small scale eigenvalue problem. I have in mind to use slepc > to to use to get the solution, since it has all the necessary algorithms, > but I am trying to understand how to get my code to have that problem > solved locally, serially, within the context of a larger parallel problem. > Is it sufficient to just declare the matrix associated with the eigenvalue > problem to be of sequential type? This is why every constructor takes a communicator. Just create those subproblems on PETSC_COMM_SELF. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.adams at columbia.edu Mon Mar 11 08:21:59 2013 From: mark.adams at columbia.edu (Mark F. Adams) Date: Mon, 11 Mar 2013 09:21:59 -0400 Subject: [petsc-users] odd SNES behavior In-Reply-To: References: <46F46D6E-0F42-4AE1-B794-AA9A97D40EF1@columbia.edu> <238DC882-A981-46F4-B3A7-12A2D6D0ABCA@mcs.anl.gov> <4F8532EE-09D7-411F-92AB-561634EA64A8@columbia.edu> <38A5C64A-B600-4395-843A-6DC4CE7D8D31@mcs.anl.gov> <99C18346-3C6E-4B2F-9443-1BBF671A7EAF@columbia.edu> <86B10F5C-6660-4F60-862B-A14C3644FCAC@mcs.anl.gov> <674CFF0D-3679-42D5-966E-A8979E130B79@mcs.anl.gov> <51EA347E-5969-4101-B903-CB21DEBAB1D9@columbia.edu> Message-ID: <761532E9-52A4-4D8E-B2DC-05402F3BBE96@columbia.edu> Humm, I'm not seeing PCSetUserAmat: 09:14 ~/Codes/petsc-dev$ hg grep PCSetUserAmat src/docs/website/documentation/changes/dev.html:26440:
  • Merged PCBJacobiSetUseTrueLocal(), -pc_bjacobi_true_local, PCKSPSetUseTrue(), -pc_ksp_true, PCCompositeSetUseTrue() -pc_composite_true to PCSetUserAmat(), -pc_use_amat. On Mar 8, 2013, at 10:27 AM, Barry Smith wrote: > > On Mar 8, 2013, at 9:23 AM, "Mark F. Adams" wrote: > >>> >>> I have merged PCBJacobiSetUseTrueLocal(), -pc_bjacobi_true_local, PCKSPSetUseTrue(), -pc_ksp_true, PCCompositeSetUseTrue() -pc_composite_true to PCSetUserAmat(), -pc_use_amat in petsc-dev. >>> >>> Note that other preconditioners, PCMG, PCFieldSplit, PCASM, PCGASM should adopt the same flag but I will leave that to Mark and Jed. >> >> GAMG's problem comes from PCMG, do I need to do anything? > > Yes, modify the PCMG :-). >> >> other than make '-pc_use_amat false' because I would like to match hypre semantics by default. > > It will be false by default. > > Barry > > > From bsmith at mcs.anl.gov Mon Mar 11 08:28:35 2013 From: bsmith at mcs.anl.gov (Barry Smith) Date: Mon, 11 Mar 2013 08:28:35 -0500 Subject: [petsc-users] odd SNES behavior In-Reply-To: <761532E9-52A4-4D8E-B2DC-05402F3BBE96@columbia.edu> References: <46F46D6E-0F42-4AE1-B794-AA9A97D40EF1@columbia.edu> <238DC882-A981-46F4-B3A7-12A2D6D0ABCA@mcs.anl.gov> <4F8532EE-09D7-411F-92AB-561634EA64A8@columbia.edu> <38A5C64A-B600-4395-843A-6DC4CE7D8D31@mcs.anl.gov> <99C18346-3C6E-4B2F-9443-1BBF671A7EAF@columbia.edu> <86B10F5C-6660-4F60-862B-A14C3644FCAC@mcs.anl.gov> <674CFF0D-3679-42D5-966E-A8979E130B79@mcs.anl.gov> <51EA347E-5969-4101-B903-CB21DEBAB1D9@columbia.edu> <761532E9-52A4-4D8E-B2DC-05402F3BBE96@columbia.edu> Message-ID: Sorry should be UseAmat On Mar 11, 2013, at 8:21 AM, "Mark F. Adams" wrote: > Humm, I'm not seeing PCSetUserAmat: > > 09:14 ~/Codes/petsc-dev$ hg grep PCSetUserAmat > src/docs/website/documentation/changes/dev.html:26440:
  • Merged PCBJacobiSetUseTrueLocal(), -pc_bjacobi_true_local, PCKSPSetUseTrue(), -pc_ksp_true, PCCompositeSetUseTrue() -pc_composite_true to PCSetUserAmat(), -pc_use_amat. > > > > On Mar 8, 2013, at 10:27 AM, Barry Smith wrote: > >> >> On Mar 8, 2013, at 9:23 AM, "Mark F. Adams" wrote: >> >>>> >>>> I have merged PCBJacobiSetUseTrueLocal(), -pc_bjacobi_true_local, PCKSPSetUseTrue(), -pc_ksp_true, PCCompositeSetUseTrue() -pc_composite_true to PCSetUserAmat(), -pc_use_amat in petsc-dev. >>>> >>>> Note that other preconditioners, PCMG, PCFieldSplit, PCASM, PCGASM should adopt the same flag but I will leave that to Mark and Jed. >>> >>> GAMG's problem comes from PCMG, do I need to do anything? >> >> Yes, modify the PCMG :-). >>> >>> other than make '-pc_use_amat false' because I would like to match hypre semantics by default. >> >> It will be false by default. >> >> Barry >> >> >> > From s_g at berkeley.edu Tue Mar 12 00:14:08 2013 From: s_g at berkeley.edu (Sanjay Govindjee) Date: Mon, 11 Mar 2013 22:14:08 -0700 Subject: [petsc-users] MatSetValues problem Message-ID: <513EB9A0.3020906@berkeley.edu> I am having a problem with MatSetValues. I have a two processor run that spits the following error: [0]PETSC ERROR: MatSetValues_MPIAIJ() line 564 in /Users/sg/petsc-3.3-p5/src/mat/impls/aij/mpi/mpiaij.c New nonzero at (1,1) caused a malloc [1]PETSC ERROR: MatSetValues_MPIAIJ() line 564 in /Users/sg/petsc-3.3-p5/src/mat/impls/aij/mpi/mpiaij.c New nonzero at (18,-1) caused a malloc I did a run with -on_error_attach_debugger. Going up the stack I find: #9 0x000000010eec135d in matsetvalue_ (mat=0x1111151b8, i=0x7fff6dabdd04, j=0x7fff6dabdd0c, va=0x7fff6dabdd88, mode=0x11076215c, ierr=0x7fff6dabdd10) at /Users/sg/petsc-3.3-p5/src/mat/ftn-custom/zmat.c:19 19 *ierr = MatSetValues(*mat,1,i,1,j,va,*mode); (gdb) print *i $1 = 1 (gdb) print *j $2 = 42 on one processor and #9 0x000000010c43235d in matsetvalue_ (mat=0x10e6861b8, i=0x7fff6b02ed04, j=0x7fff6b02ed0c, va=0x7fff6b02ed88, mode=0x10dcd315c, ierr=0x7fff6b02ed10) at /Users/sg/petsc-3.3-p5/src/mat/ftn-custom/zmat.c:19 19 *ierr = MatSetValues(*mat,1,i,1,j,va,*mode); (gdb) print j $1 = (PetscInt *) 0x7fff6b02ed0c (gdb) print *i $2 = 42 (gdb) print *j $3 = 1 on the other. If I pop the stack one more time to my application (which is in Fortran) I see 1,42 and 42,1 -- i.e. consistent with zmat.c. Thus I find it hard to understand the error message I am getting. I was expecting to find that (i,j) match (1,1) and (18,-1) which would allow me to track my error. Note I am using petsc-3.3-p5. -sanjay From knepley at gmail.com Tue Mar 12 07:11:27 2013 From: knepley at gmail.com (Matthew Knepley) Date: Tue, 12 Mar 2013 08:11:27 -0400 Subject: [petsc-users] MatSetValues problem In-Reply-To: <513EB9A0.3020906@berkeley.edu> References: <513EB9A0.3020906@berkeley.edu> Message-ID: On Tue, Mar 12, 2013 at 1:14 AM, Sanjay Govindjee wrote: > I am having a problem with MatSetValues. I have a two processor run that > spits the following error: > > [0]PETSC ERROR: MatSetValues_MPIAIJ() line 564 in > /Users/sg/petsc-3.3-p5/src/**mat/impls/aij/mpi/mpiaij.c New nonzero at > (1,1) caused a malloc > [1]PETSC ERROR: MatSetValues_MPIAIJ() line 564 in > /Users/sg/petsc-3.3-p5/src/**mat/impls/aij/mpi/mpiaij.c New nonzero at > (18,-1) caused a malloc > It is giving you local indices. This error occurs down inside the macro in aij.h for setting a value in a serial AIJ matrix. We have not found an easy way to do index translation on the way up. Thanks, Matt > I did a run with -on_error_attach_debugger. Going up the stack I find: > > #9 0x000000010eec135d in matsetvalue_ (mat=0x1111151b8, i=0x7fff6dabdd04, > j=0x7fff6dabdd0c, va=0x7fff6dabdd88, mode=0x11076215c, > ierr=0x7fff6dabdd10) > at /Users/sg/petsc-3.3-p5/src/**mat/ftn-custom/zmat.c:19 > 19 *ierr = MatSetValues(*mat,1,i,1,j,va,***mode); > (gdb) print *i > $1 = 1 > (gdb) print *j > $2 = 42 > > on one processor and > > #9 0x000000010c43235d in matsetvalue_ (mat=0x10e6861b8, i=0x7fff6b02ed04, > j=0x7fff6b02ed0c, va=0x7fff6b02ed88, mode=0x10dcd315c, > ierr=0x7fff6b02ed10) > at /Users/sg/petsc-3.3-p5/src/**mat/ftn-custom/zmat.c:19 > 19 *ierr = MatSetValues(*mat,1,i,1,j,va,***mode); > (gdb) print j > $1 = (PetscInt *) 0x7fff6b02ed0c > (gdb) print *i > $2 = 42 > (gdb) print *j > $3 = 1 > > on the other. If I pop the stack one more time to my application (which > is in Fortran) I see 1,42 and 42,1 -- i.e. consistent with zmat.c. > > Thus I find it hard to understand the error message I am getting. I was > expecting to find > that (i,j) match (1,1) and (18,-1) which would allow me to track my error. > Note I am using petsc-3.3-p5. > > -sanjay > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From james.j.ramsey14.civ at mail.mil Tue Mar 12 07:32:35 2013 From: james.j.ramsey14.civ at mail.mil (Ramsey, James J CIV (US)) Date: Tue, 12 Mar 2013 12:32:35 +0000 Subject: [petsc-users] MatSetValues problem In-Reply-To: <513EB9A0.3020906@berkeley.edu> References: <513EB9A0.3020906@berkeley.edu> Message-ID: ________________________________________ I am having a problem with MatSetValues. I have a two processor run that spits the following error: [0]PETSC ERROR: MatSetValues_MPIAIJ() line 564 in /Users/sg/petsc-3.3-p5/src/mat/impls/aij/mpi/mpiaij.c New nonzero at (1,1) caused a malloc [1]PETSC ERROR: MatSetValues_MPIAIJ() line 564 in /Users/sg/petsc-3.3-p5/src/mat/impls/aij/mpi/mpiaij.c New nonzero at (18,-1) caused a malloc ________________________________________ The "New nonzero at caused a malloc" error looks like what happens if the preallocation is not exact. What happens if you add call MatSetOption(Kglobal, MAT_NEW_NONZERO_ALLOCATION_ERR, PETSC_FALSE, ierr) after your call to your preallocation subroutine? From james.j.ramsey14.civ at mail.mil Tue Mar 12 07:38:51 2013 From: james.j.ramsey14.civ at mail.mil (Ramsey, James J CIV (US)) Date: Tue, 12 Mar 2013 12:38:51 +0000 Subject: [petsc-users] MatSetValues problem In-Reply-To: References: <513EB9A0.3020906@berkeley.edu>, Message-ID: ________________________________________ The "New nonzero at caused a malloc" error looks like what happens if the preallocation is not exact. What happens if you add call MatSetOption(Kglobal, MAT_NEW_NONZERO_ALLOCATION_ERR, PETSC_FALSE, ierr) after your call to your preallocation subroutine? ________________________________________ Oh, of course Kglobal should be replaced by whatever matrix you are trying to set the values of. From frtr at fysik.dtu.dk Tue Mar 12 04:56:31 2013 From: frtr at fysik.dtu.dk (Frederik Treue) Date: Tue, 12 Mar 2013 10:56:31 +0100 Subject: [petsc-users] precise meaning of SAME_NONZERO_PATTERN in MatAXPY? Message-ID: <1363082191.4124.8.camel@frtr-laptop> Hi, what, exactly, does the the matstructure parameter to (e.g.) MatAXPY do? If the two matrices come from the same dm, ie. have the same stencil, is SAME_NONZERO_PATTERN then _guaranteed_ to work? Or does the routines actually depend on the actual value of the matrices being zero/non-zero, even inside the stencil? /Frederik Treue From knepley at gmail.com Tue Mar 12 09:54:04 2013 From: knepley at gmail.com (Matthew Knepley) Date: Tue, 12 Mar 2013 10:54:04 -0400 Subject: [petsc-users] precise meaning of SAME_NONZERO_PATTERN in MatAXPY? In-Reply-To: <1363082191.4124.8.camel@frtr-laptop> References: <1363082191.4124.8.camel@frtr-laptop> Message-ID: On Tue, Mar 12, 2013 at 5:56 AM, Frederik Treue wrote: > Hi, > > what, exactly, does the the matstructure parameter to (e.g.) MatAXPY do? > If the two matrices come from the same dm, ie. have the same stencil, is > SAME_NONZERO_PATTERN then _guaranteed_ to work? Or does the routines > actually depend on the actual value of the matrices being zero/non-zero, > even inside the stencil? It only concerns the nonzero pattern, not actual values. If two Mats come from the same DM with the same parameters, they have the same pattern. Thanks, Matt > > /Frederik Treue > > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From s_g at berkeley.edu Tue Mar 12 12:19:45 2013 From: s_g at berkeley.edu (Sanjay Govindjee) Date: Tue, 12 Mar 2013 10:19:45 -0700 Subject: [petsc-users] MatSetValues problem In-Reply-To: References: <513EB9A0.3020906@berkeley.edu>, Message-ID: <513F63B1.1040707@berkeley.edu> Matt, I take it then that I should ignore the indicies that are printed and just chase the values I found up the stack to see why my preallocation missed them. James, thanks for the comment on MatSetOptions -- that option does remove the malloc-error-warning. I guess I now need to determine the why. -sanjay > On Tue, Mar 12, 2013 at 1:14 AM, Sanjay Govindjee > wrote: > > I am having a problem with MatSetValues. I have a two processor > run that spits the following error: > > [0]PETSC ERROR: MatSetValues_MPIAIJ() line 564 in > /Users/sg/petsc-3.3-p5/src/mat/impls/aij/mpi/mpiaij.c New nonzero > at (1,1) caused a malloc > [1]PETSC ERROR: MatSetValues_MPIAIJ() line 564 in > /Users/sg/petsc-3.3-p5/src/mat/impls/aij/mpi/mpiaij.c New nonzero > at (18,-1) caused a malloc > > > It is giving you local indices. This error occurs down inside the > macro in aij.h for setting a value > in a serial AIJ matrix. We have not found an easy way to do index > translation on the way up. > > Thanks, > > Matt On 3/12/13 5:38 AM, Ramsey, James J CIV (US) wrote: > ________________________________________ > > The "New nonzero at caused a malloc" error looks like what happens if the preallocation is not exact. What happens if you add > > call MatSetOption(Kglobal, MAT_NEW_NONZERO_ALLOCATION_ERR, PETSC_FALSE, ierr) > > after your call to your preallocation subroutine? > ________________________________________ > > Oh, of course Kglobal should be replaced by whatever matrix you are trying to set the values of. > -- ----------------------------------------------- Sanjay Govindjee, PhD, PE Professor of Civil Engineering Vice Chair for Academic Affairs 779 Davis Hall Structural Engineering, Mechanics and Materials Department of Civil Engineering University of California Berkeley, CA 94720-1710 Voice: +1 510 642 6060 FAX: +1 510 643 5264 s_g at berkeley.edu http://www.ce.berkeley.edu/~sanjay ----------------------------------------------- New Books: Engineering Mechanics of Deformable Solids: A Presentation with Exercises http://www.oup.com/us/catalog/general/subject/Physics/MaterialsScience/?view=usa&ci=9780199651641 http://ukcatalogue.oup.com/product/9780199651641.do http://amzn.com/0199651647 Engineering Mechanics 3 (Dynamics) http://www.springer.com/materials/mechanics/book/978-3-642-14018-1 http://amzn.com/3642140181 ----------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From gpau at lbl.gov Tue Mar 12 16:10:49 2013 From: gpau at lbl.gov (George Pau) Date: Tue, 12 Mar 2013 14:10:49 -0700 Subject: [petsc-users] MatCreateMPIAdj Message-ID: Hi, I am trying to use MatCreateMPIAdj in Fortran. The command reference says the weight is optional. What does that mean in terms of Fortran syntax? Or I must create an weight array in Fortran? Thanks, George -- George Pau Earth Sciences Division Lawrence Berkeley National Laboratory One Cyclotron, MS 74-120 Berkeley, CA 94720 (510) 486-7196 gpau at lbl.gov http://esd.lbl.gov/about/staff/georgepau/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From bsmith at mcs.anl.gov Tue Mar 12 16:16:58 2013 From: bsmith at mcs.anl.gov (Barry Smith) Date: Tue, 12 Mar 2013 16:16:58 -0500 Subject: [petsc-users] MatCreateMPIAdj In-Reply-To: References: Message-ID: George, Pass PETSC_NULL_INTEGER for that argument. Barry In general where the C function takes a NULL (or PETSC_NULL) you can pass PETSC_NULL_xxx where xxx is the type expected, INTEGER, SCALAR, or OBJECT On Mar 12, 2013, at 4:10 P M, George Pau wrote: > Hi, > > I am trying to use MatCreateMPIAdj in Fortran. The command reference says the weight is optional. What does that mean in terms of Fortran syntax? Or I must create an weight array in Fortran? > > Thanks, > George > > > -- > George Pau > Earth Sciences Division > Lawrence Berkeley National Laboratory > One Cyclotron, MS 74-120 > Berkeley, CA 94720 > > (510) 486-7196 > gpau at lbl.gov > http://esd.lbl.gov/about/staff/georgepau/ From jefonseca at gmail.com Wed Mar 13 11:05:30 2013 From: jefonseca at gmail.com (Jim Fonseca) Date: Wed, 13 Mar 2013 12:05:30 -0400 Subject: [petsc-users] PETSc on BlueWaters Message-ID: Hi, I'm wondering if any other groups out there have built their own PETSc on BlueWaters. We have a unique PETSc build that combines double and complex builds and we have been struggling to get it running there, even though we have had success on other Cray machines. At this point we are trying to have PETSc build its own mpich. The only way we have been able to get a simple MPI example included with PETSc to work has been by adding the mpich download option to the configuration. We would like to be able to use the Blue Waters mpich, since other packages such as HDF5 rely on the mpich residing on Blue Waters. I know I'm supposed to include config.log but we've been running through those left and right trying many different things. Thanks, Jim -- Jim Fonseca, PhD Research Scientist Network for Computational Nanotechnology Purdue University 765-496-6495 www.jimfonseca.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Wed Mar 13 11:08:02 2013 From: knepley at gmail.com (Matthew Knepley) Date: Wed, 13 Mar 2013 12:08:02 -0400 Subject: [petsc-users] PETSc on BlueWaters In-Reply-To: References: Message-ID: On Wed, Mar 13, 2013 at 12:05 PM, Jim Fonseca wrote: > Hi, > I'm wondering if any other groups out there have built their own PETSc on > BlueWaters. We have a unique PETSc build that combines double and complex > builds and we have been struggling to get it running there, even though we > have had success on other Cray machines. > > At this point we are trying to have PETSc build its own mpich. The only > way we have been able to get a simple MPI example included with PETSc to > work has been by adding the mpich download option to the configuration. We > would like to be able to use the Blue Waters mpich, since other packages > such as HDF5 rely on the mpich residing on Blue Waters. > > I know I'm supposed to include config.log but we've been running through > those left and right trying many different things. > Send them all to petsc-maint. Matt > Thanks, > Jim > > -- > Jim Fonseca, PhD > Research Scientist > Network for Computational Nanotechnology > Purdue University > 765-496-6495 > www.jimfonseca.com > > > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From balay at mcs.anl.gov Wed Mar 13 11:23:57 2013 From: balay at mcs.anl.gov (Satish Balay) Date: Wed, 13 Mar 2013 11:23:57 -0500 (CDT) Subject: [petsc-users] PETSc on BlueWaters In-Reply-To: References: Message-ID: On Wed, 13 Mar 2013, Matthew Knepley wrote: > On Wed, Mar 13, 2013 at 12:05 PM, Jim Fonseca wrote: > > > Hi, > > I'm wondering if any other groups out there have built their own PETSc on > > BlueWaters. We have a unique PETSc build that combines double and complex > > builds and we have been struggling to get it running there, even though we > > have had success on other Cray machines. > > > > At this point we are trying to have PETSc build its own mpich. The only > > way we have been able to get a simple MPI example included with PETSc to > > work has been by adding the mpich download option to the configuration. We > > would like to be able to use the Blue Waters mpich, since other packages > > such as HDF5 rely on the mpich residing on Blue Waters. > > > > I know I'm supposed to include config.log but we've been running through > > those left and right trying many different things. > > > > Send them all to petsc-maint. I'll say - try the basic build [with recommended compilers/mpi] and send it over. bluewaters appears to be cray-xe6 - same as nersc-hopper - with default pgi compilers? petsc/config/examples/arch-cray-xt6-pkgs-opt.py is what we used previously to install the nersc machine. Satish > > Matt > > > > Thanks, > > Jim > > > > -- > > Jim Fonseca, PhD > > Research Scientist > > Network for Computational Nanotechnology > > Purdue University > > 765-496-6495 > > www.jimfonseca.com > > > > > > > > > From Shuangshuang.Jin at pnnl.gov Wed Mar 13 13:28:59 2013 From: Shuangshuang.Jin at pnnl.gov (Jin, Shuangshuang) Date: Wed, 13 Mar 2013 11:28:59 -0700 Subject: [petsc-users] runtime error for help Message-ID: <6778DE83AB681D49BFC2CD850610FEB1018FC6BE70DE@EMAIL04.pnl.gov> Hello, I'm using petsc-dev to develop a program which involves complex numbers. With the help from petsc-maint, I have successfully built the PETSc complex version on my system, and am able to run the example /ksp/ksp/examples/tutorials/ex11.c Now the problem is I can compile my code successfully: [d3m956 at olympus v0]$ make mpicxx -I/pic/projects/ds/petsc-dev/include -I/pic/projects/ds/petsc-dev/arch-complex/include -I/share/apps/openmpi/1.5.4/gcc/4.1.2/include -g -c -o allocMainData.o allocMainData.C mpicxx -I/pic/projects/ds/petsc-dev/include -I/pic/projects/ds/petsc-dev/arch-complex/include -I/share/apps/openmpi/1.5.4/gcc/4.1.2/include -g -c -o dynSim.o dynSim.C mpicxx -I/pic/projects/ds/petsc-dev/include -I/pic/projects/ds/petsc-dev/arch-complex/include -I/share/apps/openmpi/1.5.4/gcc/4.1.2/include -g -c -o readInput.o readInput.C mpicxx -I/pic/projects/ds/petsc-dev/include -I/pic/projects/ds/petsc-dev/arch-complex/include -I/share/apps/openmpi/1.5.4/gcc/4.1.2/include -g -c -o bcastGlobals.o bcastGlobals.C mpicxx -I/pic/projects/ds/petsc-dev/include -I/pic/projects/ds/petsc-dev/arch-complex/include -I/share/apps/openmpi/1.5.4/gcc/4.1.2/include -g -c -o admitBuild.o admitBuild.C mpicxx -o dynSim allocMainData.o dynSim.o readInput.o bcastGlobals.o admitBuild.o -L/pic/projects/ds/petsc-dev/arch-complex/lib -lpetsc -llapack -lblas -lX11 -lpthread -Wl,-rpath,/share/apps/openmpi/1.5.4/gcc/4.1.2/lib -L/share/apps/openmpi/1.5.4/gcc/4.1.2/lib -Wl,-rpath,/usr/lib/gcc/x86_64-redhat-linux/4.1.2 -L/usr/lib/gcc/x86_64-redhat-linux/4.1.2 -lmpi_f90 -lmpi_f77 -lgfortran -lm -lm -lm -lm -lmpi_cxx -lstdc++ -lmpi_cxx -lstdc++ -ldl -lmpi -lnsl -lutil -lgcc_s -lpthread -ldl However, when I ran the code, I got several Error Messages as well as some results during the runtime as shown below: [d3m956 at olympus v0]$ mpirun -n 1 dynSim -i d100.txt Number of buses: 290 Number of branches: 907 Number of swing buses: 1 Number of PQ buses: 190 Number of PV buses: 99 Number of generators: 100 Number of switches: 7 Initialization time: 0.00221014 Alloc main data time: 0.00632787 Read input data time: 0.0415301 [0]PETSC ERROR: --------------------- Error Message ------------------------------------ [0]PETSC ERROR: Object is in wrong state! [0]PETSC ERROR: Must call MatXXXSetPreallocation() or MatSetUp() on argument 1 "mat" before MatSetValues()! [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: Petsc Development HG revision: 6e0ddc6e9b6d8a9d8eb4c0ede0105827a6b58dfb HG Date: Mon Mar 11 22:54:30 2013 -0500 [0]PETSC ERROR: See docs/changes/index.html for recent updates. [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. [0]PETSC ERROR: See docs/index.html for manual pages. [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: dynSim on a arch-complex named olympus.local by d3m956 Tue Mar 12 15:33:32 2013 [0]PETSC ERROR: Libraries linked from /pic/projects/ds/petsc-dev/arch-complex/lib [0]PETSC ERROR: Configure run at Tue Mar 12 14:32:37 2013 [0]PETSC ERROR: Configure options --with-scalar-type=complex --with-clanguage=C++ PETSC_ARCH=arch-complex --with-fortran-kernels=generic [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: MatSetValues() line 1061 in src/mat/interface/matrix.c [0]PETSC ERROR: buildYshMatrix() line 216 in "unknowndirectory/"admitBuild.C [0]PETSC ERROR: --------------------- Error Message ------------------------------------ [0]PETSC ERROR: Object is in wrong state! [0]PETSC ERROR: Must call MatXXXSetPreallocation() or MatSetUp() on argument 1 "mat" before MatSetValues()! [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: Petsc Development HG revision: 6e0ddc6e9b6d8a9d8eb4c0ede0105827a6b58dfb HG Date: Mon Mar 11 22:54:30 2013 -0500 [0]PETSC ERROR: See docs/changes/index.html for recent updates. [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. [0]PETSC ERROR: See docs/index.html for manual pages. [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: dynSim on a arch-complex named olympus.local by d3m956 Tue Mar 12 15:33:32 2013 [0]PETSC ERROR: Libraries linked from /pic/projects/ds/petsc-dev/arch-complex/lib [0]PETSC ERROR: Configure run at Tue Mar 12 14:32:37 2013 [0]PETSC ERROR: Configure options --with-scalar-type=complex --with-clanguage=C++ PETSC_ARCH=arch-complex --with-fortran-kernels=generic [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: MatSetValues() line 1061 in src/mat/interface/matrix.c [0]PETSC ERROR: buildConnectMatrix() line 281 in "unknowndirectory/"admitBuild.C [0]PETSC ERROR: --------------------- Error Message ------------------------------------ [0]PETSC ERROR: Object is in wrong state! [0]PETSC ERROR: Not for unassembled matrix! [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: Petsc Development HG revision: 6e0ddc6e9b6d8a9d8eb4c0ede0105827a6b58dfb HG Date: Mon Mar 11 22:54:30 2013 -0500 [0]PETSC ERROR: See docs/changes/index.html for recent updates. [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. [0]PETSC ERROR: See docs/index.html for manual pages. [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: dynSim on a arch-complex named olympus.local by d3m956 Tue Mar 12 15:33:32 2013 [0]PETSC ERROR: Libraries linked from /pic/projects/ds/petsc-dev/arch-complex/lib [0]PETSC ERROR: Configure run at Tue Mar 12 14:32:37 2013 [0]PETSC ERROR: Configure options --with-scalar-type=complex --with-clanguage=C++ PETSC_ARCH=arch-complex --with-fortran-kernels=generic [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: MatDuplicate() line 4039 in src/mat/interface/matrix.c [0]PETSC ERROR: buildDiagMatrices() line 331 in "unknowndirectory/"admitBuild.C [0]PETSC ERROR: --------------------- Error Message ------------------------------------ [0]PETSC ERROR: Invalid argument! [0]PETSC ERROR: Wrong type of object: Parameter # 1! [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: Petsc Development HG revision: 6e0ddc6e9b6d8a9d8eb4c0ede0105827a6b58dfb HG Date: Mon Mar 11 22:54:30 2013 -0500 [0]PETSC ERROR: See docs/changes/index.html for recent updates. [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. [0]PETSC ERROR: See docs/index.html for manual pages. [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: dynSim on a arch-complex named olympus.local by d3m956 Tue Mar 12 15:33:32 2013 [0]PETSC ERROR: Libraries linked from /pic/projects/ds/petsc-dev/arch-complex/lib [0]PETSC ERROR: Configure run at Tue Mar 12 14:32:37 2013 [0]PETSC ERROR: Configure options --with-scalar-type=complex --with-clanguage=C++ PETSC_ARCH=arch-complex --with-fortran-kernels=generic [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: MatMatMult() line 8516 in src/mat/interface/matrix.c [0]PETSC ERROR: buildMatrix() line 107 in "unknowndirectory/"admitBuild.C [0]PETSC ERROR: buildAdmittanceMatrix() line 66 in "unknowndirectory/"dynSim.h Build admittance matrix time: 0.00370693 Can anyone give me a shot what might be a reason for errors like this? [0]PETSC ERROR: Object is in wrong state! [0]PETSC ERROR: Must call MatXXXSetPreallocation() or MatSetUp() on argument 1 "mat" before MatSetValues()! [0]PETSC ERROR: MatSetValues() line 1061 in src/mat/interface/matrix.c [0]PETSC ERROR: buildYshMatrix() line 216 in "unknowndirectory/"admitBuild.C Thanks, Shuangshuang -------------- next part -------------- An HTML attachment was scrubbed... URL: From bsmith at mcs.anl.gov Wed Mar 13 13:33:18 2013 From: bsmith at mcs.anl.gov (Barry Smith) Date: Wed, 13 Mar 2013 13:33:18 -0500 Subject: [petsc-users] runtime error for help In-Reply-To: <6778DE83AB681D49BFC2CD850610FEB1018FC6BE70DE@EMAIL04.pnl.gov> References: <6778DE83AB681D49BFC2CD850610FEB1018FC6BE70DE@EMAIL04.pnl.gov> Message-ID: You must either call MatSetUp() or MatXXXSetPreallocation() before calling MatSetValues() see the users manual for MatMPIAIJSetPreallocation() http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatMPIAIJSetPreallocation.html Barry [0]PETSC ERROR: Object is in wrong state! [0]PETSC ERROR: Must call MatXXXSetPreallocation() or MatSetUp() on argument 1 "mat" before MatSetValues()! On Mar 13, 2013, at 1:28 PM, "Jin, Shuangshuang" wrote: > Hello, I?m using petsc-dev to develop a program which involves complex numbers. > > With the help from petsc-maint, I have successfully built the PETSc complex version on my system, and am able to run the example/ksp/ksp/examples/tutorials/ex11.c > > Now the problem is I can compile my code successfully: > > [d3m956 at olympus v0]$ make > mpicxx -I/pic/projects/ds/petsc-dev/include -I/pic/projects/ds/petsc-dev/arch-complex/include -I/share/apps/openmpi/1.5.4/gcc/4.1.2/include -g -c -o allocMainData.o allocMainData.C > mpicxx -I/pic/projects/ds/petsc-dev/include -I/pic/projects/ds/petsc-dev/arch-complex/include -I/share/apps/openmpi/1.5.4/gcc/4.1.2/include -g -c -o dynSim.o dynSim.C > mpicxx -I/pic/projects/ds/petsc-dev/include -I/pic/projects/ds/petsc-dev/arch-complex/include -I/share/apps/openmpi/1.5.4/gcc/4.1.2/include -g -c -o readInput.o readInput.C > mpicxx -I/pic/projects/ds/petsc-dev/include -I/pic/projects/ds/petsc-dev/arch-complex/include -I/share/apps/openmpi/1.5.4/gcc/4.1.2/include -g -c -o bcastGlobals.o bcastGlobals.C > mpicxx -I/pic/projects/ds/petsc-dev/include -I/pic/projects/ds/petsc-dev/arch-complex/include -I/share/apps/openmpi/1.5.4/gcc/4.1.2/include -g -c -o admitBuild.o admitBuild.C > mpicxx -o dynSim allocMainData.o dynSim.o readInput.o bcastGlobals.o admitBuild.o -L/pic/projects/ds/petsc-dev/arch-complex/lib -lpetsc -llapack -lblas -lX11 -lpthread -Wl,-rpath,/share/apps/openmpi/1.5.4/gcc/4.1.2/lib -L/share/apps/openmpi/1.5.4/gcc/4.1.2/lib -Wl,-rpath,/usr/lib/gcc/x86_64-redhat-linux/4.1.2 -L/usr/lib/gcc/x86_64-redhat-linux/4.1.2 -lmpi_f90 -lmpi_f77 -lgfortran -lm -lm -lm -lm -lmpi_cxx -lstdc++ -lmpi_cxx -lstdc++ -ldl -lmpi -lnsl -lutil -lgcc_s -lpthread ?ldl > > However, when I ran the code, I got several Error Messages as well as some results during the runtime as shown below: > > [d3m956 at olympus v0]$ mpirun -n 1 dynSim -i d100.txt > Number of buses: 290 > Number of branches: 907 > Number of swing buses: 1 > Number of PQ buses: 190 > Number of PV buses: 99 > Number of generators: 100 > Number of switches: 7 > Initialization time: 0.00221014 > Alloc main data time: 0.00632787 > Read input data time: 0.0415301 > [0]PETSC ERROR: --------------------- Error Message ------------------------------------ > [0]PETSC ERROR: Object is in wrong state! > [0]PETSC ERROR: Must call MatXXXSetPreallocation() or MatSetUp() on argument 1 "mat" before MatSetValues()! > [0]PETSC ERROR: ------------------------------------------------------------------------ > [0]PETSC ERROR: Petsc Development HG revision: 6e0ddc6e9b6d8a9d8eb4c0ede0105827a6b58dfb HG Date: Mon Mar 11 22:54:30 2013 -0500 > [0]PETSC ERROR: See docs/changes/index.html for recent updates. > [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. > [0]PETSC ERROR: See docs/index.html for manual pages. > [0]PETSC ERROR: ------------------------------------------------------------------------ > [0]PETSC ERROR: dynSim on a arch-complex named olympus.local by d3m956 Tue Mar 12 15:33:32 2013 > [0]PETSC ERROR: Libraries linked from /pic/projects/ds/petsc-dev/arch-complex/lib > [0]PETSC ERROR: Configure run at Tue Mar 12 14:32:37 2013 > [0]PETSC ERROR: Configure options --with-scalar-type=complex --with-clanguage=C++ PETSC_ARCH=arch-complex --with-fortran-kernels=generic > [0]PETSC ERROR: ------------------------------------------------------------------------ > [0]PETSC ERROR: MatSetValues() line 1061 in src/mat/interface/matrix.c > [0]PETSC ERROR: buildYshMatrix() line 216 in "unknowndirectory/"admitBuild.C > [0]PETSC ERROR: --------------------- Error Message ------------------------------------ > [0]PETSC ERROR: Object is in wrong state! > [0]PETSC ERROR: Must call MatXXXSetPreallocation() or MatSetUp() on argument 1 "mat" before MatSetValues()! > [0]PETSC ERROR: ------------------------------------------------------------------------ > [0]PETSC ERROR: Petsc Development HG revision: 6e0ddc6e9b6d8a9d8eb4c0ede0105827a6b58dfb HG Date: Mon Mar 11 22:54:30 2013 -0500 > [0]PETSC ERROR: See docs/changes/index.html for recent updates. > [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. > [0]PETSC ERROR: See docs/index.html for manual pages. > [0]PETSC ERROR: ------------------------------------------------------------------------ > [0]PETSC ERROR: dynSim on a arch-complex named olympus.local by d3m956 Tue Mar 12 15:33:32 2013 > [0]PETSC ERROR: Libraries linked from /pic/projects/ds/petsc-dev/arch-complex/lib > [0]PETSC ERROR: Configure run at Tue Mar 12 14:32:37 2013 > [0]PETSC ERROR: Configure options --with-scalar-type=complex --with-clanguage=C++ PETSC_ARCH=arch-complex --with-fortran-kernels=generic > [0]PETSC ERROR: ------------------------------------------------------------------------ > [0]PETSC ERROR: MatSetValues() line 1061 in src/mat/interface/matrix.c > [0]PETSC ERROR: buildConnectMatrix() line 281 in "unknowndirectory/"admitBuild.C > [0]PETSC ERROR: --------------------- Error Message ------------------------------------ > [0]PETSC ERROR: Object is in wrong state! > [0]PETSC ERROR: Not for unassembled matrix! > [0]PETSC ERROR: ------------------------------------------------------------------------ > [0]PETSC ERROR: Petsc Development HG revision: 6e0ddc6e9b6d8a9d8eb4c0ede0105827a6b58dfb HG Date: Mon Mar 11 22:54:30 2013 -0500 > [0]PETSC ERROR: See docs/changes/index.html for recent updates. > [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. > [0]PETSC ERROR: See docs/index.html for manual pages. > [0]PETSC ERROR: ------------------------------------------------------------------------ > [0]PETSC ERROR: dynSim on a arch-complex named olympus.local by d3m956 Tue Mar 12 15:33:32 2013 > [0]PETSC ERROR: Libraries linked from /pic/projects/ds/petsc-dev/arch-complex/lib > [0]PETSC ERROR: Configure run at Tue Mar 12 14:32:37 2013 > [0]PETSC ERROR: Configure options --with-scalar-type=complex --with-clanguage=C++ PETSC_ARCH=arch-complex --with-fortran-kernels=generic > [0]PETSC ERROR: ------------------------------------------------------------------------ > [0]PETSC ERROR: MatDuplicate() line 4039 in src/mat/interface/matrix.c > [0]PETSC ERROR: buildDiagMatrices() line 331 in "unknowndirectory/"admitBuild.C > [0]PETSC ERROR: --------------------- Error Message ------------------------------------ > [0]PETSC ERROR: Invalid argument! > [0]PETSC ERROR: Wrong type of object: Parameter # 1! > [0]PETSC ERROR: ------------------------------------------------------------------------ > [0]PETSC ERROR: Petsc Development HG revision: 6e0ddc6e9b6d8a9d8eb4c0ede0105827a6b58dfb HG Date: Mon Mar 11 22:54:30 2013 -0500 > [0]PETSC ERROR: See docs/changes/index.html for recent updates. > [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. > [0]PETSC ERROR: See docs/index.html for manual pages. > [0]PETSC ERROR: ------------------------------------------------------------------------ > [0]PETSC ERROR: dynSim on a arch-complex named olympus.local by d3m956 Tue Mar 12 15:33:32 2013 > [0]PETSC ERROR: Libraries linked from /pic/projects/ds/petsc-dev/arch-complex/lib > [0]PETSC ERROR: Configure run at Tue Mar 12 14:32:37 2013 > [0]PETSC ERROR: Configure options --with-scalar-type=complex --with-clanguage=C++ PETSC_ARCH=arch-complex --with-fortran-kernels=generic > [0]PETSC ERROR: ------------------------------------------------------------------------ > [0]PETSC ERROR: MatMatMult() line 8516 in src/mat/interface/matrix.c > [0]PETSC ERROR: buildMatrix() line 107 in "unknowndirectory/"admitBuild.C > [0]PETSC ERROR: buildAdmittanceMatrix() line 66 in "unknowndirectory/"dynSim.h > Build admittance matrix time: 0.00370693 > > Can anyone give me a shot what might be a reason for errors like this? > > [0]PETSC ERROR: Object is in wrong state! > [0]PETSC ERROR: Must call MatXXXSetPreallocation() or MatSetUp() on argument 1 "mat" before MatSetValues()! > [0]PETSC ERROR: MatSetValues() line 1061 in src/mat/interface/matrix.c > [0]PETSC ERROR: buildYshMatrix() line 216 in "unknowndirectory/"admitBuild.C > > Thanks, > Shuangshuang > > > From gokhalen at gmail.com Wed Mar 13 16:21:32 2013 From: gokhalen at gmail.com (Nachiket Gokhale) Date: Wed, 13 Mar 2013 17:21:32 -0400 Subject: [petsc-users] possible error Message-ID: I am getting the error at the end of the email only in optimized mode. Output of -on_error_attach_debugger and "where" is at the end of this email. Running through valgrind in debug mode doesn't show up any memory misuse on my part. Does this seem to be something in petsc? -Nachiket 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: configure using --with-debugging=yes, recompile, link, and run [0]PETSC ERROR: to get more information on the crash. [0]PETSC ERROR: User provided function() line 0 in unknown directory unknown file [0]PETSC ERROR: PETSC: Attaching gdb to /home/gokhale/WAIGEN/GDEB-WAIGEN2012/bin/waigen of pid 8458 on display :47.0 on machine asd1.wai.com #0 0x0000003caccaba50 in __nanosleep_nocancel () from /lib64/libc.so.6 #1 0x0000003caccab8e0 in sleep () from /lib64/libc.so.6 #2 0x00007f715f45f67f in PetscSleep () from /opt/petsc/petsc-hg/linux-gcc-gpp-mpich-mumps-complex/lib/libpetsc.so #3 0x00007f715f4982db in PetscAttachDebugger () from /opt/petsc/petsc-hg/linux-gcc-gpp-mpich-mumps-complex/lib/libpetsc.so #4 0x00007f715f49834b in PetscAttachDebuggerErrorHandler () from /opt/petsc/petsc-hg/linux-gcc-gpp-mpich-mumps-complex/lib/libpetsc.so #5 0x00007f715f498df8 in PetscError () from /opt/petsc/petsc-hg/linux-gcc-gpp-mpich-mumps-complex/lib/libpetsc.so #6 0x00007f715f49d67e in PetscSignalHandlerDefault () from /opt/petsc/petsc-hg/linux-gcc-gpp-mpich-mumps-complex/lib/libpetsc.so #7 0x00007f715f49d731 in PetscSignalHandler_Private(int) () from /opt/petsc/petsc-hg/linux-gcc-gpp-mpich-mumps-complex/lib/libpetsc.so #8 #9 0x00007f715f8bbcdb in MatTranspose_SeqAIJ(_p_Mat*, MatReuse, _p_Mat**) () from /opt/petsc/petsc-hg/linux-gcc-gpp-mpich-mumps-complex/lib/libpetsc.so #10 0x00007f715f57f05c in MatTranspose () from /opt/petsc/petsc-hg/linux-gcc-gpp-mpich-mumps-complex/lib/libpetsc.so #11 0x000000000040ce03 in waigensolveepsnull(_p_Mat**, _p_Mat**, _p_Mat**, _p_Vec**, int*, int*, int*, int*, PetscBool) () #12 0x000000000040275f in main () From knepley at gmail.com Wed Mar 13 18:07:36 2013 From: knepley at gmail.com (Matthew Knepley) Date: Wed, 13 Mar 2013 19:07:36 -0400 Subject: [petsc-users] DMPlex Fortran examples In-Reply-To: References: Message-ID: On Wed, Mar 6, 2013 at 5:30 PM, Dharmendar Reddy wrote: > Hello Mathew, > I created an example (tutorial like) for creating DM > using cell list of a box mesh with quad cells (anti clockwise orientation > for cell nodes). The Box mesh is created locally. I also included in > comments explanations of cells, dimension, co-dimension based on my > understanding. > > May be you can add some explanation for understanding the idea of stratum. > > > I find that DMPlexComputeCellGeometry gives incorrect results for J, detJ > and InvJ where as the same code that you used in > DMPlexComputeRectangleGeometry_private gives correct answers when i > evaluated those steps locally in the example code. > This was my bug. I forgot to declare an F90 interface for that function. I am including my changed version that worked for me. > Can you tell me how i should go about this: I create mesh in gmsh for my > problem. The output of node coordinates, and connectivity which i use via > DMcreateFromcelllist to create a DM. In gmsh i also assign physical ids to > blokcs for region which i need to use for assigning material properties, > boundary conditions. How do i include this information into DMPlex ? > You use DMLabels. You can look at the implementation I use to read ExodusII files in plexexodusii.c We have recently converted the repository to Git. If you clone the new repository, and checkout the 'next' branch, you will get my fix. If you want to see the latest DMPlex development, I use the branch knepley/branch. If you have any problems, feel free to mail because we are trying to make it easy. There are directions online at https://bitbucket.org/petsc/petsc/wiki/Home. I understood how to create a Petscsection for Feild data layout. Now i need > to be able to access some auxilary data which is usually mesh positon > dependent but given information. > You can just create another one for this. I would make another DM using DMPlexClone() and set the PetscSection for the aux data as the default on that one. Thanks, Matt > I have design my code interface such that the user needs to write the > linear and blinear form with the DM, cell and basis functions as input. All > the data dof and aux data is to be access via DM > > Please give me some pointers, i will digg to learn more. > > Thanks > Reddy > > On Wed, Mar 6, 2013 at 4:51 AM, Matthew Knepley wrote: > >> On Wed, Mar 6, 2013 at 2:43 AM, Dharmendar Reddy > > wrote: >> >>> I think i caught the issues, please see the reply inline below. It is >>> not clear to me for which DMPlex i should include petsc.h90 or petsc.h >>> >>> Still need to fix the DMPlexComputeCellGeometry though >>> >>> >>> On Tue, Mar 5, 2013 at 9:52 PM, Dharmendar Reddy < >>> dharmareddy84 at gmail.com> wrote: >>> >>>> Hello, >>>> >>>> I am having trouble with a couple of DMPlex routines. >>>> I was doing tests on various function calls that i may need to write a >>>> test Poisson problem. >>>> >>>> First issue is with DMPlexComputeCellGeometry. For a rectangle cell >>>> geometry, I get , v0, J, invJ, and detJ as zero. >>>> >>> >> Geometric primitives of course depend on the way you specify a cell. >> Simplicies are nice in >> that you can only change the orientation, but hexes are harder. I specify >> quads so that the >> vertices go counter-clockwise around the boundary. Do you do this? If so, >> can you send >> a small example test that I can add to PETSc. >> >> >>> DMPlexGetConeSize gives run time error >>>> >>>> I had to include petsc.h90 to fix this. >>> >> >> I have fixed the manpage documentation to reflect this. >> >> >>> >>> DMPlexVecGetClosure gives runtime error, Should not this call be >>>> DMPlexVecGetClosureF90 ? is there such interface ? I remember doing a >>>> procedure like VecGetArrayF90 and VecRestoreArrayF90 when i had to pass >>>> pointer which need to be restored. >>>> >>>> Looks like there is an inconsistency in interface defined on >>> petsc-dev manual page. and the interface defined in >>> finclude/ftn-custom/petscdmplex.h90 >>> Fortran interface does not have the csize parameter defined below >>> >>> PetscErrorCode DMPlexVecGetClosure(DM dm, PetscSection section, Vec v, PetscInt point, PetscInt *csize, const PetscScalar *values[]) >>> >>> I have noted this on the manpage. >> >> Did you look at src/dm/impls/plex/examples/tests/ex2f90.F? It tests many >> of these operations. >> >> Thanks, >> >> Matt >> >> >>> >>> >>> I have attached test case with the make file and error.log. Please have >>>> a look at it. >>>> you need to run: >>>> make all debug=0 >>>> ./testDMView >>>> >>>> Also, I have trouble compiling the code with debug=1 which uses petsc >>>> configured in debug mode everything else being same (you can see the >>>> configure options in the error.log). >>>> I get this error message: >>>> login1$ make all debug=1 >>>> make: *** /home1/00924/Reddy135/LocalApps/petsc-dev/mpi_rScalar: Is a >>>> directory. Stop >>>> . >>>> >>>> >>>> >>>> On Tue, Mar 5, 2013 at 9:22 AM, Matthew Knepley wrote: >>>> >>>>> On Tue, Mar 5, 2013 at 10:20 AM, Dharmendar Reddy < >>>>> dharmareddy84 at gmail.com> wrote: >>>>> >>>>>> Thanks, so numDof is basically number of dof per topological entity >>>>>> of a cell. Did i get this right ? >>>>>> >>>>> >>>>> Yes, dof per field per topological entity (sieve point depth). >>>>> >>>>> Matt >>>>> >>>>> >>>>>> +! Let u be defined on vertices >>>>>> >>>>>> + numDof(0*(dim+1)+1) = 1 (should not be number of nodes) >>>>>> >>>>>> +! Let v be defined on cells >>>>>> >>>>>> + numDof(1*(dim+1)+dim+1) = dim >>>>>> >>>>>> +! Let v be defined on faces >>>>>> >>>>>> + numDof(2*(dim+1)+dim) = dim-1 (similarly, should not be number of faces time (dim-1)) >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> On Tue, Mar 5, 2013 at 9:06 AM, Matthew Knepley wrote: >>>>>> >>>>>>> On Tue, Mar 5, 2013 at 2:18 AM, Dharmendar Reddy < >>>>>>> dharmareddy84 at gmail.com> wrote: >>>>>>> >>>>>>>> Hello, >>>>>>>> >>>>>>>> Trying to understand the DMPlexCreateSection first. I have >>>>>>>> created a test case, can you please have a look at it? Actually the code >>>>>>>> has a link error on my system with petsc-dev. I used DMPlexeCreateBoxMesh >>>>>>>> to create the mesh. Looks like there is no Fortran interface to that >>>>>>>> function. If i comment out the dmplexcreateboxmesh. It does create and >>>>>>>> executable. >>>>>>>> >>>>>>> >>>>>>> I have now pushed your example, slightly changed, to the repository: >>>>>>> >>>>>>> src/dm/impls/plex/examples/tutorials/ex1.c/ex1f90.F >>>>>>> >>>>>>> and you can run with -dim 2 or -dim 3. >>>>>>> >>>>>>> Thanks, >>>>>>> >>>>>>> Matt >>>>>>> >>>>>>> >>>>>>>> petscDMTest_v2.o: In function `MAIN__': >>>>>>>> petscDMTest_v2.F90:(.text+0x9b): undefined reference to >>>>>>>> `dmplexcreateboxmesh_' >>>>>>>> make: [testDMMeshv2] Error 1 (ignored) >>>>>>>> >>>>>>>> Also, If include finclude/petsc.h90 instead of finclude/petsch.h i >>>>>>>> get compile error : >>>>>>>> >>>>>>>> petscDMTest_v2.F90(73): error #6691: A pointer dummy argument may >>>>>>>> only be argument a >>>>>>>> ssociated with a pointer. [NUMCOMP] >>>>>>>> call DMPlexCreateSection(dmMesh, topologyDim, numField, numComp, >>>>>>>> numDof, & >>>>>>>> ----------------------------------------------------------^ >>>>>>>> petscDMTest_v2.F90(73): error #6691: A pointer dummy argument may >>>>>>>> only be argument a >>>>>>>> ssociated with a pointer. [NUMDOF] >>>>>>>> call DMPlexCreateSection(dmMesh, topologyDim, numField, numComp, >>>>>>>> numDof, & >>>>>>>> -------------------------------------------------------------------^ >>>>>>>> petscDMTest_v2.F90(74): error #6691: A pointer dummy argument may >>>>>>>> only be argument a >>>>>>>> ssociated with a pointer. [BCFIELD] >>>>>>>> numBC, bcField, bcPointIS,section,ierr) >>>>>>>> ----------------------------------^ >>>>>>>> petscDMTest_v2.F90(74): error #6691: A pointer dummy argument may >>>>>>>> only be argument a >>>>>>>> ssociated with a pointer. [BCPOINTIS] >>>>>>>> numBC, bcField, bcPointIS,section,ierr) >>>>>>>> -------------------------------------------^ >>>>>>>> >>>>>>>> Please have a look at the attached test case and Makefile >>>>>>>> >>>>>>>> >>>>>>>> On Mon, Mar 4, 2013 at 7:39 PM, Matthew Knepley wrote: >>>>>>>> >>>>>>>>> On Mon, Mar 4, 2013 at 7:50 PM, Dharmendar Reddy < >>>>>>>>> dharmareddy84 at gmail.com> wrote: >>>>>>>>> >>>>>>>>>> Hello, >>>>>>>>>> Is there a DMPlex based fortran example for solving a >>>>>>>>>> pde such as laplace ? Even a c example will do. I am not able to understand >>>>>>>>>> the terminology of chart, cone etc. Is there a paper or user guide to learn >>>>>>>>>> more about the definitions of terms such as chart cone stratum ? I remember >>>>>>>>>> reading a presentation file by mathew about sieve. Is there a newer >>>>>>>>>> tutorial with terminology mapped to the new DMPlex/DMMesh functions. >>>>>>>>>> >>>>>>>>> >>>>>>>>> There is a fully worked out Stokes example (SNES ex62) and a >>>>>>>>> Finite Volume example (TS ex11), >>>>>>>>> and there are a few tests. You should not need much of that stuff >>>>>>>>> for defining a problem. I am >>>>>>>>> writing up a paper about ex11 right now. There is a short manual >>>>>>>>> section on unstructured grids as well. >>>>>>>>> >>>>>>>>> I think the key thing to understand is how to define a data layout >>>>>>>>> over the mesh using a PetscSection. >>>>>>>>> Once that is done, all the DM functions work as normal, and the >>>>>>>>> last hard part is coding your residual >>>>>>>>> loop. I have support for FEM schemes, but its undocumented and >>>>>>>>> slightly complex in order to allow >>>>>>>>> GPU assembly, so you may be more comfortable with your own element >>>>>>>>> loop to start. >>>>>>>>> >>>>>>>>> Thanks, >>>>>>>>> >>>>>>>>> Matt >>>>>>>>> >>>>>>>>> >>>>>>>>>> Thanks >>>>>>>>>> Reddy >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> -- >>>>>>>>>> ----------------------------------------------------- >>>>>>>>>> Dharmendar Reddy Palle >>>>>>>>>> Graduate Student >>>>>>>>>> Microelectronics Research center, >>>>>>>>>> University of Texas at Austin, >>>>>>>>>> 10100 Burnet Road, Bldg. 160 >>>>>>>>>> MER 2.608F, TX 78758-4445 >>>>>>>>>> e-mail: dharmareddy84 at gmail.com >>>>>>>>>> Phone: +1-512-350-9082 >>>>>>>>>> United States of America. >>>>>>>>>> Homepage: https://webspace.utexas.edu/~dpr342 >>>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> -- >>>>>>>>> What most experimenters take for granted before they begin their >>>>>>>>> experiments is infinitely more interesting than any results to which their >>>>>>>>> experiments lead. >>>>>>>>> -- Norbert Wiener >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> ----------------------------------------------------- >>>>>>>> Dharmendar Reddy Palle >>>>>>>> Graduate Student >>>>>>>> Microelectronics Research center, >>>>>>>> University of Texas at Austin, >>>>>>>> 10100 Burnet Road, Bldg. 160 >>>>>>>> MER 2.608F, TX 78758-4445 >>>>>>>> e-mail: dharmareddy84 at gmail.com >>>>>>>> Phone: +1-512-350-9082 >>>>>>>> United States of America. >>>>>>>> Homepage: https://webspace.utexas.edu/~dpr342 >>>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> What most experimenters take for granted before they begin their >>>>>>> experiments is infinitely more interesting than any results to which their >>>>>>> experiments lead. >>>>>>> -- Norbert Wiener >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> ----------------------------------------------------- >>>>>> Dharmendar Reddy Palle >>>>>> Graduate Student >>>>>> Microelectronics Research center, >>>>>> University of Texas at Austin, >>>>>> 10100 Burnet Road, Bldg. 160 >>>>>> MER 2.608F, TX 78758-4445 >>>>>> e-mail: dharmareddy84 at gmail.com >>>>>> Phone: +1-512-350-9082 >>>>>> United States of America. >>>>>> Homepage: https://webspace.utexas.edu/~dpr342 >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> What most experimenters take for granted before they begin their >>>>> experiments is infinitely more interesting than any results to which their >>>>> experiments lead. >>>>> -- Norbert Wiener >>>>> >>>> >>>> >>>> >>>> -- >>>> ----------------------------------------------------- >>>> Dharmendar Reddy Palle >>>> Graduate Student >>>> Microelectronics Research center, >>>> University of Texas at Austin, >>>> 10100 Burnet Road, Bldg. 160 >>>> MER 2.608F, TX 78758-4445 >>>> e-mail: dharmareddy84 at gmail.com >>>> Phone: +1-512-350-9082 >>>> United States of America. >>>> Homepage: https://webspace.utexas.edu/~dpr342 >>>> >>> >>> >>> >>> -- >>> ----------------------------------------------------- >>> Dharmendar Reddy Palle >>> Graduate Student >>> Microelectronics Research center, >>> University of Texas at Austin, >>> 10100 Burnet Road, Bldg. 160 >>> MER 2.608F, TX 78758-4445 >>> e-mail: dharmareddy84 at gmail.com >>> Phone: +1-512-350-9082 >>> United States of America. >>> Homepage: https://webspace.utexas.edu/~dpr342 >>> >> >> >> >> -- >> What most experimenters take for granted before they begin their >> experiments is infinitely more interesting than any results to which their >> experiments lead. >> -- Norbert Wiener >> > > > > -- > ----------------------------------------------------- > Dharmendar Reddy Palle > Graduate Student > Microelectronics Research center, > University of Texas at Austin, > 10100 Burnet Road, Bldg. 160 > MER 2.608F, TX 78758-4445 > e-mail: dharmareddy84 at gmail.com > Phone: +1-512-350-9082 > United States of America. > Homepage: https://webspace.utexas.edu/~dpr342 > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Wed Mar 13 18:08:09 2013 From: knepley at gmail.com (Matthew Knepley) Date: Wed, 13 Mar 2013 19:08:09 -0400 Subject: [petsc-users] DMPlex Fortran examples In-Reply-To: References: Message-ID: On Wed, Mar 13, 2013 at 7:07 PM, Matthew Knepley wrote: > On Wed, Mar 6, 2013 at 5:30 PM, Dharmendar Reddy wrote: > >> Hello Mathew, >> I created an example (tutorial like) for creating DM >> using cell list of a box mesh with quad cells (anti clockwise orientation >> for cell nodes). The Box mesh is created locally. I also included in >> comments explanations of cells, dimension, co-dimension based on my >> understanding. >> >> May be you can add some explanation for understanding the idea of >> stratum. >> >> >> I find that DMPlexComputeCellGeometry gives incorrect results for J, detJ >> and InvJ where as the same code that you used in >> DMPlexComputeRectangleGeometry_private gives correct answers when i >> evaluated those steps locally in the example code. >> > > This was my bug. I forgot to declare an F90 interface for that function. I > am including my changed version that worked for me. > I forgot to attach it. Matt > > Can you tell me how i should go about this: I create mesh in gmsh for my >> problem. The output of node coordinates, and connectivity which i use via >> DMcreateFromcelllist to create a DM. In gmsh i also assign physical ids to >> blokcs for region which i need to use for assigning material properties, >> boundary conditions. How do i include this information into DMPlex ? >> > > You use DMLabels. You can look at the implementation I use to read > ExodusII files in plexexodusii.c > > We have recently converted the repository to Git. If you clone the new > repository, and checkout the 'next' > branch, you will get my fix. If you want to see the latest DMPlex > development, I use the branch knepley/branch. > If you have any problems, feel free to mail because we are trying to make > it easy. There are directions online at > https://bitbucket.org/petsc/petsc/wiki/Home. > > I understood how to create a Petscsection for Feild data layout. Now i >> need to be able to access some auxilary data which is usually mesh positon >> dependent but given information. >> > > You can just create another one for this. I would make another DM using > DMPlexClone() and set the > PetscSection for the aux data as the default on that one. > > Thanks, > > Matt > > >> I have design my code interface such that the user needs to write the >> linear and blinear form with the DM, cell and basis functions as input. All >> the data dof and aux data is to be access via DM >> >> Please give me some pointers, i will digg to learn more. >> >> Thanks >> Reddy >> >> On Wed, Mar 6, 2013 at 4:51 AM, Matthew Knepley wrote: >> >>> On Wed, Mar 6, 2013 at 2:43 AM, Dharmendar Reddy < >>> dharmareddy84 at gmail.com> wrote: >>> >>>> I think i caught the issues, please see the reply inline below. It is >>>> not clear to me for which DMPlex i should include petsc.h90 or petsc.h >>>> >>>> Still need to fix the DMPlexComputeCellGeometry though >>>> >>>> >>>> On Tue, Mar 5, 2013 at 9:52 PM, Dharmendar Reddy < >>>> dharmareddy84 at gmail.com> wrote: >>>> >>>>> Hello, >>>>> >>>>> I am having trouble with a couple of DMPlex routines. >>>>> I was doing tests on various function calls that i may need to write >>>>> a test Poisson problem. >>>>> >>>>> First issue is with DMPlexComputeCellGeometry. For a rectangle cell >>>>> geometry, I get , v0, J, invJ, and detJ as zero. >>>>> >>>> >>> Geometric primitives of course depend on the way you specify a cell. >>> Simplicies are nice in >>> that you can only change the orientation, but hexes are harder. I >>> specify quads so that the >>> vertices go counter-clockwise around the boundary. Do you do this? If >>> so, can you send >>> a small example test that I can add to PETSc. >>> >>> >>>> DMPlexGetConeSize gives run time error >>>>> >>>>> I had to include petsc.h90 to fix this. >>>> >>> >>> I have fixed the manpage documentation to reflect this. >>> >>> >>>> >>>> DMPlexVecGetClosure gives runtime error, Should not this call be >>>>> DMPlexVecGetClosureF90 ? is there such interface ? I remember doing a >>>>> procedure like VecGetArrayF90 and VecRestoreArrayF90 when i had to pass >>>>> pointer which need to be restored. >>>>> >>>>> Looks like there is an inconsistency in interface defined on >>>> petsc-dev manual page. and the interface defined in >>>> finclude/ftn-custom/petscdmplex.h90 >>>> Fortran interface does not have the csize parameter defined below >>>> >>>> PetscErrorCode DMPlexVecGetClosure(DM dm, PetscSection section, Vec v, PetscInt point, PetscInt *csize, const PetscScalar *values[]) >>>> >>>> I have noted this on the manpage. >>> >>> Did you look at src/dm/impls/plex/examples/tests/ex2f90.F? It tests many >>> of these operations. >>> >>> Thanks, >>> >>> Matt >>> >>> >>>> >>>> >>>> I have attached test case with the make file and error.log. Please have >>>>> a look at it. >>>>> you need to run: >>>>> make all debug=0 >>>>> ./testDMView >>>>> >>>>> Also, I have trouble compiling the code with debug=1 which uses petsc >>>>> configured in debug mode everything else being same (you can see the >>>>> configure options in the error.log). >>>>> I get this error message: >>>>> login1$ make all debug=1 >>>>> make: *** /home1/00924/Reddy135/LocalApps/petsc-dev/mpi_rScalar: Is a >>>>> directory. Stop >>>>> . >>>>> >>>>> >>>>> >>>>> On Tue, Mar 5, 2013 at 9:22 AM, Matthew Knepley wrote: >>>>> >>>>>> On Tue, Mar 5, 2013 at 10:20 AM, Dharmendar Reddy < >>>>>> dharmareddy84 at gmail.com> wrote: >>>>>> >>>>>>> Thanks, so numDof is basically number of dof per topological entity >>>>>>> of a cell. Did i get this right ? >>>>>>> >>>>>> >>>>>> Yes, dof per field per topological entity (sieve point depth). >>>>>> >>>>>> Matt >>>>>> >>>>>> >>>>>>> +! Let u be defined on vertices >>>>>>> >>>>>>> + numDof(0*(dim+1)+1) = 1 (should not be number of nodes) >>>>>>> >>>>>>> +! Let v be defined on cells >>>>>>> >>>>>>> + numDof(1*(dim+1)+dim+1) = dim >>>>>>> >>>>>>> +! Let v be defined on faces >>>>>>> >>>>>>> + numDof(2*(dim+1)+dim) = dim-1 (similarly, should not be number of faces time (dim-1)) >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> On Tue, Mar 5, 2013 at 9:06 AM, Matthew Knepley wrote: >>>>>>> >>>>>>>> On Tue, Mar 5, 2013 at 2:18 AM, Dharmendar Reddy < >>>>>>>> dharmareddy84 at gmail.com> wrote: >>>>>>>> >>>>>>>>> Hello, >>>>>>>>> >>>>>>>>> Trying to understand the DMPlexCreateSection first. I >>>>>>>>> have created a test case, can you please have a look at it? Actually the >>>>>>>>> code has a link error on my system with petsc-dev. I used >>>>>>>>> DMPlexeCreateBoxMesh to create the mesh. Looks like there is no Fortran >>>>>>>>> interface to that function. If i comment out the dmplexcreateboxmesh. It >>>>>>>>> does create and executable. >>>>>>>>> >>>>>>>> >>>>>>>> I have now pushed your example, slightly changed, to the repository: >>>>>>>> >>>>>>>> src/dm/impls/plex/examples/tutorials/ex1.c/ex1f90.F >>>>>>>> >>>>>>>> and you can run with -dim 2 or -dim 3. >>>>>>>> >>>>>>>> Thanks, >>>>>>>> >>>>>>>> Matt >>>>>>>> >>>>>>>> >>>>>>>>> petscDMTest_v2.o: In function `MAIN__': >>>>>>>>> petscDMTest_v2.F90:(.text+0x9b): undefined reference to >>>>>>>>> `dmplexcreateboxmesh_' >>>>>>>>> make: [testDMMeshv2] Error 1 (ignored) >>>>>>>>> >>>>>>>>> Also, If include finclude/petsc.h90 instead of finclude/petsch.h i >>>>>>>>> get compile error : >>>>>>>>> >>>>>>>>> petscDMTest_v2.F90(73): error #6691: A pointer dummy argument may >>>>>>>>> only be argument a >>>>>>>>> ssociated with a pointer. [NUMCOMP] >>>>>>>>> call DMPlexCreateSection(dmMesh, topologyDim, numField, numComp, >>>>>>>>> numDof, & >>>>>>>>> ----------------------------------------------------------^ >>>>>>>>> petscDMTest_v2.F90(73): error #6691: A pointer dummy argument may >>>>>>>>> only be argument a >>>>>>>>> ssociated with a pointer. [NUMDOF] >>>>>>>>> call DMPlexCreateSection(dmMesh, topologyDim, numField, numComp, >>>>>>>>> numDof, & >>>>>>>>> >>>>>>>>> -------------------------------------------------------------------^ >>>>>>>>> petscDMTest_v2.F90(74): error #6691: A pointer dummy argument may >>>>>>>>> only be argument a >>>>>>>>> ssociated with a pointer. [BCFIELD] >>>>>>>>> numBC, bcField, bcPointIS,section,ierr) >>>>>>>>> ----------------------------------^ >>>>>>>>> petscDMTest_v2.F90(74): error #6691: A pointer dummy argument may >>>>>>>>> only be argument a >>>>>>>>> ssociated with a pointer. [BCPOINTIS] >>>>>>>>> numBC, bcField, bcPointIS,section,ierr) >>>>>>>>> -------------------------------------------^ >>>>>>>>> >>>>>>>>> Please have a look at the attached test case and Makefile >>>>>>>>> >>>>>>>>> >>>>>>>>> On Mon, Mar 4, 2013 at 7:39 PM, Matthew Knepley >>>>>>>> > wrote: >>>>>>>>> >>>>>>>>>> On Mon, Mar 4, 2013 at 7:50 PM, Dharmendar Reddy < >>>>>>>>>> dharmareddy84 at gmail.com> wrote: >>>>>>>>>> >>>>>>>>>>> Hello, >>>>>>>>>>> Is there a DMPlex based fortran example for solving a >>>>>>>>>>> pde such as laplace ? Even a c example will do. I am not able to understand >>>>>>>>>>> the terminology of chart, cone etc. Is there a paper or user guide to learn >>>>>>>>>>> more about the definitions of terms such as chart cone stratum ? I remember >>>>>>>>>>> reading a presentation file by mathew about sieve. Is there a newer >>>>>>>>>>> tutorial with terminology mapped to the new DMPlex/DMMesh functions. >>>>>>>>>>> >>>>>>>>>> >>>>>>>>>> There is a fully worked out Stokes example (SNES ex62) and a >>>>>>>>>> Finite Volume example (TS ex11), >>>>>>>>>> and there are a few tests. You should not need much of that stuff >>>>>>>>>> for defining a problem. I am >>>>>>>>>> writing up a paper about ex11 right now. There is a short manual >>>>>>>>>> section on unstructured grids as well. >>>>>>>>>> >>>>>>>>>> I think the key thing to understand is how to define a data >>>>>>>>>> layout over the mesh using a PetscSection. >>>>>>>>>> Once that is done, all the DM functions work as normal, and the >>>>>>>>>> last hard part is coding your residual >>>>>>>>>> loop. I have support for FEM schemes, but its undocumented and >>>>>>>>>> slightly complex in order to allow >>>>>>>>>> GPU assembly, so you may be more comfortable with your own >>>>>>>>>> element loop to start. >>>>>>>>>> >>>>>>>>>> Thanks, >>>>>>>>>> >>>>>>>>>> Matt >>>>>>>>>> >>>>>>>>>> >>>>>>>>>>> Thanks >>>>>>>>>>> Reddy >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> -- >>>>>>>>>>> ----------------------------------------------------- >>>>>>>>>>> Dharmendar Reddy Palle >>>>>>>>>>> Graduate Student >>>>>>>>>>> Microelectronics Research center, >>>>>>>>>>> University of Texas at Austin, >>>>>>>>>>> 10100 Burnet Road, Bldg. 160 >>>>>>>>>>> MER 2.608F, TX 78758-4445 >>>>>>>>>>> e-mail: dharmareddy84 at gmail.com >>>>>>>>>>> Phone: +1-512-350-9082 >>>>>>>>>>> United States of America. >>>>>>>>>>> Homepage: https://webspace.utexas.edu/~dpr342 >>>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> -- >>>>>>>>>> What most experimenters take for granted before they begin their >>>>>>>>>> experiments is infinitely more interesting than any results to which their >>>>>>>>>> experiments lead. >>>>>>>>>> -- Norbert Wiener >>>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> -- >>>>>>>>> ----------------------------------------------------- >>>>>>>>> Dharmendar Reddy Palle >>>>>>>>> Graduate Student >>>>>>>>> Microelectronics Research center, >>>>>>>>> University of Texas at Austin, >>>>>>>>> 10100 Burnet Road, Bldg. 160 >>>>>>>>> MER 2.608F, TX 78758-4445 >>>>>>>>> e-mail: dharmareddy84 at gmail.com >>>>>>>>> Phone: +1-512-350-9082 >>>>>>>>> United States of America. >>>>>>>>> Homepage: https://webspace.utexas.edu/~dpr342 >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> What most experimenters take for granted before they begin their >>>>>>>> experiments is infinitely more interesting than any results to which their >>>>>>>> experiments lead. >>>>>>>> -- Norbert Wiener >>>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> ----------------------------------------------------- >>>>>>> Dharmendar Reddy Palle >>>>>>> Graduate Student >>>>>>> Microelectronics Research center, >>>>>>> University of Texas at Austin, >>>>>>> 10100 Burnet Road, Bldg. 160 >>>>>>> MER 2.608F, TX 78758-4445 >>>>>>> e-mail: dharmareddy84 at gmail.com >>>>>>> Phone: +1-512-350-9082 >>>>>>> United States of America. >>>>>>> Homepage: https://webspace.utexas.edu/~dpr342 >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> What most experimenters take for granted before they begin their >>>>>> experiments is infinitely more interesting than any results to which their >>>>>> experiments lead. >>>>>> -- Norbert Wiener >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> ----------------------------------------------------- >>>>> Dharmendar Reddy Palle >>>>> Graduate Student >>>>> Microelectronics Research center, >>>>> University of Texas at Austin, >>>>> 10100 Burnet Road, Bldg. 160 >>>>> MER 2.608F, TX 78758-4445 >>>>> e-mail: dharmareddy84 at gmail.com >>>>> Phone: +1-512-350-9082 >>>>> United States of America. >>>>> Homepage: https://webspace.utexas.edu/~dpr342 >>>>> >>>> >>>> >>>> >>>> -- >>>> ----------------------------------------------------- >>>> Dharmendar Reddy Palle >>>> Graduate Student >>>> Microelectronics Research center, >>>> University of Texas at Austin, >>>> 10100 Burnet Road, Bldg. 160 >>>> MER 2.608F, TX 78758-4445 >>>> e-mail: dharmareddy84 at gmail.com >>>> Phone: +1-512-350-9082 >>>> United States of America. >>>> Homepage: https://webspace.utexas.edu/~dpr342 >>>> >>> >>> >>> >>> -- >>> What most experimenters take for granted before they begin their >>> experiments is infinitely more interesting than any results to which their >>> experiments lead. >>> -- Norbert Wiener >>> >> >> >> >> -- >> ----------------------------------------------------- >> Dharmendar Reddy Palle >> Graduate Student >> Microelectronics Research center, >> University of Texas at Austin, >> 10100 Burnet Road, Bldg. 160 >> MER 2.608F, TX 78758-4445 >> e-mail: dharmareddy84 at gmail.com >> Phone: +1-512-350-9082 >> United States of America. >> Homepage: https://webspace.utexas.edu/~dpr342 >> > > > > -- > What most experimenters take for granted before they begin their > experiments is infinitely more interesting than any results to which their > experiments lead. > -- Norbert Wiener > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: testDMView.F90 Type: application/octet-stream Size: 8315 bytes Desc: not available URL: From jedbrown at mcs.anl.gov Wed Mar 13 19:13:39 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Wed, 13 Mar 2013 19:13:39 -0500 Subject: [petsc-users] DMPlex Fortran examples In-Reply-To: References: Message-ID: On Wed, Mar 13, 2013 at 6:07 PM, Matthew Knepley wrote: > If you want to see the latest DMPlex development, I use the branch > knepley/branch. The branch name is 'knepley/plex'. After cloning PETSc, you can see it by running $ git checkout knepley/plex and update later with $ git pull -------------- next part -------------- An HTML attachment was scrubbed... URL: From jedbrown at mcs.anl.gov Wed Mar 13 19:19:56 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Wed, 13 Mar 2013 19:19:56 -0500 Subject: [petsc-users] possible error In-Reply-To: References: Message-ID: On Wed, Mar 13, 2013 at 4:21 PM, Nachiket Gokhale wrote: > I am getting the error at the end of the email only in optimized mode. > Output of -on_error_attach_debugger and "where" is at the end of this > email. Running through valgrind in debug mode doesn't show up any > memory misuse on my part. Does this seem to be something in petsc? > > -Nachiket > > 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: configure using --with-debugging=yes, recompile, link, and > run > Is it says here, reconfigure --with-debugging=yes. The trace is not very useful without line numbers. Also provide steps to reproduce. > [0]PETSC ERROR: to get more information on the crash. > [0]PETSC ERROR: User provided function() line 0 in unknown directory > unknown file > [0]PETSC ERROR: PETSC: Attaching gdb to > /home/gokhale/WAIGEN/GDEB-WAIGEN2012/bin/waigen of pid 8458 on display > :47.0 on machine asd1.wai.com > > > #0 0x0000003caccaba50 in __nanosleep_nocancel () from /lib64/libc.so.6 > #1 0x0000003caccab8e0 in sleep () from /lib64/libc.so.6 > #2 0x00007f715f45f67f in PetscSleep () > from > /opt/petsc/petsc-hg/linux-gcc-gpp-mpich-mumps-complex/lib/libpetsc.so > #3 0x00007f715f4982db in PetscAttachDebugger () > from > /opt/petsc/petsc-hg/linux-gcc-gpp-mpich-mumps-complex/lib/libpetsc.so > #4 0x00007f715f49834b in PetscAttachDebuggerErrorHandler () > from > /opt/petsc/petsc-hg/linux-gcc-gpp-mpich-mumps-complex/lib/libpetsc.so > #5 0x00007f715f498df8 in PetscError () > from > /opt/petsc/petsc-hg/linux-gcc-gpp-mpich-mumps-complex/lib/libpetsc.so > #6 0x00007f715f49d67e in PetscSignalHandlerDefault () > from > /opt/petsc/petsc-hg/linux-gcc-gpp-mpich-mumps-complex/lib/libpetsc.so > #7 0x00007f715f49d731 in PetscSignalHandler_Private(int) () > from > /opt/petsc/petsc-hg/linux-gcc-gpp-mpich-mumps-complex/lib/libpetsc.so > #8 > #9 0x00007f715f8bbcdb in MatTranspose_SeqAIJ(_p_Mat*, MatReuse, _p_Mat**) > () > from > /opt/petsc/petsc-hg/linux-gcc-gpp-mpich-mumps-complex/lib/libpetsc.so > #10 0x00007f715f57f05c in MatTranspose () > from > /opt/petsc/petsc-hg/linux-gcc-gpp-mpich-mumps-complex/lib/libpetsc.so > #11 0x000000000040ce03 in waigensolveepsnull(_p_Mat**, _p_Mat**, > _p_Mat**, _p_Vec**, int*, int*, int*, int*, PetscBool) () > #12 0x000000000040275f in main () > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gpau at lbl.gov Wed Mar 13 23:33:39 2013 From: gpau at lbl.gov (George Pau) Date: Wed, 13 Mar 2013 21:33:39 -0700 Subject: [petsc-users] ISGetIndicesF90 Message-ID: Hi, I am getting the following error when I used the above subroutine: Fortran runtime error: Pointer actual argument 'idx_ptr' is not associated The following is how the subroutine is called: IS :: is_global PetscScalar, pointer :: idx_ptr(:) PetscErrorCode :: pierr call ISGetIndicesF90(is_global,idx_ptr,pierr) I read on the command reference page that it doesn't work with some fortran compiler. I have gfortran 4.6.3 on Ubuntu machine. Could my fortran be the problem? I have tested ISGetIndices and it works. I really want to use ISGetIndicesF90 instead of ISGetIndices since I cannot do bound check with the later. Thanks, George -------------- next part -------------- An HTML attachment was scrubbed... URL: From balay at mcs.anl.gov Thu Mar 14 01:25:05 2013 From: balay at mcs.anl.gov (Satish Balay) Date: Thu, 14 Mar 2013 01:25:05 -0500 (CDT) Subject: [petsc-users] ISGetIndicesF90 In-Reply-To: References: Message-ID: Did you include 'petscis.h90' [or petsc.h90] in your code? Do the examples ex1f90.F and ex3f90.F in src/vec/is/is/examples/tutorials work for you? Satish On Wed, 13 Mar 2013, George Pau wrote: > Hi, > > I am getting the following error when I used the above subroutine: > > Fortran runtime error: Pointer actual argument 'idx_ptr' is not associated > > The following is how the subroutine is called: > > IS :: is_global > PetscScalar, pointer :: idx_ptr(:) > PetscErrorCode :: pierr > call ISGetIndicesF90(is_global,idx_ptr,pierr) > > I read on the command reference page that it doesn't work with some fortran > compiler. I have gfortran 4.6.3 on Ubuntu machine. Could my fortran be > the problem? I have tested ISGetIndices and it works. I really want to use > ISGetIndicesF90 instead of ISGetIndices since I cannot do bound check with > the later. > > Thanks, > George > From gokhalen at gmail.com Thu Mar 14 07:35:04 2013 From: gokhalen at gmail.com (Nachiket Gokhale) Date: Thu, 14 Mar 2013 08:35:04 -0400 Subject: [petsc-users] possible error In-Reply-To: References: Message-ID: On Wed, Mar 13, 2013 at 8:19 PM, Jed Brown wrote: > On Wed, Mar 13, 2013 at 4:21 PM, Nachiket Gokhale > wrote: >> >> I am getting the error at the end of the email only in optimized mode. >> Output of -on_error_attach_debugger and "where" is at the end of this >> email. Running through valgrind in debug mode doesn't show up any >> memory misuse on my part. Does this seem to be something in petsc? >> >> -Nachiket >> > > > Is it says here, reconfigure --with-debugging=yes. The trace is not very > useful without line numbers. Also provide steps to reproduce. > Let me see what I can do. I don't seem to get this error in debug mode; so I can't produce line numbers. -Nachiket From jedbrown at mcs.anl.gov Thu Mar 14 07:40:47 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Thu, 14 Mar 2013 07:40:47 -0500 Subject: [petsc-users] possible error In-Reply-To: References: Message-ID: On Thu, Mar 14, 2013 at 7:35 AM, Nachiket Gokhale wrote: > Let me see what I can do. I don't seem to get this error in debug > mode; so I can't produce line numbers. > ./configure --with-debugging=0 COPTFLAGS='-O0 -g3' PETSC_ARCH=whatever-optg That'll make the stack trace useful. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gpau at lbl.gov Thu Mar 14 11:39:56 2013 From: gpau at lbl.gov (George Pau) Date: Thu, 14 Mar 2013 09:39:56 -0700 Subject: [petsc-users] ISGetIndicesF90 Message-ID: Thank you Satish. My mistake for not including the appropriate header file (petscis.h90). Thanks, George -------------- next part -------------- An HTML attachment was scrubbed... URL: From s_g at berkeley.edu Thu Mar 14 13:28:57 2013 From: s_g at berkeley.edu (Sanjay Govindjee) Date: Thu, 14 Mar 2013 11:28:57 -0700 Subject: [petsc-users] Question on non-zero pattern Message-ID: <514216E9.7020901@berkeley.edu> Is there a mechanism for resetting a matrix's non-zero pattern? In particular, I have a preallocated a matrix, set the values, and assembled it. And used it to solve a problem. Now I would like to zero it, and reassemble it with a different non-zero pattern. Note the matrix has been preallocated so that it can accommodate both non-zero patterns. -sanjay From elafint.john at gmail.com Thu Mar 14 13:32:43 2013 From: elafint.john at gmail.com (John Mousel) Date: Thu, 14 Mar 2013 13:32:43 -0500 Subject: [petsc-users] Question on non-zero pattern In-Reply-To: <514216E9.7020901@berkeley.edu> References: <514216E9.7020901@berkeley.edu> Message-ID: Why not just put zeros in the composite non-zero pattern before you assemble it the first time? Then call MatZeroEntries whenever you want to reassemble. On Thu, Mar 14, 2013 at 1:28 PM, Sanjay Govindjee wrote: > Is there a mechanism for resetting a matrix's non-zero pattern? > > In particular, I have a preallocated a matrix, set the values, and > assembled it. > And used it to solve a problem. > > Now I would like to zero it, and reassemble it with a different non-zero > pattern. > Note the matrix has been preallocated so that it can accommodate both > non-zero > patterns. > > -sanjay > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gokhalen at gmail.com Thu Mar 14 13:39:21 2013 From: gokhalen at gmail.com (Nachiket Gokhale) Date: Thu, 14 Mar 2013 14:39:21 -0400 Subject: [petsc-users] possible error In-Reply-To: References: Message-ID: On Thu, Mar 14, 2013 at 8:40 AM, Jed Brown wrote: > > On Thu, Mar 14, 2013 at 7:35 AM, Nachiket Gokhale > wrote: >> >> Let me see what I can do. I don't seem to get this error in debug >> mode; so I can't produce line numbers. > > > ./configure --with-debugging=0 COPTFLAGS='-O0 -g3' PETSC_ARCH=whatever-optg > > That'll make the stack trace useful. I compiled with --with-debugging=0 --COPTFLAGS='-O0 -g3' --CXXOPTFLAGS='-O0 -g3' and I do not get the error. Am I to infer that it is an error in the optimization levels? I am using gcc-4.4.5 - perhaps I should try upgrading? -Nachiket From jedbrown at mcs.anl.gov Thu Mar 14 13:44:07 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Thu, 14 Mar 2013 13:44:07 -0500 Subject: [petsc-users] possible error In-Reply-To: References: Message-ID: On Thu, Mar 14, 2013 at 1:39 PM, Nachiket Gokhale wrote: > I compiled with --with-debugging=0 --COPTFLAGS='-O0 -g3' > --CXXOPTFLAGS='-O0 -g3' and I do not get the error. Am I to infer > that it is an error in the optimization levels? I am using gcc-4.4.5 > - perhaps I should try upgrading? > I would try upgrading, yes. It's also possible that the code is buggy and relies on some undefined behavior. Newer compilers are more likely to tell you about that, but it's no guarantee. I would also try an incremental approach, e.g., COPTFLAGS='-O1 -g'. Debugging at optimization without debugging symbols is hard enough already, doing it over email isn't really practical. -------------- next part -------------- An HTML attachment was scrubbed... URL: From rlmackie862 at gmail.com Thu Mar 14 13:49:06 2013 From: rlmackie862 at gmail.com (Randall Mackie) Date: Thu, 14 Mar 2013 11:49:06 -0700 Subject: [petsc-users] possible error In-Reply-To: References: Message-ID: Nachiket, I've run into a similar situation before, where my code ran fine in debug mode, bombed out with segmentation violation in optimize mode, and yet I couldn't find anything in valgrind. In my case, I eventually tracked it down to some variable not being broadcast to all processors, and so that variable would often take some weird value on some processor. I tracked it down by putting in a goto statement (that would go to the end of the code and PetscFinalize) early in my code, and if it ran fine, then I'd move the goto statement down further in the code, and then keep moving it until the program bombed, and this helped me track it down the issue. Also, if you run on just 1 processor do you see the same behavior? Randy M. On Mar 14, 2013, at 11:39 AM, Nachiket Gokhale wrote: > On Thu, Mar 14, 2013 at 8:40 AM, Jed Brown wrote: >> >> On Thu, Mar 14, 2013 at 7:35 AM, Nachiket Gokhale >> wrote: >>> >>> Let me see what I can do. I don't seem to get this error in debug >>> mode; so I can't produce line numbers. >> >> >> ./configure --with-debugging=0 COPTFLAGS='-O0 -g3' PETSC_ARCH=whatever-optg >> >> That'll make the stack trace useful. > > I compiled with --with-debugging=0 --COPTFLAGS='-O0 -g3' > --CXXOPTFLAGS='-O0 -g3' and I do not get the error. Am I to infer > that it is an error in the optimization levels? I am using gcc-4.4.5 > - perhaps I should try upgrading? > > -Nachiket From tibo at berkeley.edu Thu Mar 14 13:52:26 2013 From: tibo at berkeley.edu (Thibault Faney) Date: Thu, 14 Mar 2013 14:52:26 -0400 Subject: [petsc-users] Reuse symbolic factorization with petsc - mumps Message-ID: Hi, I am using the cray-petsc implementation on the NERSC system. Specifically, I have implemented a runge kutta solver, and I need to solve a linear system Ax = b several times per time step. I am using PETSC to interface with the MUMPS solver for direct factorization. The matrix A is constant over a whole time step, but changes at each time step. What I do now is that at the beginning of each time step, I compute the matrix A, use the MUMPS solver to compute a LU factorization of A, and then use KSPSolve to solve each linear system during the same time step. Here is an example of the succession of calls (inspired from example ex52. c): Once per time step: call KSPSetOperators(KSP_A, A, A, DIFFERENT_NONZERO_PATTERN, ierr) call KSPSetType(KSP_A, KSPPREONLY, ierr); call KSPGetPC(KSP_A, PC_A, ierr) call KSPSetTolerances(KSP_A, 1.d-20, PETSC_DEFAULT_DOUBLE_PRECISION, PETSC_DEFAULT_DOUBLE_PRECISION, PETSC_DEFAULT_INTEGER, ierr) call PCSetType(PC_A, PCLU, ierr) call PCFactorSetMatSolverPackage(PC_A, MATSOLVERMUMPS, ierr) call PCFactorSetUpMatSolverPackage(PC_A, ierr) call PCFactorGetMatrix(PC_A, PC_A, ierr) call MatMumpsSetIcntl(PC_A, 7, 5, ierr) call PCSetup(PC_A, ierr) call KSPSetUp(KSP_A, ierr) Then several times per time step: call KSPSolve( KSP_A, b, x, ierr) This works fine. However, I am able to precompute the maximal sparsity pattern of A before the time iterations. Therefore, I would like to use this information by precomputing the symbolic factorization before the time iterations start, and only compute the numerical factorization at each time step. Is there a way to use MUMPS in PETSC to do this ? I would appreciate any help/reference on this topic. Thank you, Tibo -------------- next part -------------- An HTML attachment was scrubbed... URL: From hzhang at mcs.anl.gov Thu Mar 14 14:29:13 2013 From: hzhang at mcs.anl.gov (Hong Zhang) Date: Thu, 14 Mar 2013 14:29:13 -0500 Subject: [petsc-users] Reuse symbolic factorization with petsc - mumps In-Reply-To: References: Message-ID: Tibo: Replace call KSPSetOperators(KSP_A, A, A, DIFFERENT_NONZERO_PATTERN, ierr) with call KSPSetOperators(KSP_A, A, A, SAME_NONZERO_PATTERN, ierr) Run your code with option '-log_summary' to see the number of calling MatLUSymbolic() and MatLUNumeric(). Hong > > I am using the cray-petsc implementation on the NERSC system. Specifically, > I have implemented a runge kutta solver, and I need to solve a linear system > Ax = b several times per time step. I am using PETSC to interface with the > MUMPS solver for direct factorization. > > The matrix A is constant over a whole time step, but changes at each time > step. What I do now is that at the beginning of each time step, I compute > the matrix A, use the MUMPS solver to compute a LU factorization of A, and > then use KSPSolve to solve each linear system during the same time step. > Here is an example of the succession of calls (inspired from example > ex52.c): > > Once per time step: > call KSPSetOperators(KSP_A, A, A, DIFFERENT_NONZERO_PATTERN, ierr) > call KSPSetType(KSP_A, KSPPREONLY, ierr); > call KSPGetPC(KSP_A, PC_A, ierr) > call KSPSetTolerances(KSP_A, 1.d-20, PETSC_DEFAULT_DOUBLE_PRECISION, > PETSC_DEFAULT_DOUBLE_PRECISION, PETSC_DEFAULT_INTEGER, ierr) > call PCSetType(PC_A, PCLU, ierr) > call PCFactorSetMatSolverPackage(PC_A, MATSOLVERMUMPS, ierr) > call PCFactorSetUpMatSolverPackage(PC_A, ierr) > call PCFactorGetMatrix(PC_A, PC_A, ierr) > call MatMumpsSetIcntl(PC_A, 7, 5, ierr) > call PCSetup(PC_A, ierr) > call KSPSetUp(KSP_A, ierr) > > Then several times per time step: > call KSPSolve( KSP_A, b, x, ierr) > > This works fine. > However, I am able to precompute the maximal sparsity pattern of A before > the time iterations. Therefore, I would like to use this information by > precomputing the symbolic factorization before the time iterations start, > and only compute the numerical factorization at each time step. Is there a > way to use MUMPS in PETSC to do this ? I would appreciate any help/reference > on this topic. > > Thank you, > > Tibo From gokhalen at gmail.com Thu Mar 14 14:37:47 2013 From: gokhalen at gmail.com (Nachiket Gokhale) Date: Thu, 14 Mar 2013 15:37:47 -0400 Subject: [petsc-users] possible error Message-ID: > > ------------------------------ > > Message: 5 > Date: Thu, 14 Mar 2013 11:49:06 -0700 > From: Randall Mackie > To: PETSc users list > Subject: Re: [petsc-users] possible error > Message-ID: > Content-Type: text/plain; charset=us-ascii > > Nachiket, > > I've run into a similar situation before, where my code ran fine in debug mode, bombed out with segmentation violation > in optimize mode, and yet I couldn't find anything in valgrind. In my case, I eventually tracked it down to some variable > not being broadcast to all processors, and so that variable would often take some weird value on some processor. > I tracked it down by putting in a goto statement (that would go to the end of the code and PetscFinalize) early in my code, > and if it ran fine, then I'd move the goto statement down further in the code, and then keep moving it > until the program bombed, and this helped me track it down the issue. Also, if you run on just 1 processor do you see the same > behavior? > > Randy M. Hi Randy, Thanks for your message. I see the same behavior on one processor. I'm upgrading gcc right now; if that does not fix it - I will try to track it down using your method. -Nachiket From s_g at berkeley.edu Thu Mar 14 14:50:17 2013 From: s_g at berkeley.edu (Sanjay Govindjee) Date: Thu, 14 Mar 2013 12:50:17 -0700 Subject: [petsc-users] Question on non-zero pattern In-Reply-To: <514216E9.7020901@berkeley.edu> References: <514216E9.7020901@berkeley.edu> Message-ID: <514229F9.7050904@berkeley.edu> Found my answer, use call MatSetOption(Kmat,MAT_NEW_NONZERO_LOCATIONS,PETSC_TRUE,ierr) after the MatAssemblyEnd( ). On 3/14/13 11:28 AM, Sanjay Govindjee wrote: > Is there a mechanism for resetting a matrix's non-zero pattern? > > In particular, I have a preallocated a matrix, set the values, and > assembled it. > And used it to solve a problem. > > Now I would like to zero it, and reassemble it with a different > non-zero pattern. > Note the matrix has been preallocated so that it can accommodate both > non-zero > patterns. > > -sanjay -- ----------------------------------------------- Sanjay Govindjee, PhD, PE Professor of Civil Engineering Vice Chair for Academic Affairs 779 Davis Hall Structural Engineering, Mechanics and Materials Department of Civil Engineering University of California Berkeley, CA 94720-1710 Voice: +1 510 642 6060 FAX: +1 510 643 5264 s_g at berkeley.edu http://www.ce.berkeley.edu/~sanjay ----------------------------------------------- New Books: Engineering Mechanics of Deformable Solids: A Presentation with Exercises http://www.oup.com/us/catalog/general/subject/Physics/MaterialsScience/?view=usa&ci=9780199651641 http://ukcatalogue.oup.com/product/9780199651641.do http://amzn.com/0199651647 Engineering Mechanics 3 (Dynamics) http://www.springer.com/materials/mechanics/book/978-3-642-14018-1 http://amzn.com/3642140181 ----------------------------------------------- From balay at mcs.anl.gov Thu Mar 14 14:52:56 2013 From: balay at mcs.anl.gov (Satish Balay) Date: Thu, 14 Mar 2013 14:52:56 -0500 (CDT) Subject: [petsc-users] Question on non-zero pattern In-Reply-To: <514229F9.7050904@berkeley.edu> References: <514216E9.7020901@berkeley.edu> <514229F9.7050904@berkeley.edu> Message-ID: But you might have mallocs with the new nonzero structure. Its proably more efficient to destroy/create a new mat with the new structure. Satish On Thu, 14 Mar 2013, Sanjay Govindjee wrote: > Found my answer, use > > call MatSetOption(Kmat,MAT_NEW_NONZERO_LOCATIONS,PETSC_TRUE,ierr) > > after the MatAssemblyEnd( ). > > > On 3/14/13 11:28 AM, Sanjay Govindjee wrote: > > Is there a mechanism for resetting a matrix's non-zero pattern? > > > > In particular, I have a preallocated a matrix, set the values, and > > assembled it. > > And used it to solve a problem. > > > > Now I would like to zero it, and reassemble it with a different non-zero > > pattern. > > Note the matrix has been preallocated so that it can accommodate both > > non-zero > > patterns. > > > > -sanjay > > From s_g at berkeley.edu Thu Mar 14 14:56:51 2013 From: s_g at berkeley.edu (Sanjay Govindjee) Date: Thu, 14 Mar 2013 12:56:51 -0700 Subject: [petsc-users] Question on non-zero pattern In-Reply-To: References: <514216E9.7020901@berkeley.edu> <514229F9.7050904@berkeley.edu> Message-ID: <51422B83.7060803@berkeley.edu> When I pre-allocated, I preallocated sufficient on and off and off processor memory for all possible non-zero patterns. So I assume that there will not be any mallocs necessary. Or am I mis-understanding how the preallocation works? -sanjay On 3/14/13 12:52 PM, Satish Balay wrote: > But you might have mallocs with the new nonzero structure. Its proably > more efficient to destroy/create a new mat with the new structure. > > Satish > > On Thu, 14 Mar 2013, Sanjay Govindjee wrote: > >> Found my answer, use >> >> call MatSetOption(Kmat,MAT_NEW_NONZERO_LOCATIONS,PETSC_TRUE,ierr) >> >> after the MatAssemblyEnd( ). >> >> >> On 3/14/13 11:28 AM, Sanjay Govindjee wrote: >>> Is there a mechanism for resetting a matrix's non-zero pattern? >>> >>> In particular, I have a preallocated a matrix, set the values, and >>> assembled it. >>> And used it to solve a problem. >>> >>> Now I would like to zero it, and reassemble it with a different non-zero >>> pattern. >>> Note the matrix has been preallocated so that it can accommodate both >>> non-zero >>> patterns. >>> >>> -sanjay >> From tibo at berkeley.edu Thu Mar 14 14:52:16 2013 From: tibo at berkeley.edu (Thibault Faney) Date: Thu, 14 Mar 2013 15:52:16 -0400 Subject: [petsc-users] Reuse symbolic factorization with petsc - mumps In-Reply-To: References: Message-ID: Hong: thank you for your answer. I can replace DIFFERENT_NONZERO_PATTERN by SAME_NONZERO_PATTERN, however this will give me the wrong answer as the zero pattern changes from a time step to another (e.g. the matrix A at time step 1 has more zeros than at time step 2) . What I can precompute is the maximal non-zero pattern. Do you mean I should compute the facorization for the maximal zero pattern before time iterations and then use SAME_NONZERO_PATTERN during the iterations ? On Thu, Mar 14, 2013 at 3:29 PM, Hong Zhang wrote: > Tibo: > > Replace > call KSPSetOperators(KSP_A, A, A, DIFFERENT_NONZERO_PATTERN, ierr) > with > call KSPSetOperators(KSP_A, A, A, SAME_NONZERO_PATTERN, ierr) > > Run your code with option '-log_summary' to see the number of calling > MatLUSymbolic() and MatLUNumeric(). > > Hong > > > > > I am using the cray-petsc implementation on the NERSC system. > Specifically, > > I have implemented a runge kutta solver, and I need to solve a linear > system > > Ax = b several times per time step. I am using PETSC to interface with > the > > MUMPS solver for direct factorization. > > > > The matrix A is constant over a whole time step, but changes at each time > > step. What I do now is that at the beginning of each time step, I compute > > the matrix A, use the MUMPS solver to compute a LU factorization of A, > and > > then use KSPSolve to solve each linear system during the same time step. > > Here is an example of the succession of calls (inspired from example > > ex52.c): > > > > Once per time step: > > call KSPSetOperators(KSP_A, A, A, DIFFERENT_NONZERO_PATTERN, ierr) > > call KSPSetType(KSP_A, KSPPREONLY, ierr); > > call KSPGetPC(KSP_A, PC_A, ierr) > > call KSPSetTolerances(KSP_A, 1.d-20, PETSC_DEFAULT_DOUBLE_PRECISION, > > PETSC_DEFAULT_DOUBLE_PRECISION, PETSC_DEFAULT_INTEGER, ierr) > > call PCSetType(PC_A, PCLU, ierr) > > call PCFactorSetMatSolverPackage(PC_A, MATSOLVERMUMPS, ierr) > > call PCFactorSetUpMatSolverPackage(PC_A, ierr) > > call PCFactorGetMatrix(PC_A, PC_A, ierr) > > call MatMumpsSetIcntl(PC_A, 7, 5, ierr) > > call PCSetup(PC_A, ierr) > > call KSPSetUp(KSP_A, ierr) > > > > Then several times per time step: > > call KSPSolve( KSP_A, b, x, ierr) > > > > This works fine. > > However, I am able to precompute the maximal sparsity pattern of A before > > the time iterations. Therefore, I would like to use this information by > > precomputing the symbolic factorization before the time iterations start, > > and only compute the numerical factorization at each time step. Is there > a > > way to use MUMPS in PETSC to do this ? I would appreciate any > help/reference > > on this topic. > > > > Thank you, > > > > Tibo > -------------- next part -------------- An HTML attachment was scrubbed... URL: From balay at mcs.anl.gov Thu Mar 14 14:59:35 2013 From: balay at mcs.anl.gov (Satish Balay) Date: Thu, 14 Mar 2013 14:59:35 -0500 (CDT) Subject: [petsc-users] Question on non-zero pattern In-Reply-To: <51422B83.7060803@berkeley.edu> References: <514216E9.7020901@berkeley.edu> <514229F9.7050904@berkeley.edu> <51422B83.7060803@berkeley.edu> Message-ID: Only if you did MatSetValues(val=0) for those extra locations - the subsequent assembly will be efficient. You can alway verify with -info Satish On Thu, 14 Mar 2013, Sanjay Govindjee wrote: > When I pre-allocated, I preallocated sufficient on and off and off processor > memory for > all possible non-zero patterns. So I assume that there will not be any > mallocs necessary. > Or am I mis-understanding how the preallocation works? > > -sanjay > > > > On 3/14/13 12:52 PM, Satish Balay wrote: > > But you might have mallocs with the new nonzero structure. Its proably > > more efficient to destroy/create a new mat with the new structure. > > > > Satish > > > > On Thu, 14 Mar 2013, Sanjay Govindjee wrote: > > > > > Found my answer, use > > > > > > call > > > MatSetOption(Kmat,MAT_NEW_NONZERO_LOCATIONS,PETSC_TRUE,ierr) > > > > > > after the MatAssemblyEnd( ). > > > > > > > > > On 3/14/13 11:28 AM, Sanjay Govindjee wrote: > > > > Is there a mechanism for resetting a matrix's non-zero pattern? > > > > > > > > In particular, I have a preallocated a matrix, set the values, and > > > > assembled it. > > > > And used it to solve a problem. > > > > > > > > Now I would like to zero it, and reassemble it with a different non-zero > > > > pattern. > > > > Note the matrix has been preallocated so that it can accommodate both > > > > non-zero > > > > patterns. > > > > > > > > -sanjay > > > > > From jedbrown at mcs.anl.gov Thu Mar 14 14:59:34 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Thu, 14 Mar 2013 14:59:34 -0500 Subject: [petsc-users] Question on non-zero pattern In-Reply-To: <51422B83.7060803@berkeley.edu> References: <514216E9.7020901@berkeley.edu> <514229F9.7050904@berkeley.edu> <51422B83.7060803@berkeley.edu> Message-ID: On Thu, Mar 14, 2013 at 2:56 PM, Sanjay Govindjee wrote: > When I pre-allocated, I preallocated sufficient on and off and off > processor memory for > all possible non-zero patterns. So I assume that there will not be any > mallocs necessary. > Or am I mis-understanding how the preallocation works? > You need to _insert_ values there, otherwise they will be compressed out in the first assembly. It's not really the allocation that's expensive, it's the contiguous storage, which is important for performance elsewhere. If you insert explicit zeros the first time you assemble, then you won't need to set MAT_NEW_NONZERO_LOCATIONS. -------------- next part -------------- An HTML attachment was scrubbed... URL: From s_g at berkeley.edu Thu Mar 14 15:17:12 2013 From: s_g at berkeley.edu (Sanjay Govindjee) Date: Thu, 14 Mar 2013 13:17:12 -0700 Subject: [petsc-users] Question on non-zero pattern In-Reply-To: References: <514216E9.7020901@berkeley.edu> <514229F9.7050904@berkeley.edu> <51422B83.7060803@berkeley.edu> Message-ID: <51423048.3090004@berkeley.edu> Thanks. I think I will just destroy and reallocat when the pattern changes since filling with zeros will force me into a bit of awkward programming. On 3/14/13 12:59 PM, Satish Balay wrote: > Only if you did MatSetValues(val=0) for those extra locations - the > subsequent assembly will be efficient. > > You can alway verify with -info > > Satish > > On Thu, 14 Mar 2013, Sanjay Govindjee wrote: > >> When I pre-allocated, I preallocated sufficient on and off and off processor >> memory for >> all possible non-zero patterns. So I assume that there will not be any >> mallocs necessary. >> Or am I mis-understanding how the preallocation works? >> >> -sanjay >> >> >> >> On 3/14/13 12:52 PM, Satish Balay wrote: >>> But you might have mallocs with the new nonzero structure. Its proably >>> more efficient to destroy/create a new mat with the new structure. >>> >>> Satish >>> >>> On Thu, 14 Mar 2013, Sanjay Govindjee wrote: >>> >>>> Found my answer, use >>>> >>>> call >>>> MatSetOption(Kmat,MAT_NEW_NONZERO_LOCATIONS,PETSC_TRUE,ierr) >>>> >>>> after the MatAssemblyEnd( ). >>>> >>>> >>>> On 3/14/13 11:28 AM, Sanjay Govindjee wrote: >>>>> Is there a mechanism for resetting a matrix's non-zero pattern? >>>>> >>>>> In particular, I have a preallocated a matrix, set the values, and >>>>> assembled it. >>>>> And used it to solve a problem. >>>>> >>>>> Now I would like to zero it, and reassemble it with a different non-zero >>>>> pattern. >>>>> Note the matrix has been preallocated so that it can accommodate both >>>>> non-zero >>>>> patterns. >>>>> >>>>> -sanjay >> From hzhang at mcs.anl.gov Thu Mar 14 15:20:19 2013 From: hzhang at mcs.anl.gov (Hong Zhang) Date: Thu, 14 Mar 2013 15:20:19 -0500 Subject: [petsc-users] Reuse symbolic factorization with petsc - mumps In-Reply-To: References: Message-ID: On Thu, Mar 14, 2013 at 2:52 PM, Thibault Faney wrote: > Hong: > > thank you for your answer. > I can replace DIFFERENT_NONZERO_PATTERN by SAME_NONZERO_PATTERN, however > this will give me the wrong answer as the zero pattern changes from a time > step to another (e.g. the matrix A at time step 1 has more zeros than at > time step 2) . What I can precompute is the maximal non-zero pattern. Do you > mean I should compute the facorization for the maximal zero pattern before > time iterations and then use SAME_NONZERO_PATTERN during the iterations ? Yes. Hong > > > On Thu, Mar 14, 2013 at 3:29 PM, Hong Zhang wrote: >> >> Tibo: >> >> Replace >> call KSPSetOperators(KSP_A, A, A, DIFFERENT_NONZERO_PATTERN, ierr) >> with >> call KSPSetOperators(KSP_A, A, A, SAME_NONZERO_PATTERN, ierr) >> >> Run your code with option '-log_summary' to see the number of calling >> MatLUSymbolic() and MatLUNumeric(). >> >> Hong >> >> > >> > I am using the cray-petsc implementation on the NERSC system. >> > Specifically, >> > I have implemented a runge kutta solver, and I need to solve a linear >> > system >> > Ax = b several times per time step. I am using PETSC to interface with >> > the >> > MUMPS solver for direct factorization. >> > >> > The matrix A is constant over a whole time step, but changes at each >> > time >> > step. What I do now is that at the beginning of each time step, I >> > compute >> > the matrix A, use the MUMPS solver to compute a LU factorization of A, >> > and >> > then use KSPSolve to solve each linear system during the same time step. >> > Here is an example of the succession of calls (inspired from example >> > ex52.c): >> > >> > Once per time step: >> > call KSPSetOperators(KSP_A, A, A, DIFFERENT_NONZERO_PATTERN, ierr) >> > call KSPSetType(KSP_A, KSPPREONLY, ierr); >> > call KSPGetPC(KSP_A, PC_A, ierr) >> > call KSPSetTolerances(KSP_A, 1.d-20, PETSC_DEFAULT_DOUBLE_PRECISION, >> > PETSC_DEFAULT_DOUBLE_PRECISION, PETSC_DEFAULT_INTEGER, ierr) >> > call PCSetType(PC_A, PCLU, ierr) >> > call PCFactorSetMatSolverPackage(PC_A, MATSOLVERMUMPS, ierr) >> > call PCFactorSetUpMatSolverPackage(PC_A, ierr) >> > call PCFactorGetMatrix(PC_A, PC_A, ierr) >> > call MatMumpsSetIcntl(PC_A, 7, 5, ierr) >> > call PCSetup(PC_A, ierr) >> > call KSPSetUp(KSP_A, ierr) >> > >> > Then several times per time step: >> > call KSPSolve( KSP_A, b, x, ierr) >> > >> > This works fine. >> > However, I am able to precompute the maximal sparsity pattern of A >> > before >> > the time iterations. Therefore, I would like to use this information by >> > precomputing the symbolic factorization before the time iterations >> > start, >> > and only compute the numerical factorization at each time step. Is there >> > a >> > way to use MUMPS in PETSC to do this ? I would appreciate any >> > help/reference >> > on this topic. >> > >> > Thank you, >> > >> > Tibo > > From bsmith at mcs.anl.gov Thu Mar 14 15:36:05 2013 From: bsmith at mcs.anl.gov (Barry Smith) Date: Thu, 14 Mar 2013 15:36:05 -0500 Subject: [petsc-users] Question on non-zero pattern In-Reply-To: <51423048.3090004@berkeley.edu> References: <514216E9.7020901@berkeley.edu> <514229F9.7050904@berkeley.edu> <51422B83.7060803@berkeley.edu> <51423048.3090004@berkeley.edu> Message-ID: <5F8D86A8-1D71-4985-96E1-10BF36DA52FD@mcs.anl.gov> On Mar 14, 2013, at 3:17 PM, Sanjay Govindjee wrote: > Thanks. I think I will just destroy and reallocat when the pattern changes since > filling with zeros will force me into a bit of awkward programming. Before you ever generate the "real" values for the matrix, but after the preallocation call you could run over ALL the preallocated locations setting zeros and them call MatAssemblyBegin/End(). Now it is ready be be filled with any combination of "true" nonzero locations and you can call MatSetValues() on the just the first set of "true" non zeros and the MatAssemblyBegin/End() then repeat for the second set of "true" non zeros etc. Barry > > On 3/14/13 12:59 PM, Satish Balay wrote: >> Only if you did MatSetValues(val=0) for those extra locations - the >> subsequent assembly will be efficient. >> >> You can alway verify with -info >> >> Satish >> >> On Thu, 14 Mar 2013, Sanjay Govindjee wrote: >> >>> When I pre-allocated, I preallocated sufficient on and off and off processor >>> memory for >>> all possible non-zero patterns. So I assume that there will not be any >>> mallocs necessary. >>> Or am I mis-understanding how the preallocation works? >>> >>> -sanjay >>> >>> >>> >>> On 3/14/13 12:52 PM, Satish Balay wrote: >>>> But you might have mallocs with the new nonzero structure. Its proably >>>> more efficient to destroy/create a new mat with the new structure. >>>> >>>> Satish >>>> >>>> On Thu, 14 Mar 2013, Sanjay Govindjee wrote: >>>> >>>>> Found my answer, use >>>>> >>>>> call >>>>> MatSetOption(Kmat,MAT_NEW_NONZERO_LOCATIONS,PETSC_TRUE,ierr) >>>>> >>>>> after the MatAssemblyEnd( ). >>>>> >>>>> >>>>> On 3/14/13 11:28 AM, Sanjay Govindjee wrote: >>>>>> Is there a mechanism for resetting a matrix's non-zero pattern? >>>>>> >>>>>> In particular, I have a preallocated a matrix, set the values, and >>>>>> assembled it. >>>>>> And used it to solve a problem. >>>>>> >>>>>> Now I would like to zero it, and reassemble it with a different non-zero >>>>>> pattern. >>>>>> Note the matrix has been preallocated so that it can accommodate both >>>>>> non-zero >>>>>> patterns. >>>>>> >>>>>> -sanjay >>> > From tibo at berkeley.edu Thu Mar 14 15:44:50 2013 From: tibo at berkeley.edu (Thibault Faney) Date: Thu, 14 Mar 2013 16:44:50 -0400 Subject: [petsc-users] Reuse symbolic factorization with petsc - mumps In-Reply-To: References: Message-ID: Thank you this works perfectly. On Thu, Mar 14, 2013 at 4:20 PM, Hong Zhang wrote: > On Thu, Mar 14, 2013 at 2:52 PM, Thibault Faney wrote: > > Hong: > > > > thank you for your answer. > > I can replace DIFFERENT_NONZERO_PATTERN by SAME_NONZERO_PATTERN, however > > this will give me the wrong answer as the zero pattern changes from a > time > > step to another (e.g. the matrix A at time step 1 has more zeros than at > > time step 2) . What I can precompute is the maximal non-zero pattern. Do > you > > mean I should compute the facorization for the maximal zero pattern > before > > time iterations and then use SAME_NONZERO_PATTERN during the iterations ? > > Yes. > Hong > > > > > > On Thu, Mar 14, 2013 at 3:29 PM, Hong Zhang wrote: > >> > >> Tibo: > >> > >> Replace > >> call KSPSetOperators(KSP_A, A, A, DIFFERENT_NONZERO_PATTERN, ierr) > >> with > >> call KSPSetOperators(KSP_A, A, A, SAME_NONZERO_PATTERN, ierr) > >> > >> Run your code with option '-log_summary' to see the number of calling > >> MatLUSymbolic() and MatLUNumeric(). > >> > >> Hong > >> > >> > > >> > I am using the cray-petsc implementation on the NERSC system. > >> > Specifically, > >> > I have implemented a runge kutta solver, and I need to solve a linear > >> > system > >> > Ax = b several times per time step. I am using PETSC to interface with > >> > the > >> > MUMPS solver for direct factorization. > >> > > >> > The matrix A is constant over a whole time step, but changes at each > >> > time > >> > step. What I do now is that at the beginning of each time step, I > >> > compute > >> > the matrix A, use the MUMPS solver to compute a LU factorization of A, > >> > and > >> > then use KSPSolve to solve each linear system during the same time > step. > >> > Here is an example of the succession of calls (inspired from example > >> > ex52.c): > >> > > >> > Once per time step: > >> > call KSPSetOperators(KSP_A, A, A, DIFFERENT_NONZERO_PATTERN, ierr) > >> > call KSPSetType(KSP_A, KSPPREONLY, ierr); > >> > call KSPGetPC(KSP_A, PC_A, ierr) > >> > call KSPSetTolerances(KSP_A, 1.d-20, PETSC_DEFAULT_DOUBLE_PRECISION, > >> > PETSC_DEFAULT_DOUBLE_PRECISION, PETSC_DEFAULT_INTEGER, ierr) > >> > call PCSetType(PC_A, PCLU, ierr) > >> > call PCFactorSetMatSolverPackage(PC_A, MATSOLVERMUMPS, ierr) > >> > call PCFactorSetUpMatSolverPackage(PC_A, ierr) > >> > call PCFactorGetMatrix(PC_A, PC_A, ierr) > >> > call MatMumpsSetIcntl(PC_A, 7, 5, ierr) > >> > call PCSetup(PC_A, ierr) > >> > call KSPSetUp(KSP_A, ierr) > >> > > >> > Then several times per time step: > >> > call KSPSolve( KSP_A, b, x, ierr) > >> > > >> > This works fine. > >> > However, I am able to precompute the maximal sparsity pattern of A > >> > before > >> > the time iterations. Therefore, I would like to use this information > by > >> > precomputing the symbolic factorization before the time iterations > >> > start, > >> > and only compute the numerical factorization at each time step. Is > there > >> > a > >> > way to use MUMPS in PETSC to do this ? I would appreciate any > >> > help/reference > >> > on this topic. > >> > > >> > Thank you, > >> > > >> > Tibo > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jedbrown at mcs.anl.gov Sat Mar 16 17:26:58 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Sat, 16 Mar 2013 17:26:58 -0500 Subject: [petsc-users] odd SNES behavior In-Reply-To: References: <46F46D6E-0F42-4AE1-B794-AA9A97D40EF1@columbia.edu> <238DC882-A981-46F4-B3A7-12A2D6D0ABCA@mcs.anl.gov> <4F8532EE-09D7-411F-92AB-561634EA64A8@columbia.edu> <38A5C64A-B600-4395-843A-6DC4CE7D8D31@mcs.anl.gov> <99C18346-3C6E-4B2F-9443-1BBF671A7EAF@columbia.edu> <86B10F5C-6660-4F60-862B-A14C3644FCAC@mcs.anl.gov> <674CFF0D-3679-42D5-966E-A8979E130B79@mcs.anl.gov> <51EA347E-5969-4101-B903-CB21DEBAB1D9@columbia.edu> <761532E9-52A4-4D8E-B2DC-05402F3BBE96@columbia.edu> Message-ID: The associated change to fieldsplit is in 'next': https://bitbucket.org/petsc/petsc/commits/branch/jed/fieldsplit-use-amat On Mon, Mar 11, 2013 at 8:28 AM, Barry Smith wrote: > > Sorry should be UseAmat > > > On Mar 11, 2013, at 8:21 AM, "Mark F. Adams" > wrote: > > > Humm, I'm not seeing PCSetUserAmat: > > > > 09:14 ~/Codes/petsc-dev$ hg grep PCSetUserAmat > > src/docs/website/documentation/changes/dev.html:26440:
  • Merged > PCBJacobiSetUseTrueLocal(), -pc_bjacobi_true_local, PCKSPSetUseTrue(), > -pc_ksp_true, PCCompositeSetUseTrue() -pc_composite_true to > PCSetUserAmat(), -pc_use_amat. > > > > > > > > On Mar 8, 2013, at 10:27 AM, Barry Smith wrote: > > > >> > >> On Mar 8, 2013, at 9:23 AM, "Mark F. Adams" > wrote: > >> > >>>> > >>>> I have merged PCBJacobiSetUseTrueLocal(), -pc_bjacobi_true_local, > PCKSPSetUseTrue(), -pc_ksp_true, PCCompositeSetUseTrue() -pc_composite_true > to PCSetUserAmat(), -pc_use_amat in petsc-dev. > >>>> > >>>> Note that other preconditioners, PCMG, PCFieldSplit, PCASM, PCGASM > should adopt the same flag but I will leave that to Mark and Jed. > >>> > >>> GAMG's problem comes from PCMG, do I need to do anything? > >> > >> Yes, modify the PCMG :-). > >>> > >>> other than make '-pc_use_amat false' because I would like to match > hypre semantics by default. > >> > >> It will be false by default. > >> > >> Barry > >> > >> > >> > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sonyablade2010 at hotmail.com Sun Mar 17 11:37:07 2013 From: sonyablade2010 at hotmail.com (Sonya Blade) Date: Sun, 17 Mar 2013 16:37:07 +0000 Subject: [petsc-users] Eigenvalue solver method in Petsc Message-ID: Dear All, I'm pretty new to the Petsc library, before going into installation hassle, I'd like to know is it possible solve common eigenvalue problems mainly? encountered in solid mechanics engineering such as Subspace iteration,Jacobi? method, simultaneous iteration, Stodola etc..with Petsc. Mainly those problems comes in stiffness and mass matrices form, where in general? they are symmetric and can be huge in size e.g 5000x5000. If it's possible to solve those type of problems with Petsc then is it? trouble free the installation of library with Gnu GCC and gfortran on Win64? Your help will be appreciated, REgards, From jedbrown at mcs.anl.gov Sun Mar 17 11:40:43 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Sun, 17 Mar 2013 11:40:43 -0500 Subject: [petsc-users] Eigenvalue solver method in Petsc In-Reply-To: References: Message-ID: On Sun, Mar 17, 2013 at 11:37 AM, Sonya Blade wrote: > > Dear All, > > I'm pretty new to the Petsc library, before going into installation hassle, > I'd like to know is it possible solve common eigenvalue problems mainly > encountered in solid mechanics engineering such as Subspace > iteration,Jacobi > method, simultaneous iteration, Stodola etc..with Petsc. > SLEPc is the eigensolver package build on PETSc. http://www.grycap.upv.es/slepc/ It is easy to install and use after installing PETSc. > > Mainly those problems comes in stiffness and mass matrices form, where in > general > they are symmetric and can be huge in size e.g 5000x5000. > > If it's possible to solve those type of problems with Petsc then is it > trouble free the installation of library with Gnu GCC and gfortran on > Win64? > Cygwin is required to build PETSc, but not to use it. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sonyablade2010 at hotmail.com Sun Mar 17 11:59:13 2013 From: sonyablade2010 at hotmail.com (Sonya Blade) Date: Sun, 17 Mar 2013 16:59:13 +0000 Subject: [petsc-users] Eigenvalue solver method in Petsc In-Reply-To: References: Message-ID: >SLEPc is the eigensolver package build on PETSc. >http://www.grycap.upv.es/slepc/ >It is easy to install and use after installing PETSc. So the Petsc can not solve it on its own w/o Slepc? >Cygwin is required to build PETSc, but not to use it. How about the MSys interface, which I've already installed. REgards, From jedbrown at mcs.anl.gov Sun Mar 17 12:05:18 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Sun, 17 Mar 2013 12:05:18 -0500 Subject: [petsc-users] Eigenvalue solver method in Petsc In-Reply-To: References: Message-ID: On Sun, Mar 17, 2013 at 11:59 AM, Sonya Blade wrote: > >SLEPc is the eigensolver package build on PETSc. > >http://www.grycap.upv.es/slepc/ > >It is easy to install and use after installing PETSc. > > So the Petsc can not solve it on its own w/o Slepc? > PETSc is not an eigensolver package. You can write an eigensolver using PETSc or you can use SLEPc. > > >Cygwin is required to build PETSc, but not to use it. > How about the MSys interface, which I've already installed. Not currently, as far as I know. -------------- next part -------------- An HTML attachment was scrubbed... URL: From s_g at berkeley.edu Sun Mar 17 13:43:52 2013 From: s_g at berkeley.edu (Sanjay Govindjee) Date: Sun, 17 Mar 2013 11:43:52 -0700 Subject: [petsc-users] Eigenvalue solver method in Petsc In-Reply-To: References: Message-ID: <51460EE8.6090906@berkeley.edu> For our FEA code we have used PETSc to solve mechanical eigen problems using subspace as well as parallel-ARPACK. It works well and is not that hard to program. Though we sort of cheat and have each processor solve the (same) small dense problem at the end. So there is a bit of waste in the simple implementation -- but it is minor for your average mechanical problem. On 3/17/13 9:37 AM, Sonya Blade wrote: > Dear All, > > I'm pretty new to the Petsc library, before going into installation hassle, > I'd like to know is it possible solve common eigenvalue problems mainly > encountered in solid mechanics engineering such as Subspace iteration,Jacobi > method, simultaneous iteration, Stodola etc..with Petsc. > > Mainly those problems comes in stiffness and mass matrices form, where in general > they are symmetric and can be huge in size e.g 5000x5000. > > If it's possible to solve those type of problems with Petsc then is it > trouble free the installation of library with Gnu GCC and gfortran on Win64? > > Your help will be appreciated, > > REgards, From sonyablade2010 at hotmail.com Sun Mar 17 14:40:18 2013 From: sonyablade2010 at hotmail.com (Sonya Blade) Date: Sun, 17 Mar 2013 19:40:18 +0000 Subject: [petsc-users] Eigenvalue solver method in Petsc In-Reply-To: References: Message-ID: >For our FEA code we have used PETSc to solve mechanical eigen problems using >subspace as well as parallel-ARPACK. It works well and is not that hard >to program. Which package exactly solved the subspace or you used them in conjunction? Can you give pseudo-code for that, for example do I have to call a set of functions or only the one function is associated with subspace iteration in? Petsc or Arpack? How about the other methods Jacobi, simultaneous iteration etc.. is it possible to use them in Petsc? >but it is minor for your average mechanical problem. If you call 5000x5000 matrix small I really wonder what you will call huge ? Regards, From balay at mcs.anl.gov Sun Mar 17 15:14:38 2013 From: balay at mcs.anl.gov (Satish Balay) Date: Sun, 17 Mar 2013 15:14:38 -0500 (CDT) Subject: [petsc-users] Eigenvalue solver method in Petsc In-Reply-To: References: Message-ID: On Sun, 17 Mar 2013, Jed Brown wrote: > > >Cygwin is required to build PETSc, but not to use it. > > How about the MSys interface, which I've already installed. > > Not currently, as far as I know. whats your compiler requirement? And why? thanks, Satish From sonyablade2010 at hotmail.com Sun Mar 17 15:41:55 2013 From: sonyablade2010 at hotmail.com (Sonya Blade) Date: Sun, 17 Mar 2013 20:41:55 +0000 Subject: [petsc-users] Eigenvalue solver method in Petsc In-Reply-To: References: , Message-ID: > > >Cygwin is required to build PETSc, but not to use it. > > How about the MSys interface, which I've already installed. > > Not currently, as far as I know. >whats your compiler requirement? And why? I use gfortran which ships with MinGW and with Msys I feel more comfortable. From balay at mcs.anl.gov Sun Mar 17 15:51:26 2013 From: balay at mcs.anl.gov (Satish Balay) Date: Sun, 17 Mar 2013 15:51:26 -0500 (CDT) Subject: [petsc-users] Eigenvalue solver method in Petsc In-Reply-To: References: , Message-ID: On Sun, 17 Mar 2013, Sonya Blade wrote: > > > >Cygwin is required to build PETSc, but not to use it. > > > How about the MSys interface, which I've already installed. > > > > Not currently, as far as I know. > > >whats your compiler requirement? And why? > I use gfortran which ships with MinGW and with Msys I feel more > comfortable. Are you looking at sequential use of PETSc - or parallel? I see mpich doesn't work with msys/mingw. You can try an install of petsc with msys - and see if it works. If not send us logs at petsc-maint. [its possible things won't work - and you would have to use cygwin/gfortran. Presumably it shouldn't conflict with your msys install] Satish From bsmith at mcs.anl.gov Sun Mar 17 17:32:14 2013 From: bsmith at mcs.anl.gov (Barry Smith) Date: Sun, 17 Mar 2013 17:32:14 -0500 Subject: [petsc-users] Eigenvalue solver method in Petsc In-Reply-To: References: , Message-ID: <2F032090-7375-435B-8DEB-FB7094A4461C@mcs.anl.gov> On Mar 17, 2013, at 3:51 PM, Satish Balay wrote: > On Sun, 17 Mar 2013, Sonya Blade wrote: > >>>>> Cygwin is required to build PETSc, but not to use it. >>>> How about the MSys interface, which I've already installed. >>> >>> Not currently, as far as I know. >> >>> whats your compiler requirement? And why? >> I use gfortran which ships with MinGW and with Msys I feel more >> comfortable. > > Are you looking at sequential use of PETSc - or parallel? I see mpich > doesn't work with msys/mingw. And why not. It is far more natural than cygwin. > > You can try an install of petsc with msys - and see if it works. If not send > us logs at petsc-maint. > > [its possible things won't work - and you would have to use > cygwin/gfortran. Presumably it shouldn't conflict with your msys > install] > > Satish From s_g at berkeley.edu Sun Mar 17 17:34:14 2013 From: s_g at berkeley.edu (Sanjay Govindjee) Date: Sun, 17 Mar 2013 15:34:14 -0700 Subject: [petsc-users] Eigenvalue solver method in Petsc In-Reply-To: References: Message-ID: <514644E6.3080403@berkeley.edu> Our FEA code has its own local serial solver which we use at the final step to solve the subspace etc. The serial solver is both direct and iterative (one chooses). One could just as easily use a PETSc solver -- serial or parallel. We did it this way since we had a legacy code that already had the algorithms programed up. To convert to parallel we only had to program the operator and inverse operator applications which we did with PETSc. On 3/17/13 12:40 PM, Sonya Blade wrote: > >> For our FEA code we have used PETSc to solve mechanical eigen problems using >> subspace as well as parallel-ARPACK. It works well and is not that hard >> to program. > Which package exactly solved the subspace or you used them in conjunction? > Can you give pseudo-code for that, for example do I have to call a set of > functions or only the one function is associated with subspace iteration in > Petsc or Arpack? > > How about the other methods Jacobi, simultaneous iteration etc.. is it possible > to use them in Petsc? > >> but it is minor for your average mechanical problem. > If you call 5000x5000 matrix small I really wonder what you will call huge ? > > Regards, > > > -- ----------------------------------------------- Sanjay Govindjee, PhD, PE Professor of Civil Engineering Vice Chair for Academic Affairs 779 Davis Hall Structural Engineering, Mechanics and Materials Department of Civil Engineering University of California Berkeley, CA 94720-1710 Voice: +1 510 642 6060 FAX: +1 510 643 5264 s_g at berkeley.edu http://www.ce.berkeley.edu/~sanjay ----------------------------------------------- New Books: Engineering Mechanics of Deformable Solids: A Presentation with Exercises http://www.oup.com/us/catalog/general/subject/Physics/MaterialsScience/?view=usa&ci=9780199651641 http://ukcatalogue.oup.com/product/9780199651641.do http://amzn.com/0199651647 Engineering Mechanics 3 (Dynamics) http://www.springer.com/materials/mechanics/book/978-3-642-14018-1 http://amzn.com/3642140181 ----------------------------------------------- From balay at mcs.anl.gov Sun Mar 17 17:37:40 2013 From: balay at mcs.anl.gov (Satish Balay) Date: Sun, 17 Mar 2013 17:37:40 -0500 (CDT) Subject: [petsc-users] Eigenvalue solver method in Petsc In-Reply-To: <2F032090-7375-435B-8DEB-FB7094A4461C@mcs.anl.gov> References: , <2F032090-7375-435B-8DEB-FB7094A4461C@mcs.anl.gov> Message-ID: On Sun, 17 Mar 2013, Barry Smith wrote: > > On Mar 17, 2013, at 3:51 PM, Satish Balay wrote: > > > On Sun, 17 Mar 2013, Sonya Blade wrote: > > > >>>>> Cygwin is required to build PETSc, but not to use it. > >>>> How about the MSys interface, which I've already installed. > >>> > >>> Not currently, as far as I know. > >> > >>> whats your compiler requirement? And why? > >> I use gfortran which ships with MinGW and with Msys I feel more > >> comfortable. > > > > Are you looking at sequential use of PETSc - or parallel? I see mpich > > doesn't work with msys/mingw. > > And why not. Sorry - forgot to post this link. http://lists.mcs.anl.gov/pipermail/mpich-discuss/2010-July/007458.html > It is far more natural than cygwin. How so? Even python [which is now considered a universal requirement?] doesn't compile on it. Satish > > > > > You can try an install of petsc with msys - and see if it works. If not send > > us logs at petsc-maint. > > > > [its possible things won't work - and you would have to use > > cygwin/gfortran. Presumably it shouldn't conflict with your msys > > install] > > > > Satish > > From bsmith at mcs.anl.gov Sun Mar 17 17:40:40 2013 From: bsmith at mcs.anl.gov (Barry Smith) Date: Sun, 17 Mar 2013 17:40:40 -0500 Subject: [petsc-users] Eigenvalue solver method in Petsc In-Reply-To: References: , <2F032090-7375-435B-8DEB-FB7094A4461C@mcs.anl.gov> Message-ID: On Mar 17, 2013, at 5:37 PM, Satish Balay wrote: > On Sun, 17 Mar 2013, Barry Smith wrote: > >> >> On Mar 17, 2013, at 3:51 PM, Satish Balay wrote: >> >>> On Sun, 17 Mar 2013, Sonya Blade wrote: >>> >>>>>>> Cygwin is required to build PETSc, but not to use it. >>>>>> How about the MSys interface, which I've already installed. >>>>> >>>>> Not currently, as far as I know. >>>> >>>>> whats your compiler requirement? And why? >>>> I use gfortran which ships with MinGW and with Msys I feel more >>>> comfortable. >>> >>> Are you looking at sequential use of PETSc - or parallel? I see mpich >>> doesn't work with msys/mingw. >> >> And why not. > > Sorry - forgot to post this link. > http://lists.mcs.anl.gov/pipermail/mpich-discuss/2010-July/007458.html > >> It is far more natural than cygwin. > > How so? Even python [which is now considered a universal requirement?] doesn't compile on it. Why compile python? Windows already has a perfectly good python to use. > > Satish > >> >>> >>> You can try an install of petsc with msys - and see if it works. If not send >>> us logs at petsc-maint. >>> >>> [its possible things won't work - and you would have to use >>> cygwin/gfortran. Presumably it shouldn't conflict with your msys >>> install] >>> >>> Satish >> >> > From balay at mcs.anl.gov Sun Mar 17 17:42:01 2013 From: balay at mcs.anl.gov (Satish Balay) Date: Sun, 17 Mar 2013 17:42:01 -0500 (CDT) Subject: [petsc-users] Eigenvalue solver method in Petsc In-Reply-To: References: , <2F032090-7375-435B-8DEB-FB7094A4461C@mcs.anl.gov> Message-ID: On Sun, 17 Mar 2013, Barry Smith wrote: > > On Mar 17, 2013, at 5:37 PM, Satish Balay wrote: > > > On Sun, 17 Mar 2013, Barry Smith wrote: > > > >> > >> On Mar 17, 2013, at 3:51 PM, Satish Balay wrote: > >> > >>> On Sun, 17 Mar 2013, Sonya Blade wrote: > >>> > >>>>>>> Cygwin is required to build PETSc, but not to use it. > >>>>>> How about the MSys interface, which I've already installed. > >>>>> > >>>>> Not currently, as far as I know. > >>>> > >>>>> whats your compiler requirement? And why? > >>>> I use gfortran which ships with MinGW and with Msys I feel more > >>>> comfortable. > >>> > >>> Are you looking at sequential use of PETSc - or parallel? I see mpich > >>> doesn't work with msys/mingw. > >> > >> And why not. > > > > Sorry - forgot to post this link. > > http://lists.mcs.anl.gov/pipermail/mpich-discuss/2010-July/007458.html > > > >> It is far more natural than cygwin. > > > > How so? Even python [which is now considered a universal requirement?] doesn't compile on it. > > Why compile python? Windows already has a perfectly good python to use. Our build tools don't work with MS paths. Satish > > > > > Satish > > > >> > >>> > >>> You can try an install of petsc with msys - and see if it works. If not send > >>> us logs at petsc-maint. > >>> > >>> [its possible things won't work - and you would have to use > >>> cygwin/gfortran. Presumably it shouldn't conflict with your msys > >>> install] > >>> > >>> Satish > >> > >> > > > > From bsmith at mcs.anl.gov Sun Mar 17 17:43:47 2013 From: bsmith at mcs.anl.gov (Barry Smith) Date: Sun, 17 Mar 2013 17:43:47 -0500 Subject: [petsc-users] Eigenvalue solver method in Petsc In-Reply-To: References: , <2F032090-7375-435B-8DEB-FB7094A4461C@mcs.anl.gov> Message-ID: On Mar 17, 2013, at 5:42 PM, Satish Balay wrote: > On Sun, 17 Mar 2013, Barry Smith wrote: > >> >> On Mar 17, 2013, at 5:37 PM, Satish Balay wrote: >> >>> On Sun, 17 Mar 2013, Barry Smith wrote: >>> >>>> >>>> On Mar 17, 2013, at 3:51 PM, Satish Balay wrote: >>>> >>>>> On Sun, 17 Mar 2013, Sonya Blade wrote: >>>>> >>>>>>>>> Cygwin is required to build PETSc, but not to use it. >>>>>>>> How about the MSys interface, which I've already installed. >>>>>>> >>>>>>> Not currently, as far as I know. >>>>>> >>>>>>> whats your compiler requirement? And why? >>>>>> I use gfortran which ships with MinGW and with Msys I feel more >>>>>> comfortable. >>>>> >>>>> Are you looking at sequential use of PETSc - or parallel? I see mpich >>>>> doesn't work with msys/mingw. >>>> >>>> And why not. >>> >>> Sorry - forgot to post this link. >>> http://lists.mcs.anl.gov/pipermail/mpich-discuss/2010-July/007458.html >>> >>>> It is far more natural than cygwin. >>> >>> How so? Even python [which is now considered a universal requirement?] doesn't compile on it. >> >> Why compile python? Windows already has a perfectly good python to use. > > Our build tools don't work with MS paths. Buildsystem does, as does cmake. Which ones don't work? Barry > > Satish > >> >>> >>> Satish >>> >>>> >>>>> >>>>> You can try an install of petsc with msys - and see if it works. If not send >>>>> us logs at petsc-maint. >>>>> >>>>> [its possible things won't work - and you would have to use >>>>> cygwin/gfortran. Presumably it shouldn't conflict with your msys >>>>> install] >>>>> >>>>> Satish >>>> >>>> >>> >> >> > From balay at mcs.anl.gov Sun Mar 17 17:47:49 2013 From: balay at mcs.anl.gov (Satish Balay) Date: Sun, 17 Mar 2013 17:47:49 -0500 (CDT) Subject: [petsc-users] Eigenvalue solver method in Petsc In-Reply-To: References: , <2F032090-7375-435B-8DEB-FB7094A4461C@mcs.anl.gov> Message-ID: On Sun, 17 Mar 2013, Barry Smith wrote: > > On Mar 17, 2013, at 5:42 PM, Satish Balay wrote: > > > On Sun, 17 Mar 2013, Barry Smith wrote: > > > >> > >> On Mar 17, 2013, at 5:37 PM, Satish Balay wrote: > >> > >>> On Sun, 17 Mar 2013, Barry Smith wrote: > >>> > >>>> > >>>> On Mar 17, 2013, at 3:51 PM, Satish Balay wrote: > >>>> > >>>>> On Sun, 17 Mar 2013, Sonya Blade wrote: > >>>>> > >>>>>>>>> Cygwin is required to build PETSc, but not to use it. > >>>>>>>> How about the MSys interface, which I've already installed. > >>>>>>> > >>>>>>> Not currently, as far as I know. > >>>>>> > >>>>>>> whats your compiler requirement? And why? > >>>>>> I use gfortran which ships with MinGW and with Msys I feel more > >>>>>> comfortable. > >>>>> > >>>>> Are you looking at sequential use of PETSc - or parallel? I see mpich > >>>>> doesn't work with msys/mingw. > >>>> > >>>> And why not. > >>> > >>> Sorry - forgot to post this link. > >>> http://lists.mcs.anl.gov/pipermail/mpich-discuss/2010-July/007458.html > >>> > >>>> It is far more natural than cygwin. > >>> > >>> How so? Even python [which is now considered a universal requirement?] doesn't compile on it. > >> > >> Why compile python? Windows already has a perfectly good python to use. > > > > Our build tools don't work with MS paths. > > Buildsystem does, since when? And even if it were to work - whats the point of using it [with MS paths] with mingw-gcc/gfortran? Its not like 'msys' is more userfriendly wrt install/use to Windows users [with no unix knowledge] as compared to cygwin. > as does cmake. Which ones don't work? Only after cygwin run of buildsystem - and hacking the cmake stuff produced by it. Satish > > Barry > > > > > Satish > > > >> > >>> > >>> Satish > >>> > >>>> > >>>>> > >>>>> You can try an install of petsc with msys - and see if it works. If not send > >>>>> us logs at petsc-maint. > >>>>> > >>>>> [its possible things won't work - and you would have to use > >>>>> cygwin/gfortran. Presumably it shouldn't conflict with your msys > >>>>> install] > >>>>> > >>>>> Satish > >>>> > >>>> > >>> > >> > >> > > > > From jedbrown at mcs.anl.gov Sun Mar 17 17:48:03 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Sun, 17 Mar 2013 17:48:03 -0500 Subject: [petsc-users] Eigenvalue solver method in Petsc In-Reply-To: References: <2F032090-7375-435B-8DEB-FB7094A4461C@mcs.anl.gov> Message-ID: On Sun, Mar 17, 2013 at 5:43 PM, Barry Smith wrote: > Buildsystem does What gives you that impression? It looks chock full of unixy paths to me. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bsmith at mcs.anl.gov Sun Mar 17 17:50:24 2013 From: bsmith at mcs.anl.gov (Barry Smith) Date: Sun, 17 Mar 2013 17:50:24 -0500 Subject: [petsc-users] Eigenvalue solver method in Petsc In-Reply-To: References: <2F032090-7375-435B-8DEB-FB7094A4461C@mcs.anl.gov> Message-ID: <28EEC96C-B425-4AA3-BE86-909B80C23CDB@mcs.anl.gov> On Mar 17, 2013, at 5:48 PM, Jed Brown wrote: > > On Sun, Mar 17, 2013 at 5:43 PM, Barry Smith wrote: > Buildsystem does > > What gives you that impression? It looks chock full of unixy paths to me. Make a branch and fix any you find. It is not suppose to. Barry From jedbrown at mcs.anl.gov Sun Mar 17 17:59:43 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Sun, 17 Mar 2013 17:59:43 -0500 Subject: [petsc-users] Eigenvalue solver method in Petsc In-Reply-To: <28EEC96C-B425-4AA3-BE86-909B80C23CDB@mcs.anl.gov> References: <2F032090-7375-435B-8DEB-FB7094A4461C@mcs.anl.gov> <28EEC96C-B425-4AA3-BE86-909B80C23CDB@mcs.anl.gov> Message-ID: On Sun, Mar 17, 2013 at 5:50 PM, Barry Smith wrote: > > Make a branch and fix any you find. It is not suppose to. I think this is a very tedious project and will probably have more stumbling blocks than path manipulation. If there is a machine where we can ssh to msys bash, then there might be a chance. I can't tell whether we would use GCC or Microsoft compilers (via win32fe). -------------- next part -------------- An HTML attachment was scrubbed... URL: From bsmith at mcs.anl.gov Sun Mar 17 18:01:36 2013 From: bsmith at mcs.anl.gov (Barry Smith) Date: Sun, 17 Mar 2013 18:01:36 -0500 Subject: [petsc-users] Eigenvalue solver method in Petsc In-Reply-To: References: <2F032090-7375-435B-8DEB-FB7094A4461C@mcs.anl.gov> <28EEC96C-B425-4AA3-BE86-909B80C23CDB@mcs.anl.gov> Message-ID: <1B8B8837-CAC5-4906-9B89-3DE7D66A968D@mcs.anl.gov> On Mar 17, 2013, at 5:59 PM, Jed Brown wrote: > On Sun, Mar 17, 2013 at 5:50 PM, Barry Smith wrote: > > Make a branch and fix any you find. It is not suppose to. > > I think this is a very tedious project and will probably have more stumbling blocks than path manipulation. > > If there is a machine where we can ssh to msys bash, then there might be a chance. > > I can't tell whether we would use GCC We would use the native Windows gnu compilers which use Window's paths. :-) > or Microsoft compilers (via win32fe). From zhang.wei at chalmers.se Mon Mar 18 10:15:19 2013 From: zhang.wei at chalmers.se (Zhang Wei) Date: Mon, 18 Mar 2013 15:15:19 +0000 Subject: [petsc-users] memory control Message-ID: Hi I am new to the slepc, I am struggling with handson exercies "Exercise 5: Problem without Explicit Matrix Storage", it seems the memory cost is really big for the case, as i simply increase the size of case ,n, to 9600 resulting cost around 8Gb memory during the runtime, and at beginning stage, it is clearly observed that each vector in krylove space cost 800Mb for 9600 elements case.. that is unreasonable.can any one help me on that ? Wei. From jedbrown at mcs.anl.gov Mon Mar 18 10:24:38 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Mon, 18 Mar 2013 10:24:38 -0500 Subject: [petsc-users] memory control In-Reply-To: References: Message-ID: On Mon, Mar 18, 2013 at 10:15 AM, Zhang Wei wrote: > Hi > I am new to the slepc, I am struggling with handson exercies "Exercise 5: > Problem without Explicit Matrix Storage", it seems the memory cost is > really big for the case, as i simply increase the size of case ,n, to 9600 > resulting cost around 8Gb memory during the runtime, and at beginning > stage, it is clearly observed that each vector in krylove space cost 800Mb > for 9600 elements case.. that is unreasonable.can any one help me on that ? > This doesn't sound right. Please send -log_summary output and explain what you are doing. -------------- next part -------------- An HTML attachment was scrubbed... URL: From zhangw at chalmers.se Mon Mar 18 11:12:29 2013 From: zhangw at chalmers.se (Zhang Wei) Date: Mon, 18 Mar 2013 17:12:29 +0100 Subject: [petsc-users] memory control In-Reply-To: References: Message-ID: <1363623149.9354.33.camel@smt-218-23.chl.chalmers.se> Hi I fixed it, I misunderstood the mean of parameter N, which resulting a N^2 size problem. thanks for your help. On Mon, 2013-03-18 at 10:24 -0500, Jed Brown wrote: > On Mon, Mar 18, 2013 at 10:15 AM, Zhang Wei > wrote: > Hi > I am new to the slepc, I am struggling with handson exercies > "Exercise 5: Problem without Explicit Matrix Storage", it > seems the memory cost is really big for the case, as i simply > increase the size of case ,n, to 9600 resulting cost around > 8Gb memory during the runtime, and at beginning stage, it is > clearly observed that each vector in krylove space cost 800Mb > for 9600 elements case.. that is unreasonable.can any one help > me on that ? > > > This doesn't sound right. Please send -log_summary output and explain > what you are doing. From balay at mcs.anl.gov Mon Mar 18 14:16:22 2013 From: balay at mcs.anl.gov (Satish Balay) Date: Mon, 18 Mar 2013 14:16:22 -0500 (CDT) Subject: [petsc-users] Eigenvalue solver method in Petsc In-Reply-To: <1B8B8837-CAC5-4906-9B89-3DE7D66A968D@mcs.anl.gov> References: <2F032090-7375-435B-8DEB-FB7094A4461C@mcs.anl.gov> <28EEC96C-B425-4AA3-BE86-909B80C23CDB@mcs.anl.gov> <1B8B8837-CAC5-4906-9B89-3DE7D66A968D@mcs.anl.gov> Message-ID: On Sun, 17 Mar 2013, Barry Smith wrote: > > On Mar 17, 2013, at 5:59 PM, Jed Brown wrote: > > > On Sun, Mar 17, 2013 at 5:50 PM, Barry Smith wrote: > > > > Make a branch and fix any you find. It is not suppose to. > > > > I think this is a very tedious project and will probably have more stumbling blocks than path manipulation. > > > > If there is a machine where we can ssh to msys bash, then there might be a chance. > > > > I can't tell whether we would use GCC > > We would use the native Windows gnu compilers which use Window's paths. :-) For one - there is no 'native Windows gnu compilers' that I'm aware of. But if you mean gnu compilers that don't need cygwin.dll - then I believe mingw compilers are also distributed as part of cygwin. [but I have not tired that] And if 'using Window's paths' is important - cygwin works with it aswell. [if our buildtools can manage that] >>>>> balay at Win7-KVM ~/junk $ ls c:\\cygwin\\home\\balay\\foo.h c:\cygwin\home\balay\foo.h balay at Win7-KVM ~/junk $ gcc -c vard.c vard.c:1:17: fatal error: foo.h: No such file or directory compilation terminated. balay at Win7-KVM ~/junk $ gcc -c vard.c -Ic:\\cygwin\\home\\balay balay at Win7-KVM ~/junk $ <<<<<<<<< But I think the primary concern here is 'remove cygwin dependency in our buildtool chain' I don't think msys is a solution for that. [And I suspect folks who want that solution don't don't even want to install ms-python or run configure with it] Satish From wumengda at gmail.com Mon Mar 18 14:34:22 2013 From: wumengda at gmail.com (Mengda Wu) Date: Mon, 18 Mar 2013 15:34:22 -0400 Subject: [petsc-users] How to do this in Petsc? Message-ID: Hi all, I would like to solve a system Ax=b multiple times, with A and b stay the same from time to time. The difference among each time is that a set of DOFs in x are fixed and others are free to be solved. And the set of DOFs to be fixed/ solved varies from time to time. I know I can assemble A each time and move the set of fixed DOFs to the rhs. But I don't want to do this because the size of A is changing. Is there a simpler and more automated way to deal with this issue? Thanks, Guanglei -------------- next part -------------- An HTML attachment was scrubbed... URL: From jedbrown at mcs.anl.gov Mon Mar 18 15:02:50 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Mon, 18 Mar 2013 15:02:50 -0500 Subject: [petsc-users] How to do this in Petsc? In-Reply-To: References: Message-ID: On Mon, Mar 18, 2013 at 2:34 PM, Mengda Wu wrote: > Hi all, > > I would like to solve a system Ax=b multiple times, with A and b stay > the same from time to time. The difference among each time is that a set of > DOFs in x are fixed and others are free to be solved. And the set of DOFs > to be fixed/ solved varies from time to time. I know I can assemble A each > time and move the set of fixed DOFs to the rhs. But I don't want to do this > because the size of A is changing. > > Is there a simpler and more automated way to deal with this issue? > You should assemble a separate system for each "active" set. This is the simplest and fastest method. You can create the system using MatGetSubMatrix() if you don't want to call your assembly routines each time. -------------- next part -------------- An HTML attachment was scrubbed... URL: From balay at mcs.anl.gov Mon Mar 18 16:08:17 2013 From: balay at mcs.anl.gov (Satish Balay) Date: Mon, 18 Mar 2013 16:08:17 -0500 (CDT) Subject: [petsc-users] Eigenvalue solver method in Petsc In-Reply-To: References: <2F032090-7375-435B-8DEB-FB7094A4461C@mcs.anl.gov> <28EEC96C-B425-4AA3-BE86-909B80C23CDB@mcs.anl.gov> <1B8B8837-CAC5-4906-9B89-3DE7D66A968D@mcs.anl.gov> Message-ID: On Mon, 18 Mar 2013, Satish Balay wrote: > But if you mean gnu compilers that don't need cygwin.dll - then I > believe mingw compilers are also distributed as part of cygwin. [but I > have not tired that] Appears to work fine [using mingw compilers from cygwin with petsc 'stable']. - install mingw compilers from cygwin setup.exe - setup PATH to mingw dlls export PATH=/usr/i686-pc-mingw32/sys-root/mingw/bin/:$PATH - build PETSc ./configure CC=i686-pc-mingw32-gcc --with-cxx=0 FC=i686-pc-mingw32-gfortran --with-mpi=0 --download-f-blas-lapack=1 make Satish ----------- balay at Win7-KVM ~/petsc.clone/src/ksp/ksp/examples/tutorials $ make ex2 i686-pc-mingw32-gcc -o ex2.o -c -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -g3 -fno-inline -O0 -I/home/balay/petsc.clone/include -I/home/balay/petsc.clone/arch-mswin-c-debug/include -I/home/balay/petsc.clone/include/mpiuni -D__INSDIR__=src/ksp/ksp/examples/tutorials/ ex2.c i686-pc-mingw32-gcc -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -g3 -fno-inline -O0 -o ex2 ex2.o -L/home/balay/petsc.clone/arch-mswin-c-debug/lib -lpetsc -Wl,-rpath,/home/balay/petsc.clone/arch-mswin-c-debug/lib -lflapack -lfblas -lpthread -L/usr/lib/gcc/i686-pc-mingw32/4.5.2 -L/usr/i686-pc-mingw32/lib -L/usr/i686-pc-mingw32/sys-root/mingw/lib -lgfortran -lgcc_s -lgdi32 -luser32 -ladvapi32 -lkernel32 -lmingw32 -lgcc_eh -lmoldname -lmingwex -lmsvcrt -luser32 -ladvapi32 -lshell32 /usr/bin/rm -f ex2.o balay at Win7-KVM ~/petsc.clone/src/ksp/ksp/examples/tutorials $ ./ex2 Norm of error 0.000156044 iterations 6 balay at Win7-KVM ~/petsc.clone/src/ksp/ksp/examples/tutorials $ ldd ex2 ntdll.dll => /cygdrive/c/Windows/SYSTEM32/ntdll.dll (0x77630000) kernel32.dll => /cygdrive/c/Windows/system32/kernel32.dll (0x76240000) KERNELBASE.dll => /cygdrive/c/Windows/system32/KERNELBASE.dll (0x75a50000) ADVAPI32.DLL => /cygdrive/c/Windows/system32/ADVAPI32.DLL (0x75b70000) msvcrt.dll => /cygdrive/c/Windows/system32/msvcrt.dll (0x75c10000) sechost.dll => /cygdrive/c/Windows/SYSTEM32/sechost.dll (0x75cf0000) RPCRT4.dll => /cygdrive/c/Windows/system32/RPCRT4.dll (0x75ac0000) GDI32.dll => /cygdrive/c/Windows/system32/GDI32.dll (0x764f0000) USER32.dll => /cygdrive/c/Windows/system32/USER32.dll (0x76410000) LPK.dll => /cygdrive/c/Windows/system32/LPK.dll (0x77770000) USP10.dll => /cygdrive/c/Windows/system32/USP10.dll (0x75e80000) libgcc_s_dw2-1.dll => /usr/i686-pc-mingw32/sys-root/mingw/bin/libgcc_s_dw2-1.dll (0x6e940000) libgfortran-3.dll => /usr/i686-pc-mingw32/sys-root/mingw/bin/libgfortran-3.dll (0x6f600000) IMM32.DLL => /cygdrive/c/Windows/system32/IMM32.DLL (0x76320000) MSCTF.dll => /cygdrive/c/Windows/system32/MSCTF.dll (0x765c0000) balay at Win7-KVM ~/petsc.clone/src/ksp/ksp/examples/tutorials $ i686-pc-mingw32-gcc --version i686-pc-mingw32-gcc (GCC) 4.5.2 Copyright (C) 2010 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. From gokhalen at gmail.com Wed Mar 20 12:59:23 2013 From: gokhalen at gmail.com (Nachiket Gokhale) Date: Wed, 20 Mar 2013 13:59:23 -0400 Subject: [petsc-users] petscviewerduplicate? Message-ID: Not a show stopper, but would it be possible to add a PetscViewerDuplicate function? I don't see such a function here - http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Viewer/index.html Cheers, -Nachiket From mh.farahani at gmail.com Wed Mar 20 13:12:39 2013 From: mh.farahani at gmail.com (Mehrdad H Farahani) Date: Wed, 20 Mar 2013 13:12:39 -0500 Subject: [petsc-users] KSP convergence problem Message-ID: I'm experience a weird convergence problem with bcgsl with both ILU and GAMG preconditioning. The problem converges normally (at least in the preconditioned norm), but then kicks out with converged reason = -4. I've attached the convergence history of the previous time-step which worked and the timestep which shows problems. Could someone give me an idea on how to proceed? Best Regards -- Mehrdad -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: convergence Type: application/octet-stream Size: 129219 bytes Desc: not available URL: From jedbrown at mcs.anl.gov Wed Mar 20 13:16:26 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Wed, 20 Mar 2013 13:16:26 -0500 Subject: [petsc-users] petscviewerduplicate? In-Reply-To: References: Message-ID: What would it mean to duplicate a viewer? What are you actually trying to do? On Mar 20, 2013 12:59 PM, "Nachiket Gokhale" wrote: > Not a show stopper, but would it be possible to add a > PetscViewerDuplicate function? I don't see such a function here - > > http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Viewer/index.html > > Cheers, -Nachiket > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gokhalen at gmail.com Wed Mar 20 13:28:53 2013 From: gokhalen at gmail.com (Nachiket Gokhale) Date: Wed, 20 Mar 2013 14:28:53 -0400 Subject: [petsc-users] petscviewerduplicate? In-Reply-To: References: Message-ID: I have this in my code: ierr = PetscViewerCreate(PETSC_COMM_WORLD,&RightViewer);CHKERRQ(ierr); ierr = PetscViewerSetType(RightViewer,PETSCVIEWERASCII);CHKERRQ(ierr); ierr = PetscViewerFileSetMode(RightViewer,FILE_MODE_WRITE);CHKERRQ(ierr); ierr = PetscViewerSetFormat(RightViewer,PETSC_VIEWER_ASCII_MATLAB);CHKERRQ(ierr); ierr = PetscViewerCreate(PETSC_COMM_WORLD,&LeftViewer);CHKERRQ(ierr); ierr = PetscViewerSetType(LeftViewer,PETSCVIEWERASCII);CHKERRQ(ierr); ierr = PetscViewerFileSetMode(LeftViewer,FILE_MODE_WRITE);CHKERRQ(ierr); ierr = PetscViewerSetFormat(LeftViewer,PETSC_VIEWER_ASCII_MATLAB);CHKERRQ(ierr); It would have been nice to create the LeftViewer from the RightViewer. That is what I am trying to do. At other places I use only one viewer to output left and right matrices: // projection matrices in ascii ierr = PetscViewerCreate(PETSC_COMM_WORLD,&ProjMatViewer);CHKERRQ(ierr); ierr = PetscViewerSetType(ProjMatViewer,PETSCVIEWERASCII);CHKERRQ(ierr); ierr = PetscViewerFileSetMode(ProjMatViewer,FILE_MODE_WRITE);CHKERRQ(ierr); ierr = PetscViewerSetFormat(ProjMatViewer,PETSC_VIEWER_ASCII_MATLAB);CHKERRQ(ierr); // right ierr = PetscViewerFileSetName(ProjMatViewer,projfileasciiright);CHKERRQ(ierr); ierr = MatView(ProjMatRight,ProjMatViewer);CHKERRQ(ierr); // left ierr = PetscViewerFileSetName(ProjMatViewer,projfileasciileft);CHKERRQ(ierr); ierr = MatView(ProjMatLeft,ProjMatViewer);CHKERRQ(ierr); // destroy ierr = PetscViewerDestroy(&ProjMatViewer);CHKERRQ(ierr); But I think switching the filename is inconvenient - I'd rather create a separate viewer Left and Right Matrices and have it copy the same parameters from an already created viewer. -Nachiket On Wed, Mar 20, 2013 at 2:16 PM, Jed Brown wrote: > What would it mean to duplicate a viewer? What are you actually trying to > do? > > On Mar 20, 2013 12:59 PM, "Nachiket Gokhale" wrote: >> >> Not a show stopper, but would it be possible to add a >> PetscViewerDuplicate function? I don't see such a function here - >> >> http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Viewer/index.html >> >> Cheers, -Nachiket From jedbrown at mcs.anl.gov Wed Mar 20 13:35:56 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Wed, 20 Mar 2013 13:35:56 -0500 Subject: [petsc-users] petscviewerduplicate? In-Reply-To: References: Message-ID: Just make a function that creates viewers like this, then call it to create two independent viewers that are configured similarly except for the file name. I don't think this makes sense in the library. On Wed, Mar 20, 2013 at 1:28 PM, Nachiket Gokhale wrote: > I have this in my code: > > ierr = PetscViewerCreate(PETSC_COMM_WORLD,&RightViewer);CHKERRQ(ierr); > ierr = PetscViewerSetType(RightViewer,PETSCVIEWERASCII);CHKERRQ(ierr); > ierr = PetscViewerFileSetMode(RightViewer,FILE_MODE_WRITE);CHKERRQ(ierr); > ierr = > PetscViewerSetFormat(RightViewer,PETSC_VIEWER_ASCII_MATLAB);CHKERRQ(ierr); > > ierr = PetscViewerCreate(PETSC_COMM_WORLD,&LeftViewer);CHKERRQ(ierr); > ierr = PetscViewerSetType(LeftViewer,PETSCVIEWERASCII);CHKERRQ(ierr); > ierr = PetscViewerFileSetMode(LeftViewer,FILE_MODE_WRITE);CHKERRQ(ierr); > ierr = > PetscViewerSetFormat(LeftViewer,PETSC_VIEWER_ASCII_MATLAB);CHKERRQ(ierr); > > It would have been nice to create the LeftViewer from the RightViewer. > That is what I am trying to do. > > At other places I use only one viewer to output left and right matrices: > > // projection matrices in ascii > ierr = PetscViewerCreate(PETSC_COMM_WORLD,&ProjMatViewer);CHKERRQ(ierr); > ierr = PetscViewerSetType(ProjMatViewer,PETSCVIEWERASCII);CHKERRQ(ierr); > ierr = > PetscViewerFileSetMode(ProjMatViewer,FILE_MODE_WRITE);CHKERRQ(ierr); > ierr = > PetscViewerSetFormat(ProjMatViewer,PETSC_VIEWER_ASCII_MATLAB);CHKERRQ(ierr); > // right > ierr = > PetscViewerFileSetName(ProjMatViewer,projfileasciiright);CHKERRQ(ierr); > ierr = MatView(ProjMatRight,ProjMatViewer);CHKERRQ(ierr); > // left > ierr = > PetscViewerFileSetName(ProjMatViewer,projfileasciileft);CHKERRQ(ierr); > ierr = MatView(ProjMatLeft,ProjMatViewer);CHKERRQ(ierr); > // destroy > ierr = PetscViewerDestroy(&ProjMatViewer);CHKERRQ(ierr); > > But I think switching the filename is inconvenient - I'd rather create > a separate viewer Left and Right Matrices and have it copy the same > parameters from an already created viewer. > > -Nachiket > > On Wed, Mar 20, 2013 at 2:16 PM, Jed Brown wrote: > > What would it mean to duplicate a viewer? What are you actually trying to > > do? > > > > On Mar 20, 2013 12:59 PM, "Nachiket Gokhale" wrote: > >> > >> Not a show stopper, but would it be possible to add a > >> PetscViewerDuplicate function? I don't see such a function here - > >> > >> > http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Viewer/index.html > >> > >> Cheers, -Nachiket > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.adams at columbia.edu Wed Mar 20 14:00:41 2013 From: mark.adams at columbia.edu (Mark F. Adams) Date: Wed, 20 Mar 2013 15:00:41 -0400 Subject: [petsc-users] KSP convergence problem In-Reply-To: References: Message-ID: <7C47EAB6-D02B-44C3-930D-3E110A7E63C6@columbia.edu> On Mar 20, 2013, at 2:12 PM, Mehrdad H Farahani wrote: > I'm experience a weird convergence problem with bcgsl with both ILU and GAMG preconditioning. The problem converges normally (at least in the preconditioned norm), but then kicks out with converged reason = -4. I've attached the convergence history of the previous time-step which worked and the timestep which shows problems. Could someone give me an idea on how to proceed? > Did you run with -ksp_converged_reason ? I don't know were this -4 comes from. Could this be from your code? > Best Regards > > -- > Mehrdad > > > From jedbrown at mcs.anl.gov Wed Mar 20 14:03:53 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Wed, 20 Mar 2013 14:03:53 -0500 Subject: [petsc-users] KSP convergence problem In-Reply-To: <7C47EAB6-D02B-44C3-930D-3E110A7E63C6@columbia.edu> References: <7C47EAB6-D02B-44C3-930D-3E110A7E63C6@columbia.edu> Message-ID: On Wed, Mar 20, 2013 at 2:00 PM, Mark F. Adams wrote: > > On Mar 20, 2013, at 2:12 PM, Mehrdad H Farahani > wrote: > > > I'm experience a weird convergence problem with bcgsl with both ILU and > GAMG preconditioning. The problem converges normally (at least in the > preconditioned norm), but then kicks out with converged reason = -4. I've > attached the convergence history of the previous time-step which worked and > the timestep which shows problems. Could someone give me an idea on how to > proceed? > > > > Did you run with -ksp_converged_reason ? > > I don't know were this -4 comes from. Could this be from your code? > Some people call KSPGetConvergedReason(), but then don't compare to the enums and don't convert to a string using KSPConvergedReasons[reason]. http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/KSP/KSP_DIVERGED_DTOL.html The problem is likely that your preconditioner is singular. What sort of problem are you solving? -------------- next part -------------- An HTML attachment was scrubbed... URL: From mh.farahani at gmail.com Wed Mar 20 15:13:21 2013 From: mh.farahani at gmail.com (Mehrdad H Farahani) Date: Wed, 20 Mar 2013 15:13:21 -0500 Subject: [petsc-users] KSP convergence problem In-Reply-To: References: <7C47EAB6-D02B-44C3-930D-3E110A7E63C6@columbia.edu> Message-ID: I am solving a Poisson equation with Neumann boundary conditions applied along an arbitrary curve using a ghost fluid treatment. The matrix is non-symmetric and the null space contains more than the constant vector. I have implemented a solve for the null space itself and have previously supplied it using MatSetNullSpace. Unfortunately the null space solve is extremely expensive and does not play well with GAMG or ML. We've checked that the answers we get without supplying this null space are very close to the answers we get when we do include it. The matrix for the two solves in the previous attachment are identical. The problem also seems to be converging and then suddenly diverges. Is this common behavior for a singular preconditioner? Thanks, > > From: Jed Brown > Date: Wed, Mar 20, 2013 at 2:03 PM > Subject: Re: [petsc-users] KSP convergence problem > To: PETSc users list > > > On Wed, Mar 20, 2013 at 2:00 PM, Mark F. Adams wrote: > >> >> On Mar 20, 2013, at 2:12 PM, Mehrdad H Farahani >> wrote: >> >> > I'm experience a weird convergence problem with bcgsl with both ILU and >> GAMG preconditioning. The problem converges normally (at least in the >> preconditioned norm), but then kicks out with converged reason = -4. I've >> attached the convergence history of the previous time-step which worked and >> the timestep which shows problems. Could someone give me an idea on how to >> proceed? >> > >> >> Did you run with -ksp_converged_reason ? >> >> I don't know were this -4 comes from. Could this be from your code? >> > > Some people call KSPGetConvergedReason(), but then don't compare to the > enums and don't convert to a string using KSPConvergedReasons[reason]. > > > http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/KSP/KSP_DIVERGED_DTOL.html > > The problem is likely that your preconditioner is singular. What sort of > problem are you solving? > > -- Mehrdad -------------- next part -------------- An HTML attachment was scrubbed... URL: From bsmith at mcs.anl.gov Wed Mar 20 15:22:47 2013 From: bsmith at mcs.anl.gov (Barry Smith) Date: Wed, 20 Mar 2013 15:22:47 -0500 Subject: [petsc-users] petscviewerduplicate? In-Reply-To: References: Message-ID: <14E8B343-2282-43E6-AE8A-A36FFC0F3D2B@mcs.anl.gov> Why not just use one file, if Matlab is going to read them, it saves you typing both when saving the matrices and when reading them in Matlab? If the matrices are not tiny you likely also want to use the binary viewer, it will be much faster and work in parallel. Barry On Mar 20, 2013, at 1:28 PM, Nachiket Gokhale wrote: > I have this in my code: > > ierr = PetscViewerCreate(PETSC_COMM_WORLD,&RightViewer);CHKERRQ(ierr); > ierr = PetscViewerSetType(RightViewer,PETSCVIEWERASCII);CHKERRQ(ierr); > ierr = PetscViewerFileSetMode(RightViewer,FILE_MODE_WRITE);CHKERRQ(ierr); > ierr = PetscViewerSetFormat(RightViewer,PETSC_VIEWER_ASCII_MATLAB);CHKERRQ(ierr); > > ierr = PetscViewerCreate(PETSC_COMM_WORLD,&LeftViewer);CHKERRQ(ierr); > ierr = PetscViewerSetType(LeftViewer,PETSCVIEWERASCII);CHKERRQ(ierr); > ierr = PetscViewerFileSetMode(LeftViewer,FILE_MODE_WRITE);CHKERRQ(ierr); > ierr = PetscViewerSetFormat(LeftViewer,PETSC_VIEWER_ASCII_MATLAB);CHKERRQ(ierr); > > It would have been nice to create the LeftViewer from the RightViewer. > That is what I am trying to do. > > At other places I use only one viewer to output left and right matrices: > > // projection matrices in ascii > ierr = PetscViewerCreate(PETSC_COMM_WORLD,&ProjMatViewer);CHKERRQ(ierr); > ierr = PetscViewerSetType(ProjMatViewer,PETSCVIEWERASCII);CHKERRQ(ierr); > ierr = PetscViewerFileSetMode(ProjMatViewer,FILE_MODE_WRITE);CHKERRQ(ierr); > ierr = PetscViewerSetFormat(ProjMatViewer,PETSC_VIEWER_ASCII_MATLAB);CHKERRQ(ierr); > // right > ierr = PetscViewerFileSetName(ProjMatViewer,projfileasciiright);CHKERRQ(ierr); > ierr = MatView(ProjMatRight,ProjMatViewer);CHKERRQ(ierr); > // left > ierr = PetscViewerFileSetName(ProjMatViewer,projfileasciileft);CHKERRQ(ierr); > ierr = MatView(ProjMatLeft,ProjMatViewer);CHKERRQ(ierr); > // destroy > ierr = PetscViewerDestroy(&ProjMatViewer);CHKERRQ(ierr); > > But I think switching the filename is inconvenient - I'd rather create > a separate viewer Left and Right Matrices and have it copy the same > parameters from an already created viewer. > > -Nachiket > > On Wed, Mar 20, 2013 at 2:16 PM, Jed Brown wrote: >> What would it mean to duplicate a viewer? What are you actually trying to >> do? >> >> On Mar 20, 2013 12:59 PM, "Nachiket Gokhale" wrote: >>> >>> Not a show stopper, but would it be possible to add a >>> PetscViewerDuplicate function? I don't see such a function here - >>> >>> http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Viewer/index.html >>> >>> Cheers, -Nachiket From jedbrown at mcs.anl.gov Wed Mar 20 15:37:03 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Wed, 20 Mar 2013 15:37:03 -0500 Subject: [petsc-users] KSP convergence problem In-Reply-To: References: <7C47EAB6-D02B-44C3-930D-3E110A7E63C6@columbia.edu> Message-ID: On Wed, Mar 20, 2013 at 3:13 PM, Mehrdad H Farahani wrote: > I am solving a Poisson equation with Neumann boundary conditions applied > along an arbitrary curve using a ghost fluid treatment. The matrix is > non-symmetric and the null space contains more than the constant vector. I > have implemented a solve for the null space itself and have previously > supplied it using MatSetNullSpace. Unfortunately the null space solve is > extremely expensive and does not play well with GAMG or ML. We've checked > that the answers we get without supplying this null space are very close to > the answers we get when we do include it. The matrix for the two solves in > the previous attachment are identical. The problem also seems to be > converging and then suddenly diverges. Is this common behavior for a > singular preconditioner? > If the RHS is not consistent or the preconditioner has a different null space than the operator, you will have problems. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gokhalen at gmail.com Wed Mar 20 15:38:39 2013 From: gokhalen at gmail.com (Nachiket Gokhale) Date: Wed, 20 Mar 2013 16:38:39 -0400 Subject: [petsc-users] petscviewerduplicate? In-Reply-To: <14E8B343-2282-43E6-AE8A-A36FFC0F3D2B@mcs.anl.gov> References: <14E8B343-2282-43E6-AE8A-A36FFC0F3D2B@mcs.anl.gov> Message-ID: On Wed, Mar 20, 2013 at 4:22 PM, Barry Smith wrote: > > Why not just use one file, if Matlab is going to read them, it saves you typing both when saving the matrices and when reading them in Matlab? Because I didn't realize I could store multiple matrices in one file. Is this true for binary as well? > > If the matrices are not tiny you likely also want to use the binary viewer, it will be much faster and work in parallel. I am using the binary viewer. Matlab is there for debugging. -Nachiket > > Barry > > On Mar 20, 2013, at 1:28 PM, Nachiket Gokhale wrote: > >> I have this in my code: >> >> ierr = PetscViewerCreate(PETSC_COMM_WORLD,&RightViewer);CHKERRQ(ierr); >> ierr = PetscViewerSetType(RightViewer,PETSCVIEWERASCII);CHKERRQ(ierr); >> ierr = PetscViewerFileSetMode(RightViewer,FILE_MODE_WRITE);CHKERRQ(ierr); >> ierr = PetscViewerSetFormat(RightViewer,PETSC_VIEWER_ASCII_MATLAB);CHKERRQ(ierr); >> >> ierr = PetscViewerCreate(PETSC_COMM_WORLD,&LeftViewer);CHKERRQ(ierr); >> ierr = PetscViewerSetType(LeftViewer,PETSCVIEWERASCII);CHKERRQ(ierr); >> ierr = PetscViewerFileSetMode(LeftViewer,FILE_MODE_WRITE);CHKERRQ(ierr); >> ierr = PetscViewerSetFormat(LeftViewer,PETSC_VIEWER_ASCII_MATLAB);CHKERRQ(ierr); >> >> It would have been nice to create the LeftViewer from the RightViewer. >> That is what I am trying to do. >> >> At other places I use only one viewer to output left and right matrices: >> >> // projection matrices in ascii >> ierr = PetscViewerCreate(PETSC_COMM_WORLD,&ProjMatViewer);CHKERRQ(ierr); >> ierr = PetscViewerSetType(ProjMatViewer,PETSCVIEWERASCII);CHKERRQ(ierr); >> ierr = PetscViewerFileSetMode(ProjMatViewer,FILE_MODE_WRITE);CHKERRQ(ierr); >> ierr = PetscViewerSetFormat(ProjMatViewer,PETSC_VIEWER_ASCII_MATLAB);CHKERRQ(ierr); >> // right >> ierr = PetscViewerFileSetName(ProjMatViewer,projfileasciiright);CHKERRQ(ierr); >> ierr = MatView(ProjMatRight,ProjMatViewer);CHKERRQ(ierr); >> // left >> ierr = PetscViewerFileSetName(ProjMatViewer,projfileasciileft);CHKERRQ(ierr); >> ierr = MatView(ProjMatLeft,ProjMatViewer);CHKERRQ(ierr); >> // destroy >> ierr = PetscViewerDestroy(&ProjMatViewer);CHKERRQ(ierr); >> >> But I think switching the filename is inconvenient - I'd rather create >> a separate viewer Left and Right Matrices and have it copy the same >> parameters from an already created viewer. >> >> -Nachiket >> >> On Wed, Mar 20, 2013 at 2:16 PM, Jed Brown wrote: >>> What would it mean to duplicate a viewer? What are you actually trying to >>> do? >>> >>> On Mar 20, 2013 12:59 PM, "Nachiket Gokhale" wrote: >>>> >>>> Not a show stopper, but would it be possible to add a >>>> PetscViewerDuplicate function? I don't see such a function here - >>>> >>>> http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Viewer/index.html >>>> >>>> Cheers, -Nachiket > From gokhalen at gmail.com Wed Mar 20 15:42:53 2013 From: gokhalen at gmail.com (Nachiket Gokhale) Date: Wed, 20 Mar 2013 16:42:53 -0400 Subject: [petsc-users] petscviewerduplicate? In-Reply-To: References: <14E8B343-2282-43E6-AE8A-A36FFC0F3D2B@mcs.anl.gov> Message-ID: On Wed, Mar 20, 2013 at 4:38 PM, Nachiket Gokhale wrote: > On Wed, Mar 20, 2013 at 4:22 PM, Barry Smith wrote: >> >> Why not just use one file, if Matlab is going to read them, it saves you typing both when saving the matrices and when reading them in Matlab? > > Because I didn't realize I could store multiple matrices in one file. > Is this true for binary as well? Misunderstood what you said. MatLoad can read only one matrix from a file http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatLoad.html -Nachiket >> >> If the matrices are not tiny you likely also want to use the binary viewer, it will be much faster and work in parallel. > > I am using the binary viewer. Matlab is there for debugging. > > -Nachiket > >> >> Barry >> >> On Mar 20, 2013, at 1:28 PM, Nachiket Gokhale wrote: >> >>> I have this in my code: >>> >>> ierr = PetscViewerCreate(PETSC_COMM_WORLD,&RightViewer);CHKERRQ(ierr); >>> ierr = PetscViewerSetType(RightViewer,PETSCVIEWERASCII);CHKERRQ(ierr); >>> ierr = PetscViewerFileSetMode(RightViewer,FILE_MODE_WRITE);CHKERRQ(ierr); >>> ierr = PetscViewerSetFormat(RightViewer,PETSC_VIEWER_ASCII_MATLAB);CHKERRQ(ierr); >>> >>> ierr = PetscViewerCreate(PETSC_COMM_WORLD,&LeftViewer);CHKERRQ(ierr); >>> ierr = PetscViewerSetType(LeftViewer,PETSCVIEWERASCII);CHKERRQ(ierr); >>> ierr = PetscViewerFileSetMode(LeftViewer,FILE_MODE_WRITE);CHKERRQ(ierr); >>> ierr = PetscViewerSetFormat(LeftViewer,PETSC_VIEWER_ASCII_MATLAB);CHKERRQ(ierr); >>> >>> It would have been nice to create the LeftViewer from the RightViewer. >>> That is what I am trying to do. >>> >>> At other places I use only one viewer to output left and right matrices: >>> >>> // projection matrices in ascii >>> ierr = PetscViewerCreate(PETSC_COMM_WORLD,&ProjMatViewer);CHKERRQ(ierr); >>> ierr = PetscViewerSetType(ProjMatViewer,PETSCVIEWERASCII);CHKERRQ(ierr); >>> ierr = PetscViewerFileSetMode(ProjMatViewer,FILE_MODE_WRITE);CHKERRQ(ierr); >>> ierr = PetscViewerSetFormat(ProjMatViewer,PETSC_VIEWER_ASCII_MATLAB);CHKERRQ(ierr); >>> // right >>> ierr = PetscViewerFileSetName(ProjMatViewer,projfileasciiright);CHKERRQ(ierr); >>> ierr = MatView(ProjMatRight,ProjMatViewer);CHKERRQ(ierr); >>> // left >>> ierr = PetscViewerFileSetName(ProjMatViewer,projfileasciileft);CHKERRQ(ierr); >>> ierr = MatView(ProjMatLeft,ProjMatViewer);CHKERRQ(ierr); >>> // destroy >>> ierr = PetscViewerDestroy(&ProjMatViewer);CHKERRQ(ierr); >>> >>> But I think switching the filename is inconvenient - I'd rather create >>> a separate viewer Left and Right Matrices and have it copy the same >>> parameters from an already created viewer. >>> >>> -Nachiket >>> >>> On Wed, Mar 20, 2013 at 2:16 PM, Jed Brown wrote: >>>> What would it mean to duplicate a viewer? What are you actually trying to >>>> do? >>>> >>>> On Mar 20, 2013 12:59 PM, "Nachiket Gokhale" wrote: >>>>> >>>>> Not a show stopper, but would it be possible to add a >>>>> PetscViewerDuplicate function? I don't see such a function here - >>>>> >>>>> http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Viewer/index.html >>>>> >>>>> Cheers, -Nachiket >> From mh.farahani at gmail.com Wed Mar 20 15:43:04 2013 From: mh.farahani at gmail.com (Mehrdad H Farahani) Date: Wed, 20 Mar 2013 15:43:04 -0500 Subject: [petsc-users] KSP convergence problem In-Reply-To: References: <7C47EAB6-D02B-44C3-930D-3E110A7E63C6@columbia.edu> Message-ID: Besides, such diverging behavior occurs only with optimized build of Petsc. On Wed, Mar 20, 2013 at 3:13 PM, Mehrdad H Farahani wrote: > I am solving a Poisson equation with Neumann boundary conditions applied > along an arbitrary curve using a ghost fluid treatment. The matrix is > non-symmetric and the null space contains more than the constant vector. I > have implemented a solve for the null space itself and have previously > supplied it using MatSetNullSpace. Unfortunately the null space solve is > extremely expensive and does not play well with GAMG or ML. We've checked > that the answers we get without supplying this null space are very close to > the answers we get when we do include it. The matrix for the two solves in > the previous attachment are identical. The problem also seems to be > converging and then suddenly diverges. Is this common behavior for a > singular preconditioner? > > Thanks, > > > >> >> From: Jed Brown >> Date: Wed, Mar 20, 2013 at 2:03 PM >> Subject: Re: [petsc-users] KSP convergence problem >> To: PETSc users list >> >> >> On Wed, Mar 20, 2013 at 2:00 PM, Mark F. Adams wrote: >> >>> >>> On Mar 20, 2013, at 2:12 PM, Mehrdad H Farahani >>> wrote: >>> >>> > I'm experience a weird convergence problem with bcgsl with both ILU >>> and GAMG preconditioning. The problem converges normally (at least in the >>> preconditioned norm), but then kicks out with converged reason = -4. I've >>> attached the convergence history of the previous time-step which worked and >>> the timestep which shows problems. Could someone give me an idea on how to >>> proceed? >>> > >>> >>> Did you run with -ksp_converged_reason ? >>> >>> I don't know were this -4 comes from. Could this be from your code? >>> >> >> Some people call KSPGetConvergedReason(), but then don't compare to the >> enums and don't convert to a string using KSPConvergedReasons[reason]. >> >> >> http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/KSP/KSP_DIVERGED_DTOL.html >> >> The problem is likely that your preconditioner is singular. What sort of >> problem are you solving? >> >> > > > -- > Mehrdad > -- Mehrdad -------------- next part -------------- An HTML attachment was scrubbed... URL: From jedbrown at mcs.anl.gov Wed Mar 20 15:49:21 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Wed, 20 Mar 2013 15:49:21 -0500 Subject: [petsc-users] KSP convergence problem In-Reply-To: References: <7C47EAB6-D02B-44C3-930D-3E110A7E63C6@columbia.edu> Message-ID: On Wed, Mar 20, 2013 at 3:43 PM, Mehrdad H Farahani wrote: > Besides, such diverging behavior occurs only with optimized build of Petsc. Any more information on this? Can you make an optimized build using COPTFLAGS='-O0 -g' and see if the problem is there too? Then use a debugger to compare both versions. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jedbrown at mcs.anl.gov Wed Mar 20 15:50:55 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Wed, 20 Mar 2013 15:50:55 -0500 Subject: [petsc-users] petscviewerduplicate? In-Reply-To: References: <14E8B343-2282-43E6-AE8A-A36FFC0F3D2B@mcs.anl.gov> Message-ID: On Wed, Mar 20, 2013 at 3:42 PM, Nachiket Gokhale wrote: > On Wed, Mar 20, 2013 at 4:38 PM, Nachiket Gokhale > wrote: > > On Wed, Mar 20, 2013 at 4:22 PM, Barry Smith wrote: > >> > >> Why not just use one file, if Matlab is going to read them, it saves > you typing both when saving the matrices and when reading them in Matlab? > > > > Because I didn't realize I could store multiple matrices in one file. > > Is this true for binary as well? > > > Misunderstood what you said. MatLoad can read only one matrix from a file > > > http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatLoad.html What makes you say that? Call MatLoad() again to get the second matrix. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gokhalen at gmail.com Wed Mar 20 15:55:03 2013 From: gokhalen at gmail.com (Nachiket Gokhale) Date: Wed, 20 Mar 2013 16:55:03 -0400 Subject: [petsc-users] petscviewerduplicate? In-Reply-To: References: <14E8B343-2282-43E6-AE8A-A36FFC0F3D2B@mcs.anl.gov> Message-ID: On Wed, Mar 20, 2013 at 4:50 PM, Jed Brown wrote: > > On Wed, Mar 20, 2013 at 3:42 PM, Nachiket Gokhale > wrote: >> >> On Wed, Mar 20, 2013 at 4:38 PM, Nachiket Gokhale >> wrote: >> > On Wed, Mar 20, 2013 at 4:22 PM, Barry Smith wrote: >> >> >> >> Why not just use one file, if Matlab is going to read them, it saves >> >> you typing both when saving the matrices and when reading them in Matlab? >> > >> > Because I didn't realize I could store multiple matrices in one file. >> > Is this true for binary as well? >> >> >> Misunderstood what you said. MatLoad can read only one matrix from a file >> >> >> http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatLoad.html > > > What makes you say that? Call MatLoad() again to get the second matrix. Nice! Thanks. Since MatLoad didn't have an argument to specify which matrix to load either a string or a number, I thought it loads only one matrix. -Nachiket From jedbrown at mcs.anl.gov Wed Mar 20 15:57:47 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Wed, 20 Mar 2013 15:57:47 -0500 Subject: [petsc-users] petscviewerduplicate? In-Reply-To: References: <14E8B343-2282-43E6-AE8A-A36FFC0F3D2B@mcs.anl.gov> Message-ID: On Wed, Mar 20, 2013 at 3:55 PM, Nachiket Gokhale wrote: > Nice! Thanks. Since MatLoad didn't have an argument to specify which > matrix to load either a string or a number, I thought it loads only > one matrix. > It loads sequentially. PETSc binary file viewers don't have a "table of contents" so you just load the next thing. The HDF5 viewer can "seek" to named contents if you need it to. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mh.farahani at gmail.com Wed Mar 20 16:33:00 2013 From: mh.farahani at gmail.com (Mehrdad H Farahani) Date: Wed, 20 Mar 2013 16:33:00 -0500 Subject: [petsc-users] KSP convergence problem In-Reply-To: References: <7C47EAB6-D02B-44C3-930D-3E110A7E63C6@columbia.edu> Message-ID: I made an optimized build with COPTFLAGS="-O0 -g" and FOPTFLAGS="-O0 -g". I will test it for the same simulation. -- Mehrdad -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.adams at columbia.edu Wed Mar 20 16:37:18 2013 From: mark.adams at columbia.edu (Mark F. Adams) Date: Wed, 20 Mar 2013 17:37:18 -0400 Subject: [petsc-users] KSP convergence problem In-Reply-To: References: <7C47EAB6-D02B-44C3-930D-3E110A7E63C6@columbia.edu> Message-ID: <369018A9-0934-4D50-90CD-E7CB5AEB3439@columbia.edu> On Mar 20, 2013, at 4:13 PM, Mehrdad H Farahani wrote: > I am solving a Poisson equation with Neumann boundary conditions applied along an arbitrary curve using a ghost fluid treatment. The matrix is non-symmetric and the null space contains more than the constant vector. I have implemented a solve for the null space itself and have previously supplied it using MatSetNullSpace. Unfortunately the null space solve is extremely expensive and does not play well with GAMG or ML. We've checked that the answers we get without supplying this null space are very close to the answers If you set the null space in GAMG and (I'm sure) ML you need to give us he _whole_ null space. For 3D elasticity GAMG will take coordinates and -- just for user convenience and to annoy Jed -- we create the 6 rigid body modes. How many null space vectors are you giving us? > we get when we do include it. The matrix for the two solves in the previous attachment are identical. The problem also seems to be converging and then suddenly diverges. Is this common behavior for a singular preconditioner? > > Thanks, > > > > From: Jed Brown > Date: Wed, Mar 20, 2013 at 2:03 PM > Subject: Re: [petsc-users] KSP convergence problem > To: PETSc users list > > > On Wed, Mar 20, 2013 at 2:00 PM, Mark F. Adams wrote: > > On Mar 20, 2013, at 2:12 PM, Mehrdad H Farahani wrote: > > > I'm experience a weird convergence problem with bcgsl with both ILU and GAMG preconditioning. The problem converges normally (at least in the preconditioned norm), but then kicks out with converged reason = -4. I've attached the convergence history of the previous time-step which worked and the timestep which shows problems. Could someone give me an idea on how to proceed? > > > > Did you run with -ksp_converged_reason ? > > I don't know were this -4 comes from. Could this be from your code? > > Some people call KSPGetConvergedReason(), but then don't compare to the enums and don't convert to a string using KSPConvergedReasons[reason]. > > http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/KSP/KSP_DIVERGED_DTOL.html > > The problem is likely that your preconditioner is singular. What sort of problem are you solving? > > > > > -- > Mehrdad -------------- next part -------------- An HTML attachment was scrubbed... URL: From Shuangshuang.Jin at pnnl.gov Wed Mar 20 16:47:51 2013 From: Shuangshuang.Jin at pnnl.gov (Jin, Shuangshuang) Date: Wed, 20 Mar 2013 14:47:51 -0700 Subject: [petsc-users] TSSetIFunction Message-ID: <6778DE83AB681D49BFC2CD850610FEB1018FC7CB4FB0@EMAIL04.pnl.gov> Hi, I use src\ts\examples\tutorials\ex19.c as an example to use PETSc DAE solver. I get the following problem while running my code: [d3m956 at olympus ss00]$ make mpicxx -I/pic/projects/ds/petsc-dev/include -I/pic/projects/ds/petsc-dev/arch-complex/include -I/share/apps/openmpi/1.5.4/gcc/4.1.2/include -g -c -o simulation.o simulation.C simulation.C: In member function ???PetscErrorCode Simulation::simu(_p_Mat*, _p_Mat*, _p_Mat*)???: simulation.C:80: error: argument of type ???PetscErrorCode (Simulation::)(_p_TS*, PetscReal, _p_Vec*, _p_Vec*, _p_Vec*, void*)??? does not match ???PetscErrorCode (*)(_p_TS*, PetscReal, _p_Vec*, _p_Vec*, _p_Vec*, void*)??? make: *** [simulation.o] Error 1 What does it mean? The IFunction is copied from ex19.c, PetscErrorCode Simulation::IFunction(TS ts,PetscReal t,Vec X,Vec Xdot,Vec F,void *ctx) { PetscErrorCode ierr; PetscScalar *x,*xdot,*f; PetscFunctionBegin; ierr = VecGetArray(X,&x);CHKERRQ(ierr); ierr = VecGetArray(Xdot,&xdot);CHKERRQ(ierr); ierr = VecGetArray(F,&f);CHKERRQ(ierr); f[0] = xdot[0] + x[1]; f[1] = (x[1]*x[1]*x[1]/3 - x[1])-x[0]; ierr = VecRestoreArray(X,&x);CHKERRQ(ierr); ierr = VecRestoreArray(Xdot,&xdot);CHKERRQ(ierr); ierr = VecRestoreArray(F,&f);CHKERRQ(ierr); PetscFunctionReturn(0); } And in Simulation::simu(Mat f1, Mat f2, Mat f3), I have: ierr = TSSetIFunction(ts,NULL,IFunction,&user);CHKERRQ(ierr); Thanks, Shuangshuang -------------- next part -------------- An HTML attachment was scrubbed... URL: From john.mousel at gmail.com Wed Mar 20 16:51:25 2013 From: john.mousel at gmail.com (John Mousel) Date: Wed, 20 Mar 2013 16:51:25 -0500 Subject: [petsc-users] KSP convergence problem In-Reply-To: References: <7C47EAB6-D02B-44C3-930D-3E110A7E63C6@columbia.edu> <369018A9-0934-4D50-90CD-E7CB5AEB3439@columbia.edu> Message-ID: Mark, Right now, Mehrdad and I are just passing the constant vector. The problem is that the null space is extremely expensive to compute. Something like 5-20 times the cost of solving the Poisson equation itself depending on the problem size. What we have tried in the past is to find a single solution to Atrans*n = 0 and pass this as the nullspace. It's had success at making the true residual drop in unison with the preconditioned residual. However, because we are working with moving boundary problems, the null space is changing each time step. In order to get around this, we have decided to try to avoid giving the null space, and see if we get an accurate answer, and we do get pretty much the same answer when we only require preconditioned residual convergence. This is obviously less than robust, but we've yet to find a way to get the null space in an efficient manner. I tried programming up a GASM type algorithm where BiCG/ILU is used near the interface where the solution is not smooth, and GAMG is used far away where the changes in the null vector are very very small, but that didn't have much success. On Wed, Mar 20, 2013 at 4:47 PM, John Mousel wrote: > Mark, > > Right now, Mehrdad and I are just passing the constant vector. The problem > is that the null space is extremely expensive to compute. Something like > 5-20 times the cost of solving the Poisson equation itself depending on the > problem size. What we have tried in the past is to find a single solution > to Atrans*n = 0 and pass this as the nullspace. It's had success at making > the true residual drop in unison with the preconditioned residual. However, > because we are working with moving boundary problems, the null space is > changing each time step. In order to get around this, we have decided to > try to avoid giving the null space, and see if we get an accurate answer, > and we do get pretty much the same answer when we only require > preconditioned residual convergence. This is obviously less than robust, > but we've yet to find a way to get the null space in an efficient manner. I > tried programming up a GASM type algorithm where BiCG/ILU is used near the > interface where the solution is not smooth, and GAMG is used far away where > the changes in the null vector are very very small, but that didn't have > much success. > > John > > > On Wed, Mar 20, 2013 at 4:37 PM, Mark F. Adams wrote: > >> >> On Mar 20, 2013, at 4:13 PM, Mehrdad H Farahani >> wrote: >> >> I am solving a Poisson equation with Neumann boundary conditions applied >> along an arbitrary curve using a ghost fluid treatment. The matrix is >> non-symmetric and the null space contains more than the constant vector. I >> have implemented a solve for the null space itself and have previously >> supplied it using MatSetNullSpace. Unfortunately the null space solve is >> extremely expensive and does not play well with GAMG or ML. We've checked >> that the answers we get without supplying this null space are very close to >> the answers >> >> >> If you set the null space in GAMG and (I'm sure) ML you need to give us >> he _whole_ null space. For 3D elasticity GAMG will take coordinates and -- >> just for user convenience and to annoy Jed -- we create the 6 rigid body >> modes. How many null space vectors are you giving us? >> >> we get when we do include it. The matrix for the two solves in the >> previous attachment are identical. The problem also seems to be converging >> and then suddenly diverges. Is this common behavior for a singular >> preconditioner? >> >> Thanks, >> >> >>> >>> From: Jed Brown >>> Date: Wed, Mar 20, 2013 at 2:03 PM >>> Subject: Re: [petsc-users] KSP convergence problem >>> To: PETSc users list >>> >>> >>> On Wed, Mar 20, 2013 at 2:00 PM, Mark F. Adams >> > wrote: >>> >>>> >>>> On Mar 20, 2013, at 2:12 PM, Mehrdad H Farahani >>>> wrote: >>>> >>>> > I'm experience a weird convergence problem with bcgsl with both ILU >>>> and GAMG preconditioning. The problem converges normally (at least in the >>>> preconditioned norm), but then kicks out with converged reason = -4. I've >>>> attached the convergence history of the previous time-step which worked and >>>> the timestep which shows problems. Could someone give me an idea on how to >>>> proceed? >>>> > >>>> >>>> Did you run with -ksp_converged_reason ? >>>> >>>> I don't know were this -4 comes from. Could this be from your code? >>>> >>> >>> Some people call KSPGetConvergedReason(), but then don't compare to the >>> enums and don't convert to a string using KSPConvergedReasons[reason]. >>> >>> >>> http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/KSP/KSP_DIVERGED_DTOL.html >>> >>> The problem is likely that your preconditioner is singular. What sort of >>> problem are you solving? >>> >>> >> >> >> -- >> Mehrdad >> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jedbrown at mcs.anl.gov Wed Mar 20 16:52:00 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Wed, 20 Mar 2013 16:52:00 -0500 Subject: [petsc-users] TSSetIFunction In-Reply-To: <6778DE83AB681D49BFC2CD850610FEB1018FC7CB4FB0@EMAIL04.pnl.gov> References: <6778DE83AB681D49BFC2CD850610FEB1018FC7CB4FB0@EMAIL04.pnl.gov> Message-ID: You cannot use a member function as a callback. You can (with almost all compilers) use a _static_ member function. Note that static member functions do not have a "this" pointer. The void* argument in the callback should be set to the class so that you can use it as a "this" pointer. On Wed, Mar 20, 2013 at 4:47 PM, Jin, Shuangshuang < Shuangshuang.Jin at pnnl.gov> wrote: > Hi, I use src\ts\examples\tutorials\ex19.c as an example to use PETSc > DAE solver. I get the following problem while running my code: > > [d3m956 at olympus ss00]$ make > mpicxx -I/pic/projects/ds/petsc-dev/include > -I/pic/projects/ds/petsc-dev/arch-complex/include > -I/share/apps/openmpi/1.5.4/gcc/4.1.2/include -g -c -o simulation.o > simulation.C > simulation.C: In member function ???PetscErrorCode > Simulation::simu(_p_Mat*, _p_Mat*, _p_Mat*)???: > simulation.C:80: error: argument of type ???PetscErrorCode > (Simulation::)(_p_TS*, PetscReal, _p_Vec*, _p_Vec*, _p_Vec*, void*)??? does > not match ???PetscErrorCode (*)(_p_TS*, PetscReal, _p_Vec*, _p_Vec*, > _p_Vec*, void*)??? > make: *** [simulation.o] Error 1 > > What does it mean? > > The IFunction is copied from ex19.c, > > PetscErrorCode Simulation::IFunction(TS ts,PetscReal t,Vec X,Vec Xdot,Vec > F,void *ctx) > { > PetscErrorCode ierr; > PetscScalar *x,*xdot,*f; > > PetscFunctionBegin; > ierr = VecGetArray(X,&x);CHKERRQ(ierr); > ierr = VecGetArray(Xdot,&xdot);CHKERRQ(ierr); > ierr = VecGetArray(F,&f);CHKERRQ(ierr); > f[0] = xdot[0] + x[1]; > f[1] = (x[1]*x[1]*x[1]/3 - x[1])-x[0]; > ierr = VecRestoreArray(X,&x);CHKERRQ(ierr); > ierr = VecRestoreArray(Xdot,&xdot);CHKERRQ(ierr); > ierr = VecRestoreArray(F,&f);CHKERRQ(ierr); > PetscFunctionReturn(0); > } > > And in Simulation::simu(Mat f1, Mat f2, Mat f3), I have: > > ierr = TSSetIFunction(ts,NULL,IFunction,&user);CHKERRQ(ierr); > > Thanks, > Shuangshuang > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From elafint.john at gmail.com Wed Mar 20 16:47:54 2013 From: elafint.john at gmail.com (John Mousel) Date: Wed, 20 Mar 2013 16:47:54 -0500 Subject: [petsc-users] KSP convergence problem In-Reply-To: <369018A9-0934-4D50-90CD-E7CB5AEB3439@columbia.edu> References: <7C47EAB6-D02B-44C3-930D-3E110A7E63C6@columbia.edu> <369018A9-0934-4D50-90CD-E7CB5AEB3439@columbia.edu> Message-ID: Mark, Right now, Mehrdad and I are just passing the constant vector. The problem is that the null space is extremely expensive to compute. Something like 5-20 times the cost of solving the Poisson equation itself depending on the problem size. What we have tried in the past is to find a single solution to Atrans*n = 0 and pass this as the nullspace. It's had success at making the true residual drop in unison with the preconditioned residual. However, because we are working with moving boundary problems, the null space is changing each time step. In order to get around this, we have decided to try to avoid giving the null space, and see if we get an accurate answer, and we do get pretty much the same answer when we only require preconditioned residual convergence. This is obviously less than robust, but we've yet to find a way to get the null space in an efficient manner. I tried programming up a GASM type algorithm where BiCG/ILU is used near the interface where the solution is not smooth, and GAMG is used far away where the changes in the null vector are very very small, but that didn't have much success. John On Wed, Mar 20, 2013 at 4:37 PM, Mark F. Adams wrote: > > On Mar 20, 2013, at 4:13 PM, Mehrdad H Farahani > wrote: > > I am solving a Poisson equation with Neumann boundary conditions applied > along an arbitrary curve using a ghost fluid treatment. The matrix is > non-symmetric and the null space contains more than the constant vector. I > have implemented a solve for the null space itself and have previously > supplied it using MatSetNullSpace. Unfortunately the null space solve is > extremely expensive and does not play well with GAMG or ML. We've checked > that the answers we get without supplying this null space are very close to > the answers > > > If you set the null space in GAMG and (I'm sure) ML you need to give us he > _whole_ null space. For 3D elasticity GAMG will take coordinates and -- > just for user convenience and to annoy Jed -- we create the 6 rigid body > modes. How many null space vectors are you giving us? > > we get when we do include it. The matrix for the two solves in the > previous attachment are identical. The problem also seems to be converging > and then suddenly diverges. Is this common behavior for a singular > preconditioner? > > Thanks, > > >> >> From: Jed Brown >> Date: Wed, Mar 20, 2013 at 2:03 PM >> Subject: Re: [petsc-users] KSP convergence problem >> To: PETSc users list >> >> >> On Wed, Mar 20, 2013 at 2:00 PM, Mark F. Adams wrote: >> >>> >>> On Mar 20, 2013, at 2:12 PM, Mehrdad H Farahani >>> wrote: >>> >>> > I'm experience a weird convergence problem with bcgsl with both ILU >>> and GAMG preconditioning. The problem converges normally (at least in the >>> preconditioned norm), but then kicks out with converged reason = -4. I've >>> attached the convergence history of the previous time-step which worked and >>> the timestep which shows problems. Could someone give me an idea on how to >>> proceed? >>> > >>> >>> Did you run with -ksp_converged_reason ? >>> >>> I don't know were this -4 comes from. Could this be from your code? >>> >> >> Some people call KSPGetConvergedReason(), but then don't compare to the >> enums and don't convert to a string using KSPConvergedReasons[reason]. >> >> >> http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/KSP/KSP_DIVERGED_DTOL.html >> >> The problem is likely that your preconditioner is singular. What sort of >> problem are you solving? >> >> > > > -- > Mehrdad > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jedbrown at mcs.anl.gov Wed Mar 20 16:55:30 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Wed, 20 Mar 2013 16:55:30 -0500 Subject: [petsc-users] KSP convergence problem In-Reply-To: References: <7C47EAB6-D02B-44C3-930D-3E110A7E63C6@columbia.edu> <369018A9-0934-4D50-90CD-E7CB5AEB3439@columbia.edu> Message-ID: On Wed, Mar 20, 2013 at 4:51 PM, John Mousel wrote: > Right now, Mehrdad and I are just passing the constant vector. The problem > is that the null space is extremely expensive to compute. Something like > 5-20 times the cost of solving the Poisson equation itself depending on the > problem size. What we have tried in the past is to find a single solution > to Atrans*n = 0 and pass this as the nullspace. It's had success at making > the true residual drop in unison with the preconditioned residual. However, > because we are working with moving boundary problems, the null space is > changing each time step. In order to get around this, we have decided to > try to avoid giving the null space, and see if we get an accurate answer, > and we do get pretty much the same answer when we only require > preconditioned residual convergence. This is obviously less than robust, > but we've yet to find a way to get the null space in an efficient manner. I > tried programming up a GASM type algorithm where BiCG/ILU is used near the > interface where the solution is not smooth, and GAMG is used far away where > the changes in the null vector are very very small, but that didn't have > much success. It's not usually a good idea to choose a spatial discretization that is singular with a complicated null space. Proving that an iteration remains in the benign space is one of the first things demanded from such discretizations. If you can't find a way to iterate in the null space or otherwise project it out, then I would seriously reconsider your choice of this discretization. -------------- next part -------------- An HTML attachment was scrubbed... URL: From john.mousel at gmail.com Wed Mar 20 17:04:46 2013 From: john.mousel at gmail.com (John Mousel) Date: Wed, 20 Mar 2013 17:04:46 -0500 Subject: [petsc-users] KSP convergence problem In-Reply-To: References: <7C47EAB6-D02B-44C3-930D-3E110A7E63C6@columbia.edu> <369018A9-0934-4D50-90CD-E7CB5AEB3439@columbia.edu> Message-ID: Jed, I've wanted to scrap this approach for a long time, but moving away from these GFM-type treatments is not a choice that I've been allowed to follow through on for various reasons which are out of my control. On Wed, Mar 20, 2013 at 4:55 PM, Jed Brown wrote: > > On Wed, Mar 20, 2013 at 4:51 PM, John Mousel wrote: > >> Right now, Mehrdad and I are just passing the constant vector. The >> problem is that the null space is extremely expensive to compute. Something >> like 5-20 times the cost of solving the Poisson equation itself depending >> on the problem size. What we have tried in the past is to find a single >> solution to Atrans*n = 0 and pass this as the nullspace. It's had success >> at making the true residual drop in unison with the preconditioned >> residual. However, because we are working with moving boundary problems, >> the null space is changing each time step. In order to get around this, we >> have decided to try to avoid giving the null space, and see if we get an >> accurate answer, and we do get pretty much the same answer when we only >> require preconditioned residual convergence. This is obviously less than >> robust, but we've yet to find a way to get the null space in an efficient >> manner. I tried programming up a GASM type algorithm where BiCG/ILU is used >> near the interface where the solution is not smooth, and GAMG is used far >> away where the changes in the null vector are very very small, but that >> didn't have much success. > > > It's not usually a good idea to choose a spatial discretization that is > singular with a complicated null space. Proving that an iteration remains > in the benign space is one of the first things demanded from such > discretizations. If you can't find a way to iterate in the null space or > otherwise project it out, then I would seriously reconsider your choice of > this discretization. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From elafint.john at gmail.com Wed Mar 20 17:03:33 2013 From: elafint.john at gmail.com (John Mousel) Date: Wed, 20 Mar 2013 17:03:33 -0500 Subject: [petsc-users] KSP convergence problem In-Reply-To: References: <7C47EAB6-D02B-44C3-930D-3E110A7E63C6@columbia.edu> <369018A9-0934-4D50-90CD-E7CB5AEB3439@columbia.edu> Message-ID: Jed, I've wanted to scrap this approach for a long time, but moving away from these GFM-type treatments is not a choice that I've been allowed to follow through on for various reasons which are out of my control. John On Wed, Mar 20, 2013 at 4:55 PM, Jed Brown wrote: > > On Wed, Mar 20, 2013 at 4:51 PM, John Mousel wrote: > >> Right now, Mehrdad and I are just passing the constant vector. The >> problem is that the null space is extremely expensive to compute. Something >> like 5-20 times the cost of solving the Poisson equation itself depending >> on the problem size. What we have tried in the past is to find a single >> solution to Atrans*n = 0 and pass this as the nullspace. It's had success >> at making the true residual drop in unison with the preconditioned >> residual. However, because we are working with moving boundary problems, >> the null space is changing each time step. In order to get around this, we >> have decided to try to avoid giving the null space, and see if we get an >> accurate answer, and we do get pretty much the same answer when we only >> require preconditioned residual convergence. This is obviously less than >> robust, but we've yet to find a way to get the null space in an efficient >> manner. I tried programming up a GASM type algorithm where BiCG/ILU is used >> near the interface where the solution is not smooth, and GAMG is used far >> away where the changes in the null vector are very very small, but that >> didn't have much success. > > > It's not usually a good idea to choose a spatial discretization that is > singular with a complicated null space. Proving that an iteration remains > in the benign space is one of the first things demanded from such > discretizations. If you can't find a way to iterate in the null space or > otherwise project it out, then I would seriously reconsider your choice of > this discretization. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jedbrown at mcs.anl.gov Wed Mar 20 17:08:07 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Wed, 20 Mar 2013 17:08:07 -0500 Subject: [petsc-users] KSP convergence problem In-Reply-To: References: <7C47EAB6-D02B-44C3-930D-3E110A7E63C6@columbia.edu> <369018A9-0934-4D50-90CD-E7CB5AEB3439@columbia.edu> Message-ID: On Wed, Mar 20, 2013 at 5:04 PM, John Mousel wrote: > I've wanted to scrap this approach for a long time, but moving away from > these GFM-type treatments is not a choice that I've been allowed to follow > through on for various reasons which are out of my control. Unless there are some clever tricks to characterize the null space or to keep preconditioners compatible with the null space, the folks making the decisions might have to reconsider. It doesn't matter how sexy a method looks if it requires a solve and that solve cannot be done efficiently. -------------- next part -------------- An HTML attachment was scrubbed... URL: From john.mousel at gmail.com Wed Mar 20 17:14:53 2013 From: john.mousel at gmail.com (John Mousel) Date: Wed, 20 Mar 2013 17:14:53 -0500 Subject: [petsc-users] KSP convergence problem In-Reply-To: References: <7C47EAB6-D02B-44C3-930D-3E110A7E63C6@columbia.edu> <369018A9-0934-4D50-90CD-E7CB5AEB3439@columbia.edu> Message-ID: Can you comment on a GASM type approach to find a solution for the null space? I notice that the null vectors that successfully make the true residual drop are only complicated in a very thin band around the interface. This band is easy to identify using a level set. Other than that, the null space vector has a low frequency variation. My thought was to break the matrix into two sub-matrices, and somehow apply GAMG as a preconditioner on the far matrix, and ILU on the interface-adjacent matrix. Is this dumb or a complete misunderstanding of GASM? On Wed, Mar 20, 2013 at 5:08 PM, Jed Brown wrote: > > On Wed, Mar 20, 2013 at 5:04 PM, John Mousel wrote: > >> I've wanted to scrap this approach for a long time, but moving away from >> these GFM-type treatments is not a choice that I've been allowed to follow >> through on for various reasons which are out of my control. > > > Unless there are some clever tricks to characterize the null space or to > keep preconditioners compatible with the null space, the folks making the > decisions might have to reconsider. It doesn't matter how sexy a method > looks if it requires a solve and that solve cannot be done efficiently. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jedbrown at mcs.anl.gov Wed Mar 20 17:24:03 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Wed, 20 Mar 2013 17:24:03 -0500 Subject: [petsc-users] KSP convergence problem In-Reply-To: References: <7C47EAB6-D02B-44C3-930D-3E110A7E63C6@columbia.edu> <369018A9-0934-4D50-90CD-E7CB5AEB3439@columbia.edu> Message-ID: On Wed, Mar 20, 2013 at 5:14 PM, John Mousel wrote: > Can you comment on a GASM type approach to find a solution for the null > space? I notice that the null vectors that successfully make the true > residual drop are only complicated in a very thin band around the > interface. This band is easy to identify using a level set. Other than > that, the null space vector has a low frequency variation. My thought was > to break the matrix into two sub-matrices, and somehow apply GAMG as a > preconditioner on the far matrix, and ILU on the interface-adjacent matrix. > Is this dumb or a complete misunderstanding of GASM? What is the dimension of the null space? "Bootstrap AMG" might be applicable to your problem, but it has yet to be implemented in a library. It is still expensive to construct, but may be better than the alternatives (except that using a sane spatial discretization is still likely better). -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.adams at columbia.edu Wed Mar 20 18:04:30 2013 From: mark.adams at columbia.edu (Mark F. Adams) Date: Wed, 20 Mar 2013 19:04:30 -0400 Subject: [petsc-users] KSP convergence problem In-Reply-To: References: <7C47EAB6-D02B-44C3-930D-3E110A7E63C6@columbia.edu> <369018A9-0934-4D50-90CD-E7CB5AEB3439@columbia.edu> Message-ID: On Mar 20, 2013, at 6:14 PM, John Mousel wrote: > Can you comment on a GASM type approach to find a solution for the null space? I notice that the null vectors that successfully make the true residual drop are only complicated in a very thin band around the interface. This band is easy to identify using a level set. Other than that, the null space vector has a low frequency variation. My thought was to break the matrix into two sub-matrices, and somehow apply GAMG as a preconditioner on the far matrix, and ILU on the interface-adjacent matrix. Is this dumb or a complete misunderstanding of GASM? > The null space in GAMG is not a projection, it does not have to be exact. Do you try using the 6 RBM or giving GAMG coordinates? Also, you might try not smoothing the (-pc_gamg_nsmooths 0). Unsymetric matrices can work better this way. > > On Wed, Mar 20, 2013 at 5:08 PM, Jed Brown wrote: > > On Wed, Mar 20, 2013 at 5:04 PM, John Mousel wrote: > I've wanted to scrap this approach for a long time, but moving away from these GFM-type treatments is not a choice that I've been allowed to follow through on for various reasons which are out of my control. > > Unless there are some clever tricks to characterize the null space or to keep preconditioners compatible with the null space, the folks making the decisions might have to reconsider. It doesn't matter how sexy a method looks if it requires a solve and that solve cannot be done efficiently. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Shuangshuang.Jin at pnnl.gov Wed Mar 20 18:18:16 2013 From: Shuangshuang.Jin at pnnl.gov (Jin, Shuangshuang) Date: Wed, 20 Mar 2013 16:18:16 -0700 Subject: [petsc-users] TSSetIFunction In-Reply-To: References: <6778DE83AB681D49BFC2CD850610FEB1018FC7CB4FB0@EMAIL04.pnl.gov> Message-ID: <6778DE83AB681D49BFC2CD850610FEB1018FC7CB500B@EMAIL04.pnl.gov> Thanks, I make the ?IFunction? and ?IJacobian? static in the header file and the mismatch goes away. Another question is I know ex19.c is using real numbers only, if I run it alone, I should use arch-real to compile it successfully. However, because my code has to do complex numbers computation somewhere else, I built the PETSc with an ARCH-complex. Now when I integrate ex19.c into my code, I get the following compilation error: [d3m956 at olympus ss00]$ make mpicxx -I/pic/projects/ds/petsc-dev/include -I/pic/projects/ds/petsc-dev/arch-complex/include -I/share/apps/openmpi/1.5.4/gcc/4.1.2/include -g -c -o simulation.o simulation.C simulation.C: In static member function ???static PetscErrorCode Simulation::IFunction(_p_TS*, PetscReal, _p_Vec*, _p_Vec*, _p_Vec*, void*)???: simulation.C:25: error: no match for ???operator/??? in ???std::operator* [with _Tp = double](((const std::complex&)((const std::complex*)(& std::operator* [with _Tp = double](((const std::complex&)((const std::complex*)(x + 16u))), ((const std::complex&)((const std::complex*)(x + 16u))))))), ((const std::complex&)((const std::complex*)(x + 16u)))) / 3??? make: *** [simulation.o] Error 1 I guess it is because of the complex number and real number mismatch. But I?m not sure if it?s the case. simulation.C:25 corresponds to line ?f[1] = (x[1]*x[1]*x[1]/3 - x[1])-x[0];? in the code: PetscErrorCode Simulation::IFunction(TS ts,PetscReal t,Vec X,Vec Xdot,Vec F,void *ctx) { PetscErrorCode ierr; PetscScalar *x,*xdot,*f; PetscFunctionBegin; ierr = VecGetArray(X,&x);CHKERRQ(ierr); ierr = VecGetArray(Xdot,&xdot);CHKERRQ(ierr); ierr = VecGetArray(F,&f);CHKERRQ(ierr); f[0] = xdot[0] + x[1]; f[1] = (x[1]*x[1]*x[1]/3 - x[1])-x[0]; ierr = VecRestoreArray(X,&x);CHKERRQ(ierr); ierr = VecRestoreArray(Xdot,&xdot);CHKERRQ(ierr); ierr = VecRestoreArray(F,&f);CHKERRQ(ierr); PetscFunctionReturn(0); } Thanks, Shuangshuang From: petsc-users-bounces at mcs.anl.gov [mailto:petsc-users-bounces at mcs.anl.gov] On Behalf Of Jed Brown Sent: Wednesday, March 20, 2013 2:52 PM To: PETSc users list Subject: Re: [petsc-users] TSSetIFunction You cannot use a member function as a callback. You can (with almost all compilers) use a _static_ member function. Note that static member functions do not have a "this" pointer. The void* argument in the callback should be set to the class so that you can use it as a "this" pointer. On Wed, Mar 20, 2013 at 4:47 PM, Jin, Shuangshuang > wrote: Hi, I use src\ts\examples\tutorials\ex19.c as an example to use PETSc DAE solver. I get the following problem while running my code: [d3m956 at olympus ss00]$ make mpicxx -I/pic/projects/ds/petsc-dev/include -I/pic/projects/ds/petsc-dev/arch-complex/include -I/share/apps/openmpi/1.5.4/gcc/4.1.2/include -g -c -o simulation.o simulation.C simulation.C: In member function ???PetscErrorCode Simulation::simu(_p_Mat*, _p_Mat*, _p_Mat*)???: simulation.C:80: error: argument of type ???PetscErrorCode (Simulation::)(_p_TS*, PetscReal, _p_Vec*, _p_Vec*, _p_Vec*, void*)??? does not match ???PetscErrorCode (*)(_p_TS*, PetscReal, _p_Vec*, _p_Vec*, _p_Vec*, void*)??? make: *** [simulation.o] Error 1 What does it mean? The IFunction is copied from ex19.c, PetscErrorCode Simulation::IFunction(TS ts,PetscReal t,Vec X,Vec Xdot,Vec F,void *ctx) { PetscErrorCode ierr; PetscScalar *x,*xdot,*f; PetscFunctionBegin; ierr = VecGetArray(X,&x);CHKERRQ(ierr); ierr = VecGetArray(Xdot,&xdot);CHKERRQ(ierr); ierr = VecGetArray(F,&f);CHKERRQ(ierr); f[0] = xdot[0] + x[1]; f[1] = (x[1]*x[1]*x[1]/3 - x[1])-x[0]; ierr = VecRestoreArray(X,&x);CHKERRQ(ierr); ierr = VecRestoreArray(Xdot,&xdot);CHKERRQ(ierr); ierr = VecRestoreArray(F,&f);CHKERRQ(ierr); PetscFunctionReturn(0); } And in Simulation::simu(Mat f1, Mat f2, Mat f3), I have: ierr = TSSetIFunction(ts,NULL,IFunction,&user);CHKERRQ(ierr); Thanks, Shuangshuang -------------- next part -------------- An HTML attachment was scrubbed... URL: From Shuangshuang.Jin at pnnl.gov Wed Mar 20 19:08:35 2013 From: Shuangshuang.Jin at pnnl.gov (Jin, Shuangshuang) Date: Wed, 20 Mar 2013 17:08:35 -0700 Subject: [petsc-users] TSSetIFunction In-Reply-To: <6778DE83AB681D49BFC2CD850610FEB1018FC7CB500B@EMAIL04.pnl.gov> References: <6778DE83AB681D49BFC2CD850610FEB1018FC7CB4FB0@EMAIL04.pnl.gov> <6778DE83AB681D49BFC2CD850610FEB1018FC7CB500B@EMAIL04.pnl.gov> Message-ID: <6778DE83AB681D49BFC2CD850610FEB1018FC7CB5016@EMAIL04.pnl.gov> As a test, I changed the line ? f[1] = (x[1]*x[1]*x[1]/3 - x[1])-x[0];? to ?f[1] = (PetscRealPart(x[1])*PetscRealPart(x[1])*PetscRealPart(x[1])/3 - PetscRealPart(x[1]))-PetscRealPart(x[0]);?, and it runs with the same results as I run ex19.c alone. However, I don?t understand why I only need to change this line but leave nothing else such as the line before it ?f[0] = xdot[0] + x[1];? unchanged? And can anyone please tell me in ex19.c what does this part of code do? PetscErrorCode ierr; PetscFunctionBegin; { const PetscReal A[3][3] = {{0,0,0}, {0.41421356237309504880,0,0}, {0.75,0.25,0}}, At[3][3] = {{0,0,0}, {0.12132034355964257320,0.29289321881345247560,0}, {0.20710678118654752440,0.50000000000000000000,0.29289321881345247560}}; ierr = TSARKIMEXRegister("myark2",2,3,&At[0][0],PETSC_NULL,PETSC_NULL,&A[0][0],PETSC_NULL,PETSC_NULL,PETSC_NULL,PETSC_NULL,0,PETSC_NULL,PETSC_NULL);CHKERRQ(ierr); } PetscFunctionReturn(0); It seems to me an initialization of the A matrix. But I looked into TSARKIMEXRegister, still couldn?t understand how it works. Thanks, Shuangshuang From: petsc-users-bounces at mcs.anl.gov [mailto:petsc-users-bounces at mcs.anl.gov] On Behalf Of Jin, Shuangshuang Sent: Wednesday, March 20, 2013 4:18 PM To: PETSc users list Subject: Re: [petsc-users] TSSetIFunction Thanks, I make the ?IFunction? and ?IJacobian? static in the header file and the mismatch goes away. Another question is I know ex19.c is using real numbers only, if I run it alone, I should use arch-real to compile it successfully. However, because my code has to do complex numbers computation somewhere else, I built the PETSc with an ARCH-complex. Now when I integrate ex19.c into my code, I get the following compilation error: [d3m956 at olympus ss00]$ make mpicxx -I/pic/projects/ds/petsc-dev/include -I/pic/projects/ds/petsc-dev/arch-complex/include -I/share/apps/openmpi/1.5.4/gcc/4.1.2/include -g -c -o simulation.o simulation.C simulation.C: In static member function ???static PetscErrorCode Simulation::IFunction(_p_TS*, PetscReal, _p_Vec*, _p_Vec*, _p_Vec*, void*)???: simulation.C:25: error: no match for ???operator/??? in ???std::operator* [with _Tp = double](((const std::complex&)((const std::complex*)(& std::operator* [with _Tp = double](((const std::complex&)((const std::complex*)(x + 16u))), ((const std::complex&)((const std::complex*)(x + 16u))))))), ((const std::complex&)((const std::complex*)(x + 16u)))) / 3??? make: *** [simulation.o] Error 1 I guess it is because of the complex number and real number mismatch. But I?m not sure if it?s the case. simulation.C:25 corresponds to line ?f[1] = (x[1]*x[1]*x[1]/3 - x[1])-x[0];? in the code: PetscErrorCode Simulation::IFunction(TS ts,PetscReal t,Vec X,Vec Xdot,Vec F,void *ctx) { PetscErrorCode ierr; PetscScalar *x,*xdot,*f; PetscFunctionBegin; ierr = VecGetArray(X,&x);CHKERRQ(ierr); ierr = VecGetArray(Xdot,&xdot);CHKERRQ(ierr); ierr = VecGetArray(F,&f);CHKERRQ(ierr); f[0] = xdot[0] + x[1]; f[1] = (x[1]*x[1]*x[1]/3 - x[1])-x[0]; ierr = VecRestoreArray(X,&x);CHKERRQ(ierr); ierr = VecRestoreArray(Xdot,&xdot);CHKERRQ(ierr); ierr = VecRestoreArray(F,&f);CHKERRQ(ierr); PetscFunctionReturn(0); } Thanks, Shuangshuang From: petsc-users-bounces at mcs.anl.gov [mailto:petsc-users-bounces at mcs.anl.gov] On Behalf Of Jed Brown Sent: Wednesday, March 20, 2013 2:52 PM To: PETSc users list Subject: Re: [petsc-users] TSSetIFunction You cannot use a member function as a callback. You can (with almost all compilers) use a _static_ member function. Note that static member functions do not have a "this" pointer. The void* argument in the callback should be set to the class so that you can use it as a "this" pointer. On Wed, Mar 20, 2013 at 4:47 PM, Jin, Shuangshuang > wrote: Hi, I use src\ts\examples\tutorials\ex19.c as an example to use PETSc DAE solver. I get the following problem while running my code: [d3m956 at olympus ss00]$ make mpicxx -I/pic/projects/ds/petsc-dev/include -I/pic/projects/ds/petsc-dev/arch-complex/include -I/share/apps/openmpi/1.5.4/gcc/4.1.2/include -g -c -o simulation.o simulation.C simulation.C: In member function ???PetscErrorCode Simulation::simu(_p_Mat*, _p_Mat*, _p_Mat*)???: simulation.C:80: error: argument of type ???PetscErrorCode (Simulation::)(_p_TS*, PetscReal, _p_Vec*, _p_Vec*, _p_Vec*, void*)??? does not match ???PetscErrorCode (*)(_p_TS*, PetscReal, _p_Vec*, _p_Vec*, _p_Vec*, void*)??? make: *** [simulation.o] Error 1 What does it mean? The IFunction is copied from ex19.c, PetscErrorCode Simulation::IFunction(TS ts,PetscReal t,Vec X,Vec Xdot,Vec F,void *ctx) { PetscErrorCode ierr; PetscScalar *x,*xdot,*f; PetscFunctionBegin; ierr = VecGetArray(X,&x);CHKERRQ(ierr); ierr = VecGetArray(Xdot,&xdot);CHKERRQ(ierr); ierr = VecGetArray(F,&f);CHKERRQ(ierr); f[0] = xdot[0] + x[1]; f[1] = (x[1]*x[1]*x[1]/3 - x[1])-x[0]; ierr = VecRestoreArray(X,&x);CHKERRQ(ierr); ierr = VecRestoreArray(Xdot,&xdot);CHKERRQ(ierr); ierr = VecRestoreArray(F,&f);CHKERRQ(ierr); PetscFunctionReturn(0); } And in Simulation::simu(Mat f1, Mat f2, Mat f3), I have: ierr = TSSetIFunction(ts,NULL,IFunction,&user);CHKERRQ(ierr); Thanks, Shuangshuang -------------- next part -------------- An HTML attachment was scrubbed... URL: From john.mousel at gmail.com Wed Mar 20 19:33:02 2013 From: john.mousel at gmail.com (John Mousel) Date: Wed, 20 Mar 2013 19:33:02 -0500 Subject: [petsc-users] KSP convergence problem In-Reply-To: References: <7C47EAB6-D02B-44C3-930D-3E110A7E63C6@columbia.edu> <369018A9-0934-4D50-90CD-E7CB5AEB3439@columbia.edu> Message-ID: Mark, This is a flow solver Poisson equation. Is the coordinate functionality applicable? John On Wed, Mar 20, 2013 at 6:04 PM, Mark F. Adams wrote: > > On Mar 20, 2013, at 6:14 PM, John Mousel wrote: > > Can you comment on a GASM type approach to find a solution for the null > space? I notice that the null vectors that successfully make the true > residual drop are only complicated in a very thin band around the > interface. This band is easy to identify using a level set. Other than > that, the null space vector has a low frequency variation. My thought was > to break the matrix into two sub-matrices, and somehow apply GAMG as a > preconditioner on the far matrix, and ILU on the interface-adjacent matrix. > Is this dumb or a complete misunderstanding of GASM? > > > The null space in GAMG is not a projection, it does not have to be exact. > Do you try using the 6 RBM or giving GAMG coordinates? > > Also, you might try not smoothing the (-pc_gamg_nsmooths 0). Unsymetric > matrices can work better this way. > > > > On Wed, Mar 20, 2013 at 5:08 PM, Jed Brown wrote: > >> >> On Wed, Mar 20, 2013 at 5:04 PM, John Mousel wrote: >> >>> I've wanted to scrap this approach for a long time, but moving away from >>> these GFM-type treatments is not a choice that I've been allowed to follow >>> through on for various reasons which are out of my control. >> >> >> Unless there are some clever tricks to characterize the null space or to >> keep preconditioners compatible with the null space, the folks making the >> decisions might have to reconsider. It doesn't matter how sexy a method >> looks if it requires a solve and that solve cannot be done efficiently. >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jedbrown at mcs.anl.gov Wed Mar 20 19:57:08 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Wed, 20 Mar 2013 19:57:08 -0500 Subject: [petsc-users] TSSetIFunction In-Reply-To: <6778DE83AB681D49BFC2CD850610FEB1018FC7CB500B@EMAIL04.pnl.gov> References: <6778DE83AB681D49BFC2CD850610FEB1018FC7CB4FB0@EMAIL04.pnl.gov> <6778DE83AB681D49BFC2CD850610FEB1018FC7CB500B@EMAIL04.pnl.gov> Message-ID: <87obedk1sr.fsf@59A2.org> "Jin, Shuangshuang" writes: > Another question is I know ex19.c is using real numbers only, if I run it alone, I should use arch-real to compile it successfully. > However, because my code has to do complex numbers computation somewhere else, I built the PETSc with an ARCH-complex. Now when I integrate ex19.c into my code, I get the following compilation error: > > [d3m956 at olympus ss00]$ make > mpicxx -I/pic/projects/ds/petsc-dev/include -I/pic/projects/ds/petsc-dev/arch-complex/include -I/share/apps/openmpi/1.5.4/gcc/4.1.2/include -g -c -o simulation.o simulation.C > simulation.C: In static member function ???static PetscErrorCode Simulation::IFunction(_p_TS*, PetscReal, _p_Vec*, _p_Vec*, _p_Vec*, void*)???: > simulation.C:25: error: no match for ???operator/??? in ???std::operator* [with _Tp = double](((const std::complex&)((const std::complex*)(& std::operator* [with _Tp = double](((const std::complex&)((const std::complex*)(x + 16u))), ((const std::complex&)((const std::complex*)(x + 16u))))))), ((const std::complex&)((const std::complex*)(x + 16u)))) / 3??? > make: *** [simulation.o] Error 1 > > I guess it is because of the complex number and real number mismatch. But I?m not sure if it?s the case. > simulation.C:25 corresponds to line ?f[1] = (x[1]*x[1]*x[1]/3 - x[1])-x[0];? in the code: std::complex did not overload division. You can change '3' above to '3.' to make C++ use a suitable overloaded type. This lack of promotion is the nature of std::complex. C99 complex is friendlier in this regard, having no trouble with this code. From jedbrown at mcs.anl.gov Wed Mar 20 19:59:35 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Wed, 20 Mar 2013 19:59:35 -0500 Subject: [petsc-users] TSSetIFunction In-Reply-To: <6778DE83AB681D49BFC2CD850610FEB1018FC7CB5016@EMAIL04.pnl.gov> References: <6778DE83AB681D49BFC2CD850610FEB1018FC7CB4FB0@EMAIL04.pnl.gov> <6778DE83AB681D49BFC2CD850610FEB1018FC7CB500B@EMAIL04.pnl.gov> <6778DE83AB681D49BFC2CD850610FEB1018FC7CB5016@EMAIL04.pnl.gov> Message-ID: <87li9hk1oo.fsf@59A2.org> "Jin, Shuangshuang" writes: > As a test, I changed the line ? f[1] = (x[1]*x[1]*x[1]/3 - x[1])-x[0];? to ?f[1] = (PetscRealPart(x[1])*PetscRealPart(x[1])*PetscRealPart(x[1])/3 - PetscRealPart(x[1]))-PetscRealPart(x[0]);?, and it runs with the same results as I run ex19.c alone. > > However, I don?t understand why I only need to change this line but leave nothing else such as the line before it ?f[0] = xdot[0] + x[1];? unchanged? You were just missing an overload. > And can anyone please tell me in ex19.c what does this part of code do? > > PetscErrorCode ierr; > > PetscFunctionBegin; > { > const PetscReal > A[3][3] = {{0,0,0}, > {0.41421356237309504880,0,0}, > {0.75,0.25,0}}, > At[3][3] = {{0,0,0}, > {0.12132034355964257320,0.29289321881345247560,0}, > {0.20710678118654752440,0.50000000000000000000,0.29289321881345247560}}; > ierr = TSARKIMEXRegister("myark2",2,3,&At[0][0],PETSC_NULL,PETSC_NULL,&A[0][0],PETSC_NULL,PETSC_NULL,PETSC_NULL,PETSC_NULL,0,PETSC_NULL,PETSC_NULL);CHKERRQ(ierr); > } > PetscFunctionReturn(0); > > It seems to me an initialization of the A matrix. But I looked into TSARKIMEXRegister, still couldn?t understand how it works. This registers an additive Runge-Kutta IMEX method by providing its "Butcher table". Don't worry about this unless you are designing integration methods. This method, and many others are already in the library. From mpovolot at purdue.edu Thu Mar 21 00:10:08 2013 From: mpovolot at purdue.edu (Michael Povolotskyi) Date: Thu, 21 Mar 2013 01:10:08 -0400 Subject: [petsc-users] question about Hermitian matrix Message-ID: <514A9630.9040108@purdue.edu> Hello, I have to perform multiplications of a Hermitian distributed matrix by a distributed vector. Questions: 1) will setting the MAT_HERMITIAN option save the memory of the matrix storage? 2) will it save me time during the multiplication? Thank you, Michael. ** -------------- next part -------------- An HTML attachment was scrubbed... URL: From sperif at gmail.com Thu Mar 21 05:30:31 2013 From: sperif at gmail.com (Pierre-Yves Aquilanti) Date: Thu, 21 Mar 2013 18:30:31 +0800 Subject: [petsc-users] petsc-3.3-p6/src/snes/examples/tutorials/ex10.c compilation problem Message-ID: <9163B60C-A694-4A7F-9AEC-8467F9440FB5@gmail.com> Dear All, I am trying to compile the example 10.c located in the directory /petsc-3.3-p6/src/snes/examples/tutorials/ but facing a lot of compilation errors related to a ALE object (??). In fact, I have tried to compile this example using the "make ex10" command like for other examples on different platforms (OSX 10.8 and Linux x64) but no success. I am using the last version of PETSc and also tried with the dev version with no luck. Furthermore, after testing the other exercises, I noticed that ex12.c had the same problem (with the ALE object). Is there is an error with ex10 and ex12 of SNES tutorials ? How can I compile them ? Moreover, I noticed that the SNES tutorials directory contained a ex10d directory containing a ex10.c source file. Is this related to the ex10.c file in the SNES tutorials directory ? Thanks for you help. Best regards, PY -------- Errors examples ----------------------- ex10.c: In function ?CreateProblem_gen_0?: ex10.c:35: error: expected expression before ?:? token ex10.c:39: warning: implicit declaration of function ?DMMeshGetMesh? ex10.c:39: error: ?m? undeclared (first use in this function) ex10.c:39: error: (Each undeclared identifier is reported only once ex10.c:39: error: for each function it appears in.) ex10.c:41: error: nested functions are disabled, use -fnested-functions to re-enable ex10.c:41: error: expected ?=?, ?,?, ?;?, ?asm? or ?__attribute__? before ?:? token ex10.c:41: error: expected expression before ?:? token ex10.c:43: error: ?d? undeclared (first use in this function) ex10.c:35: warning: label ?ALE? defined but not used ex10.c: At top level: ex10.c:62: error: expected declaration specifiers or ?...? before ?SectionReal? ex10.c:62: error: expected declaration specifiers or ?...? before ?SectionReal? ex10.c:62: error: expected declaration specifiers or ?...? before ?SectionReal? ex10.c: In function ?FormFunctionLocal_U?: ex10.c:64: error: expected expression before ?:? token ex10.c:65: error: duplicate label ?ALE? -------- More errors after ----------------------- From jedbrown at mcs.anl.gov Thu Mar 21 06:48:02 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Thu, 21 Mar 2013 06:48:02 -0500 Subject: [petsc-users] question about Hermitian matrix In-Reply-To: <514A9630.9040108@purdue.edu> References: <514A9630.9040108@purdue.edu> Message-ID: On Thu, Mar 21, 2013 at 12:10 AM, Michael Povolotskyi wrote: > Hello, > I have to perform multiplications of a Hermitian distributed matrix by a > distributed vector. > > Questions: > 1) will setting the MAT_HERMITIAN option save the memory of the matrix > storage? > 2) will it save me time during the multiplication? > No, it only changes default preconditioner settings (like incomplete Cholesky instead of ILU and symmetric ASM instead of RASM). You can explicitly use the SBAIJ format to use a symmetric format (which saves memory, but it is sometimes slower because it has to communicate twice). -------------- next part -------------- An HTML attachment was scrubbed... URL: From jedbrown at mcs.anl.gov Thu Mar 21 08:06:52 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Thu, 21 Mar 2013 08:06:52 -0500 Subject: [petsc-users] petsc-3.3-p6/src/snes/examples/tutorials/ex10.c compilation problem In-Reply-To: <9163B60C-A694-4A7F-9AEC-8467F9440FB5@gmail.com> References: <9163B60C-A694-4A7F-9AEC-8467F9440FB5@gmail.com> Message-ID: On Thu, Mar 21, 2013 at 5:30 AM, Pierre-Yves Aquilanti wrote: > Dear All, > > I am trying to compile the example 10.c located in the directory > /petsc-3.3-p6/src/snes/examples/tutorials/ but facing a lot of compilation > errors related to a ALE object (??). > That example would only work if you configure PETSc --with-sieve (and a bunch of other options). Sieve is deprecated so don't sweat it. We have a replacement called DMPlex which does not use C++ and for which there are some examples. What are you trying to do? We can likely point you to a better example. > In fact, I have tried to compile this example using the "make ex10" > command like for other examples on different platforms (OSX 10.8 and > Linux x64) but no success. I am using the last version of PETSc and also > tried with the dev version with no luck. > > Furthermore, after testing the other exercises, I noticed that ex12.c had > the same problem (with the ALE object). > > Is there is an error with ex10 and ex12 of SNES tutorials ? How can I > compile them ? Moreover, I noticed that the SNES tutorials directory > contained a ex10d directory containing a ex10.c source file. Is this > related to the ex10.c file in the SNES tutorials directory ? > No, there is no relationship between ex10d/ex10.c and ex10.c. Matt, can you rename/delete ex10.c? -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.adams at columbia.edu Thu Mar 21 08:24:12 2013 From: mark.adams at columbia.edu (Mark F. Adams) Date: Thu, 21 Mar 2013 09:24:12 -0400 Subject: [petsc-users] KSP convergence problem In-Reply-To: References: <7C47EAB6-D02B-44C3-930D-3E110A7E63C6@columbia.edu> <369018A9-0934-4D50-90CD-E7CB5AEB3439@columbia.edu> Message-ID: No, On Mar 20, 2013, at 8:33 PM, John Mousel wrote: > Mark, > > This is a flow solver Poisson equation. Is the coordinate functionality applicable? > > John > > > On Wed, Mar 20, 2013 at 6:04 PM, Mark F. Adams wrote: > > On Mar 20, 2013, at 6:14 PM, John Mousel wrote: > >> Can you comment on a GASM type approach to find a solution for the null space? I notice that the null vectors that successfully make the true residual drop are only complicated in a very thin band around the interface. This band is easy to identify using a level set. Other than that, the null space vector has a low frequency variation. My thought was to break the matrix into two sub-matrices, and somehow apply GAMG as a preconditioner on the far matrix, and ILU on the interface-adjacent matrix. Is this dumb or a complete misunderstanding of GASM? >> > > The null space in GAMG is not a projection, it does not have to be exact. Do you try using the 6 RBM or giving GAMG coordinates? > > Also, you might try not smoothing the (-pc_gamg_nsmooths 0). Unsymetric matrices can work better this way. > > >> >> On Wed, Mar 20, 2013 at 5:08 PM, Jed Brown wrote: >> >> On Wed, Mar 20, 2013 at 5:04 PM, John Mousel wrote: >> I've wanted to scrap this approach for a long time, but moving away from these GFM-type treatments is not a choice that I've been allowed to follow through on for various reasons which are out of my control. >> >> Unless there are some clever tricks to characterize the null space or to keep preconditioners compatible with the null space, the folks making the decisions might have to reconsider. It doesn't matter how sexy a method looks if it requires a solve and that solve cannot be done efficiently. >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zhangw at chalmers.se Thu Mar 21 11:20:27 2013 From: zhangw at chalmers.se (Zhang Wei) Date: Thu, 21 Mar 2013 17:20:27 +0100 Subject: [petsc-users] problem of getting eigenvector Message-ID: <1363882827.9354.50.camel@smt-218-23.chl.chalmers.se> Hi I am using EPSGetEigenpair() command to get eigenvector for maxtrix-free problem. it seems this command still will load the operator to calculate the eigenpairs. does anyone can tell me the reason to do so? for me I think when solver get converged , the eigenpairs are already get.. there is no need to do so. Wei From jroman at dsic.upv.es Thu Mar 21 11:25:39 2013 From: jroman at dsic.upv.es (Jose E. Roman) Date: Thu, 21 Mar 2013 17:25:39 +0100 Subject: [petsc-users] problem of getting eigenvector In-Reply-To: <1363882827.9354.50.camel@smt-218-23.chl.chalmers.se> References: <1363882827.9354.50.camel@smt-218-23.chl.chalmers.se> Message-ID: <957D3D99-F878-4BF6-8322-5553369FFA7A@dsic.upv.es> El 21/03/2013, a las 17:20, Zhang Wei escribi?: > Hi > > I am using EPSGetEigenpair() command to get eigenvector for maxtrix-free > problem. it seems this command still will load the operator to calculate > the eigenpairs. does anyone can tell me the reason to do so? for me I > think when solver get converged , the eigenpairs are already get.. there > is no need to do so. > > Wei > In some cases, the operator can be used for purification of the computed eigenvectors, to get rid of components in the nullspace of B in generalized problems. Can you provide more information? Jose From jroman at dsic.upv.es Thu Mar 21 11:45:39 2013 From: jroman at dsic.upv.es (Jose E. Roman) Date: Thu, 21 Mar 2013 17:45:39 +0100 Subject: [petsc-users] problem of getting eigenvector In-Reply-To: <1363883946.9354.60.camel@smt-218-23.chl.chalmers.se> References: <1363882827.9354.50.camel@smt-218-23.chl.chalmers.se> <957D3D99-F878-4BF6-8322-5553369FFA7A@dsic.upv.es> <1363883946.9354.60.camel@smt-218-23.chl.chalmers.se> Message-ID: <58712472-1906-400F-A703-FD22915E4C25@dsic.upv.es> El 21/03/2013, a las 17:39, Zhang Wei escribi?: > Thanks for the relpy. > I change the ex3.c to a c++ code and put functions in a class and add > an iteration idx inside. once load the laplacianMultplier idx++, and > print it out. Finnaly I found that solver print this index at displaying > part so I suppose the solver load operater again when calculte the > eigenpairs. and also an odd thing to me is that it will not print > anything before full fill the krylov space. > > wei I do not understand what your problem is. If you want help, please provide complete error messages together with fragments of code that cause them. Also, answer to the list, not to me directly. Jose From dasans at gmail.com Fri Mar 22 06:58:56 2013 From: dasans at gmail.com (Anil .) Date: Fri, 22 Mar 2013 17:28:56 +0530 Subject: [petsc-users] Trying to modify petrbf to use custom text file Message-ID: Hi, I have a text file containing N rows. Each row with x,y,omega values. I am trying to interpolate this data onto a regular grid using petrbf But the KSP does not converge and am not able to find the reason. The code is available with the text files at https://www.dropbox.com/s/cypuwugbxo07kx0/rbf-interpolation.tar.gz I am very new to petsc and any direction how o proceed would be helpful. -- Sincerely Anil Das P V -------------- next part -------------- An HTML attachment was scrubbed... URL: From gaurish108 at gmail.com Fri Mar 22 10:59:26 2013 From: gaurish108 at gmail.com (Gaurish Telang) Date: Fri, 22 Mar 2013 11:59:26 -0400 Subject: [petsc-users] Problem of solving simple example in SNES in parallel Message-ID: Hello, I am trying to learn SNES to solve some non-linear equations. Consider the following non-linear equation which has solution (x,y,z) = (2,3,4) x^2 - y^2 + z^2 = 11 xy + y^2 - 3z = 3 x - xz + yz = 6 For solving this, I am able to get the following simple code I wrote to work on 1 processor, but it seems to be failing for 2 or more processors. The errors I am getting when I run with two processors (mpirun -n 2 ./a.out -snes_monitor ) Can anybody suggestions to fix this issue? It looks like a very trivial problem, but I am not sure what is wrong. (The code I wrote is after the error) %--------------------------------------------------- The error is [0]PETSC ERROR: PetscMallocValidate: error detected at SNESComputeFunction() line 1889 in /home/gaurish108/Software/petsc-3.3-p5/src/snes/interface/snes.c [0]PETSC ERROR: Memory [id=0(16)] at address 0xa1933f0 is corrupted (probably write past end of array) [0]PETSC ERROR: Memory originally allocated in VecCreate_MPI_Private() line 193 in /home/gaurish108/Software/petsc-3.3-p5/src/vec/vec/impls/mpi/pbvec.c [1]PETSC ERROR: PetscMallocValidate: error detected at SNESComputeFunction() line 1889 in /home/gaurish108/Software/petsc-3.3-p5/src/snes/interface/snes.c [1]PETSC ERROR: Memory [id=0(16)] at address 0xa04c350 is corrupted (probably write past end of array) [1]PETSC ERROR: Memory originally allocated in VecCreate_MPI_Private() line 193 in /home/gaurish108/Software/petsc-3.3-p5/src/vec/vec/impls/mpi/pbvec.c [1]PETSC ERROR: --------------------- Error Message ------------------------------------ [1]PETSC ERROR: Memory corruption! [1]PETSC ERROR: ! [1]PETSC ERROR: ------------------------------------------------------------------------ [1]PETSC ERROR: Petsc Release Version 3.3.0, Patch 5, Sat Dec 1 15:10:41 CST 2012 [1]PETSC ERROR: See docs/changes/index.html for recent updates. [1]PETSC ERROR: See docs/faq.html for hints about trouble shooting. [0]PETSC ERROR: --------------------- Error Message ------------------------------------ [0]PETSC ERROR: Memory corruption! [0]PETSC ERROR: ! [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: Petsc Release Version 3.3.0, Patch 5, Sat Dec 1 15:10:41 CST 2012 [0]PETSC ERROR: See docs/changes/index.html for recent updates. [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. [0]PETSC ERROR: [1]PETSC ERROR: See docs/index.html for manual pages. [1]PETSC ERROR: ------------------------------------------------------------------------ [1]PETSC ERROR: ./gaurish on a linux-gnu named gaurish108 by gaurish108 Fri Mar 22 11:58:01 2013 [1]PETSC ERROR: Libraries linked from /home/gaurish108/Software/petsc-3.3-p5/linux-gnu-c-yes-debug-refblas/lib [1]PETSC ERROR: Configure run at Tue Feb 19 20:22:20 2013 [1]PETSC ERROR: Configure options --download-f-blas-lapack=1 [1]PETSC ERROR: ------------------------------------------------------------------------ [1]PETSC ERROR: PetscMallocValidate() line 150 in /home/gaurish108/Software/petsc-3.3-p5/src/sys/memory/mtr.c [1]PETSC ERROR: SNESComputeFunction() line 1889 in /home/gaurish108/Software/petsc-3.3-p5/src/snes/interface/snes.c [1]PETSC ERROR: SNESSolve_LS() line 161 in /home/gaurish108/Software/petsc-3.3-p5/src/snes/impls/ls/ls.c [1]PETSC ERROR: SNESSolve() line 3536 in /home/gaurish108/Software/petsc-3.3-p5/src/snes/interface/snes.c [1]PETSC ERROR: main() line 69 in gaurish.c See docs/index.html for manual pages. [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: ./gaurish on a linux-gnu named gaurish108 by gaurish108 Fri Mar 22 11:58:01 2013 [0]PETSC ERROR: Libraries linked from /home/gaurish108/Software/petsc-3.3-p5/linux-gnu-c-yes-debug-refblas/lib [0]PETSC ERROR: Configure run at Tue Feb 19 20:22:20 2013 [0]PETSC ERROR: Configure options --download-f-blas-lapack=1 [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: PetscMallocValidate() line 150 in /home/gaurish108/Software/petsc-3.3-p5/src/sys/memory/mtr.c [0]PETSC ERROR: SNESComputeFunction() line 1889 in /home/gaurish108/Software/petsc-3.3-p5/src/snes/interface/snes.c [0]PETSC ERROR: SNESSolve_LS() line 161 in /home/gaurish108/Software/petsc-3.3-p5/src/snes/impls/ls/ls.c [0]PETSC ERROR: SNESSolve() line 3536 in /home/gaurish108/Software/petsc-3.3-p5/src/snes/interface/snes.c [0]PETSC ERROR: main() line 69 in gaurish.c -------------------------------------------------------------------------- MPI_ABORT was invoked on rank 1 in communicator MPI_COMM_WORLD with errorcode 78. NOTE: invoking MPI_ABORT causes Open MPI to kill all MPI processes. You may or may not see output from other processes, depending on exactly when Open MPI kills them. -------------------------------------------------------------------------- -------------------------------------------------------------------------- mpirun has exited due to process rank 1 with PID 17933 on node gaurish108 exiting without calling "finalize". This may have caused other processes in the application to be terminated by signals sent by mpirun (as reported here). -------------------------------------------------------------------------- [gaurish108:17931] 1 more process has sent help message help-mpi-api.txt / mpi-abort [gaurish108:17931] Set MCA parameter "orte_base_help_aggregate" to 0 to see all help / error messages %------------------------------------------------------ The code is static char help[] = "Shows solve a nonlinear equation using Newton iteration method.\n\n"; #include #include #include #include #include /* User-defined routines*/ extern PetscErrorCode FormJacobian(SNES,Vec,Mat*,Mat*,MatStructure*,void*); extern PetscErrorCode FormFunction(SNES,Vec,Vec,void*); extern PetscErrorCode FormInitialGuess(Vec); extern PetscErrorCode Monitor(SNES,PetscInt,PetscReal,void *); #undef __FUNCT__ #define __FUNCT__ "main" int main(int argc,char **argv) { SNES snes; /* SNES context */ Vec x,r,F; /* vectors */ Mat J; /* Jacobian matrix */ PetscErrorCode ierr; PetscInt its,n = 3,i,maxit,maxf; PetscMPIInt size; PetscScalar iniRHS[3]; PetscInitialize(&argc,&argv,(char *)0,help); ierr = MPI_Comm_size(PETSC_COMM_WORLD,&size);CHKERRQ(ierr); ierr = PetscOptionsGetInt(PETSC_NULL,"-n",&n,PETSC_NULL);CHKERRQ(ierr); //------------------------------------------------------------------------------- ierr = SNESCreate(PETSC_COMM_WORLD,&snes);CHKERRQ(ierr); ierr = VecCreate(PETSC_COMM_WORLD,&x);CHKERRQ(ierr); ierr = VecSetSizes(x,PETSC_DECIDE,n);CHKERRQ(ierr); ierr = VecSetFromOptions(x);CHKERRQ(ierr); ierr = VecDuplicate(x,&r);CHKERRQ(ierr); ierr = VecDuplicate(x,&F);CHKERRQ(ierr); ierr = SNESSetFunction(snes,r,FormFunction,(void*)F);CHKERRQ(ierr); ierr = MatCreate(PETSC_COMM_WORLD,&J);CHKERRQ(ierr); ierr = MatSetSizes(J,PETSC_DECIDE,PETSC_DECIDE,n,n);CHKERRQ(ierr); ierr = MatSetFromOptions(J);CHKERRQ(ierr); ierr = MatSetUp(J);CHKERRQ(ierr); ierr = SNESSetJacobian(snes,J,J,FormJacobian,PETSC_NULL);CHKERRQ(ierr); ierr = SNESSetFromOptions(snes);CHKERRQ(ierr); // Set RHS of equation to F iniRHS[0]=11; iniRHS[1]=3; iniRHS[2]=6; for (i=0;i From mark.adams at columbia.edu Fri Mar 22 11:47:06 2013 From: mark.adams at columbia.edu (Mark F. Adams) Date: Fri, 22 Mar 2013 12:47:06 -0400 Subject: [petsc-users] Problem of solving simple example in SNES in parallel In-Reply-To: References: Message-ID: <5DDFA334-AA02-4016-B750-63DC0FA96B7F@columbia.edu> You seem to be running the serial code in FormFunction. You are setting all 3 equation but you only have 1 or 2 (probably with 2 processor) so you are overwriting memory with your f[2] = ?. You need to just set the equations that you have locally. You seem to call VecGetSizem call VecGetLocalSize and and figure out which equations you own and any set them. On Mar 22, 2013, at 11:59 AM, Gaurish Telang wrote: > Hello, > > I am trying to learn SNES to solve some non-linear equations. > > Consider the following non-linear equation which has solution (x,y,z) = (2,3,4) > > x^2 - y^2 + z^2 = 11 > xy + y^2 - 3z = 3 > x - xz + yz = 6 > > For solving this, I am able to get the following simple code I wrote to work on 1 processor, but it seems to be failing for 2 or more processors. > > The errors I am getting when I run with two processors (mpirun -n 2 ./a.out -snes_monitor ) > Can anybody suggestions to fix this issue? It looks like a very trivial problem, but I am not sure what is wrong. > > (The code I wrote is after the error) > > %--------------------------------------------------- > The error is > [0]PETSC ERROR: PetscMallocValidate: error detected at SNESComputeFunction() line 1889 in /home/gaurish108/Software/petsc-3.3-p5/src/snes/interface/snes.c > [0]PETSC ERROR: Memory [id=0(16)] at address 0xa1933f0 is corrupted (probably write past end of array) > [0]PETSC ERROR: Memory originally allocated in VecCreate_MPI_Private() line 193 in /home/gaurish108/Software/petsc-3.3-p5/src/vec/vec/impls/mpi/pbvec.c > [1]PETSC ERROR: PetscMallocValidate: error detected at SNESComputeFunction() line 1889 in /home/gaurish108/Software/petsc-3.3-p5/src/snes/interface/snes.c > [1]PETSC ERROR: Memory [id=0(16)] at address 0xa04c350 is corrupted (probably write past end of array) > [1]PETSC ERROR: Memory originally allocated in VecCreate_MPI_Private() line 193 in /home/gaurish108/Software/petsc-3.3-p5/src/vec/vec/impls/mpi/pbvec.c > [1]PETSC ERROR: --------------------- Error Message ------------------------------------ > [1]PETSC ERROR: Memory corruption! > [1]PETSC ERROR: ! > [1]PETSC ERROR: ------------------------------------------------------------------------ > [1]PETSC ERROR: Petsc Release Version 3.3.0, Patch 5, Sat Dec 1 15:10:41 CST 2012 > [1]PETSC ERROR: See docs/changes/index.html for recent updates. > [1]PETSC ERROR: See docs/faq.html for hints about trouble shooting. > [0]PETSC ERROR: --------------------- Error Message ------------------------------------ > [0]PETSC ERROR: Memory corruption! > [0]PETSC ERROR: ! > [0]PETSC ERROR: ------------------------------------------------------------------------ > [0]PETSC ERROR: Petsc Release Version 3.3.0, Patch 5, Sat Dec 1 15:10:41 CST 2012 > [0]PETSC ERROR: See docs/changes/index.html for recent updates. > [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. > [0]PETSC ERROR: [1]PETSC ERROR: See docs/index.html for manual pages. > [1]PETSC ERROR: ------------------------------------------------------------------------ > [1]PETSC ERROR: ./gaurish on a linux-gnu named gaurish108 by gaurish108 Fri Mar 22 11:58:01 2013 > [1]PETSC ERROR: Libraries linked from /home/gaurish108/Software/petsc-3.3-p5/linux-gnu-c-yes-debug-refblas/lib > [1]PETSC ERROR: Configure run at Tue Feb 19 20:22:20 2013 > [1]PETSC ERROR: Configure options --download-f-blas-lapack=1 > [1]PETSC ERROR: ------------------------------------------------------------------------ > [1]PETSC ERROR: PetscMallocValidate() line 150 in /home/gaurish108/Software/petsc-3.3-p5/src/sys/memory/mtr.c > [1]PETSC ERROR: SNESComputeFunction() line 1889 in /home/gaurish108/Software/petsc-3.3-p5/src/snes/interface/snes.c > [1]PETSC ERROR: SNESSolve_LS() line 161 in /home/gaurish108/Software/petsc-3.3-p5/src/snes/impls/ls/ls.c > [1]PETSC ERROR: SNESSolve() line 3536 in /home/gaurish108/Software/petsc-3.3-p5/src/snes/interface/snes.c > [1]PETSC ERROR: main() line 69 in gaurish.c > See docs/index.html for manual pages. > [0]PETSC ERROR: ------------------------------------------------------------------------ > [0]PETSC ERROR: ./gaurish on a linux-gnu named gaurish108 by gaurish108 Fri Mar 22 11:58:01 2013 > [0]PETSC ERROR: Libraries linked from /home/gaurish108/Software/petsc-3.3-p5/linux-gnu-c-yes-debug-refblas/lib > [0]PETSC ERROR: Configure run at Tue Feb 19 20:22:20 2013 > [0]PETSC ERROR: Configure options --download-f-blas-lapack=1 > [0]PETSC ERROR: ------------------------------------------------------------------------ > [0]PETSC ERROR: PetscMallocValidate() line 150 in /home/gaurish108/Software/petsc-3.3-p5/src/sys/memory/mtr.c > [0]PETSC ERROR: SNESComputeFunction() line 1889 in /home/gaurish108/Software/petsc-3.3-p5/src/snes/interface/snes.c > [0]PETSC ERROR: SNESSolve_LS() line 161 in /home/gaurish108/Software/petsc-3.3-p5/src/snes/impls/ls/ls.c > [0]PETSC ERROR: SNESSolve() line 3536 in /home/gaurish108/Software/petsc-3.3-p5/src/snes/interface/snes.c > [0]PETSC ERROR: main() line 69 in gaurish.c > -------------------------------------------------------------------------- > MPI_ABORT was invoked on rank 1 in communicator MPI_COMM_WORLD > with errorcode 78. > > NOTE: invoking MPI_ABORT causes Open MPI to kill all MPI processes. > You may or may not see output from other processes, depending on > exactly when Open MPI kills them. > -------------------------------------------------------------------------- > -------------------------------------------------------------------------- > mpirun has exited due to process rank 1 with PID 17933 on > node gaurish108 exiting without calling "finalize". This may > have caused other processes in the application to be > terminated by signals sent by mpirun (as reported here). > -------------------------------------------------------------------------- > [gaurish108:17931] 1 more process has sent help message help-mpi-api.txt / mpi-abort > [gaurish108:17931] Set MCA parameter "orte_base_help_aggregate" to 0 to see all help / error messages > > > > %------------------------------------------------------ > The code is > > static char help[] = "Shows solve a nonlinear equation using Newton iteration method.\n\n"; > #include > #include > #include > #include > #include > /* User-defined routines*/ > extern PetscErrorCode FormJacobian(SNES,Vec,Mat*,Mat*,MatStructure*,void*); > extern PetscErrorCode FormFunction(SNES,Vec,Vec,void*); > extern PetscErrorCode FormInitialGuess(Vec); > extern PetscErrorCode Monitor(SNES,PetscInt,PetscReal,void *); > #undef __FUNCT__ > #define __FUNCT__ "main" > int main(int argc,char **argv) > { SNES snes; /* SNES context */ > Vec x,r,F; /* vectors */ > Mat J; /* Jacobian matrix */ > PetscErrorCode ierr; > PetscInt its,n = 3,i,maxit,maxf; > PetscMPIInt size; > PetscScalar iniRHS[3]; > > PetscInitialize(&argc,&argv,(char *)0,help); > ierr = MPI_Comm_size(PETSC_COMM_WORLD,&size);CHKERRQ(ierr); > ierr = PetscOptionsGetInt(PETSC_NULL,"-n",&n,PETSC_NULL);CHKERRQ(ierr); > //------------------------------------------------------------------------------- > ierr = SNESCreate(PETSC_COMM_WORLD,&snes);CHKERRQ(ierr); > > ierr = VecCreate(PETSC_COMM_WORLD,&x);CHKERRQ(ierr); > ierr = VecSetSizes(x,PETSC_DECIDE,n);CHKERRQ(ierr); > ierr = VecSetFromOptions(x);CHKERRQ(ierr); > ierr = VecDuplicate(x,&r);CHKERRQ(ierr); > ierr = VecDuplicate(x,&F);CHKERRQ(ierr); > > ierr = SNESSetFunction(snes,r,FormFunction,(void*)F);CHKERRQ(ierr); > > ierr = MatCreate(PETSC_COMM_WORLD,&J);CHKERRQ(ierr); > ierr = MatSetSizes(J,PETSC_DECIDE,PETSC_DECIDE,n,n);CHKERRQ(ierr); > ierr = MatSetFromOptions(J);CHKERRQ(ierr); > ierr = MatSetUp(J);CHKERRQ(ierr); > ierr = SNESSetJacobian(snes,J,J,FormJacobian,PETSC_NULL);CHKERRQ(ierr); > > ierr = SNESSetFromOptions(snes);CHKERRQ(ierr); > > // Set RHS of equation to F > iniRHS[0]=11; iniRHS[1]=3; iniRHS[2]=6; > for (i=0;i { > ierr = VecSetValues(F,1,&i,&iniRHS[i],INSERT_VALUES);CHKERRQ(ierr); > } > // initial guess > ierr = FormInitialGuess(x);CHKERRQ(ierr); > > ierr = SNESSolve(snes,PETSC_NULL,x);CHKERRQ(ierr); // The command to call to solve the equation. > > /* Free work space. All PETSc objects should be destroyed when they are no longer needed*/ > ierr = VecDestroy(&x);CHKERRQ(ierr); ierr = VecDestroy(&r);CHKERRQ(ierr); > ierr = VecDestroy(&F);CHKERRQ(ierr); > ierr = MatDestroy(&J);CHKERRQ(ierr); ierr = SNESDestroy(&snes);CHKERRQ(ierr); > ierr = PetscFinalize(); > return 0; > } > > > #undef __FUNCT__ > #define __FUNCT__ "FormInitialGuess" > /* > FormInitialGuess - Computes initial guess. > > Input/Output Parameter: > . x - the solution vector > */ > PetscErrorCode FormInitialGuess(Vec x) > { > PetscErrorCode ierr; > PetscScalar pfive =10; > ierr = VecSet(x,pfive);CHKERRQ(ierr); > return 0; > } > > > /* ------------------------------------------------------------------- */ > #undef __FUNCT__ > #define __FUNCT__ "FormFunction" > /* > FormFunction - Evaluates nonlinear function, F(x). > > Input Parameters: > . snes - the SNES context > . x - input vector > . ctx - optional user-defined context, as set by SNESSetFunction() > > Output Parameter: > . f - function vector > > Note: > The user-defined context can contain any application-specific data > needed for the function evaluation (such as various parameters, work > vectors, and grid information). In this program the context is just > a vector containing the right-hand-side of the discretized PDE. > */ > > PetscErrorCode FormFunction(SNES snes,Vec x,Vec f,void *ctx) > { > Vec g = (Vec)ctx; > PetscScalar *xx,*ff,*gg; > PetscErrorCode ierr; > PetscInt n; > > /* > Get pointers to vector data. > - For default PETSc vectors, VecGetArray() returns a pointer to > the data array. Otherwise, the routine is implementation dependent. > - You MUST call VecRestoreArray() when you no longer need access to > the array. > */ > ierr = VecGetArray(x,&xx);CHKERRQ(ierr); > ierr = VecGetArray(f,&ff);CHKERRQ(ierr); > ierr = VecGetArray(g,&gg);CHKERRQ(ierr); > > /* > Compute function > */ > ierr = VecGetSize(x,&n);CHKERRQ(ierr); > > ff[0]=pow(xx[0],2)-pow(xx[1],2)+pow(xx[2],2)-gg[0]; > ff[1]=xx[0]*xx[1]+pow(xx[1],2)-3.0*xx[2]-gg[1]; > ff[2]=xx[0]-xx[0]*xx[2]+xx[1]*xx[2]-gg[2]; > > /* > Restore vectors > */ > ierr = VecRestoreArray(x,&xx);CHKERRQ(ierr); > ierr = VecRestoreArray(f,&ff);CHKERRQ(ierr); > ierr = VecRestoreArray(g,&gg);CHKERRQ(ierr); > return 0; > } > > > > /* ------------------------------------------------------------------- */ > #undef __FUNCT__ > #define __FUNCT__ "FormJacobian" > /* > FormJacobian - Evaluates Jacobian matrix. > > Input Parameters: > . snes - the SNES context > . x - input vector > . dummy - optional user-defined context (not used here) > > Output Parameters: > . jac - Jacobian matrix > . B - optionally different preconditioning matrix > . flag - flag indicating matrix structure > */ > > PetscErrorCode FormJacobian(SNES snes,Vec x,Mat *jac,Mat *B,MatStructure*flag,void *dummy) > { > PetscScalar *xx,A[3]; > PetscErrorCode ierr; > PetscInt i,n,j[3]; > > /* > Get pointer to vector data > */ > ierr = VecGetArray(x,&xx);CHKERRQ(ierr); > > /* > Compute Jacobian entries and insert into matrix. > - Note that in this case we set all elements for a particular > row at once. > */ > ierr = VecGetSize(x,&n);CHKERRQ(ierr); > j[0] = 0; j[1] = 1; j[2] = 2; > /*set the first row of jacobian*/ > i=0; > A[0]=2*xx[0]; A[1]=-2*xx[1]; A[2]=2*xx[2]; > ierr = MatSetValues(*jac,1,&i,3,j,A,INSERT_VALUES);CHKERRQ(ierr); > /*set the second row of jacobian*/ > i=1; > A[0]=xx[1]; A[1]=xx[0]+2*xx[1]; A[2]=-3.0; > ierr = MatSetValues(*jac,1,&i,3,j,A,INSERT_VALUES);CHKERRQ(ierr); > /*set the third row of jacobian*/ > i=2; > A[0]=1-xx[2]; A[1]=xx[2]; A[2]=-xx[0]+xx[1]; > ierr = MatSetValues(*jac,1,&i,3,j,A,INSERT_VALUES);CHKERRQ(ierr); > > > > ierr = VecRestoreArray(x,&xx);CHKERRQ(ierr); > > /* > Assemble matrix > */ > ierr = MatAssemblyBegin(*jac,MAT_FINAL_ASSEMBLY);CHKERRQ(ierr); > ierr = MatAssemblyEnd(*jac,MAT_FINAL_ASSEMBLY);CHKERRQ(ierr); > > return 0; > } > > > > > > From knepley at gmail.com Fri Mar 22 15:48:53 2013 From: knepley at gmail.com (Matthew Knepley) Date: Sat, 23 Mar 2013 07:48:53 +1100 Subject: [petsc-users] Trying to modify petrbf to use custom text file In-Reply-To: References: Message-ID: On Fri, Mar 22, 2013 at 10:58 PM, Anil . wrote: > Hi, > > I have a text file containing N rows. > Each row with x,y,omega values. > I am trying to interpolate this data onto a regular grid using petrbf > But the KSP does not converge and am not able to find the reason. > > The code is available with the text files at > https://www.dropbox.com/s/cypuwugbxo07kx0/rbf-interpolation.tar.gz > > I am very new to petsc and any direction how o proceed would be helpful. > 1) Did you mail the petrbf list? 2) Could you run the petrbf examples? 3) We cannot tell anything about convergence without the output of -ksp_view -ksp_monitor. Matt > -- > Sincerely > Anil Das P V > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From mh.farahani at gmail.com Sat Mar 23 13:40:17 2013 From: mh.farahani at gmail.com (Mehrdad H Farahani) Date: Sat, 23 Mar 2013 13:40:17 -0500 Subject: [petsc-users] KSP convergence problem In-Reply-To: References: <7C47EAB6-D02B-44C3-930D-3E110A7E63C6@columbia.edu> Message-ID: Excuse me for the delay. We had a system maintenance and I was not able to submit any jobs. I made the Petsc build with COPTFLAGS="-O0 -g" and FOPTFLAGS="-O0 -g" and the simulation did not diverge. However, it diverges with a Petsc build with COPTFLAGS="-O2" and FOPTFLAGS="-O2". On Wed, Mar 20, 2013 at 4:33 PM, Mehrdad H Farahani wrote: > I made an optimized build with COPTFLAGS="-O0 -g" and FOPTFLAGS="-O0 -g". > I will test it for the same simulation. > > > -- > Mehrdad -- Mehrdad -------------- next part -------------- An HTML attachment was scrubbed... URL: From jedbrown at mcs.anl.gov Sat Mar 23 14:08:50 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Sat, 23 Mar 2013 14:08:50 -0500 Subject: [petsc-users] KSP convergence problem In-Reply-To: References: <7C47EAB6-D02B-44C3-930D-3E110A7E63C6@columbia.edu> Message-ID: On Sat, Mar 23, 2013 at 1:40 PM, Mehrdad H Farahani wrote: > Excuse me for the delay. We had a system maintenance and I was not able > to submit any jobs. I made the Petsc build with COPTFLAGS="-O0 -g" and > FOPTFLAGS="-O0 -g" and the simulation did not diverge. However, it diverges > with a Petsc build with COPTFLAGS="-O2" and FOPTFLAGS="-O2". > 1. Write the system out using -ksp_view_binary and compare the resulting file 'binaryoutput' as produced from the debug and optimized code. 2. If the systems above are identical up to rounding error, try to use src/ksp/ksp/examples/tutorials/ex10.c to load the system and see if you can reproduce the different behavior. If so, give us directions to reproduce using ex10 and your binary file. -------------- next part -------------- An HTML attachment was scrubbed... URL: From nico.schloemer at gmail.com Sat Mar 23 14:25:21 2013 From: nico.schloemer at gmail.com (=?ISO-8859-1?Q?Nico_Schl=F6mer?=) Date: Sat, 23 Mar 2013 20:25:21 +0100 Subject: [petsc-users] set block size on AMG systems Message-ID: Hi, I've got this linear system consisting of 2x2 blocks (acutally coming from a real-imaginary formulation of a complex-valued problem) and I'd like to precondition the linear solves with AMG. Things are already working well when taking the defaults, but I guess one could achieve way better when telling AMG about the 2x2 structure. Trilinos' ML does this by a parameter "PDE equations". -- Is there something comparable in the PETSc world? --Nico From jedbrown at mcs.anl.gov Sat Mar 23 14:29:11 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Sat, 23 Mar 2013 14:29:11 -0500 Subject: [petsc-users] set block size on AMG systems In-Reply-To: References: Message-ID: http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/Mat/MatSetBlockSize.html PCML, PCHYPRE, and PCGAMG pay attention to this parameter if no richer information (like near-null spaces) is provided. For complex-valued problems, you're likely better off using complex numbers. On Sat, Mar 23, 2013 at 2:25 PM, Nico Schl?mer wrote: > Hi, > > I've got this linear system consisting of 2x2 blocks (acutally coming > from a real-imaginary formulation of a complex-valued problem) and I'd > like to precondition the linear solves with AMG. Things are already > working well when taking the defaults, but I guess one could achieve > way better when telling AMG about the 2x2 structure. Trilinos' ML does > this by a parameter "PDE equations". -- Is there something comparable > in the PETSc world? > > --Nico > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nico.schloemer at gmail.com Sat Mar 23 14:35:40 2013 From: nico.schloemer at gmail.com (=?ISO-8859-1?Q?Nico_Schl=F6mer?=) Date: Sat, 23 Mar 2013 20:35:40 +0100 Subject: [petsc-users] set block size on AMG systems In-Reply-To: References: Message-ID: > http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/Mat/MatSetBlockSize.html Thanks! > For complex-valued problems, you're likely better off using complex numbers. Does PETSc support complex arithmetic natively? That'd be another reason for getting complex-value support into FEniCS. --Nico On Sat, Mar 23, 2013 at 8:29 PM, Jed Brown wrote: > http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/Mat/MatSetBlockSize.html > > PCML, PCHYPRE, and PCGAMG pay attention to this parameter if no richer > information (like near-null spaces) is provided. > > For complex-valued problems, you're likely better off using complex numbers. > > > On Sat, Mar 23, 2013 at 2:25 PM, Nico Schl?mer > wrote: >> >> Hi, >> >> I've got this linear system consisting of 2x2 blocks (acutally coming >> from a real-imaginary formulation of a complex-valued problem) and I'd >> like to precondition the linear solves with AMG. Things are already >> working well when taking the defaults, but I guess one could achieve >> way better when telling AMG about the 2x2 structure. Trilinos' ML does >> this by a parameter "PDE equations". -- Is there something comparable >> in the PETSc world? >> >> --Nico > > From knepley at gmail.com Sat Mar 23 14:37:46 2013 From: knepley at gmail.com (Matthew Knepley) Date: Sun, 24 Mar 2013 06:37:46 +1100 Subject: [petsc-users] set block size on AMG systems In-Reply-To: References: Message-ID: On Sun, Mar 24, 2013 at 6:35 AM, Nico Schl?mer wrote: > > > http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/Mat/MatSetBlockSize.html > > Thanks! > > > For complex-valued problems, you're likely better off using complex > numbers. > > Does PETSc support complex arithmetic natively? That'd be another > reason for getting complex-value support into FEniCS. Yes. Matt > > --Nico > > > > On Sat, Mar 23, 2013 at 8:29 PM, Jed Brown wrote: > > > http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/Mat/MatSetBlockSize.html > > > > PCML, PCHYPRE, and PCGAMG pay attention to this parameter if no richer > > information (like near-null spaces) is provided. > > > > For complex-valued problems, you're likely better off using complex > numbers. > > > > > > On Sat, Mar 23, 2013 at 2:25 PM, Nico Schl?mer > > > wrote: > >> > >> Hi, > >> > >> I've got this linear system consisting of 2x2 blocks (acutally coming > >> from a real-imaginary formulation of a complex-valued problem) and I'd > >> like to precondition the linear solves with AMG. Things are already > >> working well when taking the defaults, but I guess one could achieve > >> way better when telling AMG about the 2x2 structure. Trilinos' ML does > >> this by a parameter "PDE equations". -- Is there something comparable > >> in the PETSc world? > >> > >> --Nico > > > > > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From jedbrown at mcs.anl.gov Sat Mar 23 14:38:03 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Sat, 23 Mar 2013 14:38:03 -0500 Subject: [petsc-users] set block size on AMG systems In-Reply-To: References: Message-ID: On Sat, Mar 23, 2013 at 2:35 PM, Nico Schl?mer wrote: > Does PETSc support complex arithmetic natively? That'd be another > reason for getting complex-value support into FEniCS. > Yes, but it is a configure-time option (--with-scalar-type=complex). -------------- next part -------------- An HTML attachment was scrubbed... URL: From rxk at cfdrc.com Sat Mar 23 17:31:45 2013 From: rxk at cfdrc.com (Ravi Kannan) Date: Sat, 23 Mar 2013 17:31:45 -0500 Subject: [petsc-users] petsc does not solve this [A][x] = [b] problem in parallel..... In-Reply-To: References: Message-ID: <03c401ce2816$33b00bd0$9b102370$@com> Dear All, This is Ravi Kannan from CFD Research Corporation. I am trying to solve this Ax=b problem in parallel and serial with no preconditioner. The A matrix is 3x3. The matrices are identical, as shown by the PETSCViewerAsciiFormat. The serial one solves to nearly machine zero in one iteration. The parallel residual is much higher than zero. MORE IMPORTANTLY, the ghost values are not updated after the Ksp solve! Here is the code snippet: int PetSc::solving(std::vector& sol) { #ifdef TIMING_STUDY_ON bool solver_timing_study=true; #else bool solver_timing_study=false; #endif PetscLogDouble startsolvingfunc, endsolvingfunc; _ierr = PetscGetTime(&startsolvingfunc); VecSetValues(_x,_size,&_id[0],&sol[0],INSERT_VALUES); PetscLogDouble start, end; _ierr = PetscGetTime(&start); _assemblySystem(); _ierr = PetscGetTime(&end); if(_LSType != mf_base::DIRECT) KSPSetInitialGuessNonzero(_ksp, PETSC_TRU E); _ierr = KSPSetTolerances(_ksp,_resNob2,_abstol,1.e+30,_maxits); PetscLogDouble v1,v2; _ierr = PetscGetTime(&v1);//CHKERRQ(_ierr); _ierr = KSPSolve(_ksp,_b,_x);//CHKERRQ(_ierr); _ierr = PetscGetTime(&v2);//CHKERRQ(_ierr); _elapsed_time = fabs(v2 - v1); VecGhostUpdateBegin(_x,INSERT_VALUES,SCATTER_FORWARD); VecGhostUpdateEnd(_x,INSERT_VALUES,SCATTER_FORWARD); // z = A*x _ierr = MatMult(_A,_x,_z); // z = z - b (which is Ax-b) _ierr = VecAXPY(_z,-1.0,_b); _ierr = VecNorm(_z,NORM_2,&_norm);CHKERRQ(_ierr); _ierr = KSPGetIterationNumber(_ksp,&_iters);CHKERRQ(_ierr); double flops; _ierr = PetscGetFlops(&flops); CHKERRQ(_ierr); // SVM changes 04/02/07 Vec lx; _ierr = VecGhostGetLocalForm(_x,&lx); PetscScalar *xx; //VecGetArray(Vec x,PetscScalar *a[]) :Remove this later VecGetArray(lx,&xx); // SVM changes 04/02/07 for(int i=0;i From knepley at gmail.com Sat Mar 23 17:34:44 2013 From: knepley at gmail.com (Matthew Knepley) Date: Sun, 24 Mar 2013 09:34:44 +1100 Subject: [petsc-users] petsc does not solve this [A][x] = [b] problem in parallel..... In-Reply-To: <03c401ce2816$33b00bd0$9b102370$@com> References: <03c401ce2816$33b00bd0$9b102370$@com> Message-ID: On Sun, Mar 24, 2013 at 9:31 AM, Ravi Kannan wrote: > Dear All,**** > > ** ** > > This is Ravi Kannan from CFD Research Corporation.**** > > ** ** > > I am trying to solve this Ax=b problem in parallel and serial with no > preconditioner. The A matrix is 3x3. The matrices are identical, as shown > by the PETSCViewerAsciiFormat. **** > > ** ** > > The serial one solves to nearly machine zero in one iteration. The > parallel residual is much higher than zero. MORE IMPORTANTLY, the ghost > values are not updated after the Ksp solve! > 1) Never ask about convergence without the output of -ksp_view -ksp_monitor 2) We do not update ghost values, you do Matt > > > Here is the code snippet:**** > > ** ** > > ** ** > > ** ** > > int PetSc::solving(std::vector& sol)**** > > {**** > > #ifdef TIMING_STUDY_ON**** > > bool solver_timing_study=true;**** > > #else**** > > bool solver_timing_study=false;**** > > #endif**** > > PetscLogDouble startsolvingfunc, endsolvingfunc;**** > > _ierr = PetscGetTime(&startsolvingfunc);**** > > ** ** > > ** ** > > VecSetValues(_x,_size,&_id[0],&sol[0],INSERT_VALUES);**** > > PetscLogDouble start, end;**** > > _ierr = PetscGetTime(&start);**** > > _assemblySystem();**** > > _ierr = PetscGetTime(&end);**** > > ** ** > > ** ** > > if(_LSType != mf_base::DIRECT) KSPSetInitialGuessNonzero(_ksp, > PETSC_TRU**** > > E);**** > > ** ** > > _ierr = KSPSetTolerances(_ksp,_resNob2,_abstol,1.e+30,_maxits);*** > * > > ** ** > > PetscLogDouble v1,v2;**** > > ** ** > > _ierr = PetscGetTime(&v1);//CHKERRQ(_ierr);**** > > _ierr = KSPSolve(_ksp,_b,_x);//CHKERRQ(_ierr);**** > > _ierr = PetscGetTime(&v2);//CHKERRQ(_ierr);**** > > _elapsed_time = fabs(v2 - v1);**** > > ** ** > > ** ** > > > VecGhostUpdateBegin(_x,INSERT_VALUES,SCATTER_FORWARD);**** > > > VecGhostUpdateEnd(_x,INSERT_VALUES,SCATTER_FORWARD);**** > > ** ** > > // z = A*x**** > > _ierr = MatMult(_A,_x,_z);**** > > ** ** > > // z = z - b (which is Ax-b)**** > > _ierr = VecAXPY(_z,-1.0,_b);**** > > ** ** > > _ierr = VecNorm(_z,NORM_2,&_norm);CHKERRQ(_ierr);**** > > _ierr = KSPGetIterationNumber(_ksp,&_iters);CHKERRQ(_ierr);**** > > ** ** > > double flops;**** > > _ierr = PetscGetFlops(&flops); CHKERRQ(_ierr);**** > > ** ** > > // SVM changes 04/02/07**** > > Vec lx;**** > > _ierr = VecGhostGetLocalForm(_x,&lx);**** > > PetscScalar *xx;**** > > //VecGetArray(Vec x,PetscScalar *a[]) :Remove this later**** > > VecGetArray(lx,&xx); // SVM changes 04/02/07**** > > for(int i=0;i > VecRestoreArray(lx,&xx); // SVM changes 04/02/07**** > > _ierr = VecGhostRestoreLocalForm(_x,&lx);**** > > ** ** > > _ierr = MatZeroEntries(_A);**** > > ** ** > > ** ** > > _ierr = PetscGetTime(&endsolvingfunc);**** > > return 0;**** > > }**** > > ** ** > > Anything wrong with this?**** > > ** ** > > Thanks**** > > Ravi**** > > ** ** > > ** ** > > ** ** > > ** ** > > ** ** > > ** ** > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From bourdin at lsu.edu Sat Mar 23 20:24:00 2013 From: bourdin at lsu.edu (Blaise A Bourdin) Date: Sun, 24 Mar 2013 01:24:00 +0000 Subject: [petsc-users] Question about LogSummary Message-ID: Hi, I am trying to do some scaling tests but can't figure out something about LogSummary: When no custom stages / events are defined, how come "Main Stage" is not 100% of the time? What is not counted? Here is a example of what I get: Summary of Stages: ----- Time ------ ----- Flops ----- --- Messages --- -- Message Lengths -- -- Reductions -- Avg %Total Avg %Total counts %Total Avg %Total counts %Total 0: Main Stage: 2.5763e+03 65.1% 3.2380e+15 100.0% 1.230e+11 100.0% 8.493e+02 100.0% 7.013e+06 97.0% Where is the missing 35% of the time? I call PetscLogBegin right after PetscInitialize. Blaise -- Department of Mathematics and Center for Computation & Technology Louisiana State University, Baton Rouge, LA 70803, USA Tel. +1 (225) 578 1612, Fax +1 (225) 578 4276 http://www.math.lsu.edu/~bourdin From knepley at gmail.com Sat Mar 23 23:50:25 2013 From: knepley at gmail.com (Matthew Knepley) Date: Sun, 24 Mar 2013 15:50:25 +1100 Subject: [petsc-users] Question about LogSummary In-Reply-To: References: Message-ID: On Sun, Mar 24, 2013 at 12:24 PM, Blaise A Bourdin wrote: > Hi, > > I am trying to do some scaling tests but can't figure out something about > LogSummary: When no custom stages / events are defined, how come "Main > Stage" is not 100% of the time? What is not counted? Here is a example of > what I get: > Library loading? Matt > Summary of Stages: ----- Time ------ ----- Flops ----- --- Messages > --- -- Message Lengths -- -- Reductions -- > Avg %Total Avg %Total counts > %Total Avg %Total counts %Total > 0: Main Stage: 2.5763e+03 65.1% 3.2380e+15 100.0% 1.230e+11 > 100.0% 8.493e+02 100.0% 7.013e+06 97.0% > > Where is the missing 35% of the time? I call PetscLogBegin right after > PetscInitialize. > > Blaise > > > -- > Department of Mathematics and Center for Computation & Technology > Louisiana State University, Baton Rouge, LA 70803, USA > Tel. +1 (225) 578 1612, Fax +1 (225) 578 4276 > http://www.math.lsu.edu/~bourdin > > > > > > > > > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From bourdin at lsu.edu Sun Mar 24 08:42:02 2013 From: bourdin at lsu.edu (Blaise A Bourdin) Date: Sun, 24 Mar 2013 13:42:02 +0000 Subject: [petsc-users] Question about LogSummary In-Reply-To: References: Message-ID: <8489B5E3-9D9F-49BE-BA95-186D977798D2@lsu.edu> On Mar 23, 2013, at 11:50 PM, Matthew Knepley > wrote: On Sun, Mar 24, 2013 at 12:24 PM, Blaise A Bourdin > wrote: Hi, I am trying to do some scaling tests but can't figure out something about LogSummary: When no custom stages / events are defined, how come "Main Stage" is not 100% of the time? What is not counted? Here is a example of what I get: Library loading? Really? Is there anything I can do to test if it really is library loading or to reduce loading time? I am attaching the full log summary Blaise Matt Summary of Stages: ----- Time ------ ----- Flops ----- --- Messages --- -- Message Lengths -- -- Reductions -- Avg %Total Avg %Total counts %Total Avg %Total counts %Total 0: Main Stage: 2.5763e+03 65.1% 3.2380e+15 100.0% 1.230e+11 100.0% 8.493e+02 100.0% 7.013e+06 97.0% Where is the missing 35% of the time? I call PetscLogBegin right after PetscInitialize. Blaise -- Department of Mathematics and Center for Computation & Technology Louisiana State University, Baton Rouge, LA 70803, USA Tel. +1 (225) 578 1612, Fax +1 (225) 578 4276 http://www.math.lsu.edu/~bourdin -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -- Department of Mathematics and Center for Computation & Technology Louisiana State University, Baton Rouge, LA 70803, USA Tel. +1 (225) 578 1612, Fax +1 (225) 578 4276 http://www.math.lsu.edu/~bourdin -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: 450371-logsummary.txt URL: From knepley at gmail.com Sun Mar 24 12:28:50 2013 From: knepley at gmail.com (Matthew Knepley) Date: Mon, 25 Mar 2013 04:28:50 +1100 Subject: [petsc-users] Question about LogSummary In-Reply-To: <8489B5E3-9D9F-49BE-BA95-186D977798D2@lsu.edu> References: <8489B5E3-9D9F-49BE-BA95-186D977798D2@lsu.edu> Message-ID: On Mon, Mar 25, 2013 at 12:42 AM, Blaise A Bourdin wrote: > > On Mar 23, 2013, at 11:50 PM, Matthew Knepley > wrote: > > On Sun, Mar 24, 2013 at 12:24 PM, Blaise A Bourdin wrote: > > Hi, > > I am trying to do some scaling tests but can't figure out something about > LogSummary: When no custom stages / events are defined, how come "Main > Stage" is not 100% of the time? What is not counted? Here is a example of > what I get: > > > Library loading? > > Really? Is there anything I can do to test if it really is library loading > or to reduce loading time? I am attaching the full log summary > Blaise > > > Matt > > > Summary of Stages: ----- Time ------ ----- Flops ----- --- Messages > --- -- Message Lengths -- -- Reductions -- > Avg %Total Avg %Total counts > %Total Avg %Total counts %Total > 0: Main Stage: 2.5763e+03 65.1% 3.2380e+15 100.0% 1.230e+11 > 100.0% 8.493e+02 100.0% 7.013e+06 97.0% > > Where is the missing 35% of the time? I call PetscLogBegin right after > PetscInitialize. > > Okay, the total time is the time between PetscLogBegin() and the first several lines of PetscLogView(), before all the reductions. Thus it does not look like library loading is responsible. In this log, the main routine seems to be KSPSolve which takes 1.5e3. It looks like some time in this app is just not being logged. That would take popping the current stage and then pushing it again afterwards I think. We would have to know more about the code. Matt > > Blaise > > > -- > Department of Mathematics and Center for Computation & Technology > Louisiana State University, Baton Rouge, LA 70803, USA > Tel. +1 (225) 578 1612, Fax +1 (225) 578 4276 > http://www.math.lsu.edu/~bourdin > > > > > > > > > > > > -- > What most experimenters take for granted before they begin their > experiments is infinitely more interesting than any results to which their > experiments lead. > -- Norbert Wiener > > > -- > Department of Mathematics and Center for Computation & Technology > Louisiana State University, Baton Rouge, LA 70803, USA > Tel. +1 (225) 578 1612, Fax +1 (225) 578 4276 > http://www.math.lsu.edu/~bourdin > > > > > > > > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From bourdin at lsu.edu Sun Mar 24 15:57:39 2013 From: bourdin at lsu.edu (Blaise A Bourdin) Date: Sun, 24 Mar 2013 20:57:39 +0000 Subject: [petsc-users] Question about LogSummary In-Reply-To: References: <8489B5E3-9D9F-49BE-BA95-186D977798D2@lsu.edu> Message-ID: <398770DE-2A1F-4C37-9EFE-FAED14A2361D@lsu.edu> On Mar 24, 2013, at 12:28 PM, Matthew Knepley > wrote: On Mon, Mar 25, 2013 at 12:42 AM, Blaise A Bourdin > wrote: On Mar 23, 2013, at 11:50 PM, Matthew Knepley > wrote: On Sun, Mar 24, 2013 at 12:24 PM, Blaise A Bourdin > wrote: Hi, I am trying to do some scaling tests but can't figure out something about LogSummary: When no custom stages / events are defined, how come "Main Stage" is not 100% of the time? What is not counted? Here is a example of what I get: Library loading? Really? Is there anything I can do to test if it really is library loading or to reduce loading time? I am attaching the full log summary Blaise Matt Summary of Stages: ----- Time ------ ----- Flops ----- --- Messages --- -- Message Lengths -- -- Reductions -- Avg %Total Avg %Total counts %Total Avg %Total counts %Total 0: Main Stage: 2.5763e+03 65.1% 3.2380e+15 100.0% 1.230e+11 100.0% 8.493e+02 100.0% 7.013e+06 97.0% Where is the missing 35% of the time? I call PetscLogBegin right after PetscInitialize. Okay, the total time is the time between PetscLogBegin() and the first several lines of PetscLogView(), before all the reductions. Thus it does not look like library loading is responsible. In this log, the main routine seems to be KSPSolve which takes 1.5e3. It looks like some time in this app is just not being logged. That would take popping the current stage and then pushing it again afterwards I think. We would have to know more about the code. That's what bugs me... I removed all custom logging and custom events from the code. The code does not call any external library. Basically, it iterates assembling a matrix, calling KSPSolve, assembling another matrix, calling TAOSolve, and writing results in exodus format. Is there a command line options that would give me some informations on the log level operations? Blaise -- Department of Mathematics and Center for Computation & Technology Louisiana State University, Baton Rouge, LA 70803, USA Tel. +1 (225) 578 1612, Fax +1 (225) 578 4276 http://www.math.lsu.edu/~bourdin -------------- next part -------------- An HTML attachment was scrubbed... URL: From tisaac at ices.utexas.edu Sun Mar 24 22:33:12 2013 From: tisaac at ices.utexas.edu (Tobin Isaac) Date: Sun, 24 Mar 2013 22:33:12 -0500 Subject: [petsc-users] snes fieldsplit for kkt Message-ID: <20130325033312.GB27889@ices.utexas.edu> If I'm solving a PDE-constrained optimization problem, I'd like to be able to specify the equations and then choose at runtime between a full-space approach and a reduced-space approach. Is this possible with petsc? Thanks, Toby -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From jedbrown at mcs.anl.gov Sun Mar 24 23:03:20 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Sun, 24 Mar 2013 23:03:20 -0500 Subject: [petsc-users] snes fieldsplit for kkt In-Reply-To: <20130325033312.GB27889@ices.utexas.edu> References: <20130325033312.GB27889@ices.utexas.edu> Message-ID: <87obe8rurb.fsf@59A2.org> Tobin Isaac writes: > If I'm solving a PDE-constrained optimization problem, I'd like to be > able to specify the equations and then choose at runtime between a > full-space approach and a reduced-space approach. Is this possible > with petsc? PETSc is not an optimization package per se, so you'll have to do a little work, at least if your problem is nonlinear or if the size of the full space is potentially too large to store. In the specific case of a quadratic optimization problem, a reduced space method is equivalent to iterating on the reduced Hessian, in which case you can use Schur complement reduction via -pc_fieldsplit_type schur. Note that the Schur implementation naturally works with 2x2 systems, so you would lump state and adjoint equations into the first "block", and then (typically) decompose this further in the inner solve. George used to have a library called Veltisto that was built on PETSc and supported both full-space (LNKS) and reduced-space methods. As far as I know, this package is no longer available. I think that having a unified interface to reduced-space and full-space methods would be very useful to the community. I think that choosing an interface for inequality constraints is somewhat challenging because the more general forms give the library much less to work with. I know your group has quite a bit of experience with this. If you would be interested in working with us to put this into library form, I would be happy to help. From dasans at gmail.com Mon Mar 25 06:38:19 2013 From: dasans at gmail.com (Anil .) Date: Mon, 25 Mar 2013 17:08:19 +0530 Subject: [petsc-users] Trying to modify petrbf to use custom text file In-Reply-To: References: Message-ID: 1) Could not find the petrbf mailing list 2) Petrbf runs perfectly 3) Attached is the output with -ksp_view -ksp_monitor Just point me in the right direction. Issues might be very basic as I am starting to use Petsc On Sat, Mar 23, 2013 at 2:18 AM, Matthew Knepley wrote: > On Fri, Mar 22, 2013 at 10:58 PM, Anil . wrote: > >> Hi, >> >> I have a text file containing N rows. >> Each row with x,y,omega values. >> I am trying to interpolate this data onto a regular grid using petrbf >> But the KSP does not converge and am not able to find the reason. >> >> The code is available with the text files at >> https://www.dropbox.com/s/cypuwugbxo07kx0/rbf-interpolation.tar.gz >> >> I am very new to petsc and any direction how o proceed would be helpful. >> > > 1) Did you mail the petrbf list? > > 2) Could you run the petrbf examples? > > 3) We cannot tell anything about convergence without the output of > -ksp_view -ksp_monitor. > > Matt > > >> -- >> Sincerely >> Anil Das P V >> > > > > -- > What most experimenters take for granted before they begin their > experiments is infinitely more interesting than any results to which their > experiments lead. > -- Norbert Wiener > -- Sincerely Anil Das P V -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ksp_output Type: application/octet-stream Size: 2457 bytes Desc: not available URL: From tisaac at ices.utexas.edu Mon Mar 25 07:16:02 2013 From: tisaac at ices.utexas.edu (Tobin Isaac) Date: Mon, 25 Mar 2013 07:16:02 -0500 Subject: [petsc-users] snes fieldsplit for kkt In-Reply-To: <87obe8rurb.fsf@59A2.org> References: <20130325033312.GB27889@ices.utexas.edu> <87obe8rurb.fsf@59A2.org> Message-ID: <20130325121602.GB7116@ices.utexas.edu> On Sun, Mar 24, 2013 at 11:03:20PM -0500, Jed Brown wrote: > Tobin Isaac writes: > > > If I'm solving a PDE-constrained optimization problem, I'd like to be > > able to specify the equations and then choose at runtime between a > > full-space approach and a reduced-space approach. Is this possible > > with petsc? > > PETSc is not an optimization package per se, so you'll have to do a > little work, at least if your problem is nonlinear or if the size of the > full space is potentially too large to store. In the specific case of a > quadratic optimization problem, a reduced space method is equivalent to > iterating on the reduced Hessian, in which case you can use Schur > complement reduction via -pc_fieldsplit_type schur. Note that the Schur > implementation naturally works with 2x2 systems, so you would lump state > and adjoint equations into the first "block", and then (typically) > decompose this further in the inner solve. > > George used to have a library called Veltisto that was built on PETSc > and supported both full-space (LNKS) and reduced-space methods. As far > as I know, this package is no longer available. > > I think that having a unified interface to reduced-space and full-space > methods would be very useful to the community. I think that choosing an > interface for inequality constraints is somewhat challenging because the > more general forms give the library much less to work with. I know your > group has quite a bit of experience with this. If you would be > interested in working with us to put this into library form, I would be > happy to help. > A unified interface that encompasses inequality constraints is more ambitious than what I had in mind for now. What I meant when I said "specify the equations" was specify the first order optimality conditions for a problem with pure equality constraints. Choosing between full-space and reduced-space would then be just choosing between snes strategies. From jedbrown at mcs.anl.gov Mon Mar 25 10:21:04 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Mon, 25 Mar 2013 10:21:04 -0500 Subject: [petsc-users] snes fieldsplit for kkt In-Reply-To: <20130325121602.GB7116@ices.utexas.edu> References: <20130325033312.GB27889@ices.utexas.edu> <87obe8rurb.fsf@59A2.org> <20130325121602.GB7116@ices.utexas.edu> Message-ID: <87k3ovsdy7.fsf@59A2.org> Tobin Isaac writes: > A unified interface that encompasses inequality constraints is more > ambitious than what I had in mind for now. What I meant when I said > "specify the equations" was specify the first order optimality > conditions for a problem with pure equality constraints. Choosing > between full-space and reduced-space would then be just choosing > between snes strategies. Fair enough, a SNES FieldSplit is something we've been thinking about, but we haven't fixed an interface for decomposition. That is, we need the analog of MatGetSubMatrix() for nonlinear systems. For the line search, we will need to be able to use the problem structure to define the augmented Lagrangian objective functional. So it's not something currently available, but it's something we might be able to do in the next release cycle (3.5) and we'd certainly like to hear your input on how it should look. From sonyablade2010 at hotmail.com Mon Mar 25 10:36:01 2013 From: sonyablade2010 at hotmail.com (Sonya Blade) Date: Mon, 25 Mar 2013 15:36:01 +0000 Subject: [petsc-users] Eigenvalue example problem Message-ID: Dear All, Can you guide on how to solve the problem in the form of A*x = lambda*B*X with? Petsc or Slepc ? If possible with lowest or highest eigenvalues. Your help will be appreciated! Regards, From jroman at dsic.upv.es Mon Mar 25 10:38:39 2013 From: jroman at dsic.upv.es (Jose E. Roman) Date: Mon, 25 Mar 2013 16:38:39 +0100 Subject: [petsc-users] Eigenvalue example problem In-Reply-To: References: Message-ID: <7F984B8D-F1D8-4D9A-8084-A01DDD7139B6@dsic.upv.es> El 25/03/2013, a las 16:36, Sonya Blade escribi?: > Dear All, > > Can you guide on how to solve the problem in the form of A*x = lambda*B*X with > Petsc or Slepc ? > If possible with lowest or highest eigenvalues. > > Your help will be appreciated! > > Regards, See the handson exercise 3: http://www.grycap.upv.es/slepc/handson/handson3.html Also see the Users Manual. Jose From jedbrown at mcs.anl.gov Mon Mar 25 10:38:49 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Mon, 25 Mar 2013 10:38:49 -0500 Subject: [petsc-users] Eigenvalue example problem In-Reply-To: References: Message-ID: Did you look at the SLEPc user's manual and examples? If not, you should. If you have already, then surely you can ask a more specific question. On Mon, Mar 25, 2013 at 10:36 AM, Sonya Blade wrote: > Dear All, > > Can you guide on how to solve the problem in the form of A*x = lambda*B*X > with > Petsc or Slepc ? > If possible with lowest or highest eigenvalues. > > Your help will be appreciated! > > Regards, -------------- next part -------------- An HTML attachment was scrubbed... URL: From bsmith at mcs.anl.gov Mon Mar 25 14:29:40 2013 From: bsmith at mcs.anl.gov (Barry Smith) Date: Mon, 25 Mar 2013 14:29:40 -0500 Subject: [petsc-users] Trying to modify petrbf to use custom text file In-Reply-To: References: Message-ID: What happens if you using one process and one subdomain resulting in the equivalent of a direct solver? Why did the iteration stop at 10 iterations? What is the message if you run with -ksp_converged_reason. Barry On Mar 25, 2013, at 6:38 AM, "Anil ." wrote: > 1) Could not find the petrbf mailing list > 2) Petrbf runs perfectly > 3) Attached is the output with -ksp_view -ksp_monitor > > Just point me in the right direction. Issues might be very basic as I am starting to use Petsc > > > On Sat, Mar 23, 2013 at 2:18 AM, Matthew Knepley wrote: > On Fri, Mar 22, 2013 at 10:58 PM, Anil . wrote: > Hi, > > I have a text file containing N rows. > Each row with x,y,omega values. > I am trying to interpolate this data onto a regular grid using petrbf > But the KSP does not converge and am not able to find the reason. > > The code is available with the text files at > https://www.dropbox.com/s/cypuwugbxo07kx0/rbf-interpolation.tar.gz > > I am very new to petsc and any direction how o proceed would be helpful. > > 1) Did you mail the petrbf list? > > 2) Could you run the petrbf examples? > > 3) We cannot tell anything about convergence without the output of -ksp_view -ksp_monitor. > > Matt > > -- > Sincerely > Anil Das P V > > > > -- > What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. > -- Norbert Wiener > > > > -- > Sincerely > Anil Das P V > From dasans at gmail.com Tue Mar 26 03:55:39 2013 From: dasans at gmail.com (Anil .) Date: Tue, 26 Mar 2013 14:25:39 +0530 Subject: [petsc-users] Trying to modify petrbf to use custom text file In-Reply-To: References: Message-ID: Attached is the output with 1 processor and one subdomain. It converges in 9 iterations. What might be the reason for larger subdomain not to work? On Tue, Mar 26, 2013 at 12:59 AM, Barry Smith wrote: > > What happens if you using one process and one subdomain resulting in > the equivalent of a direct solver? > > Why did the iteration stop at 10 iterations? What is the message if you > run with -ksp_converged_reason. > > Barry > > On Mar 25, 2013, at 6:38 AM, "Anil ." wrote: > > > 1) Could not find the petrbf mailing list > > 2) Petrbf runs perfectly > > 3) Attached is the output with -ksp_view -ksp_monitor > > > > Just point me in the right direction. Issues might be very basic as I am > starting to use Petsc > > > > > > On Sat, Mar 23, 2013 at 2:18 AM, Matthew Knepley > wrote: > > On Fri, Mar 22, 2013 at 10:58 PM, Anil . wrote: > > Hi, > > > > I have a text file containing N rows. > > Each row with x,y,omega values. > > I am trying to interpolate this data onto a regular grid using petrbf > > But the KSP does not converge and am not able to find the reason. > > > > The code is available with the text files at > > https://www.dropbox.com/s/cypuwugbxo07kx0/rbf-interpolation.tar.gz > > > > I am very new to petsc and any direction how o proceed would be helpful. > > > > 1) Did you mail the petrbf list? > > > > 2) Could you run the petrbf examples? > > > > 3) We cannot tell anything about convergence without the output of > -ksp_view -ksp_monitor. > > > > Matt > > > > -- > > Sincerely > > Anil Das P V > > > > > > > > -- > > What most experimenters take for granted before they begin their > experiments is infinitely more interesting than any results to which their > experiments lead. > > -- Norbert Wiener > > > > > > > > -- > > Sincerely > > Anil Das P V > > > > -- Sincerely Anil Das P V -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ksp_output1 Type: application/octet-stream Size: 2575 bytes Desc: not available URL: From miguel.fernandez at inria.fr Tue Mar 26 05:19:39 2013 From: miguel.fernandez at inria.fr (=?iso-8859-1?Q?=22Miguel_A=2E_Fern=E1ndez=22?=) Date: Tue, 26 Mar 2013 11:19:39 +0100 Subject: [petsc-users] Partitioning and AO problem Message-ID: Dear all, I'm using Petsc interface to ParMetis, as detailed in section 3.5 of the user's manual. I have a problem with the creation of the AO mapps using the sentence AOCreateBasicIS(isg,PETSC NULL,&ao); where isg contains for each local node the new global (petsc) number of that node. The problem is that the resulting AO map is inverted, and hence the results obtained with AOApplicationToPetsc and AOPetscToApplication are not correct. Any suggestion, apart from re-inverting the maps at hand? Many thanks in advance. Best, Miguel -- Miguel A. Fern?ndez INRIA Paris - Rocquencourt Building 16, office 11 78153 Le Chesnay Cedex (France) phone: +33 (0)1 3963 5470 fax: +33 (0)1 3963 5882 www-rocq.inria.fr/who/Miguel.Fernandez -------------- next part -------------- An HTML attachment was scrubbed... URL: From jedbrown at mcs.anl.gov Tue Mar 26 08:19:01 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Tue, 26 Mar 2013 08:19:01 -0500 Subject: [petsc-users] Partitioning and AO problem In-Reply-To: References: Message-ID: <87boa647ui.fsf@59A2.org> "Miguel A. Fern?ndez" writes: > Dear all, > > I'm using Petsc interface to ParMetis, as detailed in section 3.5 of the user's manual. > > I have a problem with the creation of the AO mapps using the sentence > > AOCreateBasicIS(isg,PETSC NULL,&ao); This line in the user's manual is incorrect. See Section 2.3.1 for a proper explanation. > where isg contains for each local node the new global (petsc) number of that node. > The problem is that the resulting AO map is inverted, and hence the results obtained with > AOApplicationToPetsc and AOPetscToApplication are not correct. You have the arguments backward. http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/AO/AOCreateBasic.html It's not clear from your description above whether you have an "application ordering" or just a local to global map. From miguel.fernandez at inria.fr Tue Mar 26 08:42:59 2013 From: miguel.fernandez at inria.fr (=?iso-8859-1?Q?=22Miguel_A=2E_Fern=E1ndez=22?=) Date: Tue, 26 Mar 2013 14:42:59 +0100 Subject: [petsc-users] Partitioning and AO problem In-Reply-To: <87boa647ui.fsf@59A2.org> References: <87boa647ui.fsf@59A2.org> Message-ID: <0291E1F6-0BD2-4263-B26C-23CFC3874343@inria.fr> Thanks for your quick reply. >> I'm using Petsc interface to ParMetis, as detailed in section 3.5 of the user's manual. >> >> I have a problem with the creation of the AO mapps using the sentence >> >> AOCreateBasicIS(isg,PETSC NULL,&ao); > > This line in the user's manual is incorrect. See Section 2.3.1 for a > proper explanation. OK, good to know ;). >> where isg contains for each local node the new global (petsc) number of that node. >> The problem is that the resulting AO map is inverted, and hence the results obtained with >> AOApplicationToPetsc and AOPetscToApplication are not correct. > > You have the arguments backward. Yes, I agree, and this explains why the ApplicationToPetsc and PetscToApplication maps are inverted. The problem is that you can neither call AOCreateBasicIS(PETSC_NULL,isg,&ao); since it seems that PETSC_NULL is only allowed in the second argument. > http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/AO/AOCreateBasic.html > > It's not clear from your description above whether you have an > "application ordering" or just a local to global map. I have an application ordering and a petsc ordering, both global, in the spirit of Section 2.3.1. Here, the application ordering is the natural ordering (0, 1, 2, ? ), resulting from a simple distribution of the nodes across processors, before partition with ParMetis. Best, Miguel -- INRIA Paris - Rocquencourt Building 16, office 11 78153 Le Chesnay Cedex (France) phone: +33 (0)1 3963 5470 fax: +33 (0)1 3963 5882 www-rocq.inria.fr/who/Miguel.Fernandez -------------- next part -------------- An HTML attachment was scrubbed... URL: From jedbrown at mcs.anl.gov Tue Mar 26 08:59:06 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Tue, 26 Mar 2013 08:59:06 -0500 Subject: [petsc-users] Partitioning and AO problem In-Reply-To: <0291E1F6-0BD2-4263-B26C-23CFC3874343@inria.fr> References: <87boa647ui.fsf@59A2.org> <0291E1F6-0BD2-4263-B26C-23CFC3874343@inria.fr> Message-ID: <878v5a45zp.fsf@59A2.org> "Miguel A. Fern?ndez" writes: > Thanks for your quick reply. > >>> I'm using Petsc interface to ParMetis, as detailed in section 3.5 of the user's manual. >>> >>> I have a problem with the creation of the AO mapps using the sentence >>> >>> AOCreateBasicIS(isg,PETSC NULL,&ao); >> >> This line in the user's manual is incorrect. See Section 2.3.1 for a >> proper explanation. Actually, it's not really incorrect, just too easy to misinterpret. > Yes, I agree, and this explains why the ApplicationToPetsc and PetscToApplication maps are inverted. > The problem is that you can neither call AOCreateBasicIS(PETSC_NULL,isg,&ao); > since it seems that PETSC_NULL is only allowed in the second argument. > >> http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/AO/AOCreateBasic.html >> >> It's not clear from your description above whether you have an >> "application ordering" or just a local to global map. > > I have an application ordering and a petsc ordering, both global, in the spirit of Section 2.3.1. > Here, the application ordering is the natural ordering (0, 1, 2, ? ), resulting from a simple distribution > of the nodes across processors, before partition with ParMetis. Okay, you can specify index sets for both sides and keep the same meaning you have now, but if you call AOCreateBasicIS(isg,NULL,&ao); then the new ordering 'isg' is the "application ordering". This is consistent with normal usage where "PETSc ordering" is the way data is currently distributed and the "application ordering" is the ordering that will be used for some other purpose. https://bitbucket.org/petsc/petsc/commits/2609aec54a581b5b53a7f4681bee8e97b5c70594 From dominik at itis.ethz.ch Tue Mar 26 09:45:23 2013 From: dominik at itis.ethz.ch (Dominik Szczerba) Date: Tue, 26 Mar 2013 15:45:23 +0100 Subject: [petsc-users] Any overheads of VecGetArray/VecRestoreArray? Message-ID: Hi, Let's say I have a simple function where I assemble a global coefficient matrix by subsequent calls to another function that computes element coefficient matrix. I need some cell physical property like density that changes between grid cells, and which is stored as a Petsc Vec object. Now should I better call VecGetArray/VecRestoreArray only once in at the beginning/end of the function that assembles the global matrix or is it OK to call it each time in the function computing the element matrix? In other words, are there any overheads to better be avioded here? Thanks for any hints, Dominik From miguel.fernandez at inria.fr Tue Mar 26 09:49:59 2013 From: miguel.fernandez at inria.fr (=?iso-8859-1?Q?=22Miguel_A=2E_Fern=E1ndez=22?=) Date: Tue, 26 Mar 2013 15:49:59 +0100 Subject: [petsc-users] Partitioning and AO problem In-Reply-To: <878v5a45zp.fsf@59A2.org> References: <87boa647ui.fsf@59A2.org> <0291E1F6-0BD2-4263-B26C-23CFC3874343@inria.fr> <878v5a45zp.fsf@59A2.org> Message-ID: Thanks once more. > > Okay, you can specify index sets for both sides and keep the same > meaning you have now, but if you call > > AOCreateBasicIS(isg,NULL,&ao); > > then the new ordering 'isg' is the "application ordering". This is > consistent with normal usage where "PETSc ordering" is the way data is > currently distributed and the "application ordering" is the ordering > that will be used for some other purpose. > > https://bitbucket.org/petsc/petsc/commits/2609aec54a581b5b53a7f4681bee8e97b5c70594 OK, I see the point. In any case, I would say that this usage of the terminology "application ordering" is not fully coherent with the discussion of section 2.3.1, where (as far as I understood) "application ordering" is supposed to be the original ordering of the application data (mesh veticies, dof, etc?) before optimal distribution of it (or, e.g., by calling the program in a single processor). Best, Miguel -- INRIA Paris - Rocquencourt Building 16, office 11 78153 Le Chesnay Cedex (France) phone: +33 (0)1 3963 5470 fax: +33 (0)1 3963 5882 www-rocq.inria.fr/who/Miguel.Fernandez -------------- next part -------------- An HTML attachment was scrubbed... URL: From jedbrown at mcs.anl.gov Tue Mar 26 09:59:10 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Tue, 26 Mar 2013 09:59:10 -0500 Subject: [petsc-users] Partitioning and AO problem In-Reply-To: References: <87boa647ui.fsf@59A2.org> <0291E1F6-0BD2-4263-B26C-23CFC3874343@inria.fr> <878v5a45zp.fsf@59A2.org> Message-ID: On Tue, Mar 26, 2013 at 9:49 AM, "Miguel A. Fern?ndez" < miguel.fernandez at inria.fr> wrote: > In any case, I would say that this usage of the terminology "application > ordering" is not fully coherent with the discussion of section 2.3.1, > where (as far as I understood) "application ordering" is supposed to be > the original ordering of the application data (mesh veticies, dof, etc?) > before optimal > distribution of it (or, e.g., by calling the program in a single > processor). > Hmm, I'm not sure how to fix that. You can repartition starting from any ordering. I think the names "PETSc ordering" and "application ordering" are often unclear, but I mostly avoid use of AO entirely in favor of more direct communication. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bsmith at mcs.anl.gov Tue Mar 26 12:23:37 2013 From: bsmith at mcs.anl.gov (Barry Smith) Date: Tue, 26 Mar 2013 12:23:37 -0500 Subject: [petsc-users] Trying to modify petrbf to use custom text file In-Reply-To: References: Message-ID: <3F15807A-BA21-4202-8846-2D2EA090DE8E@mcs.anl.gov> On Mar 26, 2013, at 3:55 AM, "Anil ." wrote: > Attached is the output with 1 processor and one subdomain. It converges in 9 iterations. What does the convergence look like with -ksp_monitor_true_residual ? > > What might be the reason for larger subdomain not to work? Did you try running with more iterations? What if you run with -ksp_gmres_restart 100 -ksp_max_it 100 -ksp_converged_reason -ksp_monitor_true_residual Barry > > > On Tue, Mar 26, 2013 at 12:59 AM, Barry Smith wrote: > > What happens if you using one process and one subdomain resulting in the equivalent of a direct solver? > > Why did the iteration stop at 10 iterations? What is the message if you run with -ksp_converged_reason. > > Barry > > On Mar 25, 2013, at 6:38 AM, "Anil ." wrote: > > > 1) Could not find the petrbf mailing list > > 2) Petrbf runs perfectly > > 3) Attached is the output with -ksp_view -ksp_monitor > > > > Just point me in the right direction. Issues might be very basic as I am starting to use Petsc > > > > > > On Sat, Mar 23, 2013 at 2:18 AM, Matthew Knepley wrote: > > On Fri, Mar 22, 2013 at 10:58 PM, Anil . wrote: > > Hi, > > > > I have a text file containing N rows. > > Each row with x,y,omega values. > > I am trying to interpolate this data onto a regular grid using petrbf > > But the KSP does not converge and am not able to find the reason. > > > > The code is available with the text files at > > https://www.dropbox.com/s/cypuwugbxo07kx0/rbf-interpolation.tar.gz > > > > I am very new to petsc and any direction how o proceed would be helpful. > > > > 1) Did you mail the petrbf list? > > > > 2) Could you run the petrbf examples? > > > > 3) We cannot tell anything about convergence without the output of -ksp_view -ksp_monitor. > > > > Matt > > > > -- > > Sincerely > > Anil Das P V > > > > > > > > -- > > What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. > > -- Norbert Wiener > > > > > > > > -- > > Sincerely > > Anil Das P V > > > > > > > -- > Sincerely > Anil Das P V > From bsmith at mcs.anl.gov Tue Mar 26 12:32:00 2013 From: bsmith at mcs.anl.gov (Barry Smith) Date: Tue, 26 Mar 2013 12:32:00 -0500 Subject: [petsc-users] Any overheads of VecGetArray/VecRestoreArray? In-Reply-To: References: Message-ID: <42A176C3-7A68-47F3-B553-D56BF8BD5D96@mcs.anl.gov> Dominik, There is no copy of vector entries on the calls to VecGetArray/RestoreArray() so the overhead is minimal. Likely you would barely be able to measure a difference. Barry On Mar 26, 2013, at 9:45 AM, Dominik Szczerba wrote: > Hi, > > Let's say I have a simple function where I assemble a global > coefficient matrix by subsequent calls to another function that > computes element coefficient matrix. I need some cell physical > property like density that changes between grid cells, and which is > stored as a Petsc Vec object. Now should I better call > VecGetArray/VecRestoreArray only once in at the beginning/end of the > function that assembles the global matrix or is it OK to call it each > time in the function computing the element matrix? In other words, are > there any overheads to better be avioded here? > > Thanks for any hints, > Dominik From jedbrown at mcs.anl.gov Tue Mar 26 12:48:19 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Tue, 26 Mar 2013 12:48:19 -0500 Subject: [petsc-users] Any overheads of VecGetArray/VecRestoreArray? In-Reply-To: <42A176C3-7A68-47F3-B553-D56BF8BD5D96@mcs.anl.gov> References: <42A176C3-7A68-47F3-B553-D56BF8BD5D96@mcs.anl.gov> Message-ID: On Tue, Mar 26, 2013 at 12:32 PM, Barry Smith wrote: > > Dominik, > > There is no copy of vector entries on the calls to > VecGetArray/RestoreArray() so the overhead is minimal. Likely you would > barely be able to measure a difference. > Calling these inside the loop requires caution, however, in case some process may have zero elements. (This often happens on coarse grids, for example.) The problem is that VecRestoreArray() invalidates any cached norms. So if you run: VecNorm(X,NORM_2,&xnorm_before); for (each local element) { VecGetArray(X,&x); VecRestoreArray(X,&x); } VecNorm(X,NORM_2,&xnorm_after); if some process has no local entries, it will think that X has not been modified and will not enter the MPI_Allreduce() to compute 'xnorm_after', which is deadlock. To avoid stuff like this, we recommend placing the VecGetArray() outside the loop, which is consistent with its designation as "logically collective". You can use VecGetArrayRead() without worrying about this problem. -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Tue Mar 26 13:15:10 2013 From: knepley at gmail.com (Matthew Knepley) Date: Wed, 27 Mar 2013 05:15:10 +1100 Subject: [petsc-users] Trying to modify petrbf to use custom text file In-Reply-To: References: Message-ID: On Mon, Mar 25, 2013 at 10:38 PM, Anil . wrote: > 1) Could not find the petrbf mailing list > 2) Petrbf runs perfectly > 3) Attached is the output with -ksp_view -ksp_monitor > > Just point me in the right direction. Issues might be very basic as I am > starting to use Petsc > This output is a little strange. Some partitions have 0 entries. I am guessing this problem is very small. For PeRBF, it does turn out to be optimal to use small blocks, but the block size depends on your interaction scale. Right now you have 75 blocks, which might be too many for your small problem. Matt > On Sat, Mar 23, 2013 at 2:18 AM, Matthew Knepley wrote: > >> On Fri, Mar 22, 2013 at 10:58 PM, Anil . wrote: >> >>> Hi, >>> >>> I have a text file containing N rows. >>> Each row with x,y,omega values. >>> I am trying to interpolate this data onto a regular grid using petrbf >>> But the KSP does not converge and am not able to find the reason. >>> >>> The code is available with the text files at >>> https://www.dropbox.com/s/cypuwugbxo07kx0/rbf-interpolation.tar.gz >>> >>> I am very new to petsc and any direction how o proceed would be helpful. >>> >> >> 1) Did you mail the petrbf list? >> >> 2) Could you run the petrbf examples? >> >> 3) We cannot tell anything about convergence without the output of >> -ksp_view -ksp_monitor. >> >> Matt >> >> >>> -- >>> Sincerely >>> Anil Das P V >>> >> >> >> >> -- >> What most experimenters take for granted before they begin their >> experiments is infinitely more interesting than any results to which their >> experiments lead. >> -- Norbert Wiener >> > > > > -- > Sincerely > Anil Das P V > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From dominik at itis.ethz.ch Tue Mar 26 13:44:03 2013 From: dominik at itis.ethz.ch (Dominik Szczerba) Date: Tue, 26 Mar 2013 19:44:03 +0100 Subject: [petsc-users] Any overheads of VecGetArray/VecRestoreArray? In-Reply-To: References: <42A176C3-7A68-47F3-B553-D56BF8BD5D96@mcs.anl.gov> Message-ID: > VecNorm(X,NORM_2,&xnorm_before); > for (each local element) { > VecGetArray(X,&x); > VecRestoreArray(X,&x); > } > VecNorm(X,NORM_2,&xnorm_after); > > if some process has no local entries, it will think that X has not been > modified and will not enter the MPI_Allreduce() to compute 'xnorm_after', > which is deadlock. > > To avoid stuff like this, we recommend placing the VecGetArray() outside the > loop, which is consistent with its designation as "logically collective". Thanks a lot for the warning, so my feeling was right this is not a good idea. However, this also means I better not use it in e.g. time stepping loop, where I would call the function to assemble the global coefficient matrix. > You can use VecGetArrayRead() without worrying about this problem. Sounds interesting, but I could not find this function so you are probably referring to a dev version. Dominik From jedbrown at mcs.anl.gov Tue Mar 26 13:51:43 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Tue, 26 Mar 2013 13:51:43 -0500 Subject: [petsc-users] Any overheads of VecGetArray/VecRestoreArray? In-Reply-To: References: <42A176C3-7A68-47F3-B553-D56BF8BD5D96@mcs.anl.gov> Message-ID: On Tue, Mar 26, 2013 at 1:44 PM, Dominik Szczerba wrote: > > > You can use VecGetArrayRead() without worrying about this problem. > > Sounds interesting, but I could not find this function so you are > probably referring to a dev version. > Yes http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/Vec/VecGetArrayRead.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From mmnasr at gmail.com Tue Mar 26 19:57:24 2013 From: mmnasr at gmail.com (Mohamad M. Nasr-Azadani) Date: Tue, 26 Mar 2013 17:57:24 -0700 Subject: [petsc-users] FFTW and non-uniform grid Message-ID: Hi guys, I am newbie to the FFTW and PETSc world. I found out that PETSc has interface to use FFTW. I looked into a few examples available, but I did not find anything regarding FFTW of a DMDA vectors on a nonuniform structured grid. How do we pass the grid coordinates of the vector to FFTW? I like to solve a Poisson equation in (2 or 3d) on structured orthogonal grid with non-uniform grid spacing using FFTW and do some performance comparison against algebraic multigrid solvers. If anyone has had experience with this, could you please guide me here? Thanks, Mohamad -------------- next part -------------- An HTML attachment was scrubbed... URL: From dasans at gmail.com Tue Mar 26 19:58:45 2013 From: dasans at gmail.com (Anil .) Date: Wed, 27 Mar 2013 06:28:45 +0530 Subject: [petsc-users] Trying to modify petrbf to use custom text file In-Reply-To: References: Message-ID: Matt, I am having around 3481 particles that are placed in an unstructured manner. Attached is the image showing the distribution. On Tue, Mar 26, 2013 at 11:45 PM, Matthew Knepley wrote: > On Mon, Mar 25, 2013 at 10:38 PM, Anil . wrote: > >> 1) Could not find the petrbf mailing list >> 2) Petrbf runs perfectly >> 3) Attached is the output with -ksp_view -ksp_monitor >> >> Just point me in the right direction. Issues might be very basic as I am >> starting to use Petsc >> > > This output is a little strange. Some partitions have 0 entries. I am > guessing this problem is very > small. For PeRBF, it does turn out to be optimal to use small blocks, but > the block size depends > on your interaction scale. Right now you have 75 blocks, which might be > too many for your small > problem. > > Matt > > >> On Sat, Mar 23, 2013 at 2:18 AM, Matthew Knepley wrote: >> >>> On Fri, Mar 22, 2013 at 10:58 PM, Anil . wrote: >>> >>>> Hi, >>>> >>>> I have a text file containing N rows. >>>> Each row with x,y,omega values. >>>> I am trying to interpolate this data onto a regular grid using petrbf >>>> But the KSP does not converge and am not able to find the reason. >>>> >>>> The code is available with the text files at >>>> https://www.dropbox.com/s/cypuwugbxo07kx0/rbf-interpolation.tar.gz >>>> >>>> I am very new to petsc and any direction how o proceed would be helpful. >>>> >>> >>> 1) Did you mail the petrbf list? >>> >>> 2) Could you run the petrbf examples? >>> >>> 3) We cannot tell anything about convergence without the output of >>> -ksp_view -ksp_monitor. >>> >>> Matt >>> >>> >>>> -- >>>> Sincerely >>>> Anil Das P V >>>> >>> >>> >>> >>> -- >>> What most experimenters take for granted before they begin their >>> experiments is infinitely more interesting than any results to which their >>> experiments lead. >>> -- Norbert Wiener >>> >> >> >> >> -- >> Sincerely >> Anil Das P V >> > > > > -- > What most experimenters take for granted before they begin their > experiments is infinitely more interesting than any results to which their > experiments lead. > -- Norbert Wiener > -- Sincerely Anil Das P V -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: distribution.eps Type: application/postscript Size: 88068 bytes Desc: not available URL: From bsmith at mcs.anl.gov Tue Mar 26 21:04:49 2013 From: bsmith at mcs.anl.gov (Barry Smith) Date: Tue, 26 Mar 2013 21:04:49 -0500 Subject: [petsc-users] Trying to modify petrbf to use custom text file In-Reply-To: References: Message-ID: <5B56B8D1-6DCD-4E7B-8488-E2C20D38FCCE@mcs.anl.gov> What is the domain suppose to be? The volume of a torus? What kind of "regular" grid are you mapping it to? Are you making sure the "regular grid" is periodic in that one direction? On Mar 26, 2013, at 7:58 PM, "Anil ." wrote: > Matt, > > I am having around 3481 particles that are placed in an unstructured manner. > Attached is the image showing the distribution. > > > On Tue, Mar 26, 2013 at 11:45 PM, Matthew Knepley wrote: > On Mon, Mar 25, 2013 at 10:38 PM, Anil . wrote: > 1) Could not find the petrbf mailing list > 2) Petrbf runs perfectly > 3) Attached is the output with -ksp_view -ksp_monitor > > Just point me in the right direction. Issues might be very basic as I am starting to use Petsc > > This output is a little strange. Some partitions have 0 entries. I am guessing this problem is very > small. For PeRBF, it does turn out to be optimal to use small blocks, but the block size depends > on your interaction scale. Right now you have 75 blocks, which might be too many for your small > problem. > > Matt > > On Sat, Mar 23, 2013 at 2:18 AM, Matthew Knepley wrote: > On Fri, Mar 22, 2013 at 10:58 PM, Anil . wrote: > Hi, > > I have a text file containing N rows. > Each row with x,y,omega values. > I am trying to interpolate this data onto a regular grid using petrbf > But the KSP does not converge and am not able to find the reason. > > The code is available with the text files at > https://www.dropbox.com/s/cypuwugbxo07kx0/rbf-interpolation.tar.gz > > I am very new to petsc and any direction how o proceed would be helpful. > > 1) Did you mail the petrbf list? > > 2) Could you run the petrbf examples? > > 3) We cannot tell anything about convergence without the output of -ksp_view -ksp_monitor. > > Matt > > -- > Sincerely > Anil Das P V > > > > -- > What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. > -- Norbert Wiener > > > > -- > Sincerely > Anil Das P V > > > > -- > What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. > -- Norbert Wiener > > > > -- > Sincerely > Anil Das P V > From knepley at gmail.com Tue Mar 26 21:29:07 2013 From: knepley at gmail.com (Matthew Knepley) Date: Wed, 27 Mar 2013 13:29:07 +1100 Subject: [petsc-users] Trying to modify petrbf to use custom text file In-Reply-To: References: Message-ID: On Wed, Mar 27, 2013 at 11:58 AM, Anil . wrote: > Matt, > > I am having around 3481 particles that are placed in an unstructured > manner. > Attached is the image showing the distribution. > Show me your PETSc options, and try playing with the number of blocks. If you look at the PetRBF paper, we give guidance for choosing the sizes. Matt > > On Tue, Mar 26, 2013 at 11:45 PM, Matthew Knepley wrote: > >> On Mon, Mar 25, 2013 at 10:38 PM, Anil . wrote: >> >>> 1) Could not find the petrbf mailing list >>> 2) Petrbf runs perfectly >>> 3) Attached is the output with -ksp_view -ksp_monitor >>> >>> Just point me in the right direction. Issues might be very basic as I am >>> starting to use Petsc >>> >> >> This output is a little strange. Some partitions have 0 entries. I am >> guessing this problem is very >> small. For PeRBF, it does turn out to be optimal to use small blocks, but >> the block size depends >> on your interaction scale. Right now you have 75 blocks, which might be >> too many for your small >> problem. >> >> Matt >> >> >>> On Sat, Mar 23, 2013 at 2:18 AM, Matthew Knepley wrote: >>> >>>> On Fri, Mar 22, 2013 at 10:58 PM, Anil . wrote: >>>> >>>>> Hi, >>>>> >>>>> I have a text file containing N rows. >>>>> Each row with x,y,omega values. >>>>> I am trying to interpolate this data onto a regular grid using petrbf >>>>> But the KSP does not converge and am not able to find the reason. >>>>> >>>>> The code is available with the text files at >>>>> https://www.dropbox.com/s/cypuwugbxo07kx0/rbf-interpolation.tar.gz >>>>> >>>>> I am very new to petsc and any direction how o proceed would be >>>>> helpful. >>>>> >>>> >>>> 1) Did you mail the petrbf list? >>>> >>>> 2) Could you run the petrbf examples? >>>> >>>> 3) We cannot tell anything about convergence without the output of >>>> -ksp_view -ksp_monitor. >>>> >>>> Matt >>>> >>>> >>>>> -- >>>>> Sincerely >>>>> Anil Das P V >>>>> >>>> >>>> >>>> >>>> -- >>>> What most experimenters take for granted before they begin their >>>> experiments is infinitely more interesting than any results to which their >>>> experiments lead. >>>> -- Norbert Wiener >>>> >>> >>> >>> >>> -- >>> Sincerely >>> Anil Das P V >>> >> >> >> >> -- >> What most experimenters take for granted before they begin their >> experiments is infinitely more interesting than any results to which their >> experiments lead. >> -- Norbert Wiener >> > > > > -- > Sincerely > Anil Das P V > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From dasans at gmail.com Tue Mar 26 23:09:03 2013 From: dasans at gmail.com (Anil .) Date: Wed, 27 Mar 2013 09:39:03 +0530 Subject: [petsc-users] Trying to modify petrbf to use custom text file In-Reply-To: <5B56B8D1-6DCD-4E7B-8488-E2C20D38FCCE@mcs.anl.gov> References: <5B56B8D1-6DCD-4E7B-8488-E2C20D38FCCE@mcs.anl.gov> Message-ID: Barry, Its 2D domain. Its a simulation of flow past an ellipse. Currently I am trying to compute only the weights associated with each initial points using RBF. Using these weights I will then interpolate onto regular grid. I have not added interpolating onto regular grid yet. It diverges while computing the weights. On Wed, Mar 27, 2013 at 7:34 AM, Barry Smith wrote: > > What is the domain suppose to be? The volume of a torus? What kind of > "regular" grid are you mapping it to? Are you making sure the "regular > grid" is periodic in that one direction? > > > On Mar 26, 2013, at 7:58 PM, "Anil ." wrote: > > > Matt, > > > > I am having around 3481 particles that are placed in an unstructured > manner. > > Attached is the image showing the distribution. > > > > > > On Tue, Mar 26, 2013 at 11:45 PM, Matthew Knepley > wrote: > > On Mon, Mar 25, 2013 at 10:38 PM, Anil . wrote: > > 1) Could not find the petrbf mailing list > > 2) Petrbf runs perfectly > > 3) Attached is the output with -ksp_view -ksp_monitor > > > > Just point me in the right direction. Issues might be very basic as I am > starting to use Petsc > > > > This output is a little strange. Some partitions have 0 entries. I am > guessing this problem is very > > small. For PeRBF, it does turn out to be optimal to use small blocks, > but the block size depends > > on your interaction scale. Right now you have 75 blocks, which might be > too many for your small > > problem. > > > > Matt > > > > On Sat, Mar 23, 2013 at 2:18 AM, Matthew Knepley > wrote: > > On Fri, Mar 22, 2013 at 10:58 PM, Anil . wrote: > > Hi, > > > > I have a text file containing N rows. > > Each row with x,y,omega values. > > I am trying to interpolate this data onto a regular grid using petrbf > > But the KSP does not converge and am not able to find the reason. > > > > The code is available with the text files at > > https://www.dropbox.com/s/cypuwugbxo07kx0/rbf-interpolation.tar.gz > > > > I am very new to petsc and any direction how o proceed would be helpful. > > > > 1) Did you mail the petrbf list? > > > > 2) Could you run the petrbf examples? > > > > 3) We cannot tell anything about convergence without the output of > -ksp_view -ksp_monitor. > > > > Matt > > > > -- > > Sincerely > > Anil Das P V > > > > > > > > -- > > What most experimenters take for granted before they begin their > experiments is infinitely more interesting than any results to which their > experiments lead. > > -- Norbert Wiener > > > > > > > > -- > > Sincerely > > Anil Das P V > > > > > > > > -- > > What most experimenters take for granted before they begin their > experiments is infinitely more interesting than any results to which their > experiments lead. > > -- Norbert Wiener > > > > > > > > -- > > Sincerely > > Anil Das P V > > > > -- Sincerely Anil Das P V -------------- next part -------------- An HTML attachment was scrubbed... URL: From dasans at gmail.com Tue Mar 26 23:13:46 2013 From: dasans at gmail.com (Anil .) Date: Wed, 27 Mar 2013 09:43:46 +0530 Subject: [petsc-users] Trying to modify petrbf to use custom text file In-Reply-To: References: Message-ID: Matt, Petsc Options I use to run are.... mpirun -np 4 ./reader -pc_type asm -sub_pc_type lu -sub_mat_type dense -ksp_monitor -ksp_rtol 1e-13 -ksp_max_it 100 -vecscatter_alltoall -log_summary Attached is the output..It also contains my petsc configuration On Wed, Mar 27, 2013 at 7:59 AM, Matthew Knepley wrote: > On Wed, Mar 27, 2013 at 11:58 AM, Anil . wrote: > >> Matt, >> >> I am having around 3481 particles that are placed in an unstructured >> manner. >> Attached is the image showing the distribution. >> > > Show me your PETSc options, and try playing with the number of blocks. If > you look > at the PetRBF paper, we give guidance for choosing the sizes. > > Matt > > >> >> On Tue, Mar 26, 2013 at 11:45 PM, Matthew Knepley wrote: >> >>> On Mon, Mar 25, 2013 at 10:38 PM, Anil . wrote: >>> >>>> 1) Could not find the petrbf mailing list >>>> 2) Petrbf runs perfectly >>>> 3) Attached is the output with -ksp_view -ksp_monitor >>>> >>>> Just point me in the right direction. Issues might be very basic as I >>>> am starting to use Petsc >>>> >>> >>> This output is a little strange. Some partitions have 0 entries. I am >>> guessing this problem is very >>> small. For PeRBF, it does turn out to be optimal to use small blocks, >>> but the block size depends >>> on your interaction scale. Right now you have 75 blocks, which might be >>> too many for your small >>> problem. >>> >>> Matt >>> >>> >>>> On Sat, Mar 23, 2013 at 2:18 AM, Matthew Knepley wrote: >>>> >>>>> On Fri, Mar 22, 2013 at 10:58 PM, Anil . wrote: >>>>> >>>>>> Hi, >>>>>> >>>>>> I have a text file containing N rows. >>>>>> Each row with x,y,omega values. >>>>>> I am trying to interpolate this data onto a regular grid using petrbf >>>>>> But the KSP does not converge and am not able to find the reason. >>>>>> >>>>>> The code is available with the text files at >>>>>> https://www.dropbox.com/s/cypuwugbxo07kx0/rbf-interpolation.tar.gz >>>>>> >>>>>> I am very new to petsc and any direction how o proceed would be >>>>>> helpful. >>>>>> >>>>> >>>>> 1) Did you mail the petrbf list? >>>>> >>>>> 2) Could you run the petrbf examples? >>>>> >>>>> 3) We cannot tell anything about convergence without the output of >>>>> -ksp_view -ksp_monitor. >>>>> >>>>> Matt >>>>> >>>>> >>>>>> -- >>>>>> Sincerely >>>>>> Anil Das P V >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> What most experimenters take for granted before they begin their >>>>> experiments is infinitely more interesting than any results to which their >>>>> experiments lead. >>>>> -- Norbert Wiener >>>>> >>>> >>>> >>>> >>>> -- >>>> Sincerely >>>> Anil Das P V >>>> >>> >>> >>> >>> -- >>> What most experimenters take for granted before they begin their >>> experiments is infinitely more interesting than any results to which their >>> experiments lead. >>> -- Norbert Wiener >>> >> >> >> >> -- >> Sincerely >> Anil Das P V >> > > > > -- > What most experimenters take for granted before they begin their > experiments is infinitely more interesting than any results to which their > experiments lead. > -- Norbert Wiener > -- Sincerely Anil Das P V -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: t3.out Type: application/octet-stream Size: 16295 bytes Desc: not available URL: From knepley at gmail.com Tue Mar 26 23:20:24 2013 From: knepley at gmail.com (Matthew Knepley) Date: Wed, 27 Mar 2013 15:20:24 +1100 Subject: [petsc-users] Trying to modify petrbf to use custom text file In-Reply-To: References: Message-ID: On Wed, Mar 27, 2013 at 3:13 PM, Anil . wrote: > Matt, > > Petsc Options I use to run are.... > mpirun -np 4 ./reader -pc_type asm -sub_pc_type lu -sub_mat_type dense > -ksp_monitor -ksp_rtol 1e-13 -ksp_max_it 100 -vecscatter_alltoall > -log_summary > 1) Always run with -ksp_view. 2) The relative tolerance is probably too tight, but that is secondary 3) Something is really wrong here. I am guessing something in the input not what you want. If the interaction is truly short range, you would see significant drop in the residual on the first iteration. First, take a look at the matrix using -mat_view draw:: -draw_pause -1. It should be banded. Matt Attached is the output..It also contains my petsc configuration > > > > On Wed, Mar 27, 2013 at 7:59 AM, Matthew Knepley wrote: > >> On Wed, Mar 27, 2013 at 11:58 AM, Anil . wrote: >> >>> Matt, >>> >>> I am having around 3481 particles that are placed in an unstructured >>> manner. >>> Attached is the image showing the distribution. >>> >> >> Show me your PETSc options, and try playing with the number of blocks. >> If you look >> at the PetRBF paper, we give guidance for choosing the sizes. >> >> Matt >> >> >>> >>> On Tue, Mar 26, 2013 at 11:45 PM, Matthew Knepley wrote: >>> >>>> On Mon, Mar 25, 2013 at 10:38 PM, Anil . wrote: >>>> >>>>> 1) Could not find the petrbf mailing list >>>>> 2) Petrbf runs perfectly >>>>> 3) Attached is the output with -ksp_view -ksp_monitor >>>>> >>>>> Just point me in the right direction. Issues might be very basic as I >>>>> am starting to use Petsc >>>>> >>>> >>>> This output is a little strange. Some partitions have 0 entries. I am >>>> guessing this problem is very >>>> small. For PeRBF, it does turn out to be optimal to use small blocks, >>>> but the block size depends >>>> on your interaction scale. Right now you have 75 blocks, which might be >>>> too many for your small >>>> problem. >>>> >>>> Matt >>>> >>>> >>>>> On Sat, Mar 23, 2013 at 2:18 AM, Matthew Knepley wrote: >>>>> >>>>>> On Fri, Mar 22, 2013 at 10:58 PM, Anil . wrote: >>>>>> >>>>>>> Hi, >>>>>>> >>>>>>> I have a text file containing N rows. >>>>>>> Each row with x,y,omega values. >>>>>>> I am trying to interpolate this data onto a regular grid using petrbf >>>>>>> But the KSP does not converge and am not able to find the reason. >>>>>>> >>>>>>> The code is available with the text files at >>>>>>> https://www.dropbox.com/s/cypuwugbxo07kx0/rbf-interpolation.tar.gz >>>>>>> >>>>>>> I am very new to petsc and any direction how o proceed would be >>>>>>> helpful. >>>>>>> >>>>>> >>>>>> 1) Did you mail the petrbf list? >>>>>> >>>>>> 2) Could you run the petrbf examples? >>>>>> >>>>>> 3) We cannot tell anything about convergence without the output of >>>>>> -ksp_view -ksp_monitor. >>>>>> >>>>>> Matt >>>>>> >>>>>> >>>>>>> -- >>>>>>> Sincerely >>>>>>> Anil Das P V >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> What most experimenters take for granted before they begin their >>>>>> experiments is infinitely more interesting than any results to which their >>>>>> experiments lead. >>>>>> -- Norbert Wiener >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> Sincerely >>>>> Anil Das P V >>>>> >>>> >>>> >>>> >>>> -- >>>> What most experimenters take for granted before they begin their >>>> experiments is infinitely more interesting than any results to which their >>>> experiments lead. >>>> -- Norbert Wiener >>>> >>> >>> >>> >>> -- >>> Sincerely >>> Anil Das P V >>> >> >> >> >> -- >> What most experimenters take for granted before they begin their >> experiments is infinitely more interesting than any results to which their >> experiments lead. >> -- Norbert Wiener >> > > > > -- > Sincerely > Anil Das P V > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From sonyablade2010 at hotmail.com Wed Mar 27 07:24:10 2013 From: sonyablade2010 at hotmail.com (Sonya Blade) Date: Wed, 27 Mar 2013 12:24:10 +0000 Subject: [petsc-users] Slepc installation Message-ID: Dear All, I've completed the installation of Petsc W/o trouble (at least I think I've done so because I didn't tested it). Now I'm trying to complete the installation of SLEPC. I set the enviroment variables for PETSC_DIR and SLPEC_DIR to point out to the location of installation folders of Petsc and Slepc respectively.? When I run the ./configure from the CygWin terminal I receive the following error. I run the ./configure directly from the installed directory of Slepc, ?so why it still complains Slepc_Dir is not the current directory. $ ./configure Checking environment... ERROR: SLEPC_DIR is not the current directory Regards, From jroman at dsic.upv.es Wed Mar 27 08:01:48 2013 From: jroman at dsic.upv.es (Jose E. Roman) Date: Wed, 27 Mar 2013 14:01:48 +0100 Subject: [petsc-users] Slepc installation In-Reply-To: References: Message-ID: <3A88BD1D-1257-4582-8911-94A23FD4054D@dsic.upv.es> El 27/03/2013, a las 13:24, Sonya Blade escribi?: > Dear All, > > I've completed the installation of Petsc W/o trouble (at least I think I've done so because I didn't tested it). Now I'm trying to complete the installation of SLEPC. I set the enviroment variables for PETSC_DIR and SLPEC_DIR to point out to the location of installation folders of Petsc and Slepc respectively. > > When I run the ./configure from the CygWin terminal I receive the following error. I run the ./configure directly from the installed directory of Slepc, so why it still complains Slepc_Dir is not the current directory. > > > > $ ./configure > Checking environment... > ERROR: SLEPC_DIR is not the current directory > > > Regards, Did you export the SLEPC_DIR variable? Open the python console and try this: >>> import os >>> print os.path.realpath(os.getcwd()) >>> print os.path.realpath(os.environ['SLEPC_DIR']) Both paths should be the same. Jose From sonyablade2010 at hotmail.com Wed Mar 27 08:16:00 2013 From: sonyablade2010 at hotmail.com (Sonya Blade) Date: Wed, 27 Mar 2013 13:16:00 +0000 Subject: [petsc-users] Slepc installation In-Reply-To: References: Message-ID: >Did you export the SLEPC_DIR variable? yes, as is being instructed at the Slepc manual with?following command to point out to installed directory of Slepc. export SLEPC_DIR=/home/username/slepc-3.3 From knepley at gmail.com Wed Mar 27 08:50:08 2013 From: knepley at gmail.com (Matthew Knepley) Date: Thu, 28 Mar 2013 00:50:08 +1100 Subject: [petsc-users] Slepc installation In-Reply-To: References: Message-ID: On Thu, Mar 28, 2013 at 12:16 AM, Sonya Blade wrote: > >Did you export the SLEPC_DIR variable? > > yes, as is being instructed at the Slepc manual with following command to > point out to installed directory of Slepc. > > export SLEPC_DIR=/home/username/slepc-3.3 > Are you in that directory when you run configure? Matt -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From sonyablade2010 at hotmail.com Wed Mar 27 09:04:42 2013 From: sonyablade2010 at hotmail.com (Sonya Blade) Date: Wed, 27 Mar 2013 14:04:42 +0000 Subject: [petsc-users] Slepc installation In-Reply-To: References: , Message-ID: >Are you in that directory when you run configure? Yes sure, From jroman at dsic.upv.es Wed Mar 27 09:06:39 2013 From: jroman at dsic.upv.es (Jose E. Roman) Date: Wed, 27 Mar 2013 15:06:39 +0100 Subject: [petsc-users] Slepc installation In-Reply-To: References: , Message-ID: El 27/03/2013, a las 15:04, Sonya Blade escribi?: >> Are you in that directory when you run configure? > Yes sure, Did you run the commands suggested in my previous email? Which is the output you get? Jose From sonyablade2010 at hotmail.com Wed Mar 27 09:20:26 2013 From: sonyablade2010 at hotmail.com (Sonya Blade) Date: Wed, 27 Mar 2013 14:20:26 +0000 Subject: [petsc-users] Slepc installation In-Reply-To: References: , , Message-ID: >Did you run the commands suggested in my previous email? Which is the output you get? Sorry I missed that part, the second command retrieves SLEPC_DIR with backslash(\) separated, not as forward slash(/) expected by terminal.?The same for the PETSC_DIR configuration. Based on that I double checked the environmental variables dialog box, but this also shows the forward slashed version of both packages Petsc and SLepc. What am I missing here ? Regards, From knepley at gmail.com Wed Mar 27 09:46:35 2013 From: knepley at gmail.com (Matthew Knepley) Date: Thu, 28 Mar 2013 01:46:35 +1100 Subject: [petsc-users] Slepc installation In-Reply-To: References: Message-ID: On Thu, Mar 28, 2013 at 1:20 AM, Sonya Blade wrote: > >Did you run the commands suggested in my previous email? Which is the > output you get? > > Sorry I missed that part, the second command retrieves SLEPC_DIR with > backslash(\) separated, not as forward slash(/) expected by terminal. The > same for the PETSC_DIR configuration. > > Based on that I double checked the environmental variables dialog box, but > this also shows the forward slashed version of both packages Petsc and > SLepc. > > What am I missing here ? > You should be in a Cygwin shell. Matt > Regards, -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From sonyablade2010 at hotmail.com Wed Mar 27 10:51:44 2013 From: sonyablade2010 at hotmail.com (Sonya Blade) Date: Wed, 27 Mar 2013 15:51:44 +0000 Subject: [petsc-users] Slepc installation In-Reply-To: References: , , , Message-ID: >You should be in a Cygwin shell. Probably I'm missing something obvious but What does it mean being in a Cygwin shell. I'm already using cygwin terminal inside of the petsc directory. This is how my command line looks like. NOBODY at NOBODY /cygdrive/....../Downloads/slepc-3.3-p3 $ ./configure Regards, From knepley at gmail.com Wed Mar 27 10:54:52 2013 From: knepley at gmail.com (Matthew Knepley) Date: Thu, 28 Mar 2013 02:54:52 +1100 Subject: [petsc-users] Slepc installation In-Reply-To: References: Message-ID: On Thu, Mar 28, 2013 at 2:51 AM, Sonya Blade wrote: > >You should be in a Cygwin shell. > > Probably I'm missing something obvious but What does it mean being in a > Cygwin shell. I'm already using cygwin terminal inside of the petsc > directory. This is how my command line looks like. > > > NOBODY at NOBODY /cygdrive/....../Downloads/slepc-3.3-p3 > $ ./configure > Please show the output of the commands that Jose suggested: Open the python console and try this: >>> import os >>> print os.path.realpath(os.getcwd()) >>> print os.path.realpath(os.environ['SLEPC_DIR']) Matt > Regards, -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From balay at mcs.anl.gov Wed Mar 27 10:57:19 2013 From: balay at mcs.anl.gov (Satish Balay) Date: Wed, 27 Mar 2013 10:57:19 -0500 (CDT) Subject: [petsc-users] Slepc installation In-Reply-To: References: Message-ID: On Wed, 27 Mar 2013, Sonya Blade wrote: > >Did you export the SLEPC_DIR variable? > > yes, as is being instructed at the Slepc manual with?following command to point out to installed directory of Slepc. > > export SLEPC_DIR=/home/username/slepc-3.3 Sodunds you didn't follow this instruction. Satish From mmnasr at gmail.com Wed Mar 27 15:18:55 2013 From: mmnasr at gmail.com (Mohamad M. Nasr-Azadani) Date: Wed, 27 Mar 2013 13:18:55 -0700 Subject: [petsc-users] PCGAMG Message-ID: Hi, I am trying to use PCGAMG. The matrix I have is based on a 2-D DMDA, Laplace equation. This is the part of the code I have to setup the solver: KSP solver; PC pc; ierr = KSPCreate(PETSC_COMM_WORLD, &solver); ierr = KSPGetPC(solver, &pc);CHKERRQ(ierr); ierr = PCSetType(pc, PCGAMG);CHKERRQ(ierr); ierr = KSPSetFromOptions(solver); CHKERRQ(ierr); ierr = KSPSetOperators(solver, LHS_mat, LHS_mat, SAME_NONZERO_PATTERN); CHKERRQ(ierr); When I run the code in parallel, it is fine. But when I run it in serial, this is the error I get: [0]PCSetData_AGG bs=1 MM=11000 [0]PETSC ERROR: --------------------- Error Message ------------------------------------ [0]PETSC ERROR: No support for this operation for this object type! [0]PETSC ERROR: Not implemented for A=mpiaij and P=seqaij! [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: Petsc Release Version 3.3.0, Patch 6, Mon Feb 11 12:26:34 CST 2013 [0]PETSC ERROR: See docs/changes/index.html for recent updates. [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. [0]PETSC ERROR: See docs/index.html for manual pages. [0]PETSC ERROR: ------------------------------------------------------------------------ Any thoughts? Mohamad -------------- next part -------------- An HTML attachment was scrubbed... URL: From jedbrown at mcs.anl.gov Wed Mar 27 17:54:35 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Wed, 27 Mar 2013 17:54:35 -0500 Subject: [petsc-users] PCGAMG In-Reply-To: References: Message-ID: How did you create these matrices? Always send the FULL error message, including the stack trace. Can you set up an example that can reproduce? On Wed, Mar 27, 2013 at 3:18 PM, Mohamad M. Nasr-Azadani wrote: > Hi, > > I am trying to use PCGAMG. > The matrix I have is based on a 2-D DMDA, Laplace equation. > This is the part of the code I have to setup the solver: > > KSP solver; > PC pc; > ierr = KSPCreate(PETSC_COMM_WORLD, &solver); > ierr = KSPGetPC(solver, &pc);CHKERRQ(ierr); > ierr = PCSetType(pc, PCGAMG);CHKERRQ(ierr); > ierr = KSPSetFromOptions(solver); CHKERRQ(ierr); > ierr = KSPSetOperators(solver, LHS_mat, LHS_mat, SAME_NONZERO_PATTERN); > CHKERRQ(ierr); > > When I run the code in parallel, it is fine. > But when I run it in serial, this is the error I get: > > [0]PCSetData_AGG bs=1 MM=11000 > [0]PETSC ERROR: --------------------- Error Message > ------------------------------------ > [0]PETSC ERROR: No support for this operation for this object type! > [0]PETSC ERROR: Not implemented for A=mpiaij and P=seqaij! > [0]PETSC ERROR: > ------------------------------------------------------------------------ > [0]PETSC ERROR: Petsc Release Version 3.3.0, Patch 6, Mon Feb 11 12:26:34 > CST 2013 > [0]PETSC ERROR: See docs/changes/index.html for recent updates. > [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. > [0]PETSC ERROR: See docs/index.html for manual pages. > [0]PETSC ERROR: > ------------------------------------------------------------------------ > > > Any thoughts? > > Mohamad > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mmnasr at gmail.com Wed Mar 27 18:08:57 2013 From: mmnasr at gmail.com (Mohamad M. Nasr-Azadani) Date: Wed, 27 Mar 2013 16:08:57 -0700 Subject: [petsc-users] PCGAMG In-Reply-To: References: Message-ID: Thanks Jed, How did you create these matrices? ierr = DMCreateMatrix(DA2d, MATMPIAIJ, &LHS_mat); CHKERRQ(ierr); (The DA2d is a DMDA in two dimensions, with 1 point stencil width, 1 dof, STAR_STENCIL). It is a 5-point based discretization of the laplace equation on uniform grid). Always send the FULL error message, including the stack trace. [0]PCSetData_AGG bs=1 MM=11000 [0]PETSC ERROR: --------------------- Error Message ------------------------------------ [0]PETSC ERROR: No support for this operation for this object type! [0]PETSC ERROR: Not implemented for A=mpiaij and P=seqaij! [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: Petsc Release Version 3.3.0, Patch 6, Mon Feb 11 12:26:34 CST 2013 [0]PETSC ERROR: See docs/changes/index.html for recent updates. [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. [0]PETSC ERROR: See docs/index.html for manual pages. [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: ./ex1 on a arch-linu named yoda.mee.ucsb.edu by mmnasr Wed Mar 27 13:12:28 2013 [0]PETSC ERROR: Libraries linked from /home/mmnasr/Softwares/petsc-3.3-p6/arch-linux2-c-debug/lib [0]PETSC ERROR: Configure run at Tue Mar 26 14:35:30 2013 [0]PETSC ERROR: Configure options --with-cc=gcc --with-fc=gfortran --download-f-blas-lapack --download-mpich --download-hypre --download-mumps --download-blacs --download-scalapack --download-ptscotch --with-debuging=0 [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: MatPtAPSymbolic_MPIAIJ() line 81 in src/mat/impls/aij/mpi/mpiptap.c [0]PETSC ERROR: MatPtAPSymbolic() line 8362 in src/mat/interface/matrix.c [0]PETSC ERROR: MatPtAP_Basic() line 12 in src/mat/utils/ptap.c [0]PETSC ERROR: MatPtAP() line 8256 in src/mat/interface/matrix.c [0]PETSC ERROR: createLevel() line 152 in src/ksp/pc/impls/gamg/gamg.c [0]PETSC ERROR: PCSetUp_GAMG() line 722 in src/ksp/pc/impls/gamg/gamg.c [0]PETSC ERROR: PCSetUp() line 832 in src/ksp/pc/interface/precon.c [0]PETSC ERROR: KSPSetUp() line 278 in src/ksp/ksp/interface/itfunc.c [0]PETSC ERROR: KSPSolve() line 402 in src/ksp/ksp/interface/itfunc.c [0]PETSC ERROR: main() line 158 in ex1.c application called MPI_Abort(MPI_COMM_WORLD, 56) - process 0 [cli_0]: aborting job: application called MPI_Abort(MPI_COMM_WORLD, 56) - process 0 Can you set up an example that can reproduce? See attached. Thanks, Mohamad On Wed, Mar 27, 2013 at 3:54 PM, Jed Brown wrote: > How did you create these matrices? Always send the FULL error message, > including the stack trace. Can you set up an example that can reproduce? > > > On Wed, Mar 27, 2013 at 3:18 PM, Mohamad M. Nasr-Azadani > wrote: > >> Hi, >> >> I am trying to use PCGAMG. >> The matrix I have is based on a 2-D DMDA, Laplace equation. >> This is the part of the code I have to setup the solver: >> >> KSP solver; >> PC pc; >> ierr = KSPCreate(PETSC_COMM_WORLD, &solver); >> ierr = KSPGetPC(solver, &pc);CHKERRQ(ierr); >> ierr = PCSetType(pc, PCGAMG);CHKERRQ(ierr); >> ierr = KSPSetFromOptions(solver); CHKERRQ(ierr); >> ierr = KSPSetOperators(solver, LHS_mat, LHS_mat, SAME_NONZERO_PATTERN); >> CHKERRQ(ierr); >> >> When I run the code in parallel, it is fine. >> But when I run it in serial, this is the error I get: >> >> [0]PCSetData_AGG bs=1 MM=11000 >> [0]PETSC ERROR: --------------------- Error Message >> ------------------------------------ >> [0]PETSC ERROR: No support for this operation for this object type! >> [0]PETSC ERROR: Not implemented for A=mpiaij and P=seqaij! >> [0]PETSC ERROR: >> ------------------------------------------------------------------------ >> [0]PETSC ERROR: Petsc Release Version 3.3.0, Patch 6, Mon Feb 11 12:26:34 >> CST 2013 >> [0]PETSC ERROR: See docs/changes/index.html for recent updates. >> [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. >> [0]PETSC ERROR: See docs/index.html for manual pages. >> [0]PETSC ERROR: >> ------------------------------------------------------------------------ >> >> >> Any thoughts? >> >> Mohamad >> >> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ex1.c Type: text/x-csrc Size: 18092 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ex1.h Type: text/x-chdr Size: 787 bytes Desc: not available URL: From mmnasr at gmail.com Wed Mar 27 18:30:34 2013 From: mmnasr at gmail.com (Mohamad M. Nasr-Azadani) Date: Wed, 27 Mar 2013 16:30:34 -0700 Subject: [petsc-users] PCGAMG In-Reply-To: References: Message-ID: Sorry, the codes attached were not the most recent versions. Here is the code you can reproduce the error with. Cheers, Mohamad On Wed, Mar 27, 2013 at 4:08 PM, Mohamad M. Nasr-Azadani wrote: > Thanks Jed, > How did you create these matrices? > ierr = DMCreateMatrix(DA2d, MATMPIAIJ, &LHS_mat); CHKERRQ(ierr); > > (The DA2d is a DMDA in two dimensions, with 1 point stencil width, 1 dof, > STAR_STENCIL). > It is a 5-point based discretization of the laplace equation on uniform > grid). > > Always send the FULL error message, including the stack trace. > [0]PCSetData_AGG bs=1 MM=11000 > [0]PETSC ERROR: --------------------- Error Message > ------------------------------------ > [0]PETSC ERROR: No support for this operation for this object type! > [0]PETSC ERROR: Not implemented for A=mpiaij and P=seqaij! > [0]PETSC ERROR: > ------------------------------------------------------------------------ > [0]PETSC ERROR: Petsc Release Version 3.3.0, Patch 6, Mon Feb 11 12:26:34 > CST 2013 > [0]PETSC ERROR: See docs/changes/index.html for recent updates. > [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. > [0]PETSC ERROR: See docs/index.html for manual pages. > [0]PETSC ERROR: > ------------------------------------------------------------------------ > [0]PETSC ERROR: ./ex1 on a arch-linu named yoda.mee.ucsb.edu by mmnasr > Wed Mar 27 13:12:28 2013 > [0]PETSC ERROR: Libraries linked from > /home/mmnasr/Softwares/petsc-3.3-p6/arch-linux2-c-debug/lib > [0]PETSC ERROR: Configure run at Tue Mar 26 14:35:30 2013 > [0]PETSC ERROR: Configure options --with-cc=gcc --with-fc=gfortran > --download-f-blas-lapack --download-mpich --download-hypre --download-mumps > --download-blacs --download-scalapack --download-ptscotch --with-debuging=0 > [0]PETSC ERROR: > ------------------------------------------------------------------------ > [0]PETSC ERROR: MatPtAPSymbolic_MPIAIJ() line 81 in > src/mat/impls/aij/mpi/mpiptap.c > [0]PETSC ERROR: MatPtAPSymbolic() line 8362 in src/mat/interface/matrix.c > [0]PETSC ERROR: MatPtAP_Basic() line 12 in src/mat/utils/ptap.c > [0]PETSC ERROR: MatPtAP() line 8256 in src/mat/interface/matrix.c > [0]PETSC ERROR: createLevel() line 152 in src/ksp/pc/impls/gamg/gamg.c > [0]PETSC ERROR: PCSetUp_GAMG() line 722 in src/ksp/pc/impls/gamg/gamg.c > [0]PETSC ERROR: PCSetUp() line 832 in src/ksp/pc/interface/precon.c > [0]PETSC ERROR: KSPSetUp() line 278 in src/ksp/ksp/interface/itfunc.c > [0]PETSC ERROR: KSPSolve() line 402 in src/ksp/ksp/interface/itfunc.c > [0]PETSC ERROR: main() line 158 in ex1.c > application called MPI_Abort(MPI_COMM_WORLD, 56) - process 0 > [cli_0]: aborting job: > application called MPI_Abort(MPI_COMM_WORLD, 56) - process 0 > > > > Can you set up an example that can reproduce? > See attached. > > Thanks, > Mohamad > > > > > On Wed, Mar 27, 2013 at 3:54 PM, Jed Brown wrote: > >> How did you create these matrices? Always send the FULL error message, >> including the stack trace. Can you set up an example that can reproduce? >> >> >> On Wed, Mar 27, 2013 at 3:18 PM, Mohamad M. Nasr-Azadani < >> mmnasr at gmail.com> wrote: >> >>> Hi, >>> >>> I am trying to use PCGAMG. >>> The matrix I have is based on a 2-D DMDA, Laplace equation. >>> This is the part of the code I have to setup the solver: >>> >>> KSP solver; >>> PC pc; >>> ierr = KSPCreate(PETSC_COMM_WORLD, &solver); >>> ierr = KSPGetPC(solver, &pc);CHKERRQ(ierr); >>> ierr = PCSetType(pc, PCGAMG);CHKERRQ(ierr); >>> ierr = KSPSetFromOptions(solver); CHKERRQ(ierr); >>> ierr = KSPSetOperators(solver, LHS_mat, LHS_mat, SAME_NONZERO_PATTERN); >>> CHKERRQ(ierr); >>> >>> When I run the code in parallel, it is fine. >>> But when I run it in serial, this is the error I get: >>> >>> [0]PCSetData_AGG bs=1 MM=11000 >>> [0]PETSC ERROR: --------------------- Error Message >>> ------------------------------------ >>> [0]PETSC ERROR: No support for this operation for this object type! >>> [0]PETSC ERROR: Not implemented for A=mpiaij and P=seqaij! >>> [0]PETSC ERROR: >>> ------------------------------------------------------------------------ >>> [0]PETSC ERROR: Petsc Release Version 3.3.0, Patch 6, Mon Feb 11 >>> 12:26:34 CST 2013 >>> [0]PETSC ERROR: See docs/changes/index.html for recent updates. >>> [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. >>> [0]PETSC ERROR: See docs/index.html for manual pages. >>> [0]PETSC ERROR: >>> ------------------------------------------------------------------------ >>> >>> >>> Any thoughts? >>> >>> Mohamad >>> >>> >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ex1.c Type: text/x-csrc Size: 18759 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ex1.h Type: text/x-chdr Size: 787 bytes Desc: not available URL: From jedbrown at mcs.anl.gov Wed Mar 27 18:38:17 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Wed, 27 Mar 2013 18:38:17 -0500 Subject: [petsc-users] PCGAMG In-Reply-To: References: Message-ID: On Wed, Mar 27, 2013 at 6:30 PM, Mohamad M. Nasr-Azadani wrote: > Sorry, the codes attached were not the most recent versions. > Here is the code you can reproduce the error with. > ierr = DMCreateMatrix(DA2d, MATMPIAIJ, &LHS_mat); CHKERRQ(ierr); Just pass MATAIJ or NULL here. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Shuangshuang.Jin at pnnl.gov Wed Mar 27 20:18:41 2013 From: Shuangshuang.Jin at pnnl.gov (Jin, Shuangshuang) Date: Wed, 27 Mar 2013 18:18:41 -0700 Subject: [petsc-users] TSStep error Message-ID: <6778DE83AB681D49BFC2CD850610FEB1018FC7E872F0@EMAIL04.pnl.gov> Hi, I am using TS to solve a nonlinear DAE problem. I got an error below: [0]PETSC ERROR: --------------------- Error Message ------------------------------------ [0]PETSC ERROR: ! [0]PETSC ERROR: TSStep has failed due to DIVERGED_NONLINEAR_SOLVE, increase -ts_max_snes_failures or make negative to attempt recovery! [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: Petsc Development HG revision: 6e0ddc6e9b6d8a9d8eb4c0ede0105827a6b58dfb HG Date: Mon Mar 11 22:54:30 2013 -0500 [0]PETSC ERROR: See docs/changes/index.html for recent updates. [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. [0]PETSC ERROR: See docs/index.html for manual pages. [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: ./dynSim on a arch-complex named olympus.local by d3m956 Wed Mar 27 18:12:05 2013 [0]PETSC ERROR: Libraries linked from /pic/projects/ds/petsc-dev/arch-complex/lib [0]PETSC ERROR: Configure run at Tue Mar 12 14:32:37 2013 [0]PETSC ERROR: Configure options --with-scalar-type=complex --with-clanguage=C++ PETSC_ARCH=arch-complex --with-fortran-kernels=generic [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: TSStep() line 2442 in src/ts/interface/ts.c [0]PETSC ERROR: TSSolve() line 2553 in src/ts/interface/ts.c [0]PETSC ERROR: simu() line 420 in "unknowndirectory/"simulation.C [0]PETSC ERROR: runSimulation() line 83 in "unknowndirectory/"dynSim.h Run simulation time: 0.0317168 What does this error imply for? My ftime = 0.5, and the timestep is 0.001, and the solution method I'm using is TSBEULER PetscReal ftime=0.5; ierr = TSSetInitialTimeStep(ts, 0.0, 0.001); CHKERRQ(ierr); ierr = TSSetType(ts, TSBEULER); CHKERRQ(ierr); Is there any command option I should use when I run the code? Thanks, Shuangshuang -------------- next part -------------- An HTML attachment was scrubbed... URL: From jedbrown at mcs.anl.gov Wed Mar 27 21:01:30 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Wed, 27 Mar 2013 21:01:30 -0500 Subject: [petsc-users] TSStep error In-Reply-To: <6778DE83AB681D49BFC2CD850610FEB1018FC7E872F0@EMAIL04.pnl.gov> References: <6778DE83AB681D49BFC2CD850610FEB1018FC7E872F0@EMAIL04.pnl.gov> Message-ID: On Wed, Mar 27, 2013 at 8:18 PM, Jin, Shuangshuang < Shuangshuang.Jin at pnnl.gov> wrote: > Hi, I am using TS to solve a nonlinear DAE problem. I got an error below: > > [0]PETSC ERROR: --------------------- Error Message > ------------------------------------ > [0]PETSC ERROR: ! > [0]PETSC ERROR: TSStep has failed due to DIVERGED_NONLINEAR_SOLVE, > increase -ts_max_snes_failures or make negative to attempt recovery! > By default BEULER does not adaptively shorten steps in response to a failed nonlinear solve. If you change the option noted above, it will retry with shorter time steps when the solve fails. You might also consider using '-ts_type arkimex -ts_arkimex_type 1bee' which is backward Euler with adaptive error control using an extrapolation estimator. > [0]PETSC ERROR: > ------------------------------------------------------------------------ > [0]PETSC ERROR: Petsc Development HG revision: > 6e0ddc6e9b6d8a9d8eb4c0ede0105827a6b58dfb HG Date: Mon Mar 11 22:54:30 2013 > -0500 > [0]PETSC ERROR: See docs/changes/index.html for recent updates. > [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. > [0]PETSC ERROR: See docs/index.html for manual pages. > [0]PETSC ERROR: > ------------------------------------------------------------------------ > [0]PETSC ERROR: ./dynSim on a arch-complex named olympus.local by d3m956 > Wed Mar 27 18:12:05 2013 > [0]PETSC ERROR: Libraries linked from > /pic/projects/ds/petsc-dev/arch-complex/lib > [0]PETSC ERROR: Configure run at Tue Mar 12 14:32:37 2013 > [0]PETSC ERROR: Configure options --with-scalar-type=complex > --with-clanguage=C++ PETSC_ARCH=arch-complex --with-fortran-kernels=generic > [0]PETSC ERROR: > ------------------------------------------------------------------------ > [0]PETSC ERROR: TSStep() line 2442 in src/ts/interface/ts.c > [0]PETSC ERROR: TSSolve() line 2553 in src/ts/interface/ts.c > [0]PETSC ERROR: simu() line 420 in "unknowndirectory/"simulation.C > [0]PETSC ERROR: runSimulation() line 83 in "unknowndirectory/"dynSim.h > Run simulation time: 0.0317168 > > What does this error imply for? > > My ftime = 0.5, and the timestep is 0.001, and the solution method I?m > using is TSBEULER > *PetscReal ftime=0.5;* > *ierr = TSSetInitialTimeStep(ts, 0.0, 0.001); CHKERRQ(ierr);* > *ierr = TSSetType(ts, TSBEULER); CHKERRQ(ierr);* > > Is there any command option I should use when I run the code? > > Thanks, > Shuangshuang > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sonyablade2010 at hotmail.com Wed Mar 27 23:38:42 2013 From: sonyablade2010 at hotmail.com (Sonya Blade) Date: Thu, 28 Mar 2013 04:38:42 +0000 Subject: [petsc-users] Slepc installation In-Reply-To: References: , , , , Message-ID: DEar All, Here is out put from Python console after runing teh suggested Python code script. >>> import os >>> print os.path.realpath(os.getcwd()) C:\Python27 >>> print os.path.realpath(os.environ['SLEPC_DIR']) D:\TEST_FOLDER_dell\slepc >>> Interesting thing here is, why Python script returns the backslashed path although I'm sure that I set it in? environmental ?variables as forward slashed path.? And here is the output from the CygWin terminal? nobody at nobody /cygdrive/d/TEST_FOLDER_dell/slepc $ export SKPEC_DIR=D:/TEST_FOLDER_dell/slepc/ nobody at nobody /cygdrive/d/TEST_FOLDER_dell/slepc $ ./configure Checking environment... cygwin warning: ? MS-DOS style path detected: D:/TEST_FOLDER_dell/slepc ? Preferred POSIX equivalent is: /cygdrive/d/TEST_FOLDER_dell/slepc ? CYGWIN environment variable option "nodosfilewarning" turns off this warning. ? Consult the user's guide for more details about POSIX paths: ? ? http://cygwin.com/cygwin-ug-net/using.html#using-pathnames ERROR: SLEPC_DIR is not the current directory Your help will be appreciated, From balay at mcs.anl.gov Wed Mar 27 23:48:49 2013 From: balay at mcs.anl.gov (Satish Balay) Date: Wed, 27 Mar 2013 23:48:49 -0500 (CDT) Subject: [petsc-users] Slepc installation In-Reply-To: References: , , , , Message-ID: On Thu, 28 Mar 2013, Sonya Blade wrote: > DEar All, > Here is out put from Python console after runing teh suggested Python code script. > > >>> import os > >>> print os.path.realpath(os.getcwd()) > C:\Python27 > >>> print os.path.realpath(os.environ['SLEPC_DIR']) > D:\TEST_FOLDER_dell\slepc You should be using cygwin python here from cygwin-shell [as per the installation instructions]- not MS-Python [console]. > >>> > Interesting thing here is, why Python script returns the > backslashed path although I'm sure that I set it in? > environmental ?variables as forward slashed path.? > > > > And here is the output from the CygWin terminal? > > nobody at nobody /cygdrive/d/TEST_FOLDER_dell/slepc > $ export SKPEC_DIR=D:/TEST_FOLDER_dell/slepc/ See the cygwin path above in your bash prompt? Thats what you should be using. Also you have a typo for SLEPC_DIR export SLEPC_DIR=/cygdrive/d/TEST_FOLDER_dell/slepc Satish > > nobody at nobody /cygdrive/d/TEST_FOLDER_dell/slepc > $ ./configure > Checking environment... > cygwin warning: > ? MS-DOS style path detected: D:/TEST_FOLDER_dell/slepc > ? Preferred POSIX equivalent is: /cygdrive/d/TEST_FOLDER_dell/slepc > ? CYGWIN environment variable option "nodosfilewarning" turns off this warning. > ? Consult the user's guide for more details about POSIX paths: > ? ? http://cygwin.com/cygwin-ug-net/using.html#using-pathnames > ERROR: SLEPC_DIR is not the current directory > > > Your help will be appreciated, From sonyablade2010 at hotmail.com Thu Mar 28 00:00:35 2013 From: sonyablade2010 at hotmail.com (Sonya Blade) Date: Thu, 28 Mar 2013 05:00:35 +0000 Subject: [petsc-users] Slepc installation In-Reply-To: References: , , , , , Message-ID: > DEar All, > Here is out put from Python console after runing teh suggested Python code script. > > >>> import os > >>> print os.path.realpath(os.getcwd()) > C:\Python27 > >>> print os.path.realpath(os.environ['SLEPC_DIR']) > D:\TEST_FOLDER_dell\slepc >You should be using cygwin python here from cygwin-shell [as per the >installation instructions]- not MS-Python [console]. Where is that cygwin python, does it come with CygWin standart installation? Is that Cygwin python is seperate package, that I need to install? I really don't know how I make it so difficult and end up in a mess? in such straightforward task. While I was expecting the great hassle? from Petsc library where it compiled without any problem. Does anybody can upload me a video on how am I supposed to do it in neat and tidy manner? Thanks, From balay at mcs.anl.gov Thu Mar 28 00:20:18 2013 From: balay at mcs.anl.gov (Satish Balay) Date: Thu, 28 Mar 2013 00:20:18 -0500 (CDT) Subject: [petsc-users] Slepc installation In-Reply-To: References: , , , , , Message-ID: On Thu, 28 Mar 2013, Sonya Blade wrote: > > DEar All, > > Here is out put from Python console after runing teh suggested Python code script. > > > > >>> import os > > >>> print os.path.realpath(os.getcwd()) > > C:\Python27 > > >>> print os.path.realpath(os.environ['SLEPC_DIR']) > > D:\TEST_FOLDER_dell\slepc > > >You should be using cygwin python here from cygwin-shell [as per the > >installation instructions]- not MS-Python [console]. > > Where is that cygwin python, does it come with CygWin standart installation? > Is that Cygwin python is seperate package, that I need to install? you already have it installed. otherwise you cound't install petsc. And if you have to startup python to do what Jose suggested - you would do it from cygwin bash shell. [For ex: I'm using PETSC_DIR here instead of SLEPC_DIR] >>>>>>>>>>>>>>>>>>>>>>> balay at Win7-KVM ~/petsc.clone $ pwd /home/balay/petsc.clone balay at Win7-KVM ~/petsc.clone $ which python /usr/bin/python balay at Win7-KVM ~/petsc.clone $ export PETSC_DIR=/home/balay/petsc.clone balay at Win7-KVM ~/petsc.clone $ python Python 2.7.3 (default, Dec 18 2012, 13:50:09) [GCC 4.5.3] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> print os.path.realpath(os.getcwd()) /home/balay/petsc.clone >>> print os.path.realpath(os.environ['PETSC_DIR']) /home/balay/petsc.clone >>> <<<<<<<<<<<<<<<<<<<<<< > > I really don't know how I make it so difficult and end up in a mess? > in such straightforward task. While I was expecting the great hassle? > from Petsc library where it compiled without any problem. Have you tried the next part of my reply? To rephrase [assuming you have PETSC_DIR setup similarly] cd /cygdrive/d/TEST_FOLDER_dell/slepc export SLEPC_DIR=/cygdrive/d/TEST_FOLDER_dell/slepc ./configure BTW: What compilers did you build PETSc with? send make.log for this build. Satish From abhyshr at mcs.anl.gov Thu Mar 28 10:50:37 2013 From: abhyshr at mcs.anl.gov (Shri) Date: Thu, 28 Mar 2013 10:50:37 -0500 Subject: [petsc-users] TSStep error In-Reply-To: <6778DE83AB681D49BFC2CD850610FEB1018FC7E872F0@EMAIL04.pnl.gov> References: <6778DE83AB681D49BFC2CD850610FEB1018FC7E872F0@EMAIL04.pnl.gov> Message-ID: <34C8C246-BF6B-43E2-9F2C-98683BBFA554@mcs.anl.gov> On Mar 27, 2013, at 8:18 PM, Jin, Shuangshuang wrote: > Hi, I am using TS to solve a nonlinear DAE problem. I got an error below: > > [0]PETSC ERROR: --------------------- Error Message ------------------------------------ > [0]PETSC ERROR: ! > [0]PETSC ERROR: TSStep has failed due to DIVERGED_NONLINEAR_SOLVE, increase -ts_max_snes_failures or make negative to attempt recovery! > [0]PETSC ERROR: ------------------------------------------------------------------------ > [0]PETSC ERROR: Petsc Development HG revision: 6e0ddc6e9b6d8a9d8eb4c0ede0105827a6b58dfb HG Date: Mon Mar 11 22:54:30 2013 -0500 > [0]PETSC ERROR: See docs/changes/index.html for recent updates. > [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. > [0]PETSC ERROR: See docs/index.html for manual pages. > [0]PETSC ERROR: ------------------------------------------------------------------------ > [0]PETSC ERROR: ./dynSim on a arch-complex named olympus.local by d3m956 Wed Mar 27 18:12:05 2013 > [0]PETSC ERROR: Libraries linked from /pic/projects/ds/petsc-dev/arch-complex/lib > [0]PETSC ERROR: Configure run at Tue Mar 12 14:32:37 2013 > [0]PETSC ERROR: Configure options --with-scalar-type=complex --with-clanguage=C++ PETSC_ARCH=arch-complex --with-fortran-kernels=generic > [0]PETSC ERROR: ------------------------------------------------------------------------ > [0]PETSC ERROR: TSStep() line 2442 in src/ts/interface/ts.c > [0]PETSC ERROR: TSSolve() line 2553 in src/ts/interface/ts.c > [0]PETSC ERROR: simu() line 420 in "unknowndirectory/"simulation.C > [0]PETSC ERROR: runSimulation() line 83 in "unknowndirectory/"dynSim.h > Run simulation time: 0.0317168 > > What does this error imply for? The error implies that the nonlinear solve (Newton's method), used at each time step, did not converge. This could be due to various reasons as described here http://www.mcs.anl.gov/petsc/documentation/faq.html#newton > > My ftime = 0.5, and the timestep is 0.001, and the solution method I?m using is TSBEULER > PetscReal ftime=0.5; > ierr = TSSetInitialTimeStep(ts, 0.0, 0.001); CHKERRQ(ierr); > ierr = TSSetType(ts, TSBEULER); CHKERRQ(ierr); > > Is there any command option I should use when I run the code? > > Thanks, > Shuangshuang -------------- next part -------------- An HTML attachment was scrubbed... URL: From Shuangshuang.Jin at pnnl.gov Thu Mar 28 13:51:05 2013 From: Shuangshuang.Jin at pnnl.gov (Jin, Shuangshuang) Date: Thu, 28 Mar 2013 11:51:05 -0700 Subject: [petsc-users] TSStep error In-Reply-To: <34C8C246-BF6B-43E2-9F2C-98683BBFA554@mcs.anl.gov> References: <6778DE83AB681D49BFC2CD850610FEB1018FC7E872F0@EMAIL04.pnl.gov> <34C8C246-BF6B-43E2-9F2C-98683BBFA554@mcs.anl.gov> Message-ID: <6778DE83AB681D49BFC2CD850610FEB1018FC7E873DC@EMAIL04.pnl.gov> Thanks, Shri, that's a really good link. Very useful! I have identified the error according to the instruction. The Jacobian was wrong. Thanks, Shuangshuang From: petsc-users-bounces at mcs.anl.gov [mailto:petsc-users-bounces at mcs.anl.gov] On Behalf Of Shri Sent: Thursday, March 28, 2013 8:51 AM To: PETSc users list Subject: Re: [petsc-users] TSStep error On Mar 27, 2013, at 8:18 PM, Jin, Shuangshuang wrote: Hi, I am using TS to solve a nonlinear DAE problem. I got an error below: [0]PETSC ERROR: --------------------- Error Message ------------------------------------ [0]PETSC ERROR: ! [0]PETSC ERROR: TSStep has failed due to DIVERGED_NONLINEAR_SOLVE, increase -ts_max_snes_failures or make negative to attempt recovery! [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: Petsc Development HG revision: 6e0ddc6e9b6d8a9d8eb4c0ede0105827a6b58dfb HG Date: Mon Mar 11 22:54:30 2013 -0500 [0]PETSC ERROR: See docs/changes/index.html for recent updates. [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. [0]PETSC ERROR: See docs/index.html for manual pages. [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: ./dynSim on a arch-complex named olympus.local by d3m956 Wed Mar 27 18:12:05 2013 [0]PETSC ERROR: Libraries linked from /pic/projects/ds/petsc-dev/arch-complex/lib [0]PETSC ERROR: Configure run at Tue Mar 12 14:32:37 2013 [0]PETSC ERROR: Configure options --with-scalar-type=complex --with-clanguage=C++ PETSC_ARCH=arch-complex --with-fortran-kernels=generic [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: TSStep() line 2442 in src/ts/interface/ts.c [0]PETSC ERROR: TSSolve() line 2553 in src/ts/interface/ts.c [0]PETSC ERROR: simu() line 420 in "unknowndirectory/"simulation.C [0]PETSC ERROR: runSimulation() line 83 in "unknowndirectory/"dynSim.h Run simulation time: 0.0317168 What does this error imply for? The error implies that the nonlinear solve (Newton's method), used at each time step, did not converge. This could be due to various reasons as described here http://www.mcs.anl.gov/petsc/documentation/faq.html#newton My ftime = 0.5, and the timestep is 0.001, and the solution method I'm using is TSBEULER PetscReal ftime=0.5; ierr = TSSetInitialTimeStep(ts, 0.0, 0.001); CHKERRQ(ierr); ierr = TSSetType(ts, TSBEULER); CHKERRQ(ierr); Is there any command option I should use when I run the code? Thanks, Shuangshuang -------------- next part -------------- An HTML attachment was scrubbed... URL: From zhenglun.wei at gmail.com Fri Mar 29 17:05:59 2013 From: zhenglun.wei at gmail.com (Zhenglun (Alan) Wei) Date: Fri, 29 Mar 2013 17:05:59 -0500 Subject: [petsc-users] A question on the PETSc options for non-uniform grid Message-ID: <51561047.1060006@gmail.com> Dear All, I hope you're having a nice day. Based on ksp ex45, a 3D Poisson solver with non-uniform grid is coded. The PETSc options I used is: /mpiexec -np 32 ./ex45 -pc_type gamg -ksp_type cg -pc_gamg_type agg -pc_gamg_agg_nsmooths 1 -mg_levels_ksp_max_it 1 -mg_levels_ksp_type richardson -ksp_rtol 1.0e-7/ There are some problems: 1, if the mesh is very coarse with very small amount of the grid, the code runs well; 2, if the mesh is fine, an error message comes up saying 'un-symmetric graph'. It suggests me to use '-pc_gamg_sym_graph true' or '-pc_gamg_thredhold 0.0'. a) if '-pc_gamg_sym_graph true' is used, the code runs but blows up very quickly with crazy norm; b) if '-pc_gamg_thredhold 0.0' is used, the code stops on the KSPSolve() forever; 3, because of the 'un-symmetric graph' error, it reminds me that the matrix may not be symmetric, which indicates that '-ksp_type cg' may not be a good option. Therefore, I changed it to '-ksp_type gmres'. It makes the code run with 'moderate fine' mesh. However, it stops at KSPSolve() also with fine mesh. a) does there any other '-ksp_type' fit better for this case? b) does multigrid preconditioner work well for gmres? thanks, Alan -------------- next part -------------- An HTML attachment was scrubbed... URL: From sonyablade2010 at hotmail.com Sat Mar 30 03:10:21 2013 From: sonyablade2010 at hotmail.com (Sonya Blade) Date: Sat, 30 Mar 2013 08:10:21 +0000 Subject: [petsc-users] Slepc installation In-Reply-To: References: , , , , , , Message-ID: Thank you all in advance and sorry for the tardy response after Satish? suggestions I got some life pulses that this some files are not found etc.. I thought I can eliminate that after playing around with it. But I couldn't. Here is my input and output as per Satish recommendations. nobody at nobody/cygdrive/d/TEST_FOLDER_dell/slepc $ pwd /cygdrive/d/TEST_FOLDER_dell/slepc ? nobody at nobody/cygdrive/d/TEST_FOLDER_dell/slepc $ which python /usr/bin/python ? nobody at nobody/cygdrive/d/TEST_FOLDER_dell/slepc $ export PETSC_DIR=C:/Users/....../Downloads/petsc-3.3-p6 ? nobody at nobody/cygdrive/d/TEST_FOLDER_dell/slepc $ python Python 2.7.3 (default, Dec 18 2012, 13:50:09) [GCC 4.5.3] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> print os.path.realpath(os.environ['PETSC_DIR']) /cygdrive/d/TEST_FOLDER_dell/slepc/C:/Users/....../Downloads/petsc-3.3-p6 >>>? After setting with export SLEPC_DIR,PETSC_DIR,PETSC_ARCH I got the following error. export SLEPC_DIR =D:\TEST_FOLDER_dell\slepc export PETSC_DIR =C:\Users\......\Downloads\petsc-3.3-p6 export PETSC_ARCH=C:\Users\......\Downloads\petsc-3.3-p6\arch-mswin-c-debug ? ? $ ./configure Checking environment... ERROR: cannot process file C:/Users/.../Downloads/petsc-3.3-p6/C:/Users/.../Downloads/petsc-3.3-p6/arch-mswin-c-debug/conf/petscvariables ? Actually above PETSC_DIR and PETSC_ARCH paths are concatenated, Is that can be reason of that malfunctioning?? ? ? ? ? >BTW: What compilers did you build PETSc with? send make.log for this build. >Satish I used the MinGw compilers for this gcc, g++, gfortran From dasans at gmail.com Sat Mar 30 03:26:57 2013 From: dasans at gmail.com (Anil .) Date: Sat, 30 Mar 2013 13:56:57 +0530 Subject: [petsc-users] Trying to modify petrbf to use custom text file In-Reply-To: References: Message-ID: Matt, PetRBF runs properly on my system. But is the dev branch still required to run petRBF? Could my issues be associated with this? On Wed, Mar 27, 2013 at 9:50 AM, Matthew Knepley wrote: > On Wed, Mar 27, 2013 at 3:13 PM, Anil . wrote: > >> Matt, >> >> Petsc Options I use to run are.... >> mpirun -np 4 ./reader -pc_type asm -sub_pc_type lu -sub_mat_type dense >> -ksp_monitor -ksp_rtol 1e-13 -ksp_max_it 100 -vecscatter_alltoall >> -log_summary >> > > 1) Always run with -ksp_view. > > 2) The relative tolerance is probably too tight, but that is secondary > > 3) Something is really wrong here. I am guessing something in the input > not what you want. If the interaction is > truly short range, you would see significant drop in the residual on > the first iteration. First, take a look at the > matrix using -mat_view draw:: -draw_pause -1. It should be banded. > > Matt > > Attached is the output..It also contains my petsc configuration >> >> >> >> On Wed, Mar 27, 2013 at 7:59 AM, Matthew Knepley wrote: >> >>> On Wed, Mar 27, 2013 at 11:58 AM, Anil . wrote: >>> >>>> Matt, >>>> >>>> I am having around 3481 particles that are placed in an unstructured >>>> manner. >>>> Attached is the image showing the distribution. >>>> >>> >>> Show me your PETSc options, and try playing with the number of blocks. >>> If you look >>> at the PetRBF paper, we give guidance for choosing the sizes. >>> >>> Matt >>> >>> >>>> >>>> On Tue, Mar 26, 2013 at 11:45 PM, Matthew Knepley wrote: >>>> >>>>> On Mon, Mar 25, 2013 at 10:38 PM, Anil . wrote: >>>>> >>>>>> 1) Could not find the petrbf mailing list >>>>>> 2) Petrbf runs perfectly >>>>>> 3) Attached is the output with -ksp_view -ksp_monitor >>>>>> >>>>>> Just point me in the right direction. Issues might be very basic as I >>>>>> am starting to use Petsc >>>>>> >>>>> >>>>> This output is a little strange. Some partitions have 0 entries. I am >>>>> guessing this problem is very >>>>> small. For PeRBF, it does turn out to be optimal to use small blocks, >>>>> but the block size depends >>>>> on your interaction scale. Right now you have 75 blocks, which might >>>>> be too many for your small >>>>> problem. >>>>> >>>>> Matt >>>>> >>>>> >>>>>> On Sat, Mar 23, 2013 at 2:18 AM, Matthew Knepley wrote: >>>>>> >>>>>>> On Fri, Mar 22, 2013 at 10:58 PM, Anil . wrote: >>>>>>> >>>>>>>> Hi, >>>>>>>> >>>>>>>> I have a text file containing N rows. >>>>>>>> Each row with x,y,omega values. >>>>>>>> I am trying to interpolate this data onto a regular grid using >>>>>>>> petrbf >>>>>>>> But the KSP does not converge and am not able to find the reason. >>>>>>>> >>>>>>>> The code is available with the text files at >>>>>>>> https://www.dropbox.com/s/cypuwugbxo07kx0/rbf-interpolation.tar.gz >>>>>>>> >>>>>>>> I am very new to petsc and any direction how o proceed would be >>>>>>>> helpful. >>>>>>>> >>>>>>> >>>>>>> 1) Did you mail the petrbf list? >>>>>>> >>>>>>> 2) Could you run the petrbf examples? >>>>>>> >>>>>>> 3) We cannot tell anything about convergence without the output of >>>>>>> -ksp_view -ksp_monitor. >>>>>>> >>>>>>> Matt >>>>>>> >>>>>>> >>>>>>>> -- >>>>>>>> Sincerely >>>>>>>> Anil Das P V >>>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> What most experimenters take for granted before they begin their >>>>>>> experiments is infinitely more interesting than any results to which their >>>>>>> experiments lead. >>>>>>> -- Norbert Wiener >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Sincerely >>>>>> Anil Das P V >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> What most experimenters take for granted before they begin their >>>>> experiments is infinitely more interesting than any results to which their >>>>> experiments lead. >>>>> -- Norbert Wiener >>>>> >>>> >>>> >>>> >>>> -- >>>> Sincerely >>>> Anil Das P V >>>> >>> >>> >>> >>> -- >>> What most experimenters take for granted before they begin their >>> experiments is infinitely more interesting than any results to which their >>> experiments lead. >>> -- Norbert Wiener >>> >> >> >> >> -- >> Sincerely >> Anil Das P V >> > > > > -- > What most experimenters take for granted before they begin their > experiments is infinitely more interesting than any results to which their > experiments lead. > -- Norbert Wiener > -- Sincerely Anil Das P V -------------- next part -------------- An HTML attachment was scrubbed... URL: From sonyablade2010 at hotmail.com Sat Mar 30 04:13:59 2013 From: sonyablade2010 at hotmail.com (Sonya Blade) Date: Sat, 30 Mar 2013 09:13:59 +0000 Subject: [petsc-users] Slepc installation In-Reply-To: References: , , , , , , , Message-ID: Dear All, After a struggle I managed to get cluing to something reasonable, the best that I achieved is as below: $ ./configure Checking environment... Checking PETSc installation... ERROR: Unable to link with PETSc ERROR: See "arch-mswin-c-debug/conf/configure.log" file for details I already checked the configure.log, but there are thousands of variables and arguments for which exactly I'm supposed to look for ? Regards, From jedbrown at mcs.anl.gov Sat Mar 30 06:45:48 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Sat, 30 Mar 2013 06:45:48 -0500 Subject: [petsc-users] Slepc installation In-Reply-To: References: Message-ID: On Sat, Mar 30, 2013 at 3:10 AM, Sonya Blade wrote: > After setting with export SLEPC_DIR,PETSC_DIR,PETSC_ARCH I got the > following error. > export SLEPC_DIR =D:\TEST_FOLDER_dell\slepc > export PETSC_DIR =C:\Users\......\Downloads\petsc-3.3-p6 > export PETSC_ARCH=C:\Users\......\Downloads\petsc-3.3-p6\arch-mswin-c-debug > Why are you using Windows paths here when Satish gave specific instructions to use cygwin paths: """ Have you tried the next part of my reply? To rephrase [assuming you have PETSC_DIR setup similarly] cd /cygdrive/d/TEST_FOLDER_dell/slepc export SLEPC_DIR=/cygdrive/d/TEST_FOLDER_dell/slepc ./configure """ And similarly for PETSC_DIR. And PETSC_ARCH=arch-mswin-c-debug. -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Sat Mar 30 08:42:09 2013 From: knepley at gmail.com (Matthew Knepley) Date: Sun, 31 Mar 2013 00:42:09 +1100 Subject: [petsc-users] Trying to modify petrbf to use custom text file In-Reply-To: References: Message-ID: On Sat, Mar 30, 2013 at 7:26 PM, Anil . wrote: > Matt, > > PetRBF runs properly on my system. But is the dev branch still required to > run petRBF? > Could my issues be associated with this? > No. Matt > On Wed, Mar 27, 2013 at 9:50 AM, Matthew Knepley wrote: > >> On Wed, Mar 27, 2013 at 3:13 PM, Anil . wrote: >> >>> Matt, >>> >>> Petsc Options I use to run are.... >>> mpirun -np 4 ./reader -pc_type asm -sub_pc_type lu -sub_mat_type dense >>> -ksp_monitor -ksp_rtol 1e-13 -ksp_max_it 100 -vecscatter_alltoall >>> -log_summary >>> >> >> 1) Always run with -ksp_view. >> >> 2) The relative tolerance is probably too tight, but that is secondary >> >> 3) Something is really wrong here. I am guessing something in the input >> not what you want. If the interaction is >> truly short range, you would see significant drop in the residual on >> the first iteration. First, take a look at the >> matrix using -mat_view draw:: -draw_pause -1. It should be banded. >> >> Matt >> >> Attached is the output..It also contains my petsc configuration >>> >>> >>> >>> On Wed, Mar 27, 2013 at 7:59 AM, Matthew Knepley wrote: >>> >>>> On Wed, Mar 27, 2013 at 11:58 AM, Anil . wrote: >>>> >>>>> Matt, >>>>> >>>>> I am having around 3481 particles that are placed in an unstructured >>>>> manner. >>>>> Attached is the image showing the distribution. >>>>> >>>> >>>> Show me your PETSc options, and try playing with the number of blocks. >>>> If you look >>>> at the PetRBF paper, we give guidance for choosing the sizes. >>>> >>>> Matt >>>> >>>> >>>>> >>>>> On Tue, Mar 26, 2013 at 11:45 PM, Matthew Knepley wrote: >>>>> >>>>>> On Mon, Mar 25, 2013 at 10:38 PM, Anil . wrote: >>>>>> >>>>>>> 1) Could not find the petrbf mailing list >>>>>>> 2) Petrbf runs perfectly >>>>>>> 3) Attached is the output with -ksp_view -ksp_monitor >>>>>>> >>>>>>> Just point me in the right direction. Issues might be very basic as >>>>>>> I am starting to use Petsc >>>>>>> >>>>>> >>>>>> This output is a little strange. Some partitions have 0 entries. I am >>>>>> guessing this problem is very >>>>>> small. For PeRBF, it does turn out to be optimal to use small blocks, >>>>>> but the block size depends >>>>>> on your interaction scale. Right now you have 75 blocks, which might >>>>>> be too many for your small >>>>>> problem. >>>>>> >>>>>> Matt >>>>>> >>>>>> >>>>>>> On Sat, Mar 23, 2013 at 2:18 AM, Matthew Knepley wrote: >>>>>>> >>>>>>>> On Fri, Mar 22, 2013 at 10:58 PM, Anil . wrote: >>>>>>>> >>>>>>>>> Hi, >>>>>>>>> >>>>>>>>> I have a text file containing N rows. >>>>>>>>> Each row with x,y,omega values. >>>>>>>>> I am trying to interpolate this data onto a regular grid using >>>>>>>>> petrbf >>>>>>>>> But the KSP does not converge and am not able to find the reason. >>>>>>>>> >>>>>>>>> The code is available with the text files at >>>>>>>>> https://www.dropbox.com/s/cypuwugbxo07kx0/rbf-interpolation.tar.gz >>>>>>>>> >>>>>>>>> I am very new to petsc and any direction how o proceed would be >>>>>>>>> helpful. >>>>>>>>> >>>>>>>> >>>>>>>> 1) Did you mail the petrbf list? >>>>>>>> >>>>>>>> 2) Could you run the petrbf examples? >>>>>>>> >>>>>>>> 3) We cannot tell anything about convergence without the output of >>>>>>>> -ksp_view -ksp_monitor. >>>>>>>> >>>>>>>> Matt >>>>>>>> >>>>>>>> >>>>>>>>> -- >>>>>>>>> Sincerely >>>>>>>>> Anil Das P V >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> What most experimenters take for granted before they begin their >>>>>>>> experiments is infinitely more interesting than any results to which their >>>>>>>> experiments lead. >>>>>>>> -- Norbert Wiener >>>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> Sincerely >>>>>>> Anil Das P V >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> What most experimenters take for granted before they begin their >>>>>> experiments is infinitely more interesting than any results to which their >>>>>> experiments lead. >>>>>> -- Norbert Wiener >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> Sincerely >>>>> Anil Das P V >>>>> >>>> >>>> >>>> >>>> -- >>>> What most experimenters take for granted before they begin their >>>> experiments is infinitely more interesting than any results to which their >>>> experiments lead. >>>> -- Norbert Wiener >>>> >>> >>> >>> >>> -- >>> Sincerely >>> Anil Das P V >>> >> >> >> >> -- >> What most experimenters take for granted before they begin their >> experiments is infinitely more interesting than any results to which their >> experiments lead. >> -- Norbert Wiener >> > > > > -- > Sincerely > Anil Das P V > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Sat Mar 30 08:43:21 2013 From: knepley at gmail.com (Matthew Knepley) Date: Sun, 31 Mar 2013 00:43:21 +1100 Subject: [petsc-users] Trying to modify petrbf to use custom text file In-Reply-To: References: Message-ID: On Sun, Mar 31, 2013 at 12:42 AM, Matthew Knepley wrote: > On Sat, Mar 30, 2013 at 7:26 PM, Anil . wrote: > >> Matt, >> >> PetRBF runs properly on my system. But is the dev branch still required >> to run petRBF? >> Could my issues be associated with this? >> > > No. > You should 1) Look at the matrix to check that connections are short range with -mat_view draw 2) Reduce the number of blocks until convergence Matt > Matt > > >> On Wed, Mar 27, 2013 at 9:50 AM, Matthew Knepley wrote: >> >>> On Wed, Mar 27, 2013 at 3:13 PM, Anil . wrote: >>> >>>> Matt, >>>> >>>> Petsc Options I use to run are.... >>>> mpirun -np 4 ./reader -pc_type asm -sub_pc_type lu -sub_mat_type dense >>>> -ksp_monitor -ksp_rtol 1e-13 -ksp_max_it 100 -vecscatter_alltoall >>>> -log_summary >>>> >>> >>> 1) Always run with -ksp_view. >>> >>> 2) The relative tolerance is probably too tight, but that is secondary >>> >>> 3) Something is really wrong here. I am guessing something in the input >>> not what you want. If the interaction is >>> truly short range, you would see significant drop in the residual on >>> the first iteration. First, take a look at the >>> matrix using -mat_view draw:: -draw_pause -1. It should be banded. >>> >>> Matt >>> >>> Attached is the output..It also contains my petsc configuration >>>> >>>> >>>> >>>> On Wed, Mar 27, 2013 at 7:59 AM, Matthew Knepley wrote: >>>> >>>>> On Wed, Mar 27, 2013 at 11:58 AM, Anil . wrote: >>>>> >>>>>> Matt, >>>>>> >>>>>> I am having around 3481 particles that are placed in an unstructured >>>>>> manner. >>>>>> Attached is the image showing the distribution. >>>>>> >>>>> >>>>> Show me your PETSc options, and try playing with the number of >>>>> blocks. If you look >>>>> at the PetRBF paper, we give guidance for choosing the sizes. >>>>> >>>>> Matt >>>>> >>>>> >>>>>> >>>>>> On Tue, Mar 26, 2013 at 11:45 PM, Matthew Knepley wrote: >>>>>> >>>>>>> On Mon, Mar 25, 2013 at 10:38 PM, Anil . wrote: >>>>>>> >>>>>>>> 1) Could not find the petrbf mailing list >>>>>>>> 2) Petrbf runs perfectly >>>>>>>> 3) Attached is the output with -ksp_view -ksp_monitor >>>>>>>> >>>>>>>> Just point me in the right direction. Issues might be very basic as >>>>>>>> I am starting to use Petsc >>>>>>>> >>>>>>> >>>>>>> This output is a little strange. Some partitions have 0 entries. I >>>>>>> am guessing this problem is very >>>>>>> small. For PeRBF, it does turn out to be optimal to use small >>>>>>> blocks, but the block size depends >>>>>>> on your interaction scale. Right now you have 75 blocks, which might >>>>>>> be too many for your small >>>>>>> problem. >>>>>>> >>>>>>> Matt >>>>>>> >>>>>>> >>>>>>>> On Sat, Mar 23, 2013 at 2:18 AM, Matthew Knepley >>>>>>> > wrote: >>>>>>>> >>>>>>>>> On Fri, Mar 22, 2013 at 10:58 PM, Anil . wrote: >>>>>>>>> >>>>>>>>>> Hi, >>>>>>>>>> >>>>>>>>>> I have a text file containing N rows. >>>>>>>>>> Each row with x,y,omega values. >>>>>>>>>> I am trying to interpolate this data onto a regular grid using >>>>>>>>>> petrbf >>>>>>>>>> But the KSP does not converge and am not able to find the reason. >>>>>>>>>> >>>>>>>>>> The code is available with the text files at >>>>>>>>>> https://www.dropbox.com/s/cypuwugbxo07kx0/rbf-interpolation.tar.gz >>>>>>>>>> >>>>>>>>>> I am very new to petsc and any direction how o proceed would be >>>>>>>>>> helpful. >>>>>>>>>> >>>>>>>>> >>>>>>>>> 1) Did you mail the petrbf list? >>>>>>>>> >>>>>>>>> 2) Could you run the petrbf examples? >>>>>>>>> >>>>>>>>> 3) We cannot tell anything about convergence without the output of >>>>>>>>> -ksp_view -ksp_monitor. >>>>>>>>> >>>>>>>>> Matt >>>>>>>>> >>>>>>>>> >>>>>>>>>> -- >>>>>>>>>> Sincerely >>>>>>>>>> Anil Das P V >>>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> -- >>>>>>>>> What most experimenters take for granted before they begin their >>>>>>>>> experiments is infinitely more interesting than any results to which their >>>>>>>>> experiments lead. >>>>>>>>> -- Norbert Wiener >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> Sincerely >>>>>>>> Anil Das P V >>>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> What most experimenters take for granted before they begin their >>>>>>> experiments is infinitely more interesting than any results to which their >>>>>>> experiments lead. >>>>>>> -- Norbert Wiener >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Sincerely >>>>>> Anil Das P V >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> What most experimenters take for granted before they begin their >>>>> experiments is infinitely more interesting than any results to which their >>>>> experiments lead. >>>>> -- Norbert Wiener >>>>> >>>> >>>> >>>> >>>> -- >>>> Sincerely >>>> Anil Das P V >>>> >>> >>> >>> >>> -- >>> What most experimenters take for granted before they begin their >>> experiments is infinitely more interesting than any results to which their >>> experiments lead. >>> -- Norbert Wiener >>> >> >> >> >> -- >> Sincerely >> Anil Das P V >> > > > > -- > What most experimenters take for granted before they begin their > experiments is infinitely more interesting than any results to which their > experiments lead. > -- Norbert Wiener > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From balay at mcs.anl.gov Sat Mar 30 10:28:57 2013 From: balay at mcs.anl.gov (Satish Balay) Date: Sat, 30 Mar 2013 10:28:57 -0500 (CDT) Subject: [petsc-users] Slepc installation In-Reply-To: References: , , , , , , , Message-ID: On Sat, 30 Mar 2013, Sonya Blade wrote: > Dear All, > > After a struggle I managed to get cluing to something reasonable, > the best that I achieved is as below: > > $ ./configure > Checking environment... > Checking PETSc installation... > ERROR: Unable to link with PETSc > ERROR: See "arch-mswin-c-debug/conf/configure.log" file for details > > I already checked the configure.log, but there are thousands of variables > and arguments for which exactly I'm supposed to look for ? send configure.log to slepc-maint [or petsc-maint] satish From sonyablade2010 at hotmail.com Sat Mar 30 11:24:30 2013 From: sonyablade2010 at hotmail.com (Sonya Blade) Date: Sat, 30 Mar 2013 16:24:30 +0000 Subject: [petsc-users] Slepc installation In-Reply-To: References: , , , , , , , , Message-ID: Dear All, If the below means the successful installation and test then? I'd like to thank you all for trying to help the novices in a benevolent? way especially for Jed Brown and Satish Balay. make test Running test examples to verify correct installation Using SLEPC_DIR=/cygdrive/D/TEST_FOLDER_dell/slepc, PETSC_DIR=/cygdrive/c/Users/...../Downloads/petsc-3.3-p6 and PETSC_ARCH=arch-mswin-c-debug C/C++ example src/eps/examples/tests/test10 run successfully with 1 MPI process C/C++ example src/eps/examples/tests/test10 run successfully with 2 MPI process Fortran example src/eps/examples/tests/test7f run successfully with 1 MPI process Completed test examples Please confirm? Regards, From jedbrown at mcs.anl.gov Sat Mar 30 11:25:19 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Sat, 30 Mar 2013 11:25:19 -0500 Subject: [petsc-users] Slepc installation In-Reply-To: References: Message-ID: On Sat, Mar 30, 2013 at 11:24 AM, Sonya Blade wrote: > If the below means the successful installation and test then > I'd like to thank you all for trying to help the novices in a benevolent > way especially for Jed Brown and Satish Balay. > > make test > Running test examples to verify correct installation > Using SLEPC_DIR=/cygdrive/D/TEST_FOLDER_dell/slepc, > PETSC_DIR=/cygdrive/c/Users/...../Downloads/petsc-3.3-p6 and > PETSC_ARCH=arch-mswin-c-debug > C/C++ example src/eps/examples/tests/test10 run successfully with 1 MPI > process > C/C++ example src/eps/examples/tests/test10 run successfully with 2 MPI > process > Fortran example src/eps/examples/tests/test7f run successfully with 1 MPI > process > Completed test examples > > Please confirm? > Yes, looks good. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dharmareddy84 at gmail.com Sat Mar 30 19:49:19 2013 From: dharmareddy84 at gmail.com (Dharmendar Reddy) Date: Sat, 30 Mar 2013 19:49:19 -0500 Subject: [petsc-users] SetOptionsPrefix Message-ID: Hello, I was wondering how the SetOptionsPrefix work ?. I can figure out from the code that SNES set options prefix sets the options prefix to the ksp and pc objects on snes. Does it also apply the prefix to the Matrix and vectors passed to snes as jacobian, function and solution? or, are they considered as a independent objects ? Do i need to set options prefix to matrix and vector objects pased to snesset jacobian and snesset function. Thanks -- ----------------------------------------------------- Dharmendar Reddy Palle Graduate Student Microelectronics Research center, University of Texas at Austin, 10100 Burnet Road, Bldg. 160 MER 2.608F, TX 78758-4445 e-mail: dharmareddy84 at gmail.com Phone: +1-512-350-9082 United States of America. Homepage: https://webspace.utexas.edu/~dpr342 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jedbrown at mcs.anl.gov Sat Mar 30 19:53:17 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Sat, 30 Mar 2013 19:53:17 -0500 Subject: [petsc-users] SetOptionsPrefix In-Reply-To: References: Message-ID: <877gko1jb6.fsf@59A2.org> Dharmendar Reddy writes: > Hello, > I was wondering how the SetOptionsPrefix work ?. I > can figure out from the code that SNES set options prefix sets the options > prefix to the ksp and pc objects on snes. Does it also apply the prefix to > the Matrix and vectors passed to snes as jacobian, function and solution? > or, are they considered as a independent objects ? Do i need to set options > prefix to matrix and vector objects pased to snesset jacobian and snesset > function. They are separate objects, but a prefix is automatically added to any (configurable) objects created internally by the solvers, including nested solvers. If you want a unique prefix for the Jacobian, the preconditioning matrix (Pmat), or specific vectors, you should set it. From bsmith at mcs.anl.gov Sat Mar 30 19:55:43 2013 From: bsmith at mcs.anl.gov (Barry Smith) Date: Sat, 30 Mar 2013 19:55:43 -0500 Subject: [petsc-users] SetOptionsPrefix In-Reply-To: <877gko1jb6.fsf@59A2.org> References: <877gko1jb6.fsf@59A2.org> Message-ID: On Mar 30, 2013, at 7:53 PM, Jed Brown wrote: > Dharmendar Reddy writes: >> Hello, >> I was wondering how the SetOptionsPrefix work ?. I >> can figure out from the code that SNES set options prefix sets the options >> prefix to the ksp and pc objects on snes. Does it also apply the prefix to >> the Matrix and vectors passed to snes as jacobian, function and solution? >> or, are they considered as a independent objects ? Do i need to set options >> prefix to matrix and vector objects pased to snesset jacobian and snesset >> function. > > They are separate objects, but a prefix is automatically added to any > (configurable) objects created internally by the solvers, including > nested solvers. > > If you want a unique prefix for the Jacobian, the preconditioning matrix > (Pmat), or specific vectors, you should set it. But note that Vecs and Mats have essentially no runtime configurability related to the solvers being used, so usually there is no reason to provide prefixes to Mats and Vecs. Barry From mpovolot at purdue.edu Sun Mar 31 08:58:50 2013 From: mpovolot at purdue.edu (Michael Povolotskyi) Date: Sun, 31 Mar 2013 09:58:50 -0400 Subject: [petsc-users] memory reporting Message-ID: <5158411A.2030600@purdue.edu> Dear PETSc developers, I have the following question. PETSc has memory reporting system. Does it report the memory allocated inside a library (e.g MUMPS) when I call it from PETSc program? Thank you, Michael. From jedbrown at mcs.anl.gov Sun Mar 31 09:03:22 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Sun, 31 Mar 2013 09:03:22 -0500 Subject: [petsc-users] memory reporting In-Reply-To: <5158411A.2030600@purdue.edu> References: <5158411A.2030600@purdue.edu> Message-ID: On Sun, Mar 31, 2013 at 8:58 AM, Michael Povolotskyi wrote: > Dear PETSc developers, > I have the following question. > PETSc has memory reporting system. Does it report the memory allocated > inside a library (e.g MUMPS) when I call it from PETSc program? > It does not attribute it per object, though it is part of the total memory used by a process (e.g., PetscMemoryGetCurrentUsage, or -malloc_info). > > Thank you, > Michael. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mpovolot at purdue.edu Sun Mar 31 09:15:59 2013 From: mpovolot at purdue.edu (Michael Povolotskyi) Date: Sun, 31 Mar 2013 10:15:59 -0400 Subject: [petsc-users] memory reporting In-Reply-To: References: <5158411A.2030600@purdue.edu> Message-ID: <5158451F.7020700@purdue.edu> On 3/31/2013 10:03 AM, Jed Brown wrote: > On Sun, Mar 31, 2013 at 8:58 AM, Michael Povolotskyi > > wrote: > > Dear PETSc developers, > I have the following question. > PETSc has memory reporting system. Does it report the memory > allocated inside a library (e.g MUMPS) when I call it from PETSc > program? > > > It does not attribute it per object, though it is part of the total > memory used by a process (e.g., PetscMemoryGetCurrentUsage, or > -malloc_info). > > > Thank you, > Michael. > > Thank you. In our code we have our own linear system solver, optimized for a distributed 3 block diagonal matrix. We are testing its performance against MUMPS and SUPERLU_dist. We interfaced this solver with PETSc matrix and vector for the left and right hand sides of a linear system. My question: what can I do to make the memory allocated inside the solver to be reported by PetscMemoryGetCurrentUsage? Thank you, Michael. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jedbrown at mcs.anl.gov Sun Mar 31 09:19:13 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Sun, 31 Mar 2013 09:19:13 -0500 Subject: [petsc-users] memory reporting In-Reply-To: <5158451F.7020700@purdue.edu> References: <5158411A.2030600@purdue.edu> <5158451F.7020700@purdue.edu> Message-ID: On Sun, Mar 31, 2013 at 9:15 AM, Michael Povolotskyi wrote: > In our code we have our own linear system solver, optimized for a > distributed 3 block diagonal matrix. > We are testing its performance against MUMPS and SUPERLU_dist. > We interfaced this solver with PETSc matrix and vector for the left and > right hand sides of a linear system. > My question: what can I do to make the memory allocated inside the solver > to be reported by PetscMemoryGetCurrentUsage? > This function just uses the process resident size (like getrusage(3)) so that external memory is automatically included. If those packages had their own memory profiling support, we could use it, but they do not so we can't give finer grained information about the memory they are using. -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Sun Mar 31 09:20:47 2013 From: knepley at gmail.com (Matthew Knepley) Date: Mon, 1 Apr 2013 01:20:47 +1100 Subject: [petsc-users] memory reporting In-Reply-To: <5158451F.7020700@purdue.edu> References: <5158411A.2030600@purdue.edu> <5158451F.7020700@purdue.edu> Message-ID: On Mon, Apr 1, 2013 at 1:15 AM, Michael Povolotskyi wrote: > On 3/31/2013 10:03 AM, Jed Brown wrote: > > On Sun, Mar 31, 2013 at 8:58 AM, Michael Povolotskyi wrote: > >> Dear PETSc developers, >> I have the following question. >> PETSc has memory reporting system. Does it report the memory allocated >> inside a library (e.g MUMPS) when I call it from PETSc program? >> > > It does not attribute it per object, though it is part of the total > memory used by a process (e.g., PetscMemoryGetCurrentUsage, or > -malloc_info). > > >> >> Thank you, >> Michael. >> > > Thank you. > In our code we have our own linear system solver, optimized for a > distributed 3 block diagonal matrix. > Does it do block elimination, or is it Jacobi/GS? > We are testing its performance against MUMPS and SUPERLU_dist. > We interfaced this solver with PETSc matrix and vector for the left and > right hand sides of a linear system. > My question: what can I do to make the memory allocated inside the solver > to be reported by PetscMemoryGetCurrentUsage? > It is automatically reported there, since we just query the OS. You can report the memory used in your solver to Petsc logging using PetscLogObjectMemory(). Thanks, Matt > Thank you, > Michael. > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From mpovolot at purdue.edu Sun Mar 31 10:00:24 2013 From: mpovolot at purdue.edu (Michael Povolotskyi) Date: Sun, 31 Mar 2013 11:00:24 -0400 Subject: [petsc-users] memory reporting In-Reply-To: References: <5158411A.2030600@purdue.edu> <5158451F.7020700@purdue.edu> Message-ID: <51584F88.701@purdue.edu> On 3/31/2013 10:19 AM, Jed Brown wrote: > > On Sun, Mar 31, 2013 at 9:15 AM, Michael Povolotskyi > > wrote: > > In our code we have our own linear system solver, optimized for a > distributed 3 block diagonal matrix. > We are testing its performance against MUMPS and SUPERLU_dist. > We interfaced this solver with PETSc matrix and vector for the > left and right hand sides of a linear system. > My question: what can I do to make the memory allocated inside the > solver to be reported by PetscMemoryGetCurrentUsage? > > > This function just uses the process resident size (like getrusage(3)) > so that external memory is automatically included. If those packages > had their own memory profiling support, we could use it, but they do > not so we can't give finer grained information about the memory they > are using. Hi, I'm a bit confused: The web page about PetscMemoryGetCurrentUsage says: gets the current amount of memory used that was PetscMalloc()ed So, how then it can include the external memory if it is not allocated by PetscMalloc() ? Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Sun Mar 31 10:02:55 2013 From: knepley at gmail.com (Matthew Knepley) Date: Mon, 1 Apr 2013 02:02:55 +1100 Subject: [petsc-users] memory reporting In-Reply-To: <51584F88.701@purdue.edu> References: <5158411A.2030600@purdue.edu> <5158451F.7020700@purdue.edu> <51584F88.701@purdue.edu> Message-ID: On Mon, Apr 1, 2013 at 2:00 AM, Michael Povolotskyi wrote: > On 3/31/2013 10:19 AM, Jed Brown wrote: > > > On Sun, Mar 31, 2013 at 9:15 AM, Michael Povolotskyi wrote: > >> In our code we have our own linear system solver, optimized for a >> distributed 3 block diagonal matrix. >> We are testing its performance against MUMPS and SUPERLU_dist. >> We interfaced this solver with PETSc matrix and vector for the left and >> right hand sides of a linear system. >> My question: what can I do to make the memory allocated inside the solver >> to be reported by PetscMemoryGetCurrentUsage? >> > > This function just uses the process resident size (like getrusage(3)) so > that external memory is automatically included. If those packages had their > own memory profiling support, we could use it, but they do not so we can't > give finer grained information about the memory they are using. > > Hi, > I'm a bit confused: > The web page about PetscMemoryGetCurrentUsage says: gets the current > amount of memory used that was PetscMalloc()ed > I don't think it does: http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscMemoryGetCurrentUsage.html Matt > So, how then it can include the external memory if it is not allocated by > PetscMalloc() ? > Thank you. > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From jedbrown at mcs.anl.gov Sun Mar 31 10:02:58 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Sun, 31 Mar 2013 10:02:58 -0500 Subject: [petsc-users] memory reporting In-Reply-To: <51584F88.701@purdue.edu> References: <5158411A.2030600@purdue.edu> <5158451F.7020700@purdue.edu> <51584F88.701@purdue.edu> Message-ID: On Sun, Mar 31, 2013 at 10:00 AM, Michael Povolotskyi wrote: > I'm a bit confused: > The web page about PetscMemoryGetCurrentUsage says: gets the current > amount of memory used that was PetscMalloc()ed > No, it does not say that. http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscMemoryGetCurrentUsage.html Perhaps you were confusing it with: http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscMallocGetCurrentUsage.html#PetscMallocGetCurrentUsage -------------- next part -------------- An HTML attachment was scrubbed... URL: From mpovolot at purdue.edu Sun Mar 31 10:05:40 2013 From: mpovolot at purdue.edu (Michael Povolotskyi) Date: Sun, 31 Mar 2013 11:05:40 -0400 Subject: [petsc-users] memory reporting In-Reply-To: References: <5158411A.2030600@purdue.edu> <5158451F.7020700@purdue.edu> <51584F88.701@purdue.edu> Message-ID: <515850C4.5090200@purdue.edu> On 3/31/2013 11:02 AM, Matthew Knepley wrote: > On Mon, Apr 1, 2013 at 2:00 AM, Michael Povolotskyi > > wrote: > > On 3/31/2013 10:19 AM, Jed Brown wrote: >> >> On Sun, Mar 31, 2013 at 9:15 AM, Michael Povolotskyi >> > wrote: >> >> In our code we have our own linear system solver, optimized >> for a distributed 3 block diagonal matrix. >> We are testing its performance against MUMPS and SUPERLU_dist. >> We interfaced this solver with PETSc matrix and vector for >> the left and right hand sides of a linear system. >> My question: what can I do to make the memory allocated >> inside the solver to be reported by PetscMemoryGetCurrentUsage? >> >> >> This function just uses the process resident size (like >> getrusage(3)) so that external memory is automatically included. >> If those packages had their own memory profiling support, we >> could use it, but they do not so we can't give finer grained >> information about the memory they are using. > Hi, > I'm a bit confused: > The web page about PetscMemoryGetCurrentUsage says: gets the > current amount of memory used that was PetscMalloc()ed > > > I don't think it does: > > http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscMemoryGetCurrentUsage.html > > Matt > > So, how then it can include the external memory if it is not > allocated by PetscMalloc() ? > Thank you. > > > > > -- > What most experimenters take for granted before they begin their > experiments is infinitely more interesting than any results to which > their experiments lead. > -- Norbert Wiener Sorry, I confused with PetscMallocGetCurrentUsage. Now it is clear. Michael. Mic -------------- next part -------------- An HTML attachment was scrubbed... URL: From jedbrown at mcs.anl.gov Sun Mar 31 15:16:47 2013 From: jedbrown at mcs.anl.gov (Jed Brown) Date: Sun, 31 Mar 2013 15:16:47 -0500 Subject: [petsc-users] A question on the PETSc options for non-uniform grid In-Reply-To: <51561047.1060006@gmail.com> References: <51561047.1060006@gmail.com> Message-ID: <871uav1g0g.fsf@59A2.org> "Zhenglun (Alan) Wei" writes: > Dear All, > I hope you're having a nice day. > Based on ksp ex45, a 3D Poisson solver with non-uniform grid is coded. > The PETSc options I used is: > /mpiexec -np 32 ./ex45 -pc_type gamg -ksp_type cg -pc_gamg_type agg > -pc_gamg_agg_nsmooths 1 -mg_levels_ksp_max_it 1 -mg_levels_ksp_type > richardson -ksp_rtol 1.0e-7/ > There are some problems: > 1, if the mesh is very coarse with very small amount of the grid, the > code runs well; > 2, if the mesh is fine, an error message comes up saying 'un-symmetric > graph'. It suggests me to use '-pc_gamg_sym_graph true' or > '-pc_gamg_thredhold 0.0'. How are you implementing boundary conditions? > a) if '-pc_gamg_sym_graph true' is used, the code runs but blows up very > quickly with crazy norm; > b) if '-pc_gamg_thredhold 0.0' is used, the code stops on the KSPSolve() > forever; > 3, because of the 'un-symmetric graph' error, it reminds me that the > matrix may not be symmetric, which indicates that '-ksp_type cg' may not > be a good option. Therefore, I changed it to '-ksp_type gmres'. It makes > the code run with 'moderate fine' mesh. However, it stops at KSPSolve() > also with fine mesh. > a) does there any other '-ksp_type' fit better for this case? > b) does multigrid preconditioner work well for gmres? All of the above should work. Can you reproduce with our version of ex45.c, or can you send your version with the full error messages you are seeing (or other symptoms, like deadlock?) and instructions to reproduce?