While building petsc with MPICH, UMFPACK, and HYPRE, and without fortran, I get the following error: TESTING: configureLibrary from PETSc.packages.hypre(python/PETSc/ packages/hypre.py:120) using: --with- MPI-include="/opt/petsc-2.3.3-p8/externalpackages/mpich2-1.0.5p4/ darwin9.1.0-cxx-debug/include" = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = ========================= Configuring hypre; this may take several minutes = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = ********************************************************************************* UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for details): --------------------------------------------------------------------------------------- Error running configure on HYPRE: Could not execute 'cd /opt/ petsc-2.3.3-p8/externalpackages/hypre-2.0.0/src;make distclean;./ configure --prefix=/opt/petsc-2.3.3-p8/externalpackages/hypre-2.0.0/ darwin9.1.0-cxx-debug CC="/opt/petsc-2.3.3-p8/externalpackages/ mpich2-1.0.5p4/darwin9.1.0-cxx-debug/bin/mpicc -PIC -Wall -Wwrite- strings -Wno-long-double -Wno-strict-aliasing -g3 " CXX="/opt/ petsc-2.3.3-p8/externalpackages/mpich2-1.0.5p4/darwin9.1.0-cxx-debug/ bin/mpicxx -Wall -Wwrite-strings -Wno-long-double -Wno-strict- aliasing -g -PIC " --with-MPI-include="/opt/petsc-2.3.3-p8/ externalpackages/mpich2-1.0.5p4/darwin9.1.0-cxx-debug/include" --with- MPI-lib-dirs="" --with-MPI-libs="" --with-blas-libs= --with-blas-lib- dir= --with-lapack-libs= --with-lapack-lib-dir= --with-blas=yes --with- lapack=yes --without-babel --without-mli --without-fei --without- superlu': Dist-cleaning utilities ... rm -f *.o libHYPRE* f2c.h *blas.h *lapack.h rm -rf pchdir tca.map *inslog* Dist-cleaning krylov ... rm -f *.o libHYPRE* rm -rf pchdir tca.map *inslog* Dist-cleaning struct_mv ... rm -f *.o libHYPRE* rm -rf pchdir tca.map *inslog* Dist-cleaning struct_ls ... rm -f *.o libHYPRE* rm -rf pchdir tca.map *inslog* Dist-cleaning sstruct_mv ... rm -f *.o libHYPRE* rm -rf pchdir tca.map *inslog* Dist-cleaning sstruct_ls ... rm -f *.o libHYPRE* rm -rf pchdir tca.map *inslog* Dist-cleaning seq_mv ... rm -f *.o libHYPRE* rm -rf pchdir tca.map *inslog* Dist-cleaning parcsr_mv ... rm -f *.o libHYPRE* rm -f driver driver_matvec driver_matmul rm -rf pchdir tca.map *inslog* Dist-cleaning parcsr_block_mv ... rm -rf *.o libHYPRE_* rm -f driver driver_matvec driver_matmul Dist-cleaning distributed_matrix ... rm -f *.o libHYPRE* rm -rf pchdir tca.map *inslog* Dist-cleaning matrix_matrix ... rm -f *.o lib* rm -rf pchdir tca.map *inslog* Dist-cleaning IJ_mv ... rm -f *.o libHYPRE* rm -rf pchdir tca.map *inslog* Dist-cleaning distributed_ls ... rm -f *.o libHYPRE* rm -rf pchdir tca.map *inslog* rm -f *.o libHYPRE* rm -rf pchdir tca.map *inslog* rm -f *.o libHYPRE* rm -rf pchdir tca.map *inslog* Dist-cleaning parcsr_ls ... rm -f *.o libHYPRE* rm -rf pchdir tca.map *inslog* Dist-cleaning multivector ... rm -f *.o libHYPRE* rm -rf pchdir tca.map *inslog* Dist-cleaning lib ... rm -f *.o libHYPRE* rm -rf pchdir tca.map *inslog* Dist-cleaning test ... rm -f *.o rm -rf pchdir tca.map *inslog* rm -f ij ij_mv new_ij sstruct sstruct_fac struct maxwell_unscaled ams_driver rm -f ex1_for ex3_for ex5_for ex6_for ex7_for rm -f f77_ij f77_ij_mv f77_struct rm -f struct_b sstruct_b ij_b rm -f rm -f f77_ij_b f77_struct_b rm -f fei rm -f TEST_examples/*.out* rm -f TEST_examples/*.err* rm -f TEST_fac/*.out* rm -f TEST_fac/*.err* rm -f TEST_ij/*.out* rm -f TEST_ij/*.err* rm -f TEST_ij/*.txt* rm -f TEST_ij/vectors.* rm -f TEST_sstruct/*.out* rm -f TEST_sstruct/*.err* rm -f TEST_struct/*.out* rm -f TEST_struct/*.err* rm -f ex1 ex2 ex3 ex4 ex5 ex5b ex5b77 ex6 ex7 ex8 ex9 Dist-cleaning seq_ls ... checking build system type... i686-apple-darwin9.1.0 checking host system type... i686-apple-darwin9.1.0 checking for mpxlf... no checking for mpf77... no checking for mpif77... mpif77 checking for ranlib... ranlib checking for a BSD-compatible install... /usr/bin/install -c checking for gawk... no checking for mawk... no checking for nawk... no checking for awk... awk checking whether ln -s works... yes checking whether make sets $(MAKE)... yes checking for gcc... /opt/petsc-2.3.3-p8/externalpackages/ mpich2-1.0.5p4/darwin9.1.0-cxx-debug/bin/mpicc -PIC -Wall -Wwrite- strings -Wno-long-double -Wno-strict-aliasing -g3 checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether /opt/petsc-2.3.3-p8/externalpackages/mpich2-1.0.5p4/ darwin9.1.0-cxx-debug/bin/mpicc -PIC -Wall -Wwrite-strings -Wno-long- double -Wno-strict-aliasing -g3 accepts -g... yes checking for /opt/petsc-2.3.3-p8/externalpackages/mpich2-1.0.5p4/ darwin9.1.0-cxx-debug/bin/mpicc -PIC -Wall -Wwrite-strings -Wno-long- double -Wno-strict-aliasing -g3 option to accept ANSI C... none needed checking how to run the C preprocessor... /opt/petsc-2.3.3-p8/ externalpackages/mpich2-1.0.5p4/darwin9.1.0-cxx-debug/bin/mpicc -PIC - Wall -Wwrite-strings -Wno-long-double -Wno-strict-aliasing -g3 -E checking for gcc... (cached) /opt/petsc-2.3.3-p8/externalpackages/ mpich2-1.0.5p4/darwin9.1.0-cxx-debug/bin/mpicc -PIC -Wall -Wwrite- strings -Wno-long-double -Wno-strict-aliasing -g3 checking whether we are using the GNU C compiler... (cached) yes checking whether /opt/petsc-2.3.3-p8/externalpackages/mpich2-1.0.5p4/ darwin9.1.0-cxx-debug/bin/mpicc -PIC -Wall -Wwrite-strings -Wno-long- double -Wno-strict-aliasing -g3 accepts -g... (cached) yes checking for /opt/petsc-2.3.3-p8/externalpackages/mpich2-1.0.5p4/ darwin9.1.0-cxx-debug/bin/mpicc -PIC -Wall -Wwrite-strings -Wno-long- double -Wno-strict-aliasing -g3 option to accept ANSI C... (cached) none needed checking whether we are using the GNU C++ compiler... yes checking whether /opt/petsc-2.3.3-p8/externalpackages/mpich2-1.0.5p4/ darwin9.1.0-cxx-debug/bin/mpicxx -Wall -Wwrite-strings -Wno-long- double -Wno-strict-aliasing -g -PIC accepts -g... yes checking how to run the C++ preprocessor... /opt/petsc-2.3.3-p8/ externalpackages/mpich2-1.0.5p4/darwin9.1.0-cxx-debug/bin/mpicxx - Wall -Wwrite-strings -Wno-long-double -Wno-strict-aliasing -g -PIC -E checking whether we are using the GNU Fortran 77 compiler... no checking whether mpif77 accepts -g... no checking how to get verbose linking output from mpif77... checking for Fortran libraries of mpif77... checking for dummy main to link with Fortran libraries... none checking for Fortran name-mangling scheme... make[1]: *** No rule to make target `distclean'. Stop. make: *** [distclean] Error 2 rm: conftest.dSYM: is a directory configure: WARNING: compilation failed rm: conftest.dSYM: is a directory rm: conftest.dSYM: is a directory configure: error: cannot compile a simple Fortran program See `config.log' for more details.
Please send to [email protected] (NOT this list) 1) the entire petsc configure.log and 2) the file config.log from the directory externalpackages/hypre-2.0.0 Barry On Jan 29, 2008, at 7:43 PM, Gideon Simpson wrote:
While building petsc with MPICH, UMFPACK, and HYPRE, and without fortran, I get the following error:
TESTING: configureLibrary from PETSc.packages.hypre(python/PETSc/ packages/hypre.py:120) using: -- with-MPI-include="/opt/petsc-2.3.3-p8/externalpackages/ mpich2-1.0.5p4/darwin9.1.0-cxx-debug/include" = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = ======================= Configuring hypre; this may take several minutes
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = ********************************************************************************* UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for details): --------------------------------------------------------------------------------------- Error running configure on HYPRE: Could not execute 'cd /opt/ petsc-2.3.3-p8/externalpackages/hypre-2.0.0/src;make distclean;./ configure --prefix=/opt/petsc-2.3.3-p8/externalpackages/hypre-2.0.0/ darwin9.1.0-cxx-debug CC="/opt/petsc-2.3.3-p8/externalpackages/ mpich2-1.0.5p4/darwin9.1.0-cxx-debug/bin/mpicc -PIC -Wall -Wwrite- strings -Wno-long-double -Wno-strict-aliasing -g3 " CXX="/opt/ petsc-2.3.3-p8/externalpackages/mpich2-1.0.5p4/darwin9.1.0-cxx-debug/ bin/mpicxx -Wall -Wwrite-strings -Wno-long-double -Wno-strict- aliasing -g -PIC " --with-MPI-include="/opt/petsc-2.3.3-p8/ externalpackages/mpich2-1.0.5p4/darwin9.1.0-cxx-debug/include" -- with-MPI-lib-dirs="" --with-MPI-libs="" --with-blas-libs= --with- blas-lib-dir= --with-lapack-libs= --with-lapack-lib-dir= --with- blas=yes --with-lapack=yes --without-babel --without-mli --without- fei --without-superlu': Dist-cleaning utilities ... rm -f *.o libHYPRE* f2c.h *blas.h *lapack.h rm -rf pchdir tca.map *inslog* Dist-cleaning krylov ... rm -f *.o libHYPRE* rm -rf pchdir tca.map *inslog* Dist-cleaning struct_mv ... rm -f *.o libHYPRE* rm -rf pchdir tca.map *inslog* Dist-cleaning struct_ls ... rm -f *.o libHYPRE* rm -rf pchdir tca.map *inslog* Dist-cleaning sstruct_mv ... rm -f *.o libHYPRE* rm -rf pchdir tca.map *inslog* Dist-cleaning sstruct_ls ... rm -f *.o libHYPRE* rm -rf pchdir tca.map *inslog* Dist-cleaning seq_mv ... rm -f *.o libHYPRE* rm -rf pchdir tca.map *inslog* Dist-cleaning parcsr_mv ... rm -f *.o libHYPRE* rm -f driver driver_matvec driver_matmul rm -rf pchdir tca.map *inslog* Dist-cleaning parcsr_block_mv ... rm -rf *.o libHYPRE_* rm -f driver driver_matvec driver_matmul Dist-cleaning distributed_matrix ... rm -f *.o libHYPRE* rm -rf pchdir tca.map *inslog* Dist-cleaning matrix_matrix ... rm -f *.o lib* rm -rf pchdir tca.map *inslog* Dist-cleaning IJ_mv ... rm -f *.o libHYPRE* rm -rf pchdir tca.map *inslog* Dist-cleaning distributed_ls ... rm -f *.o libHYPRE* rm -rf pchdir tca.map *inslog* rm -f *.o libHYPRE* rm -rf pchdir tca.map *inslog* rm -f *.o libHYPRE* rm -rf pchdir tca.map *inslog* Dist-cleaning parcsr_ls ... rm -f *.o libHYPRE* rm -rf pchdir tca.map *inslog* Dist-cleaning multivector ... rm -f *.o libHYPRE* rm -rf pchdir tca.map *inslog* Dist-cleaning lib ... rm -f *.o libHYPRE* rm -rf pchdir tca.map *inslog* Dist-cleaning test ... rm -f *.o rm -rf pchdir tca.map *inslog* rm -f ij ij_mv new_ij sstruct sstruct_fac struct maxwell_unscaled ams_driver rm -f ex1_for ex3_for ex5_for ex6_for ex7_for rm -f f77_ij f77_ij_mv f77_struct rm -f struct_b sstruct_b ij_b rm -f rm -f f77_ij_b f77_struct_b rm -f fei rm -f TEST_examples/*.out* rm -f TEST_examples/*.err* rm -f TEST_fac/*.out* rm -f TEST_fac/*.err* rm -f TEST_ij/*.out* rm -f TEST_ij/*.err* rm -f TEST_ij/*.txt* rm -f TEST_ij/vectors.* rm -f TEST_sstruct/*.out* rm -f TEST_sstruct/*.err* rm -f TEST_struct/*.out* rm -f TEST_struct/*.err* rm -f ex1 ex2 ex3 ex4 ex5 ex5b ex5b77 ex6 ex7 ex8 ex9 Dist-cleaning seq_ls ... checking build system type... i686-apple-darwin9.1.0 checking host system type... i686-apple-darwin9.1.0 checking for mpxlf... no checking for mpf77... no checking for mpif77... mpif77 checking for ranlib... ranlib checking for a BSD-compatible install... /usr/bin/install -c checking for gawk... no checking for mawk... no checking for nawk... no checking for awk... awk checking whether ln -s works... yes checking whether make sets $(MAKE)... yes checking for gcc... /opt/petsc-2.3.3-p8/externalpackages/ mpich2-1.0.5p4/darwin9.1.0-cxx-debug/bin/mpicc -PIC -Wall -Wwrite- strings -Wno-long-double -Wno-strict-aliasing -g3 checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether /opt/petsc-2.3.3-p8/externalpackages/mpich2-1.0.5p4/ darwin9.1.0-cxx-debug/bin/mpicc -PIC -Wall -Wwrite-strings -Wno- long-double -Wno-strict-aliasing -g3 accepts -g... yes checking for /opt/petsc-2.3.3-p8/externalpackages/mpich2-1.0.5p4/ darwin9.1.0-cxx-debug/bin/mpicc -PIC -Wall -Wwrite-strings -Wno- long-double -Wno-strict-aliasing -g3 option to accept ANSI C... none needed checking how to run the C preprocessor... /opt/petsc-2.3.3-p8/ externalpackages/mpich2-1.0.5p4/darwin9.1.0-cxx-debug/bin/mpicc - PIC -Wall -Wwrite-strings -Wno-long-double -Wno-strict-aliasing -g3 -E checking for gcc... (cached) /opt/petsc-2.3.3-p8/externalpackages/ mpich2-1.0.5p4/darwin9.1.0-cxx-debug/bin/mpicc -PIC -Wall -Wwrite- strings -Wno-long-double -Wno-strict-aliasing -g3 checking whether we are using the GNU C compiler... (cached) yes checking whether /opt/petsc-2.3.3-p8/externalpackages/mpich2-1.0.5p4/ darwin9.1.0-cxx-debug/bin/mpicc -PIC -Wall -Wwrite-strings -Wno- long-double -Wno-strict-aliasing -g3 accepts -g... (cached) yes checking for /opt/petsc-2.3.3-p8/externalpackages/mpich2-1.0.5p4/ darwin9.1.0-cxx-debug/bin/mpicc -PIC -Wall -Wwrite-strings -Wno- long-double -Wno-strict-aliasing -g3 option to accept ANSI C... (cached) none needed checking whether we are using the GNU C++ compiler... yes checking whether /opt/petsc-2.3.3-p8/externalpackages/mpich2-1.0.5p4/ darwin9.1.0-cxx-debug/bin/mpicxx -Wall -Wwrite-strings -Wno-long- double -Wno-strict-aliasing -g -PIC accepts -g... yes checking how to run the C++ preprocessor... /opt/petsc-2.3.3-p8/ externalpackages/mpich2-1.0.5p4/darwin9.1.0-cxx-debug/bin/mpicxx - Wall -Wwrite-strings -Wno-long-double -Wno-strict-aliasing -g - PIC -E checking whether we are using the GNU Fortran 77 compiler... no checking whether mpif77 accepts -g... no checking how to get verbose linking output from mpif77... checking for Fortran libraries of mpif77... checking for dummy main to link with Fortran libraries... none checking for Fortran name-mangling scheme... make[1]: *** No rule to make target `distclean'. Stop. make: *** [distclean] Error 2 rm: conftest.dSYM: is a directory configure: WARNING: compilation failed rm: conftest.dSYM: is a directory rm: conftest.dSYM: is a directory configure: error: cannot compile a simple Fortran program See `config.log' for more details.
Hi, i am trying out the MG preconditioner in PETSc and am encountering some issues. In fact when i use the MG preconditioner i get a segmentation violation. This does not happen with other preconditioners. Running Petsc in debug mode with the -info option did not seem to produce any useful data (at least to me) I thought i'd ask if someone encountered this before i use valgrind. I am using 2.3.3-p8. Or does anyone have a hint on where i could start looking? Again, what bothers me is that the other preconditioner do not throw any sort of error. thanks mat
On Tue, Mar 18, 2008 at 5:00 PM, Matt Funk <[email protected]> wrote:
Hi,
i am trying out the MG preconditioner in PETSc and am encountering some issues. In fact when i use the MG preconditioner i get a segmentation violation. This does not happen with other preconditioners.
If you just do something like -pc_type mg, then you will definitely get an error. PC_MG is just the skeleton for a multigrid preconditioner. MG relies on knowledge of both the operator and domain, which is in general not available to PETSc. If you want something that just works, I suggest configuring with --download-ml or --download-hypre or --download-prometheus and running with the AMG provided in those packages. If you are using a DA, then you can use DMMG which provides the extra information. Matt
Running Petsc in debug mode with the -info option did not seem to produce any useful data (at least to me)
I thought i'd ask if someone encountered this before i use valgrind. I am using 2.3.3-p8. Or does anyone have a hint on where i could start looking? Again, what bothers me is that the other preconditioner do not throw any sort of error.
thanks mat
-- 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 to bug the list with this. i was just wondering how the possible use of PETSC in a commerical environment is/should be handled? I read the copyright notification on the website as well as the FAQs, but i didn't see much to that question. If i am too blind to see it, maybe someone can point me to where i can read about it? thanks mat
On Tue, Mar 25, 2008 at 6:15 PM, Matt Funk <[email protected]> wrote:
Sorry to bug the list with this.
i was just wondering how the possible use of PETSC in a commerical environment is/should be handled? I read the copyright notification on the website as well as the FAQs, but i didn't see much to that question.
If i am too blind to see it, maybe someone can point me to where i can read about it?
I think the license is clear. You can use it for whatever commercial purpose you want. Its already in a few commercial codes. Thanks, Matt
thanks mat -- 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
Hi, I am trying to use the SNESSetApplicationContext function to set an object as a user application context. This is being done after the SNESSolve was already called once on the SNES object, using a NULL application context. For some reason, after the SNESSetApplicationContext call, the application context on SNES is not being set. I am wondering if maybe I need to set some flag to tell the SNES object to include this new context in further residual and Jacobian calls. I saw the code for the SNESSetApplicationContext function and it doesn't look like it but may be I am missing something ? Thanks for the help. Vijay No virus found in this outgoing message. Checked by AVG. Version: 7.5.519 / Virus Database: 269.22.0/1342 - Release Date: 3/25/2008 10:26 AM
On Tue, Mar 25, 2008 at 8:54 PM, Vijay S. Mahadevan <[email protected]> wrote:
Hi,
I am trying to use the SNESSetApplicationContext function to set an object as a user application context. This is being done after the SNESSolve was already called once on the SNES object, using a NULL application context.
For some reason, after the SNESSetApplicationContext call, the application context on SNES is not being set. I am wondering if maybe I need to set some flag to tell the SNES object to include this new context in further residual and Jacobian calls. I saw the code for the SNESSetApplicationContext function and it doesn't look like it but may be I am missing something ?
There is a misunderstanding. The application context is separate from both the Function context and the Jacobian context. If you want to change these, you must call SetFunction/Jacobian() again. Matt
Thanks for the help.
Vijay
No virus found in this outgoing message. Checked by AVG. Version: 7.5.519 / Virus Database: 269.22.0/1342 - Release Date: 3/25/2008 10:26 AM
-- 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
Matt,
There is a misunderstanding. The application context is separate from both the Function context and the Jacobian context.
If the object completely belongs to the user, can I use this function to pass on pointers to my user objects ? Or is there some advanced usage that would conflict with this procedure ? Alternately I did try using SetFunction/Jacobian() already followed by SetFromOptions and it does pass the correct user context as expected. The glitch in this path is that even when I have -snes_mf, my Jacobian function is being called with a MFFD Mat type. And hence, I get an error there while trying to manipulate it. I should note that the first time I use my SNES object, the Jacobian is never called. It happens only after I set the Jacobian again. Please do let me know if the first method or the second one would be a good choice and the workaround needed to get it working. Thanks. Vijay
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Matthew Knepley Sent: Tuesday, March 25, 2008 9:16 PM To: [email protected] Subject: Re: SNESSetApplicationContext usage
On Tue, Mar 25, 2008 at 8:54 PM, Vijay S. Mahadevan <[email protected]> wrote:
Hi,
I am trying to use the SNESSetApplicationContext function to set an object as a user application context. This is being done after the SNESSolve was already called once on the SNES object, using a NULL application context.
For some reason, after the SNESSetApplicationContext call, the application context on SNES is not being set. I am wondering if maybe I need to set some flag to tell the SNES object to include this new context in further residual and Jacobian calls. I saw the code for the SNESSetApplicationContext function and it doesn't look like it but may be I am missing something ?
There is a misunderstanding. The application context is separate from both the Function context and the Jacobian context. If you want to change these, you must call SetFunction/Jacobian() again.
Matt
Thanks for the help.
Vijay
No virus found in this outgoing message. Checked by AVG. Version: 7.5.519 / Virus Database: 269.22.0/1342 - Release Date: 3/25/2008 10:26 AM
-- 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
No virus found in this incoming message. Checked by AVG. Version: 7.5.519 / Virus Database: 269.22.0/1342 - Release Date: 3/25/2008 10:26 AM
No virus found in this outgoing message. Checked by AVG. Version: 7.5.519 / Virus Database: 269.22.0/1342 - Release Date: 3/25/2008 10:26 AM
Matt, The first method from my previous email works fine. If I use SNES(Set/Get)ApplicationContext, I can store and retrieve user objects from the SNES object. And this is what I wanted. Thanks for the help and clarifying my mistake. Vijay
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Matthew Knepley Sent: Tuesday, March 25, 2008 9:16 PM To: [email protected] Subject: Re: SNESSetApplicationContext usage
On Tue, Mar 25, 2008 at 8:54 PM, Vijay S. Mahadevan <[email protected]> wrote:
Hi,
I am trying to use the SNESSetApplicationContext function to set an object as a user application context. This is being done after the SNESSolve was already called once on the SNES object, using a NULL application context.
For some reason, after the SNESSetApplicationContext call, the application context on SNES is not being set. I am wondering if maybe I need to set some flag to tell the SNES object to include this new context in further residual and Jacobian calls. I saw the code for the SNESSetApplicationContext function and it doesn't look like it but may be I am missing something ?
There is a misunderstanding. The application context is separate from both the Function context and the Jacobian context. If you want to change these, you must call SetFunction/Jacobian() again.
Matt
Thanks for the help.
Vijay
-- 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
No virus found in this outgoing message. Checked by AVG. Version: 7.5.519 / Virus Database: 269.22.0/1342 - Release Date: 3/25/2008 10:26 AM
Hi, in order to create a sparse MPIMatrix (with preallocated memory) it is necessary to give it the number of nonzero entries per row for the local and off-diagonal submatrix. The way i do things right now is that i need to allocate the entire matrix. However, my domain is decomposed into boxes where one or more boxes reside on the current processor. So, i was wondering if it is possible to allocate the matrix memory per box. Right now what i do is this: 1) iterate over the whole domain (every single box) and extract the info i need from each box for memory allocation. 2) call MatCreateMPIAIJ to create the matrix/allocate memory. 3) iterate over the whole domain again to get the info to insert the values into the matrix. Is it possible to instead do something like: 1) get info for values and memory allocation needed per box 2) allocate memory for x number of rows in global matrix and insert values for them (via MatSetValues) 3) start at 1) till every box in the domain is covered. The problem in 2) is that i can insert the values, but there is no memory preallocated for it, so it would be slow. If i could allocate it, i think it would solve my problem. I hope i am making sense. By the way, i cannot use the DA construct because i have overlapping values. thanks mat
Maybe i should clarify a little more. I guess what i am looking for is something that lets me split up the memory allocation within a given processor. The example you guys often show (for example on MatCreateMPIAIJ manual page) is where the local process owns 3 rows. But consider for example if the local process owns 1000 rows. Right now (as i can see it) i have two options. Do not allocate memory at all and use MatSetValues and allocate memory per row. This is very slow as you guys state on your manual pages. The other option is to allocate all 1000 rows at a time which means extra overhead. However, what i would like to be able to (as an example), make 2 calls for an allocation of 200 rows and a second call for an allocation of the remaining 800 rows. I do not know if this is possible as i don't know whether all the local stuff is stored in on continuous array? Anyway, i hope this clarifies my question a little more. thank mat On Wednesday 26 March 2008 14:31, Matt Funk wrote:
Hi,
in order to create a sparse MPIMatrix (with preallocated memory) it is necessary to give it the number of nonzero entries per row for the local and off-diagonal submatrix.
The way i do things right now is that i need to allocate the entire matrix. However, my domain is decomposed into boxes where one or more boxes reside on the current processor.
So, i was wondering if it is possible to allocate the matrix memory per box. Right now what i do is this: 1) iterate over the whole domain (every single box) and extract the info i need from each box for memory allocation. 2) call MatCreateMPIAIJ to create the matrix/allocate memory. 3) iterate over the whole domain again to get the info to insert the values into the matrix.
Is it possible to instead do something like: 1) get info for values and memory allocation needed per box 2) allocate memory for x number of rows in global matrix and insert values for them (via MatSetValues) 3) start at 1) till every box in the domain is covered.
The problem in 2) is that i can insert the values, but there is no memory preallocated for it, so it would be slow. If i could allocate it, i think it would solve my problem.
I hope i am making sense. By the way, i cannot use the DA construct because i have overlapping values.
thanks mat
This is not possible with the current implementation. I am not sure why you would want to do it. It seems to me to save nothing. Do you have some sort of performance problem? Matt On Wed, Mar 26, 2008 at 5:01 PM, Matt Funk <[email protected]> wrote:
Maybe i should clarify a little more. I guess what i am looking for is something that lets me split up the memory allocation within a given processor.
The example you guys often show (for example on MatCreateMPIAIJ manual page) is where the local process owns 3 rows.
But consider for example if the local process owns 1000 rows. Right now (as i can see it) i have two options. Do not allocate memory at all and use MatSetValues and allocate memory per row. This is very slow as you guys state on your manual pages. The other option is to allocate all 1000 rows at a time which means extra overhead.
However, what i would like to be able to (as an example), make 2 calls for an allocation of 200 rows and a second call for an allocation of the remaining 800 rows.
I do not know if this is possible as i don't know whether all the local stuff is stored in on continuous array?
Anyway, i hope this clarifies my question a little more.
thank mat
On Wednesday 26 March 2008 14:31, Matt Funk wrote:
Hi,
in order to create a sparse MPIMatrix (with preallocated memory) it is necessary to give it the number of nonzero entries per row for the local and off-diagonal submatrix.
The way i do things right now is that i need to allocate the entire matrix. However, my domain is decomposed into boxes where one or more boxes reside on the current processor.
So, i was wondering if it is possible to allocate the matrix memory per box. Right now what i do is this: 1) iterate over the whole domain (every single box) and extract the info i need from each box for memory allocation. 2) call MatCreateMPIAIJ to create the matrix/allocate memory. 3) iterate over the whole domain again to get the info to insert the values into the matrix.
Is it possible to instead do something like: 1) get info for values and memory allocation needed per box 2) allocate memory for x number of rows in global matrix and insert values for them (via MatSetValues) 3) start at 1) till every box in the domain is covered.
The problem in 2) is that i can insert the values, but there is no memory preallocated for it, so it would be slow. If i could allocate it, i think it would solve my problem.
I hope i am making sense. By the way, i cannot use the DA construct because i have overlapping values.
thanks mat
-- 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
Well, it is of course possible that i am looking at this wrong. as to your question what it would save: - case 1) : allocating all local rows on the local process at one time: in order to determine the information for the nonzero entries for the local on and off diagonal matrices i have to iterate over my entire domain and do logic for each node to determine whether my surrounding nodes (for the Laplacian) are on the local processor or not and/or whether they are even in the domain. Because i have to do the same thing again once i get to the point where i insert values into the matrix this is really redundant, but necessary to determine the space to allocate. i would like to eliminate this. -case 2) : do not preallocate anything very slow, and not really an option. so, what it would gain me would be the best compromise between memory allocation performance and logic overhead. I.e. the logic while iterating through the domain layout it executed only once instead of twice. I hope it makes sense... but i guess it is not possible anyway. too bad ... thanks though mat On Wednesday 26 March 2008 17:07, Matthew Knepley wrote:
This is not possible with the current implementation. I am not sure why you would want to do it. It seems to me to save nothing. Do you have some sort of performance problem?
Matt
On Wed, Mar 26, 2008 at 5:01 PM, Matt Funk <[email protected]> wrote:
Maybe i should clarify a little more. I guess what i am looking for is something that lets me split up the memory allocation within a given processor.
The example you guys often show (for example on MatCreateMPIAIJ manual page) is where the local process owns 3 rows.
But consider for example if the local process owns 1000 rows. Right now (as i can see it) i have two options. Do not allocate memory at all and use MatSetValues and allocate memory per row. This is very slow as you guys state on your manual pages. The other option is to allocate all 1000 rows at a time which means extra overhead.
However, what i would like to be able to (as an example), make 2 calls for an allocation of 200 rows and a second call for an allocation of the remaining 800 rows.
I do not know if this is possible as i don't know whether all the local stuff is stored in on continuous array?
Anyway, i hope this clarifies my question a little more.
thank mat
On Wednesday 26 March 2008 14:31, Matt Funk wrote:
Hi,
in order to create a sparse MPIMatrix (with preallocated memory) it is necessary to give it the number of nonzero entries per row for the local and off-diagonal submatrix.
The way i do things right now is that i need to allocate the entire matrix. However, my domain is decomposed into boxes where one or more boxes reside on the current processor.
So, i was wondering if it is possible to allocate the matrix memory per box. Right now what i do is this: 1) iterate over the whole domain (every single box) and extract the info i need from each box for memory allocation. 2) call MatCreateMPIAIJ to create the matrix/allocate memory. 3) iterate over the whole domain again to get the info to insert the values into the matrix.
Is it possible to instead do something like: 1) get info for values and memory allocation needed per box 2) allocate memory for x number of rows in global matrix and insert values for them (via MatSetValues) 3) start at 1) till every box in the domain is covered.
The problem in 2) is that i can insert the values, but there is no memory preallocated for it, so it would be slow. If i could allocate it, i think it would solve my problem.
I hope i am making sense. By the way, i cannot use the DA construct because i have overlapping values.
thanks mat
On Wed, Mar 26, 2008 at 6:30 PM, Matt Funk <[email protected]> wrote:
Well,
it is of course possible that i am looking at this wrong.
as to your question what it would save:
- case 1) : allocating all local rows on the local process at one time: in order to determine the information for the nonzero entries for the local on and off diagonal matrices i have to iterate over my entire domain and do logic for each node to determine whether my surrounding nodes (for the Laplacian) are on the local processor or not and/or whether they are even in the domain. Because i have to do the same thing again once i get to the point where i insert values into the matrix this is really redundant, but necessary to determine the space to allocate. i would like to eliminate this.
This is what we do. If you measure it, you will find it is a completely negligible fraction of the runtime. I see this as premature (and unnecessary) optimization. If I am wrong here, please send the numbers. Thanks, Matt
-case 2) : do not preallocate anything very slow, and not really an option.
so, what it would gain me would be the best compromise between memory allocation performance and logic overhead. I.e. the logic while iterating through the domain layout it executed only once instead of twice.
I hope it makes sense...
but i guess it is not possible anyway. too bad ...
thanks though mat
On Wednesday 26 March 2008 17:07, Matthew Knepley wrote:
This is not possible with the current implementation. I am not sure why you would want to do it. It seems to me to save nothing. Do you have some sort of performance problem?
Matt
On Wed, Mar 26, 2008 at 5:01 PM, Matt Funk <[email protected]> wrote:
Maybe i should clarify a little more. I guess what i am looking for is something that lets me split up the memory allocation within a given processor.
The example you guys often show (for example on MatCreateMPIAIJ manual page) is where the local process owns 3 rows.
But consider for example if the local process owns 1000 rows. Right now (as i can see it) i have two options. Do not allocate memory at all and use MatSetValues and allocate memory per row. This is very slow as you guys state on your manual pages. The other option is to allocate all 1000 rows at a time which means extra overhead.
However, what i would like to be able to (as an example), make 2 calls for an allocation of 200 rows and a second call for an allocation of the remaining 800 rows.
I do not know if this is possible as i don't know whether all the local stuff is stored in on continuous array?
Anyway, i hope this clarifies my question a little more.
thank mat
On Wednesday 26 March 2008 14:31, Matt Funk wrote:
Hi,
in order to create a sparse MPIMatrix (with preallocated memory) it is necessary to give it the number of nonzero entries per row for the local and off-diagonal submatrix.
The way i do things right now is that i need to allocate the entire matrix. However, my domain is decomposed into boxes where one or more boxes reside on the current processor.
So, i was wondering if it is possible to allocate the matrix memory per box. Right now what i do is this: 1) iterate over the whole domain (every single box) and extract the info i need from each box for memory allocation. 2) call MatCreateMPIAIJ to create the matrix/allocate memory. 3) iterate over the whole domain again to get the info to insert the values into the matrix.
Is it possible to instead do something like: 1) get info for values and memory allocation needed per box 2) allocate memory for x number of rows in global matrix and insert values for them (via MatSetValues) 3) start at 1) till every box in the domain is covered.
The problem in 2) is that i can insert the values, but there is no memory preallocated for it, so it would be slow. If i could allocate it, i think it would solve my problem.
I hope i am making sense. By the way, i cannot use the DA construct because i have overlapping values.
thanks mat
-- 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
Matt, I do not see any specific dis-advantage in your looping over the boxes and determining the preallocation and then looping again to set the values? Surely there is no performance issue? Having support for this in PETSc would be a very dramatic change, perhaps if we understand better the problem perhaps we can come up with an alternative solution to your problem. Barry On Mar 26, 2008, at 3:31 PM, Matt Funk wrote:
Hi,
in order to create a sparse MPIMatrix (with preallocated memory) it is necessary to give it the number of nonzero entries per row for the local and off-diagonal submatrix.
The way i do things right now is that i need to allocate the entire matrix. However, my domain is decomposed into boxes where one or more boxes reside on the current processor.
So, i was wondering if it is possible to allocate the matrix memory per box. Right now what i do is this: 1) iterate over the whole domain (every single box) and extract the info i need from each box for memory allocation. 2) call MatCreateMPIAIJ to create the matrix/allocate memory. 3) iterate over the whole domain again to get the info to insert the values into the matrix.
Is it possible to instead do something like: 1) get info for values and memory allocation needed per box 2) allocate memory for x number of rows in global matrix and insert values for them (via MatSetValues) 3) start at 1) till every box in the domain is covered.
The problem in 2) is that i can insert the values, but there is no memory preallocated for it, so it would be slow. If i could allocate it, i think it would solve my problem.
I hope i am making sense. By the way, i cannot use the DA construct because i have overlapping values.
thanks mat
participants (5)
-
Barry Smith -
Gideon Simpson -
Matt Funk -
Matthew Knepley -
Vijay S. Mahadevan