From mafunk at nmsu.edu Thu Jun 1 12:03:31 2006 From: mafunk at nmsu.edu (Matt Funk) Date: Thu, 1 Jun 2006 11:03:31 -0600 Subject: building libraries In-Reply-To: References: <447D4847.5030007@ae.metu.edu.tr> <200605311546.42002.mafunk@nmsu.edu> Message-ID: <200606011103.32528.mafunk@nmsu.edu> Thanks for the replies, the whole mpicc is a little system specific. It build the libraries after all, so it's fine. However, now i got another question. I link the libraries into my program, and then in my top level code i include petscksp.h. When i try to compile it, it gives me the following error: In file included from /home2/users/mafunk/AMR/PETSC/petsc-2.3.1-p12/include/petscis.h:7, from /home2/users/mafunk/AMR/PETSC/petsc-2.3.1-p12/include/petscvec.h:9, from /home2/users/mafunk/AMR/PETSC/petsc-2.3.1-p12/include/petscmat.h:6, from /home2/users/mafunk/AMR/PETSC/petsc-2.3.1-p12/include/petscpc.h:6, from /home2/users/mafunk/AMR/PETSC/petsc-2.3.1-p12/include/petscksp.h:6, from testNodePoisson.cpp:65: /home2/users/mafunk/AMR/PETSC/petsc-2.3.1-p12/include/petsc.h:13:23: petscconf.h: No such file or directory The only include directory that i have specified is /include in the petsc root directory. I couldn't find petscconf.h anywhere, so i was wondering if somebody knows what i am doing wrong here. thanks mat On Wednesday 31 May 2006 16:08, Matthew Knepley wrote: > You can have PETSc install MPI using --download-mpich. You can make > sure that it does not use mpicc using --with-mpi-compilers=0. > > Matt > > On 5/31/06, Matt Funk wrote: > > Hi, > > > > i need to build PETsC on s sycld machine. Basically i need to have MPI > > support > > in PetsC but i need to switch from using mpicc to gcc. > > > > I was wondering if someone could point to how i can do that. (Is there an > > option that i overlooked?) > > > > thanks > > mat From balay at mcs.anl.gov Thu Jun 1 12:11:36 2006 From: balay at mcs.anl.gov (Satish Balay) Date: Thu, 1 Jun 2006 12:11:36 -0500 (CDT) Subject: building libraries In-Reply-To: <200606011103.32528.mafunk@nmsu.edu> References: <447D4847.5030007@ae.metu.edu.tr> <200605311546.42002.mafunk@nmsu.edu> <200606011103.32528.mafunk@nmsu.edu> Message-ID: Did you try PETSc examples before attempting your code? Do they work? Looks like you are not using PETSc makefiles. This is the recommended thing to do. If you want to have your own makefiles - do the following - and make sure all the comile options you see are listed in your makefile. cd src/ksp/ksp/examples make ex2 You can also get this info with the following [in PETSC_DIR]: make getpetscflags make getincludedirs make getlinklibs Satish On Thu, 1 Jun 2006, Matt Funk wrote: > Thanks for the replies, > > the whole mpicc is a little system specific. It build the libraries after all, > so it's fine. > > However, now i got another question. I link the libraries into my program, and > then in my top level code i include petscksp.h. When i try to compile it, it > gives me the following error: > > In file included > from /home2/users/mafunk/AMR/PETSC/petsc-2.3.1-p12/include/petscis.h:7, > > from /home2/users/mafunk/AMR/PETSC/petsc-2.3.1-p12/include/petscvec.h:9, > > from /home2/users/mafunk/AMR/PETSC/petsc-2.3.1-p12/include/petscmat.h:6, > > from /home2/users/mafunk/AMR/PETSC/petsc-2.3.1-p12/include/petscpc.h:6, > > from /home2/users/mafunk/AMR/PETSC/petsc-2.3.1-p12/include/petscksp.h:6, > from testNodePoisson.cpp:65: > /home2/users/mafunk/AMR/PETSC/petsc-2.3.1-p12/include/petsc.h:13:23: > petscconf.h: No such file or directory > > The only include directory that i have specified is /include in the petsc root > directory. I couldn't find petscconf.h anywhere, so i was wondering if > somebody knows what i am doing wrong here. > > thanks > mat > > > On Wednesday 31 May 2006 16:08, Matthew Knepley wrote: > > You can have PETSc install MPI using --download-mpich. You can make > > sure that it does not use mpicc using --with-mpi-compilers=0. > > > > Matt > > > > On 5/31/06, Matt Funk wrote: > > > Hi, > > > > > > i need to build PETsC on s sycld machine. Basically i need to have MPI > > > support > > > in PetsC but i need to switch from using mpicc to gcc. > > > > > > I was wondering if someone could point to how i can do that. (Is there an > > > option that i overlooked?) > > > > > > thanks > > > mat > > From knepley at gmail.com Thu Jun 1 12:12:06 2006 From: knepley at gmail.com (Matthew Knepley) Date: Thu, 1 Jun 2006 12:12:06 -0500 Subject: building libraries In-Reply-To: <200606011103.32528.mafunk@nmsu.edu> References: <447D4847.5030007@ae.metu.edu.tr> <200605311546.42002.mafunk@nmsu.edu> <200606011103.32528.mafunk@nmsu.edu> Message-ID: I recommend reading the makefile section of the manual. Briefly, you should at least use the bmake/common/variables makefile to get such things as PETSC_INCLUDE correct (that is the problem here), if not use the targets in bmake/common/rules. You could use our example makefiles as a guide. Thanks, Matt On 6/1/06, Matt Funk wrote: > > Thanks for the replies, > > the whole mpicc is a little system specific. It build the libraries after > all, > so it's fine. > > However, now i got another question. I link the libraries into my program, > and > then in my top level code i include petscksp.h. When i try to compile it, > it > gives me the following error: > > In file included > from /home2/users/mafunk/AMR/PETSC/petsc-2.3.1-p12/include/petscis.h:7, > > from /home2/users/mafunk/AMR/PETSC/petsc-2.3.1-p12/include/petscvec.h:9, > > from /home2/users/mafunk/AMR/PETSC/petsc-2.3.1-p12/include/petscmat.h:6, > > from /home2/users/mafunk/AMR/PETSC/petsc-2.3.1-p12/include/petscpc.h:6, > > from /home2/users/mafunk/AMR/PETSC/petsc-2.3.1-p12/include/petscksp.h:6, > from testNodePoisson.cpp:65: > /home2/users/mafunk/AMR/PETSC/petsc-2.3.1-p12/include/petsc.h:13:23: > petscconf.h: No such file or directory > > The only include directory that i have specified is /include in the petsc > root > directory. I couldn't find petscconf.h anywhere, so i was wondering if > somebody knows what i am doing wrong here. > > thanks > mat > > > On Wednesday 31 May 2006 16:08, Matthew Knepley wrote: > > You can have PETSc install MPI using --download-mpich. You can make > > sure that it does not use mpicc using --with-mpi-compilers=0. > > > > Matt > > > > On 5/31/06, Matt Funk wrote: > > > Hi, > > > > > > i need to build PETsC on s sycld machine. Basically i need to have MPI > > > support > > > in PetsC but i need to switch from using mpicc to gcc. > > > > > > I was wondering if someone could point to how i can do that. (Is there > an > > > option that i overlooked?) > > > > > > thanks > > > mat > > -- "Failure has a thousand explanations. Success doesn't need one" -- Sir Alec Guiness -------------- next part -------------- An HTML attachment was scrubbed... URL: From balay at mcs.anl.gov Thu Jun 1 12:13:49 2006 From: balay at mcs.anl.gov (Satish Balay) Date: Thu, 1 Jun 2006 12:13:49 -0500 (CDT) Subject: building libraries In-Reply-To: References: <447D4847.5030007@ae.metu.edu.tr> <200605311546.42002.mafunk@nmsu.edu> <200606011103.32528.mafunk@nmsu.edu> Message-ID: On Thu, 1 Jun 2006, Satish Balay wrote: > Looks like you are not using PETSc makefiles. This is the recommended > thing to do. I intend to say 'The recommended method is to use PETSc makefiles'. Satish From Stephen.R.Ball at awe.co.uk Fri Jun 2 06:06:31 2006 From: Stephen.R.Ball at awe.co.uk (Stephen R Ball) Date: Fri, 2 Jun 2006 12:06:31 +0100 Subject: Problems using external packages Spooles and Hypre with PETSc v2. 3.1 Message-ID: <662CAB009065@awe.co.uk> Hi I have been having (patch 9). I was not having these problems with PETSc v2.3.0. I am using Spooles downloaded from the PETSc ftp site and built into PETSC_DIR/externalpackages. When solving a partcular problem I am getting the error: MatFactorNumeric_MPIAIJSpooles line 199 src/mat/impls/aij/mpi/spooles/mpispooles.c MatLUFactorNumeric line 2200 src/mat/interface/matix.c KSPSetUp line 183 src/ksp/ksp/interface/itfunc.c KSPSolve line 305 src/ksp/ksp/interface/itfunc.c The problem also occurs in serial. I am using Hypre v1.10.0b downloaded from the LLNL site and built separatly to PETSc. When I have been using Pilut and Parasails as either global problem preconditioners of as sub preconditioners for ASM or BJACOBI, I have been getting errors indicating that there could be a memory access out of range. I suspect that there may be a memory overwrite or mismatch occuring somewhere. Note that BOOMERAMG and EUCLID seem to work OK. Again these problems were not apparent when I was using PETSc v2.3.0. Have there been any significant changes in the PETSc source that handles Spooles and Hypre between versions 2.3.0 and 2.3.1 that could be causing these problems? I don't really want to go back to using PETSc v2.3.0 if I can help it. I don't know if it makes any difference, but I am using the Fortran interface to PETSc. Hope you can help. Regards Stephen R. Ball -- _______________________________________________________________________________ The information in this email and in any attachment(s) is commercial in confidence. If you are not the named addressee(s) or if you receive this email in error then any distribution, copying or use of this communication or the information in it is strictly prohibited. Please notify us immediately by email at admin.internet(at)awe.co.uk, and then delete this message from your computer. While attachments are virus checked, AWE plc does not accept any liability in respect of any virus which is not detected. AWE Plc Registered in England and Wales Registration No 02763902 AWE, Aldermaston, Reading, RG7 4PR From hzhang at mcs.anl.gov Fri Jun 2 08:46:39 2006 From: hzhang at mcs.anl.gov (Hong Zhang) Date: Fri, 2 Jun 2006 08:46:39 -0500 (CDT) Subject: Problems using external packages Spooles and Hypre with PETSc v2. 3.1 In-Reply-To: <662CAB009065@awe.co.uk> References: <662CAB009065@awe.co.uk> Message-ID: Stephen, > > I am using Spooles downloaded from the PETSc ftp site and built into > PETSC_DIR/externalpackages. When solving a partcular problem I am getting > the error: > > MatFactorNumeric_MPIAIJSpooles line 199 > src/mat/impls/aij/mpi/spooles/mpispooles.c > MatLUFactorNumeric line 2200 src/mat/interface/matix.c > KSPSetUp line 183 src/ksp/ksp/interface/itfunc.c > KSPSolve line 305 src/ksp/ksp/interface/itfunc.c May I have the complete error message after the crash? Can you run ~petsc/src/ksp/ksp/examples/tutorials/ex5.c with the cmd: mpirun -np 2 ./ex5 -ksp_type preonly -pc_type lu -mat_type aijspooles? Hong > > The problem also occurs in serial. > > I am using Hypre v1.10.0b downloaded from the LLNL site and built separatly > to PETSc. When I have been using Pilut and Parasails as either global > problem preconditioners of as sub preconditioners for ASM or BJACOBI, I have > been getting errors indicating that there could be a memory access out of > range. I suspect that there may be a memory overwrite or mismatch occuring > somewhere. Note that BOOMERAMG and EUCLID seem to work OK. Again these > problems were not apparent when I was using PETSc v2.3.0. > > Have there been any significant changes in the PETSc source that handles > Spooles and Hypre between versions 2.3.0 and 2.3.1 that could be causing > these problems? I don't really want to go back to using PETSc v2.3.0 if I > can help it. I don't know if it makes any difference, but I am using the > Fortran interface to PETSc. > > Hope you can help. > > Regards > > Stephen R. Ball > -- > _______________________________________________________________________________ > > The information in this email and in any attachment(s) is commercial in confidence. If you are not the named addressee(s) or if you receive this email in error then any distribution, copying or use of this communication or the information in it is strictly prohibited. Please notify us immediately by email at admin.internet(at)awe.co.uk, and then delete this message from your computer. While attachments are virus checked, AWE plc does not accept any liability in respect of any virus which is not detected. > > AWE Plc > Registered in England and Wales > Registration No 02763902 > AWE, Aldermaston, Reading, RG7 4PR > > From Stephen.R.Ball at awe.co.uk Fri Jun 2 11:00:56 2006 From: Stephen.R.Ball at awe.co.uk (Stephen R Ball) Date: Fri, 2 Jun 2006 17:00:56 +0100 Subject: Using the Spooles Cholesky solver via PETSc in serial Message-ID: <662H08018489@awe.co.uk> Hi Sorry, this problem is occuring in both serial and parallel. Regards Stephen > -----Original Message----- > From: Ball Stephen AWE > Sent: 02 June 2006 16:04 > To: petsc-users at mcs.anl.gov > Subject: Using the Spooles Cholesky solver via PETSc in serial > > > > Hi > > I am using PETSc v2.3.1 (patch 9) via the Fortran interface. When I use > the Spooles CHOLESKY solver in serial I get the error: > > MatSetValues_MPIBAIJ_MatScaler() line 259 in > src/mat/impls/sbaij/mpi/mpisbaij.c > Lower triangular value cannot be set for sbaij format. Ignoring > these values, run with -mat_ignore_lower_triagular or call > MatSetOption(mat,MAT_IGNORE_LOWER_TRIANGULAR) > MatSetValues() line 827 in src/mat/interface/matrix > > The command line option works fine but when I try to use MatSetOption() > with the MAT_IGNORE_LOWER_TRIANGULAR flag I get the error: > > This name does not have a type, and must have an explicit type. > [MAT_IGNORE_LOWER_TRIANGULAR] > > Can you tell me if use of the MAT_IGNORE_LOWER_TRIANGULAR flag is > supported in the Fortran interface for MatSetOption()? > > Regards > > Stephen R. Ball > -- _______________________________________________________________________________ The information in this email and in any attachment(s) is commercial in confidence. If you are not the named addressee(s) or if you receive this email in error then any distribution, copying or use of this communication or the information in it is strictly prohibited. Please notify us immediately by email at admin.internet(at)awe.co.uk, and then delete this message from your computer. While attachments are virus checked, AWE plc does not accept any liability in respect of any virus which is not detected. AWE Plc Registered in England and Wales Registration No 02763902 AWE, Aldermaston, Reading, RG7 4PR From Stephen.R.Ball at awe.co.uk Fri Jun 2 10:03:48 2006 From: Stephen.R.Ball at awe.co.uk (Stephen R Ball) Date: Fri, 2 Jun 2006 16:03:48 +0100 Subject: Using the Spooles Cholesky solver via PETSc in serial Message-ID: <662G5A016693@awe.co.uk> Hi I am using PETSc v2.3.1 (patch 9) via the Fortran interface. When I use the Spooles CHOLESKY solver in serial I get the error: MatSetValues_MPIBAIJ_MatScaler() line 259 in src/mat/impls/sbaij/mpi/mpisbaij.c Lower triangular value cannot be set for sbaij format. Ignoring these values, run with -mat_ignore_lower_triagular or call MatSetOption(mat,MAT_IGNORE_LOWER_TRIANGULAR) MatSetValues() line 827 in src/mat/interface/matrix The command line option works fine but when I try to use MatSetOption() with the MAT_IGNORE_LOWER_TRIANGULAR flag I get the error: This name does not have a type, and must have an explicit type. [MAT_IGNORE_LOWER_TRIANGULAR] Can you tell me if use of the MAT_IGNORE_LOWER_TRIANGULAR flag is supported in the Fortran interface for MatSetOption()? Regards Stephen R. Ball -- _______________________________________________________________________________ The information in this email and in any attachment(s) is commercial in confidence. If you are not the named addressee(s) or if you receive this email in error then any distribution, copying or use of this communication or the information in it is strictly prohibited. Please notify us immediately by email at admin.internet(at)awe.co.uk, and then delete this message from your computer. While attachments are virus checked, AWE plc does not accept any liability in respect of any virus which is not detected. AWE Plc Registered in England and Wales Registration No 02763902 AWE, Aldermaston, Reading, RG7 4PR From bsmith at mcs.anl.gov Fri Jun 2 12:47:27 2006 From: bsmith at mcs.anl.gov (Barry Smith) Date: Fri, 2 Jun 2006 12:47:27 -0500 (CDT) Subject: Using the Spooles Cholesky solver via PETSc in serial In-Reply-To: <662G5A016693@awe.co.uk> References: <662G5A016693@awe.co.uk> Message-ID: Stephen, This was an error in our last release and did not properly fixed in a patch (why?). It will be in the next release. You can edit include/finclude/petscmat.h and add PetscEnum MAT_USE_COMPRESSEDROW,MAT_DO_NOT_USE_COMPRESSEDROW PetscEnum MAT_IGNORE_LOWER_TRIANGULAR,MAT_ERROR_LOWER_TRIANGULAR PetscEnum MAT_GETROW_UPPERTRIANGULAR parameter (MAT_USE_COMPRESSEDROW=89) parameter (MAT_DO_NOT_USE_COMPRESSEDROW=90) parameter (MAT_IGNORE_LOWER_TRIANGULAR=91) parameter (MAT_ERROR_LOWER_TRIANGULAR=92) parameter (MAT_GETROW_UPPERTRIANGULAR=93) then it should work properly. Barry On Fri, 2 Jun 2006, Stephen R Ball wrote: > > Hi > > I am using PETSc v2.3.1 (patch 9) via the Fortran interface. When I use the > Spooles CHOLESKY solver in serial I get the error: > > MatSetValues_MPIBAIJ_MatScaler() line 259 in > src/mat/impls/sbaij/mpi/mpisbaij.c > Lower triangular value cannot be set for sbaij format. Ignoring > these values, run with -mat_ignore_lower_triagular or call > MatSetOption(mat,MAT_IGNORE_LOWER_TRIANGULAR) > MatSetValues() line 827 in src/mat/interface/matrix > > The command line option works fine but when I try to use MatSetOption() with > the MAT_IGNORE_LOWER_TRIANGULAR flag I get the error: > > This name does not have a type, and must have an explicit type. > [MAT_IGNORE_LOWER_TRIANGULAR] > > Can you tell me if use of the MAT_IGNORE_LOWER_TRIANGULAR flag is supported > in the Fortran interface for MatSetOption()? > > Regards > > Stephen R. Ball > -- > _______________________________________________________________________________ > > The information in this email and in any attachment(s) is commercial in confidence. If you are not the named addressee(s) or if you receive this email in error then any distribution, copying or use of this communication or the information in it is strictly prohibited. Please notify us immediately by email at admin.internet(at)awe.co.uk, and then delete this message from your computer. While attachments are virus checked, AWE plc does not accept any liability in respect of any virus which is not detected. > > AWE Plc > Registered in England and Wales > Registration No 02763902 > AWE, Aldermaston, Reading, RG7 4PR > > From mafunk at nmsu.edu Fri Jun 2 17:59:18 2006 From: mafunk at nmsu.edu (Matt Funk) Date: Fri, 2 Jun 2006 16:59:18 -0600 Subject: building libraries In-Reply-To: References: <447D4847.5030007@ae.metu.edu.tr> Message-ID: <200606021659.19599.mafunk@nmsu.edu> Thanks for the replies again, i found though that the directory bmake/{PETSC_ARCH} included the files (i.e. petscconf.h) that it couldn't find before. So now it seems that it works. I am not sure how i was supposed to use PETsC makefiles when i already have a existing code into which i try to include PETsC rather than starting a new code. I really know just the basics about makefiles, so i could just simply not know what you guys meant. thanks mat On Thursday 01 June 2006 11:13, Satish Balay wrote: > On Thu, 1 Jun 2006, Satish Balay wrote: > > Looks like you are not using PETSc makefiles. This is the recommended > > thing to do. > > I intend to say 'The recommended method is to use PETSc makefiles'. > > Satish From bsmith at mcs.anl.gov Fri Jun 2 18:44:21 2006 From: bsmith at mcs.anl.gov (Barry Smith) Date: Fri, 2 Jun 2006 18:44:21 -0500 (CDT) Subject: building libraries In-Reply-To: <200606021659.19599.mafunk@nmsu.edu> References: <447D4847.5030007@ae.metu.edu.tr> <200606021659.19599.mafunk@nmsu.edu> Message-ID: On Fri, 2 Jun 2006, Matt Funk wrote: > Thanks for the replies again, > > i found though that the directory bmake/{PETSC_ARCH} included the files (i.e. > petscconf.h) that it couldn't find before. > So now it seems that it works. > > I am not sure how i was supposed to use PETsC makefiles when i already have a > existing code into which i try to include PETsC rather than starting a new > code. I really know just the basics about makefiles, so i could just simply > not know what you guys meant. As Satish said in an earlier email; you need only include one PETSc makefile into your makefile. This defines the set of make variables (like libraries) that you can use in the makefile to compile the application. Barry > > thanks > mat > > > On Thursday 01 June 2006 11:13, Satish Balay wrote: >> On Thu, 1 Jun 2006, Satish Balay wrote: >>> Looks like you are not using PETSc makefiles. This is the recommended >>> thing to do. >> >> I intend to say 'The recommended method is to use PETSc makefiles'. >> >> Satish > > From shma7099 at student.uu.se Sun Jun 4 12:10:31 2006 From: shma7099 at student.uu.se (Sh.M) Date: Sun, 4 Jun 2006 19:10:31 +0200 Subject: Question about MatSetValues Message-ID: <000901c687f9$c95f24a0$2516e055@bredbandsbolaget.se> Hi, When using the MatSetValues function with one CPU only, it will cache/save the values locally and then distribute them to the other processes with MatAssemblyBegin/MatAssemblyEnd? Is this true? What happens with the cached/saved values afterwards? Are they released? Is there a way to not cache/save the data locally at all? I am asking these questions because right now speed is not of highest priority, but memory is. And unfortunately in my case I do not generate the matrix by my own and instead read it from a file obtained from "real world" data samples. I have read/distributed the matrix in a couple of different ways; for example CPU 0 reads the file, and then calls MatSetValues.. One other way has been that CPU 0 reads the file, sends the rows that belong to the other processes to the other processes and those processes call MatSetValues by their own on the received rows. And last one is that I have split the file into several smaller files and several processes reads their own file and call MatSetValues on the data they have read from their own file. To make it more convenient for me, the number of files have been maximum number of processors that I have used in my simulations. So If maximum number of processors is 64, then number of files is 64. And if 8 processors are used, then each processor reads 8 files etc. I dont believe any of the approaches I have used are elegant... What would you guys do if you had a file in CSR format, and you want to read it, distribute it and then solve it if memory usage is of highest priority? With best regards, Shaman Mahmoudi From bsmith at mcs.anl.gov Sun Jun 4 12:20:44 2006 From: bsmith at mcs.anl.gov (Barry Smith) Date: Sun, 4 Jun 2006 12:20:44 -0500 (CDT) Subject: Question about MatSetValues In-Reply-To: <000901c687f9$c95f24a0$2516e055@bredbandsbolaget.se> References: <000901c687f9$c95f24a0$2516e055@bredbandsbolaget.se> Message-ID: Write a SEQUENTIAL program that reads in the matrix and then saves it with MatView() to a binary file (can do a right hand side also) then use ksp/ksp/examples/tutorials/ex10.c which uses MatLoad() to solve the system. See for example src/mat/examples/tests/ex32.c for an example of sequential program for reading in ASCII matrix. Also ex34.c ex50.c also ex78.c Barry On Sun, 4 Jun 2006, Sh.M wrote: > Hi, > > When using the MatSetValues function with one CPU only, it will cache/save > the values locally and then distribute them to the other processes with > MatAssemblyBegin/MatAssemblyEnd? Is this true? What happens with the > cached/saved values afterwards? Are they released? Is there a way to not > cache/save the data locally at all? > > I am asking these questions because right now speed is not of highest > priority, but memory is. And unfortunately in my case I do not generate the > matrix by my own and instead read it from a file obtained from "real world" > data samples. > > I have read/distributed the matrix in a couple of different ways; for > example CPU 0 reads the file, and then calls MatSetValues.. One other way > has been that CPU 0 reads the file, sends the rows that belong to the other > processes to the other processes and those processes call MatSetValues by > their own on the received rows. And last one is that I have split the file > into several smaller files and several processes reads their own file and > call MatSetValues on the data they have read from their own file. To make it > more convenient for me, the number of files have been maximum number of > processors that I have used in my simulations. So If maximum number of > processors is 64, then number of files is 64. And if 8 processors are used, > then each processor reads 8 files etc. > > I dont believe any of the approaches I have used are elegant... > > What would you guys do if you had a file in CSR format, and you want to read > it, distribute it and then solve it if memory usage is of highest priority? > > With best regards, Shaman Mahmoudi > > From shma7099 at student.uu.se Sun Jun 4 12:41:43 2006 From: shma7099 at student.uu.se (Sh.M) Date: Sun, 4 Jun 2006 19:41:43 +0200 Subject: Question about MatSetValues References: <000901c687f9$c95f24a0$2516e055@bredbandsbolaget.se> Message-ID: <001801c687fe$251df100$2516e055@bredbandsbolaget.se> Thanks. I will try that. With best regards, Shaman Mahmoudi ----- Original Message ----- From: "Barry Smith" To: Sent: Sunday, June 04, 2006 7:20 PM Subject: Re: Question about MatSetValues > > Write a SEQUENTIAL program that reads in the matrix and then > saves it with MatView() to a binary file (can do a right hand side also) > then use ksp/ksp/examples/tutorials/ex10.c which uses MatLoad() to solve the > system. > > See for example src/mat/examples/tests/ex32.c for an example of > sequential program for reading in ASCII matrix. Also ex34.c ex50.c also ex78.c > > > > Barry > > > On Sun, 4 Jun 2006, Sh.M wrote: > > > Hi, > > > > When using the MatSetValues function with one CPU only, it will cache/save > > the values locally and then distribute them to the other processes with > > MatAssemblyBegin/MatAssemblyEnd? Is this true? What happens with the > > cached/saved values afterwards? Are they released? Is there a way to not > > cache/save the data locally at all? > > > > I am asking these questions because right now speed is not of highest > > priority, but memory is. And unfortunately in my case I do not generate the > > matrix by my own and instead read it from a file obtained from "real world" > > data samples. > > > > I have read/distributed the matrix in a couple of different ways; for > > example CPU 0 reads the file, and then calls MatSetValues.. One other way > > has been that CPU 0 reads the file, sends the rows that belong to the other > > processes to the other processes and those processes call MatSetValues by > > their own on the received rows. And last one is that I have split the file > > into several smaller files and several processes reads their own file and > > call MatSetValues on the data they have read from their own file. To make it > > more convenient for me, the number of files have been maximum number of > > processors that I have used in my simulations. So If maximum number of > > processors is 64, then number of files is 64. And if 8 processors are used, > > then each processor reads 8 files etc. > > > > I dont believe any of the approaches I have used are elegant... > > > > What would you guys do if you had a file in CSR format, and you want to read > > it, distribute it and then solve it if memory usage is of highest priority? > > > > With best regards, Shaman Mahmoudi > > > > > From shma7099 at student.uu.se Sun Jun 4 16:18:54 2006 From: shma7099 at student.uu.se (Sh.M) Date: Sun, 4 Jun 2006 23:18:54 +0200 Subject: Question about MatSetValues References: <000901c687f9$c95f24a0$2516e055@bredbandsbolaget.se> <001801c687fe$251df100$2516e055@bredbandsbolaget.se> Message-ID: <002301c6881c$7c143a00$2516e055@bredbandsbolaget.se> Hi, When I now create these binary files they also create an info file. However the info file is empty. Is it supposed to be like this? With best regards, Shaman Mahmoudi ----- Original Message ----- From: "Sh.M" To: Sent: Sunday, June 04, 2006 7:41 PM Subject: Re: Question about MatSetValues > Thanks. > > I will try that. > > With best regards, Shaman Mahmoudi > > ----- Original Message ----- > From: "Barry Smith" > To: > Sent: Sunday, June 04, 2006 7:20 PM > Subject: Re: Question about MatSetValues > > > > > > Write a SEQUENTIAL program that reads in the matrix and then > > saves it with MatView() to a binary file (can do a right hand side also) > > then use ksp/ksp/examples/tutorials/ex10.c which uses MatLoad() to solve > the > > system. > > > > See for example src/mat/examples/tests/ex32.c for an example of > > sequential program for reading in ASCII matrix. Also ex34.c ex50.c also > ex78.c > > > > > > > > Barry > > > > > > On Sun, 4 Jun 2006, Sh.M wrote: > > > > > Hi, > > > > > > When using the MatSetValues function with one CPU only, it will > cache/save > > > the values locally and then distribute them to the other processes with > > > MatAssemblyBegin/MatAssemblyEnd? Is this true? What happens with the > > > cached/saved values afterwards? Are they released? Is there a way to not > > > cache/save the data locally at all? > > > > > > I am asking these questions because right now speed is not of highest > > > priority, but memory is. And unfortunately in my case I do not generate > the > > > matrix by my own and instead read it from a file obtained from "real > world" > > > data samples. > > > > > > I have read/distributed the matrix in a couple of different ways; for > > > example CPU 0 reads the file, and then calls MatSetValues.. One other > way > > > has been that CPU 0 reads the file, sends the rows that belong to the > other > > > processes to the other processes and those processes call MatSetValues > by > > > their own on the received rows. And last one is that I have split the > file > > > into several smaller files and several processes reads their own file > and > > > call MatSetValues on the data they have read from their own file. To > make it > > > more convenient for me, the number of files have been maximum number of > > > processors that I have used in my simulations. So If maximum number of > > > processors is 64, then number of files is 64. And if 8 processors are > used, > > > then each processor reads 8 files etc. > > > > > > I dont believe any of the approaches I have used are elegant... > > > > > > What would you guys do if you had a file in CSR format, and you want to > read > > > it, distribute it and then solve it if memory usage is of highest > priority? > > > > > > With best regards, Shaman Mahmoudi > > > > > > > > > From bsmith at mcs.anl.gov Sun Jun 4 17:03:17 2006 From: bsmith at mcs.anl.gov (Barry Smith) Date: Sun, 4 Jun 2006 17:03:17 -0500 (CDT) Subject: Question about MatSetValues In-Reply-To: <002301c6881c$7c143a00$2516e055@bredbandsbolaget.se> References: <000901c687f9$c95f24a0$2516e055@bredbandsbolaget.se> <001801c687fe$251df100$2516e055@bredbandsbolaget.se> <002301c6881c$7c143a00$2516e055@bredbandsbolaget.se> Message-ID: Yes, there is no info to put into it so it is empty. Barry The info file would contain "meta-data" about the matrix like block size. On Sun, 4 Jun 2006, Sh.M wrote: > Hi, > > When I now create these binary files they also create an info file. However > the info file is empty. Is it supposed to be like this? > > With best regards, Shaman Mahmoudi > > ----- Original Message ----- > From: "Sh.M" > To: > Sent: Sunday, June 04, 2006 7:41 PM > Subject: Re: Question about MatSetValues > > >> Thanks. >> >> I will try that. >> >> With best regards, Shaman Mahmoudi >> >> ----- Original Message ----- >> From: "Barry Smith" >> To: >> Sent: Sunday, June 04, 2006 7:20 PM >> Subject: Re: Question about MatSetValues >> >> >>> >>> Write a SEQUENTIAL program that reads in the matrix and then >>> saves it with MatView() to a binary file (can do a right hand side also) >>> then use ksp/ksp/examples/tutorials/ex10.c which uses MatLoad() to solve >> the >>> system. >>> >>> See for example src/mat/examples/tests/ex32.c for an example of >>> sequential program for reading in ASCII matrix. Also ex34.c ex50.c also >> ex78.c >>> >>> >>> >>> Barry >>> >>> >>> On Sun, 4 Jun 2006, Sh.M wrote: >>> >>>> Hi, >>>> >>>> When using the MatSetValues function with one CPU only, it will >> cache/save >>>> the values locally and then distribute them to the other processes > with >>>> MatAssemblyBegin/MatAssemblyEnd? Is this true? What happens with the >>>> cached/saved values afterwards? Are they released? Is there a way to > not >>>> cache/save the data locally at all? >>>> >>>> I am asking these questions because right now speed is not of highest >>>> priority, but memory is. And unfortunately in my case I do not > generate >> the >>>> matrix by my own and instead read it from a file obtained from "real >> world" >>>> data samples. >>>> >>>> I have read/distributed the matrix in a couple of different ways; for >>>> example CPU 0 reads the file, and then calls MatSetValues.. One other >> way >>>> has been that CPU 0 reads the file, sends the rows that belong to the >> other >>>> processes to the other processes and those processes call MatSetValues >> by >>>> their own on the received rows. And last one is that I have split the >> file >>>> into several smaller files and several processes reads their own file >> and >>>> call MatSetValues on the data they have read from their own file. To >> make it >>>> more convenient for me, the number of files have been maximum number > of >>>> processors that I have used in my simulations. So If maximum number of >>>> processors is 64, then number of files is 64. And if 8 processors are >> used, >>>> then each processor reads 8 files etc. >>>> >>>> I dont believe any of the approaches I have used are elegant... >>>> >>>> What would you guys do if you had a file in CSR format, and you want > to >> read >>>> it, distribute it and then solve it if memory usage is of highest >> priority? >>>> >>>> With best regards, Shaman Mahmoudi >>>> >>>> >>> >> > > From Stephen.R.Ball at awe.co.uk Mon Jun 5 06:51:53 2006 From: Stephen.R.Ball at awe.co.uk (Stephen R Ball) Date: Mon, 5 Jun 2006 12:51:53 +0100 Subject: EXTERNAL: Re: Problems using external packages Spooles and Hy pre with PETSc v2. 3.1 Message-ID: <665CtJ008628@awe.co.uk> Hi Your example runs OK, as do some of my other problems. But with some problems PETSc v2.3.1 fails while PETSc v2.3.0 works. I have attached the output from both PETSc versions for one of these problems. If you are interested, perhaps we could make arrangements for me sending you one of these problems. Regards Stephen -----Original Message----- From: Hong Zhang [mailto:hzhang at mcs.anl.gov] Sent: 02 June 2006 14:47 To: petsc-users at mcs.anl.gov Subject: EXTERNAL: Re: Problems using external packages Spooles and Hypre with PETSc v2. 3.1 Stephen, > > I am using Spooles downloaded from the PETSc ftp site and built into > PETSC_DIR/externalpackages. When solving a partcular problem I am > getting the error: > > MatFactorNumeric_MPIAIJSpooles line 199 > src/mat/impls/aij/mpi/spooles/mpispooles.c > MatLUFactorNumeric line 2200 src/mat/interface/matix.c KSPSetUp line > 183 src/ksp/ksp/interface/itfunc.c KSPSolve line 305 > src/ksp/ksp/interface/itfunc.c May I have the complete error message after the crash? Can you run ~petsc/src/ksp/ksp/examples/tutorials/ex5.c with the cmd: mpirun -np 2 ./ex5 -ksp_type preonly -pc_type lu -mat_type aijspooles? Hong > > The problem also occurs in serial. > > I am using Hypre v1.10.0b downloaded from the LLNL site and built > separatly to PETSc. When I have been using Pilut and Parasails as > either global problem preconditioners of as sub preconditioners for > ASM or BJACOBI, I have been getting errors indicating that there could > be a memory access out of range. I suspect that there may be a memory > overwrite or mismatch occuring somewhere. Note that BOOMERAMG and > EUCLID seem to work OK. Again these problems were not apparent when I > was using PETSc v2.3.0. > > Have there been any significant changes in the PETSc source that > handles Spooles and Hypre between versions 2.3.0 and 2.3.1 that could > be causing these problems? I don't really want to go back to using > PETSc v2.3.0 if I can help it. I don't know if it makes any > difference, but I am using the Fortran interface to PETSc. > > Hope you can help. > > Regards > > Stephen R. Ball > -- > ______________________________________________________________________ > _________ > > The information in this email and in any attachment(s) is commercial > in confidence. If you are not the named addressee(s) or if you receive > this email in error then any distribution, copying or use of this > communication or the information in it is strictly prohibited. Please > notify us immediately by email at admin.internet(at)awe.co.uk, and > then delete this message from your computer. While attachments are > virus checked, AWE plc does not accept any liability in respect of any > virus which is not detected. > > AWE Plc > Registered in England and Wales > Registration No 02763902 > AWE, Aldermaston, Reading, RG7 4PR > > -- _______________________________________________________________________________ The information in this email and in any attachment(s) is commercial in confidence. If you are not the named addressee(s) or if you receive this email in error then any distribution, copying or use of this communication or the information in it is strictly prohibited. Please notify us immediately by email at admin.internet(at)awe.co.uk, and then delete this message from your computer. While attachments are virus checked, AWE plc does not accept any liability in respect of any virus which is not detected. AWE Plc Registered in England and Wales Registration No 02763902 AWE, Aldermaston, Reading, RG7 4PR -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: PETSc_v2.3.0.out.txt URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: PETSc_v2.3.1.out.txt URL: From bsmith at mcs.anl.gov Mon Jun 5 11:20:40 2006 From: bsmith at mcs.anl.gov (Barry Smith) Date: Mon, 5 Jun 2006 11:20:40 -0500 (CDT) Subject: EXTERNAL: Re: Problems using external packages Spooles and Hy pre with PETSc v2. 3.1 In-Reply-To: <665CtJ008628@awe.co.uk> References: <665CtJ008628@awe.co.uk> Message-ID: Stephen, Could you send us or post for us the matrix that causes the crash? Send directly to Hong. Thanks, Barry On Mon, 5 Jun 2006, Stephen R Ball wrote: > > > > > Hi > > Your example runs OK, as do some of my other problems. But with some > problems > PETSc v2.3.1 fails while PETSc v2.3.0 works. I have attached the output from > both PETSc versions for one of these problems. If you are interested, > perhaps > we could make arrangements for me sending you one of these problems. > > Regards > > Stephen > > > > > -----Original Message----- > From: Hong Zhang [mailto:hzhang at mcs.anl.gov] > Sent: 02 June 2006 14:47 > To: petsc-users at mcs.anl.gov > Subject: EXTERNAL: Re: Problems using external packages Spooles and Hypre > with PETSc v2. 3.1 > > > Stephen, > >> >> I am using Spooles downloaded from the PETSc ftp site and built into >> PETSC_DIR/externalpackages. When solving a partcular problem I am >> getting the error: >> >> MatFactorNumeric_MPIAIJSpooles line 199 >> src/mat/impls/aij/mpi/spooles/mpispooles.c >> MatLUFactorNumeric line 2200 src/mat/interface/matix.c KSPSetUp line >> 183 src/ksp/ksp/interface/itfunc.c KSPSolve line 305 >> src/ksp/ksp/interface/itfunc.c > > May I have the complete error message after the crash? > Can you run > ~petsc/src/ksp/ksp/examples/tutorials/ex5.c > with the cmd: > > mpirun -np 2 ./ex5 -ksp_type preonly -pc_type lu -mat_type aijspooles? > > Hong > >> >> The problem also occurs in serial. >> >> I am using Hypre v1.10.0b downloaded from the LLNL site and built >> separatly to PETSc. When I have been using Pilut and Parasails as >> either global problem preconditioners of as sub preconditioners for >> ASM or BJACOBI, I have been getting errors indicating that there could >> be a memory access out of range. I suspect that there may be a memory >> overwrite or mismatch occuring somewhere. Note that BOOMERAMG and >> EUCLID seem to work OK. Again these problems were not apparent when I >> was using PETSc v2.3.0. >> >> Have there been any significant changes in the PETSc source that >> handles Spooles and Hypre between versions 2.3.0 and 2.3.1 that could >> be causing these problems? I don't really want to go back to using >> PETSc v2.3.0 if I can help it. I don't know if it makes any >> difference, but I am using the Fortran interface to PETSc. >> >> Hope you can help. >> >> Regards >> >> Stephen R. Ball >> -- >> ______________________________________________________________________ >> _________ >> >> The information in this email and in any attachment(s) is commercial >> in confidence. If you are not the named addressee(s) or if you receive >> this email in error then any distribution, copying or use of this >> communication or the information in it is strictly prohibited. Please >> notify us immediately by email at admin.internet(at)awe.co.uk, and >> then delete this message from your computer. While attachments are >> virus checked, AWE plc does not accept any liability in respect of any >> virus which is not detected. >> >> AWE Plc >> Registered in England and Wales >> Registration No 02763902 >> AWE, Aldermaston, Reading, RG7 4PR >> >> > > > -- > _______________________________________________________________________________ > > The information in this email and in any attachment(s) is commercial in confidence. If you are not the named addressee(s) or if you receive this email in error then any distribution, copying or use of this communication or the information in it is strictly prohibited. Please notify us immediately by email at admin.internet(at)awe.co.uk, and then delete this message from your computer. While attachments are virus checked, AWE plc does not accept any liability in respect of any virus which is not detected. > > AWE Plc > Registered in England and Wales > Registration No 02763902 > AWE, Aldermaston, Reading, RG7 4PR > From Stephen.R.Ball at awe.co.uk Tue Jun 6 09:28:40 2006 From: Stephen.R.Ball at awe.co.uk (Stephen R Ball) Date: Tue, 6 Jun 2006 15:28:40 +0100 Subject: EXTERNAL: RE: EXTERNAL: Re: Problems using external packages Spooles and Hy pre with PETSc v2. 3.1 Message-ID: <666FUA012365@awe.co.uk> Hi Yes, I will post you the problem on CD. Can you give me the full postal address I should mail it to. Regards Stephen -----Original Message----- From: Barry Smith [mailto:bsmith at mcs.anl.gov] Sent: 05 June 2006 17:21 To: petsc-users at mcs.anl.gov Subject: EXTERNAL: RE: EXTERNAL: Re: Problems using external packages Spooles and Hy pre with PETSc v2. 3.1 Stephen, Could you send us or post for us the matrix that causes the crash? Send directly to Hong. Thanks, Barry On Mon, 5 Jun 2006, Stephen R Ball wrote: > > > > > Hi > > Your example runs OK, as do some of my other problems. But with some > problems PETSc v2.3.1 fails while PETSc v2.3.0 works. I have attached > the output from both PETSc versions for one of these problems. If you > are interested, perhaps > we could make arrangements for me sending you one of these problems. > > Regards > > Stephen > > > > > -----Original Message----- > From: Hong Zhang [mailto:hzhang at mcs.anl.gov] > Sent: 02 June 2006 14:47 > To: petsc-users at mcs.anl.gov > Subject: EXTERNAL: Re: Problems using external packages Spooles and > Hypre with PETSc v2. 3.1 > > > Stephen, > >> >> I am using Spooles downloaded from the PETSc ftp site and built into >> PETSC_DIR/externalpackages. When solving a partcular problem I am >> getting the error: >> >> MatFactorNumeric_MPIAIJSpooles line 199 >> src/mat/impls/aij/mpi/spooles/mpispooles.c >> MatLUFactorNumeric line 2200 src/mat/interface/matix.c KSPSetUp line >> 183 src/ksp/ksp/interface/itfunc.c KSPSolve line 305 >> src/ksp/ksp/interface/itfunc.c > > May I have the complete error message after the crash? > Can you run > ~petsc/src/ksp/ksp/examples/tutorials/ex5.c > with the cmd: > > mpirun -np 2 ./ex5 -ksp_type preonly -pc_type lu -mat_type aijspooles? > > Hong > >> >> The problem also occurs in serial. >> >> I am using Hypre v1.10.0b downloaded from the LLNL site and built >> separatly to PETSc. When I have been using Pilut and Parasails as >> either global problem preconditioners of as sub preconditioners for >> ASM or BJACOBI, I have been getting errors indicating that there >> could be a memory access out of range. I suspect that there may be a >> memory overwrite or mismatch occuring somewhere. Note that BOOMERAMG >> and EUCLID seem to work OK. Again these problems were not apparent >> when I was using PETSc v2.3.0. >> >> Have there been any significant changes in the PETSc source that >> handles Spooles and Hypre between versions 2.3.0 and 2.3.1 that could >> be causing these problems? I don't really want to go back to using >> PETSc v2.3.0 if I can help it. I don't know if it makes any >> difference, but I am using the Fortran interface to PETSc. >> >> Hope you can help. >> >> Regards >> >> Stephen R. Ball >> -- >> _____________________________________________________________________ >> _ >> _________ >> >> The information in this email and in any attachment(s) is commercial >> in confidence. If you are not the named addressee(s) or if you >> receive this email in error then any distribution, copying or use of >> this communication or the information in it is strictly prohibited. >> Please notify us immediately by email at admin.internet(at)awe.co.uk, >> and then delete this message from your computer. While attachments >> are virus checked, AWE plc does not accept any liability in respect >> of any virus which is not detected. >> >> AWE Plc >> Registered in England and Wales >> Registration No 02763902 >> AWE, Aldermaston, Reading, RG7 4PR >> >> > > > -- > ______________________________________________________________________ > _________ > > The information in this email and in any attachment(s) is commercial > in confidence. If you are not the named addressee(s) or if you receive > this email in error then any distribution, copying or use of this > communication or the information in it is strictly prohibited. Please > notify us immediately by email at admin.internet(at)awe.co.uk, and > then delete this message from your computer. While attachments are > virus checked, AWE plc does not accept any liability in respect of any > virus which is not detected. > > AWE Plc > Registered in England and Wales > Registration No 02763902 > AWE, Aldermaston, Reading, RG7 4PR > -- _______________________________________________________________________________ The information in this email and in any attachment(s) is commercial in confidence. If you are not the named addressee(s) or if you receive this email in error then any distribution, copying or use of this communication or the information in it is strictly prohibited. Please notify us immediately by email at admin.internet(at)awe.co.uk, and then delete this message from your computer. While attachments are virus checked, AWE plc does not accept any liability in respect of any virus which is not detected. AWE Plc Registered in England and Wales Registration No 02763902 AWE, Aldermaston, Reading, RG7 4PR From picard2 at llnl.gov Tue Jun 6 11:21:32 2006 From: picard2 at llnl.gov (Christophe Picard) Date: Tue, 6 Jun 2006 09:21:32 -0700 Subject: Support for viewers Message-ID: <200606060921.32148.picard2@llnl.gov> Hello, I am new to PETSC. I am writting a 3D code based on PETSC, and I would like to output the data to SILO format to use with VISIT (visualization tool). How do I compile my code to do that? I have SILO installed in some custom directory. But I don't know how to tell PETSC where to find SILO. This is the error message I have now: [0]PETSC ERROR: Unknown PetscViewer type given: silo! [0]PETSC ERROR: VecView_MPI() line 778 in src/vec/vec/impls/mpi/pdvec.c [0]PETSC ERROR: No support for this operation for this object type! [0]PETSC ERROR: Viewer type (null) not supported for this object! [0]PETSC ERROR: VecView() line 708 in src/vec/vec/interface/vector.c [0]PETSC ERROR: VecView_MPI_DA() line 424 in src/dm/da/src/gr2.c [0]PETSC ERROR: VecView() line 708 in src/vec/vec/interface/vector.c [0]PETSC ERROR: PetscViewerSetType() line 91 insrc/sys/viewer/interface/viewreg .c Actually, the same question is valid for HDF and NETCDF formats. Thank you for your help. Christophe From balay at mcs.anl.gov Tue Jun 6 11:33:34 2006 From: balay at mcs.anl.gov (Satish Balay) Date: Tue, 6 Jun 2006 11:33:34 -0500 (CDT) Subject: EXTERNAL: RE: EXTERNAL: Re: Problems using external packages Spooles and Hy pre with PETSc v2. 3.1 In-Reply-To: <666FUA012365@awe.co.uk> References: <666FUA012365@awe.co.uk> Message-ID: I think Barry ment to e-mail to petsc-maint or hzhang [@mcs.anl.gov] How big is the file? It it is very big [and not suitable for e-mail] then you can upload it to ftp://ftp.mcs.anl.gov/incoming [and send us e-mail with the name of the file] Satish On Tue, 6 Jun 2006, Stephen R Ball wrote: > > > Hi > > Yes, I will post you the problem on CD. Can you give me the full postal > address I should mail it to. > > Regards > > Stephen > > > > -----Original Message----- > From: Barry Smith [mailto:bsmith at mcs.anl.gov] > Sent: 05 June 2006 17:21 > To: petsc-users at mcs.anl.gov > Subject: EXTERNAL: RE: EXTERNAL: Re: Problems using external packages > Spooles and Hy pre with PETSc v2. 3.1 > > > Stephen, > > Could you send us or post for us the matrix that causes the crash? Send > directly to Hong. > > Thanks, > > Barry > > > On Mon, 5 Jun 2006, Stephen R Ball wrote: > > > > > > > > > > > Hi > > > > Your example runs OK, as do some of my other problems. But with some > > problems PETSc v2.3.1 fails while PETSc v2.3.0 works. I have attached > > the output from both PETSc versions for one of these problems. If you > > are interested, perhaps > > we could make arrangements for me sending you one of these problems. > > > > Regards > > > > Stephen > > > > > > > > > > -----Original Message----- > > From: Hong Zhang [mailto:hzhang at mcs.anl.gov] > > Sent: 02 June 2006 14:47 > > To: petsc-users at mcs.anl.gov > > Subject: EXTERNAL: Re: Problems using external packages Spooles and > > Hypre with PETSc v2. 3.1 > > > > > > Stephen, > > > >> > >> I am using Spooles downloaded from the PETSc ftp site and built into > >> PETSC_DIR/externalpackages. When solving a partcular problem I am > >> getting the error: > >> > >> MatFactorNumeric_MPIAIJSpooles line 199 > >> src/mat/impls/aij/mpi/spooles/mpispooles.c > >> MatLUFactorNumeric line 2200 src/mat/interface/matix.c KSPSetUp line > >> 183 src/ksp/ksp/interface/itfunc.c KSPSolve line 305 > >> src/ksp/ksp/interface/itfunc.c > > > > May I have the complete error message after the crash? > > Can you run > > ~petsc/src/ksp/ksp/examples/tutorials/ex5.c > > with the cmd: > > > > mpirun -np 2 ./ex5 -ksp_type preonly -pc_type lu -mat_type aijspooles? > > > > Hong > > > >> > >> The problem also occurs in serial. > >> > >> I am using Hypre v1.10.0b downloaded from the LLNL site and built > >> separatly to PETSc. When I have been using Pilut and Parasails as > >> either global problem preconditioners of as sub preconditioners for > >> ASM or BJACOBI, I have been getting errors indicating that there > >> could be a memory access out of range. I suspect that there may be a > >> memory overwrite or mismatch occuring somewhere. Note that BOOMERAMG > >> and EUCLID seem to work OK. Again these problems were not apparent > >> when I was using PETSc v2.3.0. > >> > >> Have there been any significant changes in the PETSc source that > >> handles Spooles and Hypre between versions 2.3.0 and 2.3.1 that could > >> be causing these problems? I don't really want to go back to using > >> PETSc v2.3.0 if I can help it. I don't know if it makes any > >> difference, but I am using the Fortran interface to PETSc. > >> > >> Hope you can help. > >> > >> Regards > >> > >> Stephen R. Ball > >> -- > >> _____________________________________________________________________ > >> _ > >> _________ > >> > >> The information in this email and in any attachment(s) is commercial > >> in confidence. If you are not the named addressee(s) or if you > >> receive this email in error then any distribution, copying or use of > >> this communication or the information in it is strictly prohibited. > >> Please notify us immediately by email at admin.internet(at)awe.co.uk, > >> and then delete this message from your computer. While attachments > >> are virus checked, AWE plc does not accept any liability in respect > >> of any virus which is not detected. > >> > >> AWE Plc > >> Registered in England and Wales > >> Registration No 02763902 > >> AWE, Aldermaston, Reading, RG7 4PR > >> > >> > > > > > > -- > > ______________________________________________________________________ > > _________ > > > > The information in this email and in any attachment(s) is commercial > > in confidence. If you are not the named addressee(s) or if you receive > > this email in error then any distribution, copying or use of this > > communication or the information in it is strictly prohibited. Please > > notify us immediately by email at admin.internet(at)awe.co.uk, and > > then delete this message from your computer. While attachments are > > virus checked, AWE plc does not accept any liability in respect of any > > virus which is not detected. > > > > AWE Plc > > Registered in England and Wales > > Registration No 02763902 > > AWE, Aldermaston, Reading, RG7 4PR > > > -- > _______________________________________________________________________________ > > The information in this email and in any attachment(s) is commercial in confidence. If you are not the named addressee(s) or if you receive this email in error then any distribution, copying or use of this communication or the information in it is strictly prohibited. Please notify us immediately by email at admin.internet(at)awe.co.uk, and then delete this message from your computer. While attachments are virus checked, AWE plc does not accept any liability in respect of any virus which is not detected. > > AWE Plc > Registered in England and Wales > Registration No 02763902 > AWE, Aldermaston, Reading, RG7 4PR > > From knepley at gmail.com Tue Jun 6 15:15:52 2006 From: knepley at gmail.com (Matthew Knepley) Date: Tue, 6 Jun 2006 15:15:52 -0500 Subject: Support for viewers In-Reply-To: <200606060921.32148.picard2@llnl.gov> References: <200606060921.32148.picard2@llnl.gov> Message-ID: I wrote the SILO viewer long ago when I had an experimental mesh format, but I stopped supporting it. We could try and help you get it coded yourself, but since it depends on a mesh and we are really busy, it is unlikely it will get done by us anytime soon. Matt On 6/6/06, Christophe Picard wrote: > > Hello, > > I am new to PETSC. I am writting a 3D code based on PETSC, and I > would like to output the data to SILO format to use with VISIT > (visualization > tool). How do I > compile my code to do that? > I have SILO installed in some custom directory. But I don't know how to > tell > PETSC where to find SILO. > > This is the error message I have now: > [0]PETSC ERROR: Unknown PetscViewer type given: silo! > [0]PETSC ERROR: VecView_MPI() line 778 in src/vec/vec/impls/mpi/pdvec.c > [0]PETSC ERROR: No support for this operation for this object type! > [0]PETSC ERROR: Viewer type (null) not supported for this object! > [0]PETSC ERROR: VecView() line 708 in src/vec/vec/interface/vector.c > [0]PETSC ERROR: VecView_MPI_DA() line 424 in src/dm/da/src/gr2.c > [0]PETSC ERROR: VecView() line 708 in src/vec/vec/interface/vector.c > [0]PETSC ERROR: PetscViewerSetType() line 91 > insrc/sys/viewer/interface/viewreg .c > > Actually, the same question is valid for HDF and NETCDF formats. > > Thank you for your help. > Christophe > > -- "Failure has a thousand explanations. Success doesn't need one" -- Sir Alec Guiness -------------- next part -------------- An HTML attachment was scrubbed... URL: From picard2 at llnl.gov Tue Jun 6 15:36:39 2006 From: picard2 at llnl.gov (Christophe Picard) Date: Tue, 6 Jun 2006 13:36:39 -0700 Subject: Support for viewers In-Reply-To: References: <200606060921.32148.picard2@llnl.gov> Message-ID: <200606061336.39182.picard2@llnl.gov> Thank you for your answer. I will write it by including SILO header files directly into my code instead of using PETSC viewers. I am dealing with structured meshes, so it shouldn't be to hard. Christophe On Tuesday 06 June 2006 01:15 pm, Matthew Knepley wrote: > I wrote the SILO viewer long ago when I had an experimental mesh > format, but I stopped supporting it. We could try and help you get > it coded yourself, but since it depends on a mesh and we are really > busy, it is unlikely it will get done by us anytime soon. > > Matt > > On 6/6/06, Christophe Picard wrote: > > Hello, > > > > I am new to PETSC. I am writting a 3D code based on PETSC, and I > > would like to output the data to SILO format to use with VISIT > > (visualization > > tool). How do I > > compile my code to do that? > > I have SILO installed in some custom directory. But I don't know how to > > tell > > PETSC where to find SILO. > > > > This is the error message I have now: > > [0]PETSC ERROR: Unknown PetscViewer type given: silo! > > [0]PETSC ERROR: VecView_MPI() line 778 in src/vec/vec/impls/mpi/pdvec.c > > [0]PETSC ERROR: No support for this operation for this object type! > > [0]PETSC ERROR: Viewer type (null) not supported for this object! > > [0]PETSC ERROR: VecView() line 708 in src/vec/vec/interface/vector.c > > [0]PETSC ERROR: VecView_MPI_DA() line 424 in src/dm/da/src/gr2.c > > [0]PETSC ERROR: VecView() line 708 in src/vec/vec/interface/vector.c > > [0]PETSC ERROR: PetscViewerSetType() line 91 > > insrc/sys/viewer/interface/viewreg .c > > > > Actually, the same question is valid for HDF and NETCDF formats. > > > > Thank you for your help. > > Christophe From gudik at ae.metu.edu.tr Wed Jun 7 06:54:00 2006 From: gudik at ae.metu.edu.tr (Evrim Dizemen) Date: Wed, 07 Jun 2006 14:54:00 +0300 Subject: Matrix input file format In-Reply-To: References: <447D4847.5030007@ae.metu.edu.tr> Message-ID: <4486BE58.4030207@ae.metu.edu.tr> Hi all, First thanks for your comments. I still have the same problem but i agree with you all that reading a matrix from a file is not parallel programming. So i wonder if you can recommend an efficient and faster way to read a 30000x30000 sparse matrix where i got those values from my fortran code on aeroacoustics similation. I tried calling MatSetValues as i attached below. I found that way from the ex11f.F in the matrix examples and not sure if it is appropriate for my situation. ! do, i=1,n ! do, j=1,n ! value=Aval(i,j) ! if(value .ne. 0)then ! l=i-1 ! m=j-1 ! call MatSetValues(A,1,l,1,m,value,INSERT_VALUES,ierr) ! endif ! enddo ! enddo Thanks soooooo much EVRIM From gudik at ae.metu.edu.tr Wed Jun 7 07:38:14 2006 From: gudik at ae.metu.edu.tr (Evrim Dizemen) Date: Wed, 07 Jun 2006 15:38:14 +0300 Subject: Matrix input file format In-Reply-To: <4486BE58.4030207@ae.metu.edu.tr> References: <447D4847.5030007@ae.metu.edu.tr> <4486BE58.4030207@ae.metu.edu.tr> Message-ID: <4486C8B6.5030809@ae.metu.edu.tr> Additionally, I want to enter the components of A matrix and the rhs vector as double complex. So how can build the libraries in double complex. As far as i can see there is only --with-scalar-type=complex option during compiling petsc. Thanks EVRIM From knepley at gmail.com Wed Jun 7 08:30:52 2006 From: knepley at gmail.com (Matthew Knepley) Date: Wed, 7 Jun 2006 08:30:52 -0500 Subject: Matrix input file format In-Reply-To: <4486BE58.4030207@ae.metu.edu.tr> References: <447D4847.5030007@ae.metu.edu.tr> <4486BE58.4030207@ae.metu.edu.tr> Message-ID: On 6/7/06, Evrim Dizemen wrote: > > Hi all, > > First thanks for your comments. I still have the same problem but i > agree with you all that reading a matrix from a file is not parallel > programming. So i wonder if you can recommend an efficient and faster > way to read a 30000x30000 sparse matrix where i got those values from my > fortran code on aeroacoustics similation. I tried calling MatSetValues > as i attached below. I found that way from the ex11f.F in the matrix > examples and not sure if it is appropriate for my situation. > > ! do, i=1,n > ! do, j=1,n > ! value=Aval(i,j) > ! if(value .ne. 0)then > ! l=i-1 > ! m=j-1 > ! call MatSetValues(A,1,l,1,m,value,INSERT_VALUES,ierr) > ! endif > ! enddo > ! enddo > > Thanks soooooo much 1) You should set an entire row at a time at least, not a single value 2) You need to preallocate the matrix for good performance: http://www-unix.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/Mat/MatMPIAIJSetPreallocation.html 3) You are here setting all values from one process. You should do as Randy suggests and set only the values which are owned by each process. 4) I would consult an example, such as: http://www-unix.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/src/ksp/ksp/examples/tutorials/ex2.c.html Matt EVRIM > -- "Failure has a thousand explanations. Success doesn't need one" -- Sir Alec Guiness -------------- next part -------------- An HTML attachment was scrubbed... URL: From bsmith at mcs.anl.gov Wed Jun 7 11:32:52 2006 From: bsmith at mcs.anl.gov (Barry Smith) Date: Wed, 7 Jun 2006 11:32:52 -0500 (CDT) Subject: Matrix input file format In-Reply-To: <4486C8B6.5030809@ae.metu.edu.tr> References: <447D4847.5030007@ae.metu.edu.tr> <4486BE58.4030207@ae.metu.edu.tr> <4486C8B6.5030809@ae.metu.edu.tr> Message-ID: The TYPE is complex, the precision is set seperately with --with-precision. By default precision is double so you are all set. Barry On Wed, 7 Jun 2006, Evrim Dizemen wrote: > Additionally, > > I want to enter the components of A matrix and the rhs vector as double > complex. So how can build the libraries in double complex. As far as i can > see there is only --with-scalar-type=complex option during compiling petsc. > > Thanks > > EVRIM > > From bsmith at mcs.anl.gov Wed Jun 7 11:35:36 2006 From: bsmith at mcs.anl.gov (Barry Smith) Date: Wed, 7 Jun 2006 11:35:36 -0500 (CDT) Subject: Matrix input file format In-Reply-To: <4486BE58.4030207@ae.metu.edu.tr> References: <447D4847.5030007@ae.metu.edu.tr> <4486BE58.4030207@ae.metu.edu.tr> Message-ID: http://www-unix.mcs.anl.gov/web-mail-archive/lists/petsc-users/2006/06/msg00012.html which can be reached from http://www-unix.mcs.anl.gov/web-mail-archive/lists/petsc-users/2006/06/threads.html Barry On Wed, 7 Jun 2006, Evrim Dizemen wrote: > Hi all, > > First thanks for your comments. I still have the same problem but i agree > with you all that reading a matrix from a file is not parallel programming. > So i wonder if you can recommend an efficient and faster way to read a > 30000x30000 sparse matrix where i got those values from my fortran code on > aeroacoustics similation. I tried calling MatSetValues as i attached below. I > found that way from the ex11f.F in the matrix examples and not sure if it is > appropriate for my situation. > > ! do, i=1,n > ! do, j=1,n > ! value=Aval(i,j) > ! if(value .ne. 0)then > ! l=i-1 > ! m=j-1 > ! call MatSetValues(A,1,l,1,m,value,INSERT_VALUES,ierr) > ! endif > ! enddo > ! enddo > > Thanks soooooo much > > EVRIM > > > > From Stephen.R.Ball at awe.co.uk Fri Jun 9 04:59:12 2006 From: Stephen.R.Ball at awe.co.uk (Stephen R Ball) Date: Fri, 9 Jun 2006 10:59:12 +0100 Subject: IS routines without a Fortran interface Message-ID: <669B05001748@awe.co.uk> Hi I am keen to use some of the indexing IS routines in my Fortan code but have discovered that several of them do not have a Fortran interface. In particular I would like to use ISLocalToGlobalMappingGetInfo() and ISLocalToGlobalMappingRestoreInfo(). Would it be possible for you to include these, and possibly any other missing IS routines not having a Fortran interface, in PETSc v2.3.1 as a new patch version. Regards Stephen -- _______________________________________________________________________________ The information in this email and in any attachment(s) is commercial in confidence. If you are not the named addressee(s) or if you receive this email in error then any distribution, copying or use of this communication or the information in it is strictly prohibited. Please notify us immediately by email at admin.internet(at)awe.co.uk, and then delete this message from your computer. While attachments are virus checked, AWE plc does not accept any liability in respect of any virus which is not detected. AWE Plc Registered in England and Wales Registration No 02763902 AWE, Aldermaston, Reading, RG7 4PR From jordi.marce at upc.edu Fri Jun 9 06:51:18 2006 From: jordi.marce at upc.edu (=?ISO-8859-1?Q?Jordi_Marc=E9_Nogu=E9?=) Date: Fri, 09 Jun 2006 13:51:18 +0200 Subject: On entry to DGEMV parameter number 6 had an illegal value Message-ID: <448960B6.7000104@upc.edu> Hi! When I'm running my code in the screen appears this message: "** On entry to DGEMV parameter number 6 had an illegal value" I've tried to find information in internet but I haven't found a link which apperas this message and a PetsC information. Is this problem from PetsC? What's happens? Thanks, jordi -- Jordi Marc?-Nogu? Dept. Resist?ncia de Materials i Estructures a l'Enginyeria Universitat Polit?cnica de Catalunya (UPC) Edifici T45 - despatx 137 ETSEIAT (Terrassa) phone: +34 937 398 728 mail: jordi.marce at upc.edu From jordi.marce at Upc.Edu Fri Jun 9 07:57:53 2006 From: jordi.marce at Upc.Edu (=?ISO-8859-1?Q?Jordi_Marc=E9_Nogu=E9?=) Date: Fri, 09 Jun 2006 14:57:53 +0200 Subject: On entry to DGEMV parameter number 6 had an illegal value In-Reply-To: <448960B6.7000104@upc.edu> References: <448960B6.7000104@upc.edu> Message-ID: <44897051.7090006@upc.edu> Ups! I've forgotten. This happens in the line "KSPSolve(solve);" :-) En/na owner-petsc-users at mcs.anl.gov ha escrit: > Hi! > > When I'm running my code in the screen appears this message: "** On > entry to DGEMV parameter number 6 had an illegal value" > > I've tried to find information in internet but I haven't found a link > which apperas this message and a PetsC information. Is this problem from > PetsC? What's happens? > > Thanks, > jordi -- Jordi Marc?-Nogu? Dept. Resist?ncia de Materials i Estructures a l'Enginyeria Universitat Polit?cnica de Catalunya (UPC) Edifici T45 - despatx 137 ETSEIAT (Terrassa) phone: +34 937 398 728 mail: jordi.marce at upc.edu From knepley at gmail.com Fri Jun 9 10:36:06 2006 From: knepley at gmail.com (Matthew Knepley) Date: Fri, 9 Jun 2006 10:36:06 -0500 Subject: On entry to DGEMV parameter number 6 had an illegal value In-Reply-To: <44897051.7090006@upc.edu> References: <448960B6.7000104@upc.edu> <44897051.7090006@upc.edu> Message-ID: Okay, first this probably happens because the Fortran string handling in the BLAS library is different from PETSc. This is probably because they were compiled with different Fortran compilers. The solution is usually to use --download-f-blaslapack in configure. However, configure should catch this error. Can you send me the configure.log? Thanks, Matt On 6/9/06, Jordi Marc? Nogu? wrote: > > Ups! I've forgotten. > > This happens in the line "KSPSolve(solve);" > > :-) > > > > > En/na owner-petsc-users at mcs.anl.gov ha escrit: > > Hi! > > > > When I'm running my code in the screen appears this message: "** On > > entry to DGEMV parameter number 6 had an illegal value" > > > > I've tried to find information in internet but I haven't found a link > > which apperas this message and a PetsC information. Is this problem from > > PetsC? What's happens? > > > > Thanks, > > jordi > > > -- > Jordi Marc?-Nogu? > Dept. Resist?ncia de Materials i Estructures a l'Enginyeria > Universitat Polit?cnica de Catalunya (UPC) > > Edifici T45 - despatx 137 > ETSEIAT (Terrassa) > > phone: +34 937 398 728 > mail: jordi.marce at upc.edu > > -- "Failure has a thousand explanations. Success doesn't need one" -- Sir Alec Guiness -------------- next part -------------- An HTML attachment was scrubbed... URL: From randy at geosystem.us Fri Jun 9 15:45:55 2006 From: randy at geosystem.us (Randall Mackie) Date: Fri, 09 Jun 2006 13:45:55 -0700 Subject: BCGS -ell Message-ID: <4489DE03.5090203@geosystem.us> I've been trying the BCGSL KSP solver, and I'm quite impressed as it seems to work very well. When I set a maximum, of say, 3 iterations, I get the following output: 0 KSP preconditioned resid norm 9.757142002171e-03 true resid norm 3.053549220804e+11 2 KSP preconditioned resid norm 9.950207052910e-03 true resid norm 2.907891952886e+11 2 KSP preconditioned resid norm 9.504746131013e-03 true resid norm 6.579636683382e+11 If I use any other KSP method, such as BCGS, I get: 0 KSP preconditioned resid norm 2.549077299276e-02 true resid norm 3.452610202150e+12 1 KSP preconditioned resid norm 1.567856172211e-02 true resid norm 4.186189492208e+11 2 KSP preconditioned resid norm 1.591051406166e-02 true resid norm 3.679106968172e+11 3 KSP preconditioned resid norm 1.633366526640e-02 true resid norm 3.656300865397e+11 Is this a bug in the BCGSL routine, or is this the expected behavior? Thanks, Randy -- Randall Mackie GSY-USA, Inc. PMB# 643 2261 Market St., San Francisco, CA 94114-1600 Tel (415) 469-8649 Fax (415) 469-5044 California Registered Geophysicist License No. GP 1034 From bsmith at mcs.anl.gov Fri Jun 9 19:52:15 2006 From: bsmith at mcs.anl.gov (Barry Smith) Date: Fri, 9 Jun 2006 19:52:15 -0500 (CDT) Subject: On entry to DGEMV parameter number 6 had an illegal value In-Reply-To: <44897051.7090006@upc.edu> References: <448960B6.7000104@upc.edu> <44897051.7090006@upc.edu> Message-ID: This an error message from BLAS. BLAS has a terrible model for error handling; it just prints a message to screen that you cannot control and does not return an error code :-( Are you 1) using a BAIJ matrix with a block size bigger than 8? 2) the bcgsl KSP solver or 3) dense matrices (how do you create the dense matrix?) 4) are you using 64bit integers (very unlikely) The best thing to do is run in the debugger to see when/where/why this is happening. Barry On Fri, 9 Jun 2006, Jordi Marc? Nogu? wrote: > Ups! I've forgotten. > > This happens in the line "KSPSolve(solve);" > > :-) > > > > > En/na owner-petsc-users at mcs.anl.gov ha escrit: >> Hi! >> >> When I'm running my code in the screen appears this message: "** On entry >> to DGEMV parameter number 6 had an illegal value" >> >> I've tried to find information in internet but I haven't found a link which >> apperas this message and a PetsC information. Is this problem from PetsC? >> What's happens? >> >> Thanks, >> jordi > > > From bsmith at mcs.anl.gov Fri Jun 9 20:20:31 2006 From: bsmith at mcs.anl.gov (Barry Smith) Date: Fri, 9 Jun 2006 20:20:31 -0500 (CDT) Subject: BCGS -ell In-Reply-To: <4489DE03.5090203@geosystem.us> References: <4489DE03.5090203@geosystem.us> Message-ID: On Fri, 9 Jun 2006, Randall Mackie wrote: > I've been trying the BCGSL KSP solver, and I'm quite impressed as it seems to > work > very well. > > When I set a maximum, of say, 3 iterations, I get the following output: > > 0 KSP preconditioned resid norm 9.757142002171e-03 true resid norm 3.053549220804e+11 > 2 KSP preconditioned resid norm 9.950207052910e-03 true resid norm 2.907891952886e+11 > 2 KSP preconditioned resid norm 9.504746131013e-03 true resid norm 6.579636683382e+11 ^^^^ this is not so good the residual is getting worse. > > > If I use any other KSP method, such as BCGS, I get: > > 0 KSP preconditioned resid norm 2.549077299276e-02 true resid norm > 3.452610202150e+12 > 1 KSP preconditioned resid norm 1.567856172211e-02 true resid norm > 4.186189492208e+11 > 2 KSP preconditioned resid norm 1.591051406166e-02 true resid norm > 3.679106968172e+11 > 3 KSP preconditioned resid norm 1.633366526640e-02 true resid norm > 3.656300865397e+11 > Hmm, I think it should have the same initial preconditioned residual. The BCGSL is a "contributed" solver, I don't know much about it. Barry > > Is this a bug in the BCGSL routine, or is this the expected behavior? > > Thanks, Randy > > > From bsmith at mcs.anl.gov Sat Jun 10 23:12:54 2006 From: bsmith at mcs.anl.gov (Barry Smith) Date: Sat, 10 Jun 2006 23:12:54 -0500 (CDT) Subject: IS routines without a Fortran interface In-Reply-To: <669B05001748@awe.co.uk> References: <669B05001748@awe.co.uk> Message-ID: Stephen, The difficulty with this routine is that it returns an array (the procs and numprocs argument) and an array of arrays (2d array) as the last argument. Returning 2d arrays from C to Fortran is not doable. Thus I have devised a slightly different calling sequence for Fortran; Fortran Usage: $ ISLocalToGlobalMpngGetInfoSize(ISLocalToGlobalMapping,PetscInt nproc,PetscInt numprocmax,ierr) followed by $ ISLocalToGlobalMappingGetInfo(ISLocalToGlobalMapping,PetscInt nproc, PetscInt procs[nproc],PetscInt numprocs[nproc], PetscInt indices[nproc][numprocmax],ierr) There is no ISLocalToGlobalMappingRestoreInfo() in Fortran. You must make sure that procs[], numprocs[] and indices[][] are large enough arrays, either by allocating them dynamically or defining static ones large enough. Attached is the new code, just drop it into src/vec/is/utisl/ftn-custom to replace the current zisltogf.c and run "make lib shared" in that directory. Please let us know if you have any difficulties with it, Barry On Fri, 9 Jun 2006, Stephen R Ball wrote: > > > Hi > > I am keen to use some of the indexing IS routines in my Fortan code but have > discovered that several of them do not have a Fortran interface. In > particular I would like to use ISLocalToGlobalMappingGetInfo() and > ISLocalToGlobalMappingRestoreInfo(). Would it be possible for you to include > these, and possibly any other missing IS routines not having a Fortran > interface, in PETSc v2.3.1 as a new patch version. > > Regards > > Stephen > -- > _______________________________________________________________________________ > > The information in this email and in any attachment(s) is commercial in confidence. If you are not the named addressee(s) or if you receive this email in error then any distribution, copying or use of this communication or the information in it is strictly prohibited. Please notify us immediately by email at admin.internet(at)awe.co.uk, and then delete this message from your computer. While attachments are virus checked, AWE plc does not accept any liability in respect of any virus which is not detected. > > AWE Plc > Registered in England and Wales > Registration No 02763902 > AWE, Aldermaston, Reading, RG7 4PR > > -------------- next part -------------- #include "zpetsc.h" #include "petscis.h" #if defined(PETSC_HAVE_FORTRAN_CAPS) #define islocaltoglobalmappingview_ ISLOCALTOGLOBALMAPPINGVIEW #define islocaltoglobalmpnggetinfosize_ ISLOCALTOGLOBALMPNGGETINFOSIZE #define islocaltoglobalmappinggetinfo_ ISLOCALTOGLOBALMAPPINGGETINFO #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) #define islocaltoglobalmappingview_ islocaltoglobalmappingview #define islocaltoglobalmpnggetinfosize_ islocaltoglobalmpnggetinfosize #define islocaltoglobalmappinggetinfo_ islocaltoglobalmappinggetinfo #endif EXTERN_C_BEGIN void PETSC_STDCALL islocaltoglobalmappingview_(ISLocalToGlobalMapping *mapping,PetscViewer *viewer,PetscErrorCode *ierr) { PetscViewer v; PetscPatchDefaultViewers_Fortran(viewer,v); *ierr = ISLocalToGlobalMappingView(*mapping,v); } static PetscInt *sprocs, *snumprocs, **sindices; static PetscTruth called; void PETSC_STDCALL islocaltoglobalmpnggetinfosize_(ISLocalToGlobalMapping *mapping,PetscInt *nprocs,PetscInt *maxnumprocs,PetscErrorCode *ierr) { PetscInt i; if (!called) {*ierr = PETSC_ERR_ARG_WRONGSTATE; return;} *ierr = ISLocalToGlobalMappingGetInfo(*mapping,nprocs,&sprocs,&snumprocs,&sindices); if (*ierr) return; *maxnumprocs = 0; for (i=0; i<*nprocs; i++) { *maxnumprocs = PetscMax(*maxnumprocs,snumprocs[i]); } called = PETSC_TRUE; } void PETSC_STDCALL islocaltoglobalmappinggetinfo_(ISLocalToGlobalMapping *mapping,PetscInt *nprocs,PetscInt *procs,PetscInt *numprocs, PetscInt *indices,PetscErrorCode *ierr) { PetscInt i,j; if (!called) {*ierr = PETSC_ERR_ARG_WRONGSTATE; return;} *ierr = PetscMemcpy(procs,sprocs,*nprocs*sizeof(PetscInt)); if (*ierr) return; *ierr = PetscMemcpy(numprocs,snumprocs,*nprocs*sizeof(PetscInt)); if (*ierr) return; for (i=0; i<*nprocs; i++) { for (j=0; j Hi I have rebuilt PETSc using your new zisltogf.c. However, ISLocalToGlobalMpngGetInfoSize() does not appear to work for me. It seems to jump out at line 28: if (!called) {*ierr = PETSC_ERR_ARG_WRONGSTATE; return} I am using the following Fortran code: ISLocalToGlobalMapping :: mapping integer :: nproc, numprocmax integer,dimension,allocatable(:) :: procs, numprocs integer,dimension,allocatable(:,:) :: indices call ISLocalToGlobalCreate(PETSC_COMM_WORLD, nlt_rows, loc_to_glob_idx, mapping, ierr) call ISLocalToGlobalMpngGetInfoSize(mapping, nproc, numprocmax, ierr) allocate(procs(nproc), stat=alloc_err) allocate(numprocs(nproc), stat=alloc_err) allocate(indices(nproc, numprocmax), stat=alloc_err) call ISLocalToGlobalMappingGetInfo(mapping, nproc, procs, numprocs, indices, ierr) Where "nlt_rows" is the number of local elements and "loc_to_glob_idx" is the global index for each local element. Have you any ideas on what could be causing the problem? Is it just a little typo in your code, or something more serious? Regards Stephen -----Original Message----- From: Barry Smith [mailto:bsmith at mcs.anl.gov] Sent: 11 June 2006 05:13 To: petsc-users at mcs.anl.gov Subject: EXTERNAL: Re: IS routines without a Fortran interface Stephen, The difficulty with this routine is that it returns an array (the procs and numprocs argument) and an array of arrays (2d array) as the last argument. Returning 2d arrays from C to Fortran is not doable. Thus I have devised a slightly different calling sequence for Fortran; Fortran Usage: $ ISLocalToGlobalMpngGetInfoSize(ISLocalToGlobalMapping,PetscInt nproc,PetscInt numprocmax,ierr) followed by $ ISLocalToGlobalMappingGetInfo(ISLocalToGlobalMapping,PetscInt nproc, PetscInt procs[nproc],PetscInt numprocs[nproc], PetscInt indices[nproc][numprocmax],ierr) There is no ISLocalToGlobalMappingRestoreInfo() in Fortran. You must make sure that procs[], numprocs[] and indices[][] are large enough arrays, either by allocating them dynamically or defining static ones large enough. Attached is the new code, just drop it into src/vec/is/utisl/ftn-custom to replace the current zisltogf.c and run "make lib shared" in that directory. Please let us know if you have any difficulties with it, Barry On Fri, 9 Jun 2006, Stephen R Ball wrote: > > > Hi > > I am keen to use some of the indexing IS routines in my Fortan code > but have discovered that several of them do not have a Fortran > interface. In particular I would like to use > ISLocalToGlobalMappingGetInfo() and > ISLocalToGlobalMappingRestoreInfo(). Would it be possible for you to > include these, and possibly any other missing IS routines not having a > Fortran interface, in PETSc v2.3.1 as a new patch version. > > Regards > > Stephen > -- > ______________________________________________________________________ > _________ > > The information in this email and in any attachment(s) is commercial > in confidence. If you are not the named addressee(s) or if you receive > this email in error then any distribution, copying or use of this > communication or the information in it is strictly prohibited. Please > notify us immediately by email at admin.internet(at)awe.co.uk, and > then delete this message from your computer. While attachments are > virus checked, AWE plc does not accept any liability in respect of any > virus which is not detected. > > AWE Plc > Registered in England and Wales > Registration No 02763902 > AWE, Aldermaston, Reading, RG7 4PR > > -- _______________________________________________________________________________ The information in this email and in any attachment(s) is commercial in confidence. If you are not the named addressee(s) or if you receive this email in error then any distribution, copying or use of this communication or the information in it is strictly prohibited. Please notify us immediately by email at admin.internet(at)awe.co.uk, and then delete this message from your computer. While attachments are virus checked, AWE plc does not accept any liability in respect of any virus which is not detected. AWE Plc Registered in England and Wales Registration No 02763902 AWE, Aldermaston, Reading, RG7 4PR From bsmith at mcs.anl.gov Mon Jun 12 19:38:56 2006 From: bsmith at mcs.anl.gov (Barry Smith) Date: Mon, 12 Jun 2006 19:38:56 -0500 (CDT) Subject: IS routines without a Fortran interface In-Reply-To: <66CGe7024487@awe.co.uk> References: <66CGe7024487@awe.co.uk> Message-ID: Sorry, my fault. It should be if (called). Also you need only compile in that one directory with make lib shared you do not need to rebuild all of PETSc. Barry On Mon, 12 Jun 2006, Stephen R Ball wrote: > > > Hi > > I have rebuilt PETSc using your new zisltogf.c. However, > ISLocalToGlobalMpngGetInfoSize() does not appear to work for me. It seems to > jump out at line 28: > > if (!called) {*ierr = PETSC_ERR_ARG_WRONGSTATE; return} > > I am using the following Fortran code: > > ISLocalToGlobalMapping :: mapping > integer :: nproc, numprocmax > integer,dimension,allocatable(:) :: procs, numprocs > integer,dimension,allocatable(:,:) :: indices > > call ISLocalToGlobalCreate(PETSC_COMM_WORLD, nlt_rows, loc_to_glob_idx, > mapping, ierr) call ISLocalToGlobalMpngGetInfoSize(mapping, nproc, > numprocmax, ierr) > > allocate(procs(nproc), stat=alloc_err) allocate(numprocs(nproc), > stat=alloc_err) allocate(indices(nproc, numprocmax), stat=alloc_err) > > call ISLocalToGlobalMappingGetInfo(mapping, nproc, procs, numprocs, indices, > ierr) > > Where "nlt_rows" is the number of local elements and "loc_to_glob_idx" is > the global index for each local element. > > Have you any ideas on what could be causing the problem? Is it just a little > typo in your code, or something more serious? > > Regards > > Stephen > > > > -----Original Message----- > From: Barry Smith [mailto:bsmith at mcs.anl.gov] > Sent: 11 June 2006 05:13 > To: petsc-users at mcs.anl.gov > Subject: EXTERNAL: Re: IS routines without a Fortran interface > > > > Stephen, > > The difficulty with this routine is that it returns an array (the procs > and numprocs argument) and an array of arrays (2d array) as the last > argument. Returning 2d arrays from C to Fortran is not doable. > > Thus I have devised a slightly different calling sequence for Fortran; > Fortran Usage: > $ ISLocalToGlobalMpngGetInfoSize(ISLocalToGlobalMapping,PetscInt > nproc,PetscInt numprocmax,ierr) followed by > $ ISLocalToGlobalMappingGetInfo(ISLocalToGlobalMapping,PetscInt > nproc, PetscInt procs[nproc],PetscInt numprocs[nproc], > PetscInt indices[nproc][numprocmax],ierr) > There is no ISLocalToGlobalMappingRestoreInfo() in Fortran. You > must make sure that procs[], numprocs[] and > indices[][] are large enough arrays, either by allocating them > dynamically or defining static ones large enough. > > Attached is the new code, just drop it into src/vec/is/utisl/ftn-custom > to replace the > current zisltogf.c and run "make lib shared" in that directory. > > Please let us know if you have any difficulties with it, > > Barry > > > > On Fri, 9 Jun 2006, Stephen R Ball wrote: > >> >> >> Hi >> >> I am keen to use some of the indexing IS routines in my Fortan code >> but have discovered that several of them do not have a Fortran >> interface. In particular I would like to use >> ISLocalToGlobalMappingGetInfo() and >> ISLocalToGlobalMappingRestoreInfo(). Would it be possible for you to >> include these, and possibly any other missing IS routines not having a >> Fortran interface, in PETSc v2.3.1 as a new patch version. >> >> Regards >> >> Stephen >> -- >> ______________________________________________________________________ >> _________ >> >> The information in this email and in any attachment(s) is commercial >> in confidence. If you are not the named addressee(s) or if you receive >> this email in error then any distribution, copying or use of this >> communication or the information in it is strictly prohibited. Please >> notify us immediately by email at admin.internet(at)awe.co.uk, and >> then delete this message from your computer. While attachments are >> virus checked, AWE plc does not accept any liability in respect of any >> virus which is not detected. >> >> AWE Plc >> Registered in England and Wales >> Registration No 02763902 >> AWE, Aldermaston, Reading, RG7 4PR >> >> > -- > _______________________________________________________________________________ > > The information in this email and in any attachment(s) is commercial in confidence. If you are not the named addressee(s) or if you receive this email in error then any distribution, copying or use of this communication or the information in it is strictly prohibited. Please notify us immediately by email at admin.internet(at)awe.co.uk, and then delete this message from your computer. While attachments are virus checked, AWE plc does not accept any liability in respect of any virus which is not detected. > > AWE Plc > Registered in England and Wales > Registration No 02763902 > AWE, Aldermaston, Reading, RG7 4PR > > From Stephen.R.Ball at awe.co.uk Tue Jun 13 09:34:30 2006 From: Stephen.R.Ball at awe.co.uk (Stephen R Ball) Date: Tue, 13 Jun 2006 15:34:30 +0100 Subject: EXTERNAL: Re: IS routines without a Fortran interface Message-ID: <66DFZ9024355@awe.co.uk> Hi Thanks, that appears to work now. Much appreciated. Stephen -----Original Message----- From: Barry Smith [mailto:bsmith at mcs.anl.gov] Sent: 13 June 2006 01:39 To: petsc-users at mcs.anl.gov Subject: EXTERNAL: Re: IS routines without a Fortran interface Sorry, my fault. It should be if (called). Also you need only compile in that one directory with make lib shared you do not need to rebuild all of PETSc. Barry On Mon, 12 Jun 2006, Stephen R Ball wrote: > > > Hi > > I have rebuilt PETSc using your new zisltogf.c. However, > ISLocalToGlobalMpngGetInfoSize() does not appear to work for me. It > seems to jump out at line 28: > > if (!called) {*ierr = PETSC_ERR_ARG_WRONGSTATE; return} > > I am using the following Fortran code: > > ISLocalToGlobalMapping :: mapping > integer :: nproc, numprocmax > integer,dimension,allocatable(:) :: procs, numprocs > integer,dimension,allocatable(:,:) :: indices > > call ISLocalToGlobalCreate(PETSC_COMM_WORLD, nlt_rows, > loc_to_glob_idx, mapping, ierr) call > ISLocalToGlobalMpngGetInfoSize(mapping, nproc, numprocmax, ierr) > > allocate(procs(nproc), stat=alloc_err) allocate(numprocs(nproc), > stat=alloc_err) allocate(indices(nproc, numprocmax), stat=alloc_err) > > call ISLocalToGlobalMappingGetInfo(mapping, nproc, procs, numprocs, > indices, > ierr) > > Where "nlt_rows" is the number of local elements and "loc_to_glob_idx" > is the global index for each local element. > > Have you any ideas on what could be causing the problem? Is it just a > little typo in your code, or something more serious? > > Regards > > Stephen > > > > -----Original Message----- > From: Barry Smith [mailto:bsmith at mcs.anl.gov] > Sent: 11 June 2006 05:13 > To: petsc-users at mcs.anl.gov > Subject: EXTERNAL: Re: IS routines without a Fortran interface > > > > Stephen, > > The difficulty with this routine is that it returns an array (the > procs and numprocs argument) and an array of arrays (2d array) as the > last argument. Returning 2d arrays from C to Fortran is not doable. > > Thus I have devised a slightly different calling sequence for Fortran; > Fortran Usage: > $ ISLocalToGlobalMpngGetInfoSize(ISLocalToGlobalMapping,PetscInt > nproc,PetscInt numprocmax,ierr) followed by > $ ISLocalToGlobalMappingGetInfo(ISLocalToGlobalMapping,PetscInt > nproc, PetscInt procs[nproc],PetscInt numprocs[nproc], > PetscInt indices[nproc][numprocmax],ierr) > There is no ISLocalToGlobalMappingRestoreInfo() in Fortran. > You must make sure that procs[], numprocs[] and > indices[][] are large enough arrays, either by allocating them > dynamically or defining static ones large enough. > > Attached is the new code, just drop it into > src/vec/is/utisl/ftn-custom to replace the current zisltogf.c and run > "make lib shared" in that directory. > > Please let us know if you have any difficulties with it, > > Barry > > > > On Fri, 9 Jun 2006, Stephen R Ball wrote: > >> >> >> Hi >> >> I am keen to use some of the indexing IS routines in my Fortan code >> but have discovered that several of them do not have a Fortran >> interface. In particular I would like to use >> ISLocalToGlobalMappingGetInfo() and >> ISLocalToGlobalMappingRestoreInfo(). Would it be possible for you to >> include these, and possibly any other missing IS routines not having >> a Fortran interface, in PETSc v2.3.1 as a new patch version. >> >> Regards >> >> Stephen >> -- >> _____________________________________________________________________ >> _ >> _________ >> >> The information in this email and in any attachment(s) is commercial >> in confidence. If you are not the named addressee(s) or if you >> receive this email in error then any distribution, copying or use of >> this communication or the information in it is strictly prohibited. >> Please notify us immediately by email at admin.internet(at)awe.co.uk, >> and then delete this message from your computer. While attachments >> are virus checked, AWE plc does not accept any liability in respect >> of any virus which is not detected. >> >> AWE Plc >> Registered in England and Wales >> Registration No 02763902 >> AWE, Aldermaston, Reading, RG7 4PR >> >> > -- > ______________________________________________________________________ > _________ > > The information in this email and in any attachment(s) is commercial > in confidence. If you are not the named addressee(s) or if you receive > this email in error then any distribution, copying or use of this > communication or the information in it is strictly prohibited. Please > notify us immediately by email at admin.internet(at)awe.co.uk, and > then delete this message from your computer. While attachments are > virus checked, AWE plc does not accept any liability in respect of any > virus which is not detected. > > AWE Plc > Registered in England and Wales > Registration No 02763902 > AWE, Aldermaston, Reading, RG7 4PR > > -- _______________________________________________________________________________ The information in this email and in any attachment(s) is commercial in confidence. If you are not the named addressee(s) or if you receive this email in error then any distribution, copying or use of this communication or the information in it is strictly prohibited. Please notify us immediately by email at admin.internet(at)awe.co.uk, and then delete this message from your computer. While attachments are virus checked, AWE plc does not accept any liability in respect of any virus which is not detected. AWE Plc Registered in England and Wales Registration No 02763902 AWE, Aldermaston, Reading, RG7 4PR From Stephen.R.Ball at awe.co.uk Tue Jun 13 09:35:43 2006 From: Stephen.R.Ball at awe.co.uk (Stephen R Ball) Date: Tue, 13 Jun 2006 15:35:43 +0100 Subject: IS routines without a Fortran interface Message-ID: <66DFZ7124355@awe.co.uk> Hi Thanks, that appears to work now. Much appreciated. Stephen -----Original Message----- From: Barry Smith [mailto:bsmith at mcs.anl.gov] Sent: 13 June 2006 01:39 To: petsc-users at mcs.anl.gov Subject: EXTERNAL: Re: IS routines without a Fortran interface Sorry, my fault. It should be if (called). Also you need only compile in that one directory with make lib shared you do not need to rebuild all of PETSc. Barry On Mon, 12 Jun 2006, Stephen R Ball wrote: > > > Hi > > I have rebuilt PETSc using your new zisltogf.c. However, > ISLocalToGlobalMpngGetInfoSize() does not appear to work for me. It > seems to jump out at line 28: > > if (!called) {*ierr = PETSC_ERR_ARG_WRONGSTATE; return} > > I am using the following Fortran code: > > ISLocalToGlobalMapping :: mapping > integer :: nproc, numprocmax > integer,dimension,allocatable(:) :: procs, numprocs > integer,dimension,allocatable(:,:) :: indices > > call ISLocalToGlobalCreate(PETSC_COMM_WORLD, nlt_rows, > loc_to_glob_idx, mapping, ierr) call > ISLocalToGlobalMpngGetInfoSize(mapping, nproc, numprocmax, ierr) > > allocate(procs(nproc), stat=alloc_err) allocate(numprocs(nproc), > stat=alloc_err) allocate(indices(nproc, numprocmax), stat=alloc_err) > > call ISLocalToGlobalMappingGetInfo(mapping, nproc, procs, numprocs, > indices, > ierr) > > Where "nlt_rows" is the number of local elements and "loc_to_glob_idx" > is the global index for each local element. > > Have you any ideas on what could be causing the problem? Is it just a > little typo in your code, or something more serious? > > Regards > > Stephen > > > > -----Original Message----- > From: Barry Smith [mailto:bsmith at mcs.anl.gov] > Sent: 11 June 2006 05:13 > To: petsc-users at mcs.anl.gov > Subject: EXTERNAL: Re: IS routines without a Fortran interface > > > > Stephen, > > The difficulty with this routine is that it returns an array (the > procs and numprocs argument) and an array of arrays (2d array) as the > last argument. Returning 2d arrays from C to Fortran is not doable. > > Thus I have devised a slightly different calling sequence for Fortran; > Fortran Usage: > $ ISLocalToGlobalMpngGetInfoSize(ISLocalToGlobalMapping,PetscInt > nproc,PetscInt numprocmax,ierr) followed by > $ ISLocalToGlobalMappingGetInfo(ISLocalToGlobalMapping,PetscInt > nproc, PetscInt procs[nproc],PetscInt numprocs[nproc], > PetscInt indices[nproc][numprocmax],ierr) > There is no ISLocalToGlobalMappingRestoreInfo() in Fortran. > You must make sure that procs[], numprocs[] and > indices[][] are large enough arrays, either by allocating them > dynamically or defining static ones large enough. > > Attached is the new code, just drop it into > src/vec/is/utisl/ftn-custom to replace the current zisltogf.c and run > "make lib shared" in that directory. > > Please let us know if you have any difficulties with it, > > Barry > > > > On Fri, 9 Jun 2006, Stephen R Ball wrote: > >> >> >> Hi >> >> I am keen to use some of the indexing IS routines in my Fortan code >> but have discovered that several of them do not have a Fortran >> interface. In particular I would like to use >> ISLocalToGlobalMappingGetInfo() and >> ISLocalToGlobalMappingRestoreInfo(). Would it be possible for you to >> include these, and possibly any other missing IS routines not having >> a Fortran interface, in PETSc v2.3.1 as a new patch version. >> >> Regards >> >> Stephen >> -- >> _____________________________________________________________________ >> _ >> _________ >> >> The information in this email and in any attachment(s) is commercial >> in confidence. If you are not the named addressee(s) or if you >> receive this email in error then any distribution, copying or use of >> this communication or the information in it is strictly prohibited. >> Please notify us immediately by email at admin.internet(at)awe.co.uk, >> and then delete this message from your computer. While attachments >> are virus checked, AWE plc does not accept any liability in respect >> of any virus which is not detected. >> >> AWE Plc >> Registered in England and Wales >> Registration No 02763902 >> AWE, Aldermaston, Reading, RG7 4PR >> >> > -- > ______________________________________________________________________ > _________ > > The information in this email and in any attachment(s) is commercial > in confidence. If you are not the named addressee(s) or if you receive > this email in error then any distribution, copying or use of this > communication or the information in it is strictly prohibited. Please > notify us immediately by email at admin.internet(at)awe.co.uk, and > then delete this message from your computer. While attachments are > virus checked, AWE plc does not accept any liability in respect of any > virus which is not detected. > > AWE Plc > Registered in England and Wales > Registration No 02763902 > AWE, Aldermaston, Reading, RG7 4PR > > -- _______________________________________________________________________________ The information in this email and in any attachment(s) is commercial in confidence. If you are not the named addressee(s) or if you receive this email in error then any distribution, copying or use of this communication or the information in it is strictly prohibited. Please notify us immediately by email at admin.internet(at)awe.co.uk, and then delete this message from your computer. While attachments are virus checked, AWE plc does not accept any liability in respect of any virus which is not detected. AWE Plc Registered in England and Wales Registration No 02763902 AWE, Aldermaston, Reading, RG7 4PR From Stephen.R.Ball at awe.co.uk Tue Jun 13 09:44:54 2006 From: Stephen.R.Ball at awe.co.uk (Stephen R Ball) Date: Tue, 13 Jun 2006 15:44:54 +0100 Subject: Problems using external packages Spooles and Hypre with PETSc v2. 3.1 Message-ID: <66DFj5024605@awe.co.uk> Thanks Hong that appears to have fixed it. At the very beginning of this post, I also mentioned that I was having some problems using Hypre with PETSc v2.3.1. I'll repeat my message below: I am using Hypre v1.10.0b downloaded from the LLNL site and built separatly to PETSc. When I have been using Pilut and Parasails as either global problem preconditioners of as sub preconditioners for ASM or BJACOBI, I have been getting errors indicating that there could be a memory access out of range. I suspect that there may be a memory overwrite or mismatch occuring somewhere. Note that BOOMERAMG and EUCLID seem to work OK. Again these problems were not apparent when I was using PETSc v2.3.0. Have there been any significant changes in the PETSc source that handles Hypre between versions 2.3.0 and 2.3.1 that could be causing these problems? I don't really want to go back to using PETSc v2.3.0 if I can help it. I don't know if it makes any difference, but I am using the Fortran interface to PETSc. Regards Stephen -----Original Message----- From: Hong Zhang [mailto:hzhang at mcs.anl.gov] Sent: 12 June 2006 22:57 To: Stephen R Ball Cc: petsc-maint at mcs.anl.gov Subject: EXTERNAL: Re: Problems using external packages Spooles and Hypre with PETS c v2. 3.1 Stephen, The crash is caused by a bug in spooles (int overflow). You can fix your spooles by editing 1) spooles-2.2/I2Ohash/src/util.c: replace line 42, 161, 232 loc = (loc1*loc2) % hashtable->nlist ; with loc = (int)(((long long)loc1*loc2) % hashtable->nlist) ; 2) reconfigure your petsc with '--download-spooles=ifneeded' and the options you have previously used. 3) rebuild petsc libraries I've put an updated spooles tarball at petsc ftp site (spooles-2.2-June_2006.tar.gz). petsc-dev will enable its auto download in few days. Let us know if you still have trouble. Thanks for reporting the bug, Hong On Mon, 12 Jun 2006, Stephen R Ball wrote: > > > Hong > > The copy of Spooles I have was downloaded on or around 26-09-05. I > have checked it again and it still works for me with PETSc v2.3.0. > > Stephen > > > -----Original Message----- > From: Hong Zhang [mailto:hzhang at mcs.anl.gov] > Sent: 10 June 2006 04:21 > To: Stephen Ball > Cc: petsc-maint at mcs.anl.gov > Subject: Re: FW: Problems using external packages Spooles and Hy pre > with PETSc v2. 3.1 > > > > Stephen, > > I tested 'mat' and 'rhs' with PETSc v2.3.0 and spooles installed from > spooles-2.2-Sept_2005-orig.tar.gz (the oldest spooles tarball for > petsc > download) and the updated tarball. > > They all crashes within spooles function > #0 0x085dae4b in I2Ohash_insert (hashtable=0xad820d8, key1=46355, > key2=46355, ^^^^^^^^^^^^^^ > value=0xa44fc88) at util.c:96 > #1 0x085d15d8 in FrontMtx_splitUpperMatrices (frontmtx=0x8d6df38, > msglvl=0, > msgFile=0x0) > at split.c:79 > #2 0x085cd94d in FrontMtx_postProcess (frontmtx=0x8d6df38, msglvl=0, > msgFile=0x0) > at postProcess.c:141 > #3 0x081e901d in MatFactorNumeric_SeqAIJSpooles (A=0x8921010, > info=0x8939204, > F=0x89391e0) at spooles.c:486 > > Which version of spooles gives you successful ran on this problem with > petsc-2.3.0? > > Hong > > > > On Thu, 8 Jun 2006, Stephen Ball wrote: > > > > > > > > > Hong > > > > I have uploaded the problem to "ftp://ftp.mcs.anl.gov/incoming". The > > filename is "spooles_fail_problem.tar.gz". Let me know if you > > receive it OK. > > > > Stephen > > > > > > > > -----Original Message----- > > From: Satish Balay [mailto:balay at mcs.anl.gov] > > Sent: 06 June 2006 17:34 > > To: petsc-users at mcs.anl.gov > > Subject: EXTERNAL: RE: EXTERNAL: RE: EXTERNAL: Re: Problems using > > external packages Spooles and Hy pre with PETSc v2. 3.1 > > > > > > I think Barry ment to e-mail to petsc-maint or hzhang [@mcs.anl.gov] > > > > How big is the file? It it is very big [and not suitable for e-mail] > > then you can upload it to ftp://ftp.mcs.anl.gov/incoming [and send > > us e-mail with the name of the file] > > > > Satish > > > > On Tue, 6 Jun 2006, Stephen R Ball wrote: > > > > > > > > > > > Hi > > > > > > Yes, I will post you the problem on CD. Can you give me the full > > > postal address I should mail it to. > > > > > > Regards > > > > > > Stephen > > > > > > > > > > > > -----Original Message----- > > > From: Barry Smith [mailto:bsmith at mcs.anl.gov] > > > Sent: 05 June 2006 17:21 > > > To: petsc-users at mcs.anl.gov > > > Subject: EXTERNAL: RE: EXTERNAL: Re: Problems using external > > > packages Spooles and Hy pre with PETSc v2. 3.1 > > > > > > > > > Stephen, > > > > > > Could you send us or post for us the matrix that causes the > > > crash? Send directly to Hong. > > > > > > Thanks, > > > > > > Barry > > > > > > > > > On Mon, 5 Jun 2006, Stephen R Ball wrote: > > > > > > > > > > > > > > > > > > > > > > > Hi > > > > > > > > Your example runs OK, as do some of my other problems. But with > > > > some > > > > > > problems PETSc v2.3.1 fails while PETSc v2.3.0 works. I have > > > > attached the output from both PETSc versions for one of these > > > > problems. If you are interested, perhaps we could make > > > > arrangements for me sending you one of these problems. > > > > > > > > Regards > > > > > > > > Stephen > > > > > > > > > > > > > > > > > > > > -----Original Message----- > > > > From: Hong Zhang [mailto:hzhang at mcs.anl.gov] > > > > Sent: 02 June 2006 14:47 > > > > To: petsc-users at mcs.anl.gov > > > > Subject: EXTERNAL: Re: Problems using external packages Spooles > > > > and Hypre with PETSc v2. 3.1 > > > > > > > > > > > > Stephen, > > > > > > > >> > > > >> I am using Spooles downloaded from the PETSc ftp site and built > > > >> into PETSC_DIR/externalpackages. When solving a partcular > > > >> problem > > > > >> I am getting the error: > > > >> > > > >> MatFactorNumeric_MPIAIJSpooles line 199 > > > >> src/mat/impls/aij/mpi/spooles/mpispooles.c > > > >> MatLUFactorNumeric line 2200 src/mat/interface/matix.c KSPSetUp > > > >> line 183 src/ksp/ksp/interface/itfunc.c KSPSolve line 305 > > > >> src/ksp/ksp/interface/itfunc.c > > > > > > > > May I have the complete error message after the crash? Can you > > > > run ~petsc/src/ksp/ksp/examples/tutorials/ex5.c > > > > with the cmd: > > > > > > > > mpirun -np 2 ./ex5 -ksp_type preonly -pc_type lu -mat_type > > > > aijspooles? > > > > > > > > Hong > > > > > > > >> > > > >> The problem also occurs in serial. > > > >> > > > >> I am using Hypre v1.10.0b downloaded from the LLNL site and > > > >> built > > > > >> separatly to PETSc. When I have been using Pilut and Parasails > > > >> as > > > > >> either global problem preconditioners of as sub preconditioners > > > >> for > > > > > >> ASM or BJACOBI, I have been getting errors indicating that > > > >> there could be a memory access out of range. I suspect that > > > >> there may be a memory overwrite or mismatch occuring somewhere. > > > >> Note that BOOMERAMG and EUCLID seem to work OK. Again these > > > >> problems were not > > > > > >> apparent when I was using PETSc v2.3.0. > > > >> > > > >> Have there been any significant changes in the PETSc source > > > >> that handles Spooles and Hypre between versions 2.3.0 and 2.3.1 > > > >> that could be causing these problems? I don't really want to go > > > >> back to using PETSc v2.3.0 if I can help it. I don't know if it > > > >> makes any difference, but I am using the Fortran interface to > > > >> PETSc. > > > >> > > > >> Hope you can help. > > > >> > > > >> Regards > > > >> > > > >> Stephen R. Ball > > > >> -- > > > >> __________ -- _______________________________________________________________________________ The information in this email and in any attachment(s) is commercial in confidence. If you are not the named addressee(s) or if you receive this email in error then any distribution, copying or use of this communication or the information in it is strictly prohibited. Please notify us immediately by email at admin.internet(at)awe.co.uk, and then delete this message from your computer. While attachments are virus checked, AWE plc does not accept any liability in respect of any virus which is not detected. AWE Plc Registered in England and Wales Registration No 02763902 AWE, Aldermaston, Reading, RG7 4PR From bsmith at mcs.anl.gov Tue Jun 13 13:03:06 2006 From: bsmith at mcs.anl.gov (Barry Smith) Date: Tue, 13 Jun 2006 13:03:06 -0500 (CDT) Subject: Problems using external packages Spooles and Hypre with PETSc v2. 3.1 In-Reply-To: <66DFj5024605@awe.co.uk> References: <66DFj5024605@awe.co.uk> Message-ID: Stephen, The PETSc source was changed to match updates to hypre. So it is possible 1) an error was introduced into PETSc, 2) an error was introduced into hypre or 3) there was an error all along (either in PETSc, hypre or your code) that just became visible after the changes. You will need to get more information on the problem with the debugger, vgrind, etc. Barry On Tue, 13 Jun 2006, Stephen R Ball wrote: > > > Thanks Hong that appears to have fixed it. > > At the very beginning of this post, I also mentioned that I was having some > problems using Hypre with PETSc v2.3.1. > I'll repeat my message below: > > > I am using Hypre v1.10.0b downloaded from the LLNL site and built separatly > to PETSc. When I have been using Pilut and Parasails as either global > problem preconditioners of as sub preconditioners for ASM or BJACOBI, I have > been getting errors indicating that there could be a memory access out of > range. I suspect that there may be a memory overwrite or mismatch occuring > somewhere. Note that BOOMERAMG and EUCLID seem to work OK. Again these > problems were not apparent when I was using PETSc v2.3.0. > > Have there been any significant changes in the PETSc source that handles > Hypre between versions 2.3.0 and 2.3.1 that could be causing these problems? > I don't really want to go back to using PETSc v2.3.0 if I can help it. I > don't know if it makes any difference, but I am using the Fortran interface > to PETSc. > > > Regards > > Stephen > > > > -----Original Message----- > From: Hong Zhang [mailto:hzhang at mcs.anl.gov] > Sent: 12 June 2006 22:57 > To: Stephen R Ball > Cc: petsc-maint at mcs.anl.gov > Subject: EXTERNAL: Re: Problems using external packages Spooles and Hypre > with PETS c v2. 3.1 > > > Stephen, > > The crash is caused by a bug in spooles > (int overflow). > > You can fix your spooles by editing > 1) spooles-2.2/I2Ohash/src/util.c: > > replace line 42, 161, 232 > loc = (loc1*loc2) % hashtable->nlist ; > with > loc = (int)(((long long)loc1*loc2) % hashtable->nlist) ; > > 2) reconfigure your petsc > with '--download-spooles=ifneeded' > and the options you have previously used. > > 3) rebuild petsc libraries > > I've put an updated spooles tarball at petsc ftp site > (spooles-2.2-June_2006.tar.gz). petsc-dev will enable its auto download in > few days. > > Let us know if you still have trouble. > > Thanks for reporting the bug, > > Hong > > On Mon, 12 Jun 2006, Stephen R Ball wrote: > >> >> >> Hong >> >> The copy of Spooles I have was downloaded on or around 26-09-05. I >> have checked it again and it still works for me with PETSc v2.3.0. >> >> Stephen >> >> >> -----Original Message----- >> From: Hong Zhang [mailto:hzhang at mcs.anl.gov] >> Sent: 10 June 2006 04:21 >> To: Stephen Ball >> Cc: petsc-maint at mcs.anl.gov >> Subject: Re: FW: Problems using external packages Spooles and Hy pre >> with PETSc v2. 3.1 >> >> >> >> Stephen, >> >> I tested 'mat' and 'rhs' with PETSc v2.3.0 and spooles installed from >> spooles-2.2-Sept_2005-orig.tar.gz (the oldest spooles tarball for >> petsc >> download) and the updated tarball. >> >> They all crashes within spooles function >> #0 0x085dae4b in I2Ohash_insert (hashtable=0xad820d8, key1=46355, >> key2=46355, ^^^^^^^^^^^^^^ >> value=0xa44fc88) at util.c:96 >> #1 0x085d15d8 in FrontMtx_splitUpperMatrices (frontmtx=0x8d6df38, >> msglvl=0, >> msgFile=0x0) >> at split.c:79 >> #2 0x085cd94d in FrontMtx_postProcess (frontmtx=0x8d6df38, msglvl=0, >> msgFile=0x0) >> at postProcess.c:141 >> #3 0x081e901d in MatFactorNumeric_SeqAIJSpooles (A=0x8921010, >> info=0x8939204, >> F=0x89391e0) at spooles.c:486 >> >> Which version of spooles gives you successful ran on this problem with >> petsc-2.3.0? >> >> Hong >> >> >> >> On Thu, 8 Jun 2006, Stephen Ball wrote: >> >>> >>> >>> >>> Hong >>> >>> I have uploaded the problem to "ftp://ftp.mcs.anl.gov/incoming". The >>> filename is "spooles_fail_problem.tar.gz". Let me know if you >>> receive it OK. >>> >>> Stephen >>> >>> >>> >>> -----Original Message----- >>> From: Satish Balay [mailto:balay at mcs.anl.gov] >>> Sent: 06 June 2006 17:34 >>> To: petsc-users at mcs.anl.gov >>> Subject: EXTERNAL: RE: EXTERNAL: RE: EXTERNAL: Re: Problems using >>> external packages Spooles and Hy pre with PETSc v2. 3.1 >>> >>> >>> I think Barry ment to e-mail to petsc-maint or hzhang [@mcs.anl.gov] >>> >>> How big is the file? It it is very big [and not suitable for e-mail] >>> then you can upload it to ftp://ftp.mcs.anl.gov/incoming [and send >>> us e-mail with the name of the file] >>> >>> Satish >>> >>> On Tue, 6 Jun 2006, Stephen R Ball wrote: >>> >>>> >>>> >>>> Hi >>>> >>>> Yes, I will post you the problem on CD. Can you give me the full >>>> postal address I should mail it to. >>>> >>>> Regards >>>> >>>> Stephen >>>> >>>> >>>> >>>> -----Original Message----- >>>> From: Barry Smith [mailto:bsmith at mcs.anl.gov] >>>> Sent: 05 June 2006 17:21 >>>> To: petsc-users at mcs.anl.gov >>>> Subject: EXTERNAL: RE: EXTERNAL: Re: Problems using external >>>> packages Spooles and Hy pre with PETSc v2. 3.1 >>>> >>>> >>>> Stephen, >>>> >>>> Could you send us or post for us the matrix that causes the >>>> crash? Send directly to Hong. >>>> >>>> Thanks, >>>> >>>> Barry >>>> >>>> >>>> On Mon, 5 Jun 2006, Stephen R Ball wrote: >>>> >>>>> >>>>> >>>>> >>>>> >>>>> Hi >>>>> >>>>> Your example runs OK, as do some of my other problems. But with >>>>> some >>> >>>>> problems PETSc v2.3.1 fails while PETSc v2.3.0 works. I have >>>>> attached the output from both PETSc versions for one of these >>>>> problems. If you are interested, perhaps we could make >>>>> arrangements for me sending you one of these problems. >>>>> >>>>> Regards >>>>> >>>>> Stephen >>>>> >>>>> >>>>> >>>>> >>>>> -----Original Message----- >>>>> From: Hong Zhang [mailto:hzhang at mcs.anl.gov] >>>>> Sent: 02 June 2006 14:47 >>>>> To: petsc-users at mcs.anl.gov >>>>> Subject: EXTERNAL: Re: Problems using external packages Spooles >>>>> and Hypre with PETSc v2. 3.1 >>>>> >>>>> >>>>> Stephen, >>>>> >>>>>> >>>>>> I am using Spooles downloaded from the PETSc ftp site and built >>>>>> into PETSC_DIR/externalpackages. When solving a partcular >>>>>> problem >> >>>>>> I am getting the error: >>>>>> >>>>>> MatFactorNumeric_MPIAIJSpooles line 199 >>>>>> src/mat/impls/aij/mpi/spooles/mpispooles.c >>>>>> MatLUFactorNumeric line 2200 src/mat/interface/matix.c KSPSetUp >>>>>> line 183 src/ksp/ksp/interface/itfunc.c KSPSolve line 305 >>>>>> src/ksp/ksp/interface/itfunc.c >>>>> >>>>> May I have the complete error message after the crash? Can you >>>>> run ~petsc/src/ksp/ksp/examples/tutorials/ex5.c >>>>> with the cmd: >>>>> >>>>> mpirun -np 2 ./ex5 -ksp_type preonly -pc_type lu -mat_type >>>>> aijspooles? >>>>> >>>>> Hong >>>>> >>>>>> >>>>>> The problem also occurs in serial. >>>>>> >>>>>> I am using Hypre v1.10.0b downloaded from the LLNL site and >>>>>> built >> >>>>>> separatly to PETSc. When I have been using Pilut and Parasails >>>>>> as >> >>>>>> either global problem preconditioners of as sub preconditioners >>>>>> for >>> >>>>>> ASM or BJACOBI, I have been getting errors indicating that >>>>>> there could be a memory access out of range. I suspect that >>>>>> there may be a memory overwrite or mismatch occuring somewhere. >>>>>> Note that BOOMERAMG and EUCLID seem to work OK. Again these >>>>>> problems were not >>> >>>>>> apparent when I was using PETSc v2.3.0. >>>>>> >>>>>> Have there been any significant changes in the PETSc source >>>>>> that handles Spooles and Hypre between versions 2.3.0 and 2.3.1 >>>>>> that could be causing these problems? I don't really want to go >>>>>> back to using PETSc v2.3.0 if I can help it. I don't know if it >>>>>> makes any difference, but I am using the Fortran interface to >>>>>> PETSc. >>>>>> >>>>>> Hope you can help. >>>>>> >>>>>> Regards >>>>>> >>>>>> Stephen R. Ball >>>>>> -- >>>>>> __________ > -- > _______________________________________________________________________________ > > The information in this email and in any attachment(s) is commercial in confidence. If you are not the named addressee(s) or if you receive this email in error then any distribution, copying or use of this communication or the information in it is strictly prohibited. Please notify us immediately by email at admin.internet(at)awe.co.uk, and then delete this message from your computer. While attachments are virus checked, AWE plc does not accept any liability in respect of any virus which is not detected. > > AWE Plc > Registered in England and Wales > Registration No 02763902 > AWE, Aldermaston, Reading, RG7 4PR > > From jordi.marce at upc.edu Wed Jun 14 10:32:38 2006 From: jordi.marce at upc.edu (=?ISO-8859-1?Q?Jordi_Marc=E9_Nogu=E9?=) Date: Wed, 14 Jun 2006 17:32:38 +0200 Subject: On entry to DGEMV parameter number 6 had an illegal value In-Reply-To: References: <448960B6.7000104@upc.edu> <44897051.7090006@upc.edu> Message-ID: <44902C16.5030704@upc.edu> En/na owner-petsc-users at mcs.anl.gov ha escrit: > > This an error message from BLAS. > > BLAS has a terrible model for error handling; it just prints > a message to screen that you cannot control and does not > return an error code :-( > > Are you > 1) using a BAIJ matrix with a block size bigger than 8? No. I'm using a SeqAIJ matrix > 2) the bcgsl KSP solver or Yes. And the error happens when I'm calling the "KSPsolve" function > 3) dense matrices (how do you create the dense matrix?) No. I'm using a sparse matrix > 4) are you using 64bit integers (very unlikely) No. I'm using 32bit integers > > The best thing to do is run in the debugger to see when/where/why > this is happening. > > Barry > > -- Jordi Marc?-Nogu? Dept. Resist?ncia de Materials i Estructures a l'Enginyeria Universitat Polit?cnica de Catalunya (UPC) Edifici T45 - despatx 137 ETSEIAT (Terrassa) phone: +34 937 398 728 mail: jordi.marce at upc.edu From picard2 at llnl.gov Wed Jun 14 11:30:49 2006 From: picard2 at llnl.gov (Christophe Picard) Date: Wed, 14 Jun 2006 09:30:49 -0700 Subject: DMMG and DA Message-ID: <200606140930.49570.picard2@llnl.gov> Hello, I have been trying to used DMMG and DA in the following way. I have a DA with several degree of freedom, and several of them have the same jacobian but different RHS (what I want to do is solve Ax1=b1(x1,x,2,x3), Ax2=b2(x1,x2,x3)). So how does DMMGsolve handle that? Since x1,x2,x3 are DA variables, but I want to solve only x1 and x2 using the same Jacobian, I figured that I can have some kind of switch in the definition of the RHS function that will make the selection, and calling dmmgSolve several times, but by modifyng the switch trough DMMGSetUser and DMMGGetUser before each call. But then where the output of the solve operation is stored? The way I understand it now is that it is overwritting x1. Am I right? Is there a way to solve x1 and x2 simultaneously, I mean by only 1 call of dmmgSolve, and without solving x3? I hope I am not too confusing. Thank you, Christophe --- From knepley at gmail.com Wed Jun 14 12:18:45 2006 From: knepley at gmail.com (Matthew Knepley) Date: Wed, 14 Jun 2006 12:18:45 -0500 Subject: DMMG and DA In-Reply-To: <200606140930.49570.picard2@llnl.gov> References: <200606140930.49570.picard2@llnl.gov> Message-ID: On 6/14/06, Christophe Picard wrote: > > Hello, > > I have been trying to used DMMG and DA in the following way. > I have a DA with several degree of freedom, and several of them have the > same > jacobian but different RHS (what I want to do is solve Ax1=b1(x1,x,2,x3), > Ax2=b2(x1,x2,x3)). > So how does DMMGsolve handle that? I am not sure I understand completely what you want, but I will start with the DA. DA objects only encode a data layout. All data resides in Vec and Mat objects. So, if you have several fields that you want to solve separately, then create a DA with 1 dof, and use several Vecs. Since the Jacobian is the same, you will have 1 Mat. Matt Since x1,x2,x3 are DA variables, but I want to solve only x1 and x2 using > the > same Jacobian, I figured that I can have some kind of switch in the > definition of the RHS function that will make the selection, and calling > dmmgSolve several times, but by modifyng the switch trough DMMGSetUser and > DMMGGetUser before each call. But then where the output of the solve > operation is stored? The way I understand it now is that it is > overwritting > x1. Am I right? > Is there a way to solve x1 and x2 simultaneously, I mean by only 1 call of > dmmgSolve, and without solving x3? > > I hope I am not too confusing. > > Thank you, > > Christophe > --- > > > -- "Failure has a thousand explanations. Success doesn't need one" -- Sir Alec Guiness -------------- next part -------------- An HTML attachment was scrubbed... URL: From picard2 at llnl.gov Wed Jun 14 12:54:06 2006 From: picard2 at llnl.gov (Christophe Picard) Date: Wed, 14 Jun 2006 10:54:06 -0700 Subject: DMMG and DA In-Reply-To: References: <200606140930.49570.picard2@llnl.gov> Message-ID: <200606141054.06339.picard2@llnl.gov> Thank you Matt. I thought about this approach, but when I compute the RHS of the equations, I want to be able to access the local value of the other variables. I believe I can do that using DACreateLocalVector, and then copy the global value to the local vector. Is it actually creating a new vector or is it creating a pointer to the global vector (and the global data)? Thanks Christophe On Wednesday 14 June 2006 10:18 am, Matthew Knepley wrote: > On 6/14/06, Christophe Picard wrote: > > Hello, > > > > I have been trying to used DMMG and DA in the following way. > > I have a DA with several degree of freedom, and several of them have the > > same > > jacobian but different RHS (what I want to do is solve Ax1=b1(x1,x,2,x3), > > Ax2=b2(x1,x2,x3)). > > So how does DMMGsolve handle that? > > I am not sure I understand completely what you want, but I will start with > the > DA. DA objects only encode a data layout. All data resides in Vec and Mat > objects. So, if you have several fields that you want to solve separately, > then > create a DA with 1 dof, and use several Vecs. Since the Jacobian is the > same, > you will have 1 Mat. > > Matt > > Since x1,x2,x3 are DA variables, but I want to solve only x1 and x2 using > > > the > > same Jacobian, I figured that I can have some kind of switch in the > > definition of the RHS function that will make the selection, and calling > > dmmgSolve several times, but by modifyng the switch trough DMMGSetUser > > and DMMGGetUser before each call. But then where the output of the solve > > operation is stored? The way I understand it now is that it is > > overwritting > > x1. Am I right? > > Is there a way to solve x1 and x2 simultaneously, I mean by only 1 call > > of dmmgSolve, and without solving x3? > > > > I hope I am not too confusing. > > > > Thank you, > > > > Christophe > > --- From bsmith at mcs.anl.gov Wed Jun 14 13:14:32 2006 From: bsmith at mcs.anl.gov (Barry Smith) Date: Wed, 14 Jun 2006 13:14:32 -0500 (CDT) Subject: On entry to DGEMV parameter number 6 had an illegal value In-Reply-To: <44902C16.5030704@upc.edu> References: <448960B6.7000104@upc.edu> <44897051.7090006@upc.edu> <44902C16.5030704@upc.edu> Message-ID: KSPSolve_BCGSL() in src/ksp/ksp/impls/bcgsl/bcgsl.c uses calls to gemv() directly. Could you please try the following. Edit the file and for alll calls to BLAS... and LAPACK... replace the character string by its first character. For example replace "noTr" with "N". Next before each BLASgemv() put in a printf("ldMZ %d\n",ldMZ); run make lib shared in that directory then relink you code and run it. Let us know what happens. Barry On Wed, 14 Jun 2006, Jordi Marc? Nogu? wrote: > En/na owner-petsc-users at mcs.anl.gov ha escrit: >> >> This an error message from BLAS. >> >> BLAS has a terrible model for error handling; it just prints >> a message to screen that you cannot control and does not >> return an error code :-( >> >> Are you >> 1) using a BAIJ matrix with a block size bigger than 8? > > No. I'm using a SeqAIJ matrix > > >> 2) the bcgsl KSP solver or > Yes. And the error happens when I'm calling the "KSPsolve" function > >> 3) dense matrices (how do you create the dense matrix?) > > No. I'm using a sparse matrix > >> 4) are you using 64bit integers (very unlikely) > > No. I'm using 32bit integers > >> >> The best thing to do is run in the debugger to see when/where/why >> this is happening. >> >> Barry >> >> > > From bsmith at mcs.anl.gov Wed Jun 14 13:21:24 2006 From: bsmith at mcs.anl.gov (Barry Smith) Date: Wed, 14 Jun 2006 13:21:24 -0500 (CDT) Subject: DMMG and DA In-Reply-To: <200606140930.49570.picard2@llnl.gov> References: <200606140930.49570.picard2@llnl.gov> Message-ID: Christophe, You should create two DA's with ONE dof; the first DA will be used twice, to solve the first then the second system. The other DA will be used to solve the third system. Then create two DMMG, one for the first DA and one for the second. On Wed, 14 Jun 2006, Christophe Picard wrote: > Hello, > > I have been trying to used DMMG and DA in the following way. > I have a DA with several degree of freedom, and several of them have the same > jacobian but different RHS (what I want to do is solve Ax1=b1(x1,x,2,x3), > Ax2=b2(x1,x2,x3)). > So how does DMMGsolve handle that? > Since x1,x2,x3 are DA variables, but I want to solve only x1 and x2 using the > same Jacobian, I figured that I can have some kind of switch in the > definition of the RHS function that will make the selection, and calling > dmmgSolve several times, but by modifyng the switch trough DMMGSetUser and > DMMGGetUser before each call. But then where the output of the solve > operation is stored? Call DMMGGetX() to get access to the solution vector. > The way I understand >it now is that it is overwritting > x1. Am I right? Yes, > Is there a way to solve x1 and x2 simultaneously, I mean by only 1 call of > dmmgSolve, and without solving x3? No, you need to call DMMGSolve on the initial DA twice, once for the first system (then call DMMGSetUser()) then for the second system. Barry > > I hope I am not too confusing. > > Thank you, > > Christophe > --- > > > From gudik at ae.metu.edu.tr Thu Jun 15 03:37:17 2006 From: gudik at ae.metu.edu.tr (Evrim Dizemen) Date: Thu, 15 Jun 2006 11:37:17 +0300 Subject: Matrix input file format In-Reply-To: References: <447D4847.5030007@ae.metu.edu.tr> <4486BE58.4030207@ae.metu.edu.tr> Message-ID: <44911C3D.3020904@ae.metu.edu.tr> Hi all, Again thanks for your comments. I guess i can not define the problem correctly. I have a sequantial fortran code giving me the global matrix of 200000x200000. The code writes the matrix in a binary file at little endian mode (i can write only the nonzero terms or the entire matrix). I tried to change the binary mode to big endian and read the global matrix by a c program as in the example /src/mat/example/tests/ex31.c. However the program reads binary file wrong and gives the following error message but the true value of no-nonzero in the binary file is 6 (for the test case 3x3 matrix) : reading matrix in binary from matrix.dat ... ------------------------------------------------------------------------ Petsc Release Version 2.3.1, Patch 13, Wed May 10 11:08:35 CDT 2006 BK revision: balay at asterix.mcs.anl.gov|ChangeSet|20060510160640|13832 See docs/changes/index.html for recent updates. See docs/faq.html for hints about trouble shooting. See docs/index.html for manual pages. ------------------------------------------------------------------------ ./ex31 on a linux named akbaba.ae.metu.edu.tr by evrim Thu Jun 15 09:26:36 2006 Libraries linked from /home/evrim/petsc-2.3.1-p13/lib/linux Configure run at Tue May 30 10:26:48 2006 Configure options --with-scalar-type=complex --with-shared=0 ------------------------------------------------------------------------ [0]PETSC ERROR: MatLoad_SeqAIJ() line 3055 in src/mat/impls/aij/seq/aij.c [0]PETSC ERROR: Read from file failed! [0]PETSC ERROR: Inconsistant matrix data in file. no-nonzeros = 100663296, sum-row-lengths = 234300 ! [0]PETSC ERROR: MatLoad() line 149 in src/mat/utils/matio.c [0]PETSC ERROR: main() line 37 in src/mat/examples/tests/ex31.c I want to send the global matrix at once to Petsc by a written input file (as i'm working on now) or by sending the matrix array from my fortran code and then partition it and solve iteratively. After the solution i also want to get the solution vector back to my fortran code. As i told in the previous mails i tried to send the matrix array to Petsc and used MatSetValues as reading one value at time in a do loop but it took about 2,5 hours to read the global matrix. Additionally i tried to read a row at a time but can not figure out a algorithm for this. Hence i do not prefer to create the matrix again in Petsc by MatSetValues. Aside i figured out that the binary files written in fortran and c are completely different from each other (fortran adds the size of the characters to the beginning and end of each character) so i wrote a c interface code to get the matrix array from the fortran code and write it to a binary file in c format. By this code i avoided from the additional information in the binary file but i still have the endianness problem. I know that i asked so much but since i'm a rookie in parallel programming, c language and library using i really need your comments on my problem. Sorry for this long mail and thanks a lot for your kind effort on guiding me. Thanks EVRIM From randy at geosystem.us Thu Jun 15 08:03:40 2006 From: randy at geosystem.us (Randall Mackie) Date: Thu, 15 Jun 2006 06:03:40 -0700 Subject: Matrix input file format In-Reply-To: <44911C3D.3020904@ae.metu.edu.tr> References: <447D4847.5030007@ae.metu.edu.tr> <4486BE58.4030207@ae.metu.edu.tr> <44911C3D.3020904@ae.metu.edu.tr> Message-ID: <44915AAC.2070309@geosystem.us> Hi Evrim, It's quite easy to modify your Fortran code to do what you want. I thought I had written it all out before, but I'll try again. There are many ways to do this, but I'll start with the easiest, at least if you're going to just modify your current sequential code. Let's say that your matrix has np global rows. Then call VecCreateMPI(PETSC_COMM_WORLD,PETSC_DECIDE,np,b,ierr) call VecDuplicate(b,xsol,ierr) call VecGetLocalSize(b,mloc,ierr) call VecGetOwnershipRange(b,Istart,Iend,ierr) do i=Istart+1,Iend loc(i)=i-1 end do These statements create parallel vectors for the solution (xsol) and the right hand side (b). The vector loc(i)is used to set values in the vectors later. Then ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! Create the linear solver context ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - call KSPCreate(PETSC_COMM_WORLD,ksp,ierr) ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! Create the scatter context for getting results back to ! each node. ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - call VecScatterCreateToAll(xsol,xToLocalAll,xseq,ierr) ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! Create the matrix that defines the linear system, Ax = b, ! for the EM problem. ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - call pre_op3d(l,m,nzn,Istart,Iend,ijkhx,ijkhy,ijkhz,d_nnz,o_nnz) call MatCreateMPIAIJ(PETSC_COMM_WORLD,mloc,mloc,np,np, . PETSC_NULL_INTEGER, d_nnz, PETSC_NULL_INTEGER, . o_nnz,A,ierr) call set_op3d(A,l,m,nzn,period,resist,x,y,z,Istart,Iend, . ijkhx,ijkhy,ijkhz) The subroutine pre_op3d is an important routine and it figures out how to pre-allocate space for your parallel matrix. This will be the difference between near-instanteous assembly and 2.5 hours that you experienced. Basically, it just computes the global column numbers, and figures out if they are between Istart and Iend. I can send you my subroutine if you'd like. The subroutine set_op3d.F actually assembles the parallel matrix and goes like this: jj=0 do i=1,l do k=2,n do j=2,m jj=jj+1 row = jj-1 IF (jj >= Istart+1 .and. jj <= Iend) THEN compute elements... call MatSetValues(A,i1,row,ic,col,v,INSERT_VALUES, . ierr) END IF end do end do end do At the end, call MatAssemblyBegin(A,MAT_FINAL_ASSEMBLY,ierr) call MatAssemblyEnd(A,MAT_FINAL_ASSEMBLY,ierr) Again, because you compute the pre-allocation, this is near-instanteous, even for large models (larger than you're using). Once you do that, you're golden: call KSPSetOperators(ksp,A,A,DIFFERENT_NONZERO_PATTERN,ierr) etc. Randy M. San Francisco Evrim Dizemen wrote: > Hi all, > > Again thanks for your comments. I guess i can not define the problem > correctly. I have a sequantial fortran code giving me the global matrix > of 200000x200000. The code writes the matrix in a binary file at little > endian mode (i can write only the nonzero terms or the entire matrix). I > tried to change the binary mode to big endian and read the global matrix > by a c program as in the example /src/mat/example/tests/ex31.c. However > the program reads binary file wrong and gives the following error > message but the true value of no-nonzero in the binary file is 6 (for > the test case 3x3 matrix) : > > reading matrix in binary from matrix.dat ... > ------------------------------------------------------------------------ > Petsc Release Version 2.3.1, Patch 13, Wed May 10 11:08:35 CDT 2006 > BK revision: balay at asterix.mcs.anl.gov|ChangeSet|20060510160640|13832 > See docs/changes/index.html for recent updates. > See docs/faq.html for hints about trouble shooting. > See docs/index.html for manual pages. > ------------------------------------------------------------------------ > ./ex31 on a linux named akbaba.ae.metu.edu.tr by evrim Thu Jun 15 > 09:26:36 2006 > Libraries linked from /home/evrim/petsc-2.3.1-p13/lib/linux > Configure run at Tue May 30 10:26:48 2006 > Configure options --with-scalar-type=complex --with-shared=0 > ------------------------------------------------------------------------ > [0]PETSC ERROR: MatLoad_SeqAIJ() line 3055 in src/mat/impls/aij/seq/aij.c > [0]PETSC ERROR: Read from file failed! > [0]PETSC ERROR: Inconsistant matrix data in file. no-nonzeros = > 100663296, sum-row-lengths = 234300 > ! > [0]PETSC ERROR: MatLoad() line 149 in src/mat/utils/matio.c > [0]PETSC ERROR: main() line 37 in src/mat/examples/tests/ex31.c > > I want to send the global matrix at once to Petsc by a written input > file (as i'm working on now) or by sending the matrix array from my > fortran code and then partition it and solve iteratively. After the > solution i also want to get the solution vector back to my fortran code. > As i told in the previous mails i tried to send the matrix array to > Petsc and used MatSetValues as reading one value at time in a do loop > but it took about 2,5 hours to read the global matrix. Additionally i > tried to read a row at a time but can not figure out a algorithm for > this. Hence i do not prefer to create the matrix again in Petsc by > MatSetValues. > > Aside i figured out that the binary files written in fortran and c are > completely different from each other (fortran adds the size of the > characters to the beginning and end of each character) so i wrote a c > interface code to get the matrix array from the fortran code and write > it to a binary file in c format. By this code i avoided from the > additional information in the binary file but i still have the > endianness problem. > > I know that i asked so much but since i'm a rookie in parallel > programming, c language and library using i really need your comments on > my problem. Sorry for this long mail and thanks a lot for your kind > effort on guiding me. > > Thanks > > EVRIM > -- Randall Mackie GSY-USA, Inc. PMB# 643 2261 Market St., San Francisco, CA 94114-1600 Tel (415) 469-8649 Fax (415) 469-5044 California Registered Geophysicist License No. GP 1034 From gudik at ae.metu.edu.tr Thu Jun 15 08:55:19 2006 From: gudik at ae.metu.edu.tr (Evrim Dizemen) Date: Thu, 15 Jun 2006 16:55:19 +0300 Subject: Matrix input file format In-Reply-To: <44915AAC.2070309@geosystem.us> References: <447D4847.5030007@ae.metu.edu.tr> <4486BE58.4030207@ae.metu.edu.tr> <44911C3D.3020904@ae.metu.edu.tr> <44915AAC.2070309@geosystem.us> Message-ID: <449166C7.5080301@ae.metu.edu.tr> Dear Randall, I guess i began to understand the consepts but there is still a missing point that i do not know when and how we define Istart and Iend. I'll be glade if you can send me the pre_op3d routine so i can see the algorithm which is a black box for me now. Thanks a lot EVRIM Randall Mackie wrote: > Hi Evrim, > > It's quite easy to modify your Fortran code to do what you want. I > thought > I had written it all out before, but I'll try again. There are many ways > to do this, but I'll start with the easiest, at least if you're going to > just modify your current sequential code. > > Let's say that your matrix has np global rows. Then > > call VecCreateMPI(PETSC_COMM_WORLD,PETSC_DECIDE,np,b,ierr) > call VecDuplicate(b,xsol,ierr) > call VecGetLocalSize(b,mloc,ierr) > call VecGetOwnershipRange(b,Istart,Iend,ierr) > > do i=Istart+1,Iend > loc(i)=i-1 > end do > > These statements create parallel vectors for the solution (xsol) and > the right hand side (b). The vector loc(i)is used to set values in the > vectors later. > > Then > > ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > ! Create the linear solver context > ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > call KSPCreate(PETSC_COMM_WORLD,ksp,ierr) > > ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > ! Create the scatter context for getting results back to > ! each node. > ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > call VecScatterCreateToAll(xsol,xToLocalAll,xseq,ierr) > > ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > ! Create the matrix that defines the linear system, Ax = b, > ! for the EM problem. > ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > call pre_op3d(l,m,nzn,Istart,Iend,ijkhx,ijkhy,ijkhz,d_nnz,o_nnz) > > call MatCreateMPIAIJ(PETSC_COMM_WORLD,mloc,mloc,np,np, > . PETSC_NULL_INTEGER, d_nnz, PETSC_NULL_INTEGER, > . o_nnz,A,ierr) > > call set_op3d(A,l,m,nzn,period,resist,x,y,z,Istart,Iend, > . ijkhx,ijkhy,ijkhz) > > > The subroutine pre_op3d is an important routine and it figures out > how to pre-allocate space for your parallel matrix. This will be > the difference between near-instanteous assembly and 2.5 hours that > you experienced. Basically, it just computes the global column numbers, > and figures out if they are between Istart and Iend. I can send you > my subroutine if you'd like. > > The subroutine set_op3d.F actually assembles the parallel matrix and > goes like this: > > > jj=0 > > do i=1,l > do k=2,n > do j=2,m > > jj=jj+1 > row = jj-1 > > IF (jj >= Istart+1 .and. jj <= Iend) THEN > > compute elements... > > call MatSetValues(A,i1,row,ic,col,v,INSERT_VALUES, > . ierr) > > END IF > > end do > end do > end do > > At the end, > > call MatAssemblyBegin(A,MAT_FINAL_ASSEMBLY,ierr) > call MatAssemblyEnd(A,MAT_FINAL_ASSEMBLY,ierr) > > > Again, because you compute the pre-allocation, this is near-instanteous, > even for large models (larger than you're using). > > > Once you do that, you're golden: > > call KSPSetOperators(ksp,A,A,DIFFERENT_NONZERO_PATTERN,ierr) > > etc. > > Randy M. > San Francisco > > > Evrim Dizemen wrote: >> Hi all, >> >> Again thanks for your comments. I guess i can not define the problem >> correctly. I have a sequantial fortran code giving me the global >> matrix of 200000x200000. The code writes the matrix in a binary file >> at little endian mode (i can write only the nonzero terms or the >> entire matrix). I tried to change the binary mode to big endian and >> read the global matrix by a c program as in the example >> /src/mat/example/tests/ex31.c. However the program reads binary file >> wrong and gives the following error message but the true value of >> no-nonzero in the binary file is 6 (for the test case 3x3 matrix) : >> >> reading matrix in binary from matrix.dat ... >> ------------------------------------------------------------------------ >> Petsc Release Version 2.3.1, Patch 13, Wed May 10 11:08:35 CDT 2006 >> BK revision: balay at asterix.mcs.anl.gov|ChangeSet|20060510160640|13832 >> See docs/changes/index.html for recent updates. >> See docs/faq.html for hints about trouble shooting. >> See docs/index.html for manual pages. >> ------------------------------------------------------------------------ >> ./ex31 on a linux named akbaba.ae.metu.edu.tr by evrim Thu Jun 15 >> 09:26:36 2006 >> Libraries linked from /home/evrim/petsc-2.3.1-p13/lib/linux >> Configure run at Tue May 30 10:26:48 2006 >> Configure options --with-scalar-type=complex --with-shared=0 >> ------------------------------------------------------------------------ >> [0]PETSC ERROR: MatLoad_SeqAIJ() line 3055 in >> src/mat/impls/aij/seq/aij.c >> [0]PETSC ERROR: Read from file failed! >> [0]PETSC ERROR: Inconsistant matrix data in file. no-nonzeros = >> 100663296, sum-row-lengths = 234300 >> ! >> [0]PETSC ERROR: MatLoad() line 149 in src/mat/utils/matio.c >> [0]PETSC ERROR: main() line 37 in src/mat/examples/tests/ex31.c >> >> I want to send the global matrix at once to Petsc by a written input >> file (as i'm working on now) or by sending the matrix array from my >> fortran code and then partition it and solve iteratively. After the >> solution i also want to get the solution vector back to my fortran >> code. As i told in the previous mails i tried to send the matrix >> array to Petsc and used MatSetValues as reading one value at time in >> a do loop but it took about 2,5 hours to read the global matrix. >> Additionally i tried to read a row at a time but can not figure out >> a algorithm for this. Hence i do not prefer to create the matrix >> again in Petsc by MatSetValues. >> >> Aside i figured out that the binary files written in fortran and c >> are completely different from each other (fortran adds the size of >> the characters to the beginning and end of each character) so i wrote >> a c interface code to get the matrix array from the fortran code and >> write it to a binary file in c format. By this code i avoided from >> the additional information in the binary file but i still have the >> endianness problem. >> >> I know that i asked so much but since i'm a rookie in parallel >> programming, c language and library using i really need your comments >> on my problem. Sorry for this long mail and thanks a lot for your >> kind effort on guiding me. >> >> Thanks >> >> EVRIM >> > From knepley at gmail.com Thu Jun 15 08:58:43 2006 From: knepley at gmail.com (Matthew Knepley) Date: Thu, 15 Jun 2006 08:58:43 -0500 Subject: Matrix input file format In-Reply-To: <449166C7.5080301@ae.metu.edu.tr> References: <447D4847.5030007@ae.metu.edu.tr> <4486BE58.4030207@ae.metu.edu.tr> <44911C3D.3020904@ae.metu.edu.tr> <44915AAC.2070309@geosystem.us> <449166C7.5080301@ae.metu.edu.tr> Message-ID: The Istart and Iend are the rows present on this particular processor, which can be obtain from MatGetOwnershipRange(). Matt On 6/15/06, Evrim Dizemen wrote: > > Dear Randall, > > I guess i began to understand the consepts but there is still a missing > point that i do not know when and how we define Istart and Iend. I'll be > glade if you can send me the pre_op3d routine so i can see the algorithm > which is a black box for me now. > > Thanks a lot > > EVRIM > > > Randall Mackie wrote: > > Hi Evrim, > > > > It's quite easy to modify your Fortran code to do what you want. I > > thought > > I had written it all out before, but I'll try again. There are many ways > > to do this, but I'll start with the easiest, at least if you're going to > > just modify your current sequential code. > > > > Let's say that your matrix has np global rows. Then > > > > call VecCreateMPI(PETSC_COMM_WORLD,PETSC_DECIDE,np,b,ierr) > > call VecDuplicate(b,xsol,ierr) > > call VecGetLocalSize(b,mloc,ierr) > > call VecGetOwnershipRange(b,Istart,Iend,ierr) > > > > do i=Istart+1,Iend > > loc(i)=i-1 > > end do > > > > These statements create parallel vectors for the solution (xsol) and > > the right hand side (b). The vector loc(i)is used to set values in the > > vectors later. > > > > Then > > > > ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > - > > ! Create the linear solver context > > ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > - > > > > call KSPCreate(PETSC_COMM_WORLD,ksp,ierr) > > > > ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > - > > ! Create the scatter context for getting results back to > > ! each node. > > ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > - > > > > call VecScatterCreateToAll(xsol,xToLocalAll,xseq,ierr) > > > > ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > - > > ! Create the matrix that defines the linear system, Ax = b, > > ! for the EM problem. > > ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > - > > > > call pre_op3d(l,m,nzn,Istart,Iend,ijkhx,ijkhy,ijkhz,d_nnz,o_nnz) > > > > call MatCreateMPIAIJ(PETSC_COMM_WORLD,mloc,mloc,np,np, > > . PETSC_NULL_INTEGER, d_nnz, PETSC_NULL_INTEGER, > > . o_nnz,A,ierr) > > > > call set_op3d(A,l,m,nzn,period,resist,x,y,z,Istart,Iend, > > . ijkhx,ijkhy,ijkhz) > > > > > > The subroutine pre_op3d is an important routine and it figures out > > how to pre-allocate space for your parallel matrix. This will be > > the difference between near-instanteous assembly and 2.5 hours that > > you experienced. Basically, it just computes the global column numbers, > > and figures out if they are between Istart and Iend. I can send you > > my subroutine if you'd like. > > > > The subroutine set_op3d.F actually assembles the parallel matrix and > > goes like this: > > > > > > jj=0 > > > > do i=1,l > > do k=2,n > > do j=2,m > > > > jj=jj+1 > > row = jj-1 > > > > IF (jj >= Istart+1 .and. jj <= Iend) THEN > > > > compute elements... > > > > call MatSetValues(A,i1,row,ic,col,v,INSERT_VALUES, > > . ierr) > > > > END IF > > > > end do > > end do > > end do > > > > At the end, > > > > call MatAssemblyBegin(A,MAT_FINAL_ASSEMBLY,ierr) > > call MatAssemblyEnd(A,MAT_FINAL_ASSEMBLY,ierr) > > > > > > Again, because you compute the pre-allocation, this is near-instanteous, > > even for large models (larger than you're using). > > > > > > Once you do that, you're golden: > > > > call KSPSetOperators(ksp,A,A,DIFFERENT_NONZERO_PATTERN,ierr) > > > > etc. > > > > Randy M. > > San Francisco > > > > > > Evrim Dizemen wrote: > >> Hi all, > >> > >> Again thanks for your comments. I guess i can not define the problem > >> correctly. I have a sequantial fortran code giving me the global > >> matrix of 200000x200000. The code writes the matrix in a binary file > >> at little endian mode (i can write only the nonzero terms or the > >> entire matrix). I tried to change the binary mode to big endian and > >> read the global matrix by a c program as in the example > >> /src/mat/example/tests/ex31.c. However the program reads binary file > >> wrong and gives the following error message but the true value of > >> no-nonzero in the binary file is 6 (for the test case 3x3 matrix) : > >> > >> reading matrix in binary from matrix.dat ... > >> > ------------------------------------------------------------------------ > >> Petsc Release Version 2.3.1, Patch 13, Wed May 10 11:08:35 CDT 2006 > >> BK revision: balay at asterix.mcs.anl.gov|ChangeSet|20060510160640|13832 > >> See docs/changes/index.html for recent updates. > >> See docs/faq.html for hints about trouble shooting. > >> See docs/index.html for manual pages. > >> > ------------------------------------------------------------------------ > >> ./ex31 on a linux named akbaba.ae.metu.edu.tr by evrim Thu Jun 15 > >> 09:26:36 2006 > >> Libraries linked from /home/evrim/petsc-2.3.1-p13/lib/linux > >> Configure run at Tue May 30 10:26:48 2006 > >> Configure options --with-scalar-type=complex --with-shared=0 > >> > ------------------------------------------------------------------------ > >> [0]PETSC ERROR: MatLoad_SeqAIJ() line 3055 in > >> src/mat/impls/aij/seq/aij.c > >> [0]PETSC ERROR: Read from file failed! > >> [0]PETSC ERROR: Inconsistant matrix data in file. no-nonzeros = > >> 100663296, sum-row-lengths = 234300 > >> ! > >> [0]PETSC ERROR: MatLoad() line 149 in src/mat/utils/matio.c > >> [0]PETSC ERROR: main() line 37 in src/mat/examples/tests/ex31.c > >> > >> I want to send the global matrix at once to Petsc by a written input > >> file (as i'm working on now) or by sending the matrix array from my > >> fortran code and then partition it and solve iteratively. After the > >> solution i also want to get the solution vector back to my fortran > >> code. As i told in the previous mails i tried to send the matrix > >> array to Petsc and used MatSetValues as reading one value at time in > >> a do loop but it took about 2,5 hours to read the global matrix. > >> Additionally i tried to read a row at a time but can not figure out > >> a algorithm for this. Hence i do not prefer to create the matrix > >> again in Petsc by MatSetValues. > >> > >> Aside i figured out that the binary files written in fortran and c > >> are completely different from each other (fortran adds the size of > >> the characters to the beginning and end of each character) so i wrote > >> a c interface code to get the matrix array from the fortran code and > >> write it to a binary file in c format. By this code i avoided from > >> the additional information in the binary file but i still have the > >> endianness problem. > >> > >> I know that i asked so much but since i'm a rookie in parallel > >> programming, c language and library using i really need your comments > >> on my problem. Sorry for this long mail and thanks a lot for your > >> kind effort on guiding me. > >> > >> Thanks > >> > >> EVRIM > >> > > > > -- "Failure has a thousand explanations. Success doesn't need one" -- Sir Alec Guiness -------------- next part -------------- An HTML attachment was scrubbed... URL: From randy at geosystem.us Thu Jun 15 09:03:58 2006 From: randy at geosystem.us (Randall Mackie) Date: Thu, 15 Jun 2006 07:03:58 -0700 Subject: Matrix input file format In-Reply-To: <449166C7.5080301@ae.metu.edu.tr> References: <447D4847.5030007@ae.metu.edu.tr> <4486BE58.4030207@ae.metu.edu.tr> <44911C3D.3020904@ae.metu.edu.tr> <44915AAC.2070309@geosystem.us> <449166C7.5080301@ae.metu.edu.tr> Message-ID: <449168CE.205@geosystem.us> Hi Evrim, The call to VecGetOwnershipRange below is the call that determines, for each processor, what part of the global matrix it "owns". Say you have a 10x10 matrix, and 2 processors. The first 5 rows would be sent to processor 1 and the second 5 rows would be sent to processor 2. The subroutine pre_op3d.F is below, but I would suggest that you try to build up incrementally. Just write a little program that has the first four Vec calls below, and then print out the results, like, print*,rank, Istart, Iend so you get an understanding of what's going on. Then you can add the next part about figuring out the pre-allocation, then print out those values, etc. Here's a snippet of my subroutine to figure out the preallocation. The variables ijkhx, ijkhy, and ijkhz are simply the global row numbers for each entry. subroutine pre_op3d(l,m,n,Istart,Iend,ijkhx,ijkhy,ijkhz, . d_nnz,o_nnz) ************************************************************************ * subroutine to determine the number of on-processor and off-processor * elements in the A coefficient matrix. these increases the * efficiency of building the parallel matrix. ************************************************************************ USE KINDS IMPLICIT NONE ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! Include files ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #include "include/finclude/petsc.h" #include "include/finclude/petscvec.h" #include "include/finclude/petscsys.h" ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! Variable declarations ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - PetscInt Istart,Iend PetscInt i,j,k,jj,ic PetscInt col(13),iloc,kk PetscInt d_nnz(*),o_nnz(*) PetscErrorCode ierr INTEGER (KIND=i4) :: l,m,n INTEGER (KIND=i4) :: ijkhx(l,m,n),ijkhy(l,m,n),ijkhz(l,m,n) jj=0 iloc=0 do i=1,l do k=2,n do j=2,m jj=jj+1 IF (jj >= Istart+1 .and. jj <= Iend) THEN iloc=iloc+1 d_nnz(iloc)=0 o_nnz(iloc)=0 * Hxijk ic=1 col(ic)=jj-1 if(k.ne.2) then ic=ic+1 col(ic)=ijkhx(i,j,k-1)-1 ! Hxijc end if if(i.ne.1) then ic=ic+1 col(ic)=ijkhz(i,j,k-1)-1 ! Hzijc end if if(i.ne.l) then ic=ic+1 col(ic)=ijkhz(i+1,j,k-1)-1 ! Hzdjc end if [more entries like these...] do kk=1,ic IF (col(kk) > Istart .and. col(kk) <= Iend) THEN d_nnz(iloc)=d_nnz(iloc)+1 ELSE o_nnz(iloc)=o_nnz(iloc)+1 END IF end do END IF end do end do end do And now you can use d_nnz and o_nnz to pre-allocate your matrix. Randy Evrim Dizemen wrote: > Dear Randall, > > I guess i began to understand the consepts but there is still a missing > point that i do not know when and how we define Istart and Iend. I'll be > glade if you can send me the pre_op3d routine so i can see the algorithm > which is a black box for me now. > > Thanks a lot > > EVRIM > > > Randall Mackie wrote: >> Hi Evrim, >> >> It's quite easy to modify your Fortran code to do what you want. I >> thought >> I had written it all out before, but I'll try again. There are many ways >> to do this, but I'll start with the easiest, at least if you're going to >> just modify your current sequential code. >> >> Let's say that your matrix has np global rows. Then >> >> call VecCreateMPI(PETSC_COMM_WORLD,PETSC_DECIDE,np,b,ierr) >> call VecDuplicate(b,xsol,ierr) >> call VecGetLocalSize(b,mloc,ierr) >> call VecGetOwnershipRange(b,Istart,Iend,ierr) >> >> do i=Istart+1,Iend >> loc(i)=i-1 >> end do >> >> These statements create parallel vectors for the solution (xsol) and >> the right hand side (b). The vector loc(i)is used to set values in the >> vectors later. >> >> Then >> >> ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >> ! Create the linear solver context >> ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >> >> call KSPCreate(PETSC_COMM_WORLD,ksp,ierr) >> >> ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >> ! Create the scatter context for getting results back to >> ! each node. >> ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >> >> call VecScatterCreateToAll(xsol,xToLocalAll,xseq,ierr) >> >> ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >> ! Create the matrix that defines the linear system, Ax = b, >> ! for the EM problem. >> ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >> >> call pre_op3d(l,m,nzn,Istart,Iend,ijkhx,ijkhy,ijkhz,d_nnz,o_nnz) >> >> call MatCreateMPIAIJ(PETSC_COMM_WORLD,mloc,mloc,np,np, >> . PETSC_NULL_INTEGER, d_nnz, PETSC_NULL_INTEGER, >> . o_nnz,A,ierr) >> >> call set_op3d(A,l,m,nzn,period,resist,x,y,z,Istart,Iend, >> . ijkhx,ijkhy,ijkhz) >> >> >> The subroutine pre_op3d is an important routine and it figures out >> how to pre-allocate space for your parallel matrix. This will be >> the difference between near-instanteous assembly and 2.5 hours that >> you experienced. Basically, it just computes the global column numbers, >> and figures out if they are between Istart and Iend. I can send you >> my subroutine if you'd like. >> >> The subroutine set_op3d.F actually assembles the parallel matrix and >> goes like this: >> >> >> jj=0 >> >> do i=1,l >> do k=2,n >> do j=2,m >> >> jj=jj+1 >> row = jj-1 >> >> IF (jj >= Istart+1 .and. jj <= Iend) THEN >> >> compute elements... >> >> call MatSetValues(A,i1,row,ic,col,v,INSERT_VALUES, >> . ierr) >> >> END IF >> >> end do >> end do >> end do >> >> At the end, >> >> call MatAssemblyBegin(A,MAT_FINAL_ASSEMBLY,ierr) >> call MatAssemblyEnd(A,MAT_FINAL_ASSEMBLY,ierr) >> >> >> Again, because you compute the pre-allocation, this is near-instanteous, >> even for large models (larger than you're using). >> >> >> Once you do that, you're golden: >> >> call KSPSetOperators(ksp,A,A,DIFFERENT_NONZERO_PATTERN,ierr) >> >> etc. >> >> Randy M. >> San Francisco >> >> >> Evrim Dizemen wrote: >>> Hi all, >>> >>> Again thanks for your comments. I guess i can not define the problem >>> correctly. I have a sequantial fortran code giving me the global >>> matrix of 200000x200000. The code writes the matrix in a binary file >>> at little endian mode (i can write only the nonzero terms or the >>> entire matrix). I tried to change the binary mode to big endian and >>> read the global matrix by a c program as in the example >>> /src/mat/example/tests/ex31.c. However the program reads binary file >>> wrong and gives the following error message but the true value of >>> no-nonzero in the binary file is 6 (for the test case 3x3 matrix) : >>> >>> reading matrix in binary from matrix.dat ... >>> ------------------------------------------------------------------------ >>> Petsc Release Version 2.3.1, Patch 13, Wed May 10 11:08:35 CDT 2006 >>> BK revision: balay at asterix.mcs.anl.gov|ChangeSet|20060510160640|13832 >>> See docs/changes/index.html for recent updates. >>> See docs/faq.html for hints about trouble shooting. >>> See docs/index.html for manual pages. >>> ------------------------------------------------------------------------ >>> ./ex31 on a linux named akbaba.ae.metu.edu.tr by evrim Thu Jun 15 >>> 09:26:36 2006 >>> Libraries linked from /home/evrim/petsc-2.3.1-p13/lib/linux >>> Configure run at Tue May 30 10:26:48 2006 >>> Configure options --with-scalar-type=complex --with-shared=0 >>> ------------------------------------------------------------------------ >>> [0]PETSC ERROR: MatLoad_SeqAIJ() line 3055 in >>> src/mat/impls/aij/seq/aij.c >>> [0]PETSC ERROR: Read from file failed! >>> [0]PETSC ERROR: Inconsistant matrix data in file. no-nonzeros = >>> 100663296, sum-row-lengths = 234300 >>> ! >>> [0]PETSC ERROR: MatLoad() line 149 in src/mat/utils/matio.c >>> [0]PETSC ERROR: main() line 37 in src/mat/examples/tests/ex31.c >>> >>> I want to send the global matrix at once to Petsc by a written input >>> file (as i'm working on now) or by sending the matrix array from my >>> fortran code and then partition it and solve iteratively. After the >>> solution i also want to get the solution vector back to my fortran >>> code. As i told in the previous mails i tried to send the matrix >>> array to Petsc and used MatSetValues as reading one value at time in >>> a do loop but it took about 2,5 hours to read the global matrix. >>> Additionally i tried to read a row at a time but can not figure out >>> a algorithm for this. Hence i do not prefer to create the matrix >>> again in Petsc by MatSetValues. >>> >>> Aside i figured out that the binary files written in fortran and c >>> are completely different from each other (fortran adds the size of >>> the characters to the beginning and end of each character) so i wrote >>> a c interface code to get the matrix array from the fortran code and >>> write it to a binary file in c format. By this code i avoided from >>> the additional information in the binary file but i still have the >>> endianness problem. >>> >>> I know that i asked so much but since i'm a rookie in parallel >>> programming, c language and library using i really need your comments >>> on my problem. Sorry for this long mail and thanks a lot for your >>> kind effort on guiding me. >>> >>> Thanks >>> >>> EVRIM >>> >> > -- Randall Mackie GSY-USA, Inc. PMB# 643 2261 Market St., San Francisco, CA 94114-1600 Tel (415) 469-8649 Fax (415) 469-5044 California Registered Geophysicist License No. GP 1034 From leep at cims.nyu.edu Thu Jun 15 11:06:02 2006 From: leep at cims.nyu.edu (Pilhwa Lee) Date: Thu, 15 Jun 2006 12:06:02 -0400 Subject: in the test compilation Message-ID: <1150387562.20808.8.camel@box106.cims.nyu.edu> Hi, I'm in the stage of testing compilation of an example. I'm using PETSc 2.1.6. In the course of compilation of /petsc-2.1.6/src/vec/examples/tutorials/ex11f.F, the following errors comes up. If any of you have some idea for solution, let me know please. thanks, Pilhwa the content of the log -------------------------------------------------------------------- g77 -Wno-globals -c -g -I/home/leep/petsc-2.1.6 - I/home/leep/petsc-2.1.6/bmake/linux64 -I/home/leep/petsc-2.1.6/include - I/home/leep/mpich/include -DPETSC_USE_DEBUG -DPETSC_USE_LOG - DPETSC_USE_BOPT_g -DPETSC_USE_STACK ex11f.F g77 -g -Wl,-rpath,/home/leep/petsc-2.1.6/lib/libg/linux64 -o ex11f ex11f.o -L/home/leep/petsc-2.1.6/lib/libg/linux64 -lpetscfortran - L/home/leep/petsc-2.1.6/lib/libg/linux64 -lpetscvec -lpetsc -L/usr/X11R6/lib64 -lX11 -L/usr/lib64 -llapack -lblas -L/home/leep/mpich/lib -lmpich -lpmpich - ldl -lc -lg2c -lm /usr/lib/gcc/x86_64-redhat-linux/3.4.5/../../../../lib64/crt1.o(.text +0x21): In function `_start': : undefined reference to `main' /home/leep/petsc-2.1.6/lib/libg/linux64/libpetscfortran.a (zstartf.o)(.text+0x4f): In function `PetscInitializeFortran': /home/leep/petsc-2.1.6/src/fortran/custom/zstartf.c:58: undefined reference to `petscsetcommonblock_' collect2: ld returned 1 exit status make: [ex11f] Error 1 (ignored) rm -f -f ex11f.o ------------------------------------------------------------------------ From balay at mcs.anl.gov Thu Jun 15 11:13:40 2006 From: balay at mcs.anl.gov (Satish Balay) Date: Thu, 15 Jun 2006 11:13:40 -0500 (CDT) Subject: in the test compilation In-Reply-To: <1150387562.20808.8.camel@box106.cims.nyu.edu> References: <1150387562.20808.8.camel@box106.cims.nyu.edu> Message-ID: Why use petsc-2.1.6 instead of the latest 2.3.1? What do you have for: nm -Ao /home/leep/petsc-2.1.6/lib/libg/linux64/*.a |grep -i petscsetcommonblock Satish On Thu, 15 Jun 2006, Pilhwa Lee wrote: > Hi, > > I'm in the stage of testing compilation of an example. I'm using PETSc > 2.1.6. In the course of compilation > of /petsc-2.1.6/src/vec/examples/tutorials/ex11f.F, the following errors > comes up. If any of you have some idea for solution, let me know please. > > thanks, Pilhwa > > the content of the log > -------------------------------------------------------------------- > g77 -Wno-globals -c -g -I/home/leep/petsc-2.1.6 - > I/home/leep/petsc-2.1.6/bmake/linux64 -I/home/leep/petsc-2.1.6/include - > I/home/leep/mpich/include -DPETSC_USE_DEBUG -DPETSC_USE_LOG - > DPETSC_USE_BOPT_g -DPETSC_USE_STACK ex11f.F > g77 -g -Wl,-rpath,/home/leep/petsc-2.1.6/lib/libg/linux64 -o ex11f > ex11f.o -L/home/leep/petsc-2.1.6/lib/libg/linux64 -lpetscfortran - > L/home/leep/petsc-2.1.6/lib/libg/linux64 -lpetscvec -lpetsc > -L/usr/X11R6/lib64 -lX11 > -L/usr/lib64 -llapack -lblas -L/home/leep/mpich/lib -lmpich -lpmpich - > ldl -lc -lg2c -lm > /usr/lib/gcc/x86_64-redhat-linux/3.4.5/../../../../lib64/crt1.o(.text > +0x21): In function `_start': > : undefined reference to `main' > /home/leep/petsc-2.1.6/lib/libg/linux64/libpetscfortran.a > (zstartf.o)(.text+0x4f): In function `PetscInitializeFortran': > /home/leep/petsc-2.1.6/src/fortran/custom/zstartf.c:58: undefined > reference to `petscsetcommonblock_' > collect2: ld returned 1 exit status > make: [ex11f] Error 1 (ignored) > rm -f -f ex11f.o > ------------------------------------------------------------------------ > > > > > From leep at cims.nyu.edu Thu Jun 15 11:31:21 2006 From: leep at cims.nyu.edu (Pilhwa Lee) Date: Thu, 15 Jun 2006 12:31:21 -0400 Subject: in the test compilation In-Reply-To: References: <1150387562.20808.8.camel@box106.cims.nyu.edu> Message-ID: <1150389081.20376.2.camel@box106.cims.nyu.edu> Hi Satish, Based on PETSc-2.1.6, I'm using SAMRAI. I get the following result. /home/leep/petsc-2.1.6/lib/libg/linux64/libpetscfortran.a:zstartf.o: U petscsetcommonblock_ Thanks, Pilhwa On Thu, 2006-06-15 at 11:13 -0500, Satish Balay wrote: > Why use petsc-2.1.6 instead of the latest 2.3.1? > > What do you have for: > > nm -Ao /home/leep/petsc-2.1.6/lib/libg/linux64/*.a |grep -i petscsetcommonblock > > Satish > > > On Thu, 15 Jun 2006, Pilhwa Lee wrote: > > > Hi, > > > > I'm in the stage of testing compilation of an example. I'm using PETSc > > 2.1.6. In the course of compilation > > of /petsc-2.1.6/src/vec/examples/tutorials/ex11f.F, the following errors > > comes up. If any of you have some idea for solution, let me know please. > > > > thanks, Pilhwa > > > > the content of the log > > -------------------------------------------------------------------- > > g77 -Wno-globals -c -g -I/home/leep/petsc-2.1.6 - > > I/home/leep/petsc-2.1.6/bmake/linux64 -I/home/leep/petsc-2.1.6/include - > > I/home/leep/mpich/include -DPETSC_USE_DEBUG -DPETSC_USE_LOG - > > DPETSC_USE_BOPT_g -DPETSC_USE_STACK ex11f.F > > g77 -g -Wl,-rpath,/home/leep/petsc-2.1.6/lib/libg/linux64 -o ex11f > > ex11f.o -L/home/leep/petsc-2.1.6/lib/libg/linux64 -lpetscfortran - > > L/home/leep/petsc-2.1.6/lib/libg/linux64 -lpetscvec -lpetsc > > -L/usr/X11R6/lib64 -lX11 > > -L/usr/lib64 -llapack -lblas -L/home/leep/mpich/lib -lmpich -lpmpich - > > ldl -lc -lg2c -lm > > /usr/lib/gcc/x86_64-redhat-linux/3.4.5/../../../../lib64/crt1.o(.text > > +0x21): In function `_start': > > : undefined reference to `main' > > /home/leep/petsc-2.1.6/lib/libg/linux64/libpetscfortran.a > > (zstartf.o)(.text+0x4f): In function `PetscInitializeFortran': > > /home/leep/petsc-2.1.6/src/fortran/custom/zstartf.c:58: undefined > > reference to `petscsetcommonblock_' > > collect2: ld returned 1 exit status > > make: [ex11f] Error 1 (ignored) > > rm -f -f ex11f.o > > ------------------------------------------------------------------------ > > > > > > > > > > > From balay at mcs.anl.gov Thu Jun 15 11:35:39 2006 From: balay at mcs.anl.gov (Satish Balay) Date: Thu, 15 Jun 2006 11:35:39 -0500 (CDT) Subject: in the test compilation In-Reply-To: <1150389081.20376.2.camel@box106.cims.nyu.edu> References: <1150387562.20808.8.camel@box106.cims.nyu.edu> <1150389081.20376.2.camel@box106.cims.nyu.edu> Message-ID: Its likely there were problems with the build of libraries. Can you send us this logfile? Satish On Thu, 15 Jun 2006, Pilhwa Lee wrote: > Hi Satish, > > Based on PETSc-2.1.6, I'm using SAMRAI. > > I get the following result. > > > > /home/leep/petsc-2.1.6/lib/libg/linux64/libpetscfortran.a:zstartf.o: > U petscsetcommonblock_ > > > > > Thanks, Pilhwa > > > > On Thu, 2006-06-15 at 11:13 -0500, Satish Balay wrote: > > Why use petsc-2.1.6 instead of the latest 2.3.1? > > > > What do you have for: > > > > nm -Ao /home/leep/petsc-2.1.6/lib/libg/linux64/*.a |grep -i petscsetcommonblock > > > > Satish > > > > > > On Thu, 15 Jun 2006, Pilhwa Lee wrote: > > > > > Hi, > > > > > > I'm in the stage of testing compilation of an example. I'm using PETSc > > > 2.1.6. In the course of compilation > > > of /petsc-2.1.6/src/vec/examples/tutorials/ex11f.F, the following errors > > > comes up. If any of you have some idea for solution, let me know please. > > > > > > thanks, Pilhwa > > > > > > the content of the log > > > -------------------------------------------------------------------- > > > g77 -Wno-globals -c -g -I/home/leep/petsc-2.1.6 - > > > I/home/leep/petsc-2.1.6/bmake/linux64 -I/home/leep/petsc-2.1.6/include - > > > I/home/leep/mpich/include -DPETSC_USE_DEBUG -DPETSC_USE_LOG - > > > DPETSC_USE_BOPT_g -DPETSC_USE_STACK ex11f.F > > > g77 -g -Wl,-rpath,/home/leep/petsc-2.1.6/lib/libg/linux64 -o ex11f > > > ex11f.o -L/home/leep/petsc-2.1.6/lib/libg/linux64 -lpetscfortran - > > > L/home/leep/petsc-2.1.6/lib/libg/linux64 -lpetscvec -lpetsc > > > -L/usr/X11R6/lib64 -lX11 > > > -L/usr/lib64 -llapack -lblas -L/home/leep/mpich/lib -lmpich -lpmpich - > > > ldl -lc -lg2c -lm > > > /usr/lib/gcc/x86_64-redhat-linux/3.4.5/../../../../lib64/crt1.o(.text > > > +0x21): In function `_start': > > > : undefined reference to `main' > > > /home/leep/petsc-2.1.6/lib/libg/linux64/libpetscfortran.a > > > (zstartf.o)(.text+0x4f): In function `PetscInitializeFortran': > > > /home/leep/petsc-2.1.6/src/fortran/custom/zstartf.c:58: undefined > > > reference to `petscsetcommonblock_' > > > collect2: ld returned 1 exit status > > > make: [ex11f] Error 1 (ignored) > > > rm -f -f ex11f.o > > > ------------------------------------------------------------------------ > > > > > > > > > > > > > > > > > > > From leep at cims.nyu.edu Thu Jun 15 11:41:41 2006 From: leep at cims.nyu.edu (Pilhwa Lee) Date: Thu, 15 Jun 2006 12:41:41 -0400 Subject: in the test compilation In-Reply-To: References: <1150387562.20808.8.camel@box106.cims.nyu.edu> <1150389081.20376.2.camel@box106.cims.nyu.edu> Message-ID: <1150389701.20376.5.camel@box106.cims.nyu.edu> Here's the log file. Thanks, Pilhwa On Thu, 2006-06-15 at 11:35 -0500, Satish Balay wrote: > Its likely there were problems with the build of libraries. > Can you send us this logfile? > > Satish > > On Thu, 15 Jun 2006, Pilhwa Lee wrote: > > > Hi Satish, > > > > Based on PETSc-2.1.6, I'm using SAMRAI. > > > > I get the following result. > > > > > > > > /home/leep/petsc-2.1.6/lib/libg/linux64/libpetscfortran.a:zstartf.o: > > U petscsetcommonblock_ > > > > > > > > > > Thanks, Pilhwa > > > > > > > > On Thu, 2006-06-15 at 11:13 -0500, Satish Balay wrote: > > > Why use petsc-2.1.6 instead of the latest 2.3.1? > > > > > > What do you have for: > > > > > > nm -Ao /home/leep/petsc-2.1.6/lib/libg/linux64/*.a |grep -i petscsetcommonblock > > > > > > Satish > > > > > > > > > On Thu, 15 Jun 2006, Pilhwa Lee wrote: > > > > > > > Hi, > > > > > > > > I'm in the stage of testing compilation of an example. I'm using PETSc > > > > 2.1.6. In the course of compilation > > > > of /petsc-2.1.6/src/vec/examples/tutorials/ex11f.F, the following errors > > > > comes up. If any of you have some idea for solution, let me know please. > > > > > > > > thanks, Pilhwa > > > > > > > > the content of the log > > > > -------------------------------------------------------------------- > > > > g77 -Wno-globals -c -g -I/home/leep/petsc-2.1.6 - > > > > I/home/leep/petsc-2.1.6/bmake/linux64 -I/home/leep/petsc-2.1.6/include - > > > > I/home/leep/mpich/include -DPETSC_USE_DEBUG -DPETSC_USE_LOG - > > > > DPETSC_USE_BOPT_g -DPETSC_USE_STACK ex11f.F > > > > g77 -g -Wl,-rpath,/home/leep/petsc-2.1.6/lib/libg/linux64 -o ex11f > > > > ex11f.o -L/home/leep/petsc-2.1.6/lib/libg/linux64 -lpetscfortran - > > > > L/home/leep/petsc-2.1.6/lib/libg/linux64 -lpetscvec -lpetsc > > > > -L/usr/X11R6/lib64 -lX11 > > > > -L/usr/lib64 -llapack -lblas -L/home/leep/mpich/lib -lmpich -lpmpich - > > > > ldl -lc -lg2c -lm > > > > /usr/lib/gcc/x86_64-redhat-linux/3.4.5/../../../../lib64/crt1.o(.text > > > > +0x21): In function `_start': > > > > : undefined reference to `main' > > > > /home/leep/petsc-2.1.6/lib/libg/linux64/libpetscfortran.a > > > > (zstartf.o)(.text+0x4f): In function `PetscInitializeFortran': > > > > /home/leep/petsc-2.1.6/src/fortran/custom/zstartf.c:58: undefined > > > > reference to `petscsetcommonblock_' > > > > collect2: ld returned 1 exit status > > > > make: [ex11f] Error 1 (ignored) > > > > rm -f -f ex11f.o > > > > ------------------------------------------------------------------------ > > > > > > > > > > > > > > > > > > > > > > > > > > > > -------------- next part -------------- make[1]: Entering directory `/home/leep/petsc-2.1.6' ========================================== See docs/troubleshooting.html and docs/bugreporting.html for help with installation problems. Please send EVERYTHING printed out below when reporting problems To subscribe to the PETSc users mailing list, send mail to majordomo at mcs.anl.gov with the message: subscribe petsc-announce ========================================== On Thu Jun 15 11:10:01 EDT 2006 on box106.cims.nyu.edu Machine characteristics: Linux box106.cims.nyu.edu 2.6.9-5.ELsmp #1 SMP Wed Jan 5 19:29:47 EST 2005 x86_64 x86_64 x86_64 GNU/Linux ----------------------------------------- Using C compiler: gcc -fPIC -g -I/home/leep/petsc-2.1.6 -I/home/leep/petsc-2.1.6/bmake/linux64 -I/home/leep/petsc-2.1.6/include -I/home/leep/mpich/include -DPETSC_USE_DEBUG -DPETSC_USE_LOG -DPETSC_USE_BOPT_g -DPETSC_USE_STACK -D__SDIR__='. ' C Compiler version: gcc (GCC) 3.4.5 20051201 (Red Hat 3.4.5-2) Copyright (C) 2004 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. Using C++ compiler: g++ -fPIC -g -I/home/leep/petsc-2.1.6 -I/home/leep/petsc-2.1.6/bmake/linux64 -I/home/leep/petsc-2.1.6/include -I/home/leep/mpich/include -DPETSC_USE_DEBUG -DPETSC_USE_LOG -DPETSC_USE_BOPT_g -DPETSC_USE_STACK -D__SDIR__='. ' C++ Compiler version: g++ (GCC) 3.4.5 20051201 (Red Hat 3.4.5-2) Copyright (C) 2004 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. Using Fortran compiler: g77 -Wno-globals -g -I/home/leep/petsc-2.1.6 -I/home/leep/petsc-2.1.6/bmake/linux64 -I/home/leep/petsc-2.1.6/include -I/home/leep/mpich/include -DPETSC_USE_DEBUG -DPETSC_USE_LOG -DPETSC_USE_BOPT_g -DPETSC_USE_STACK Fortran Compiler version: GNU Fortran (GCC) 3.4.5 20051201 (Red Hat 3.4.5-2) ----------------------------------------- PETSC_VERSION_MAJOR 2 PETSC_VERSION_MINOR 1 PETSC_VERSION_SUBMINOR 6 PETSC_VERSION_PATCH 0 PETSC_VERSION_DATE "Aug 05, 2003" ----------------------------------------- Using PETSc flags: -DPETSC_USE_DEBUG -DPETSC_USE_LOG -DPETSC_USE_BOPT_g -DPETSC_USE_STACK ----------------------------------------- Using configuration flags: #define INCLUDED_PETSCCONF_H #define PARCH_linux #define PETSC_ARCH_NAME "linux" #define PETSC_HAVE_POPEN #define PETSC_HAVE_LIMITS_H #define PETSC_HAVE_PWD_H #define PETSC_HAVE_MALLOC_H #define PETSC_HAVE_STRING_H #define PETSC_HAVE_GETDOMAINNAME #define PETSC_HAVE_DRAND48 #define PETSC_HAVE_UNAME #define PETSC_HAVE_UNISTD_H #define PETSC_HAVE_SYS_TIME_H #define PETSC_HAVE_STDLIB_H #define PETSC_HAVE_GETCWD #define PETSC_HAVE_SLEEP #define PETSC_HAVE_SYS_PARAM_H #define PETSC_HAVE_SYS_STAT_H #define PETSC_HAVE_FORTRAN_UNDERSCORE #define PETSC_HAVE_FORTRAN_UNDERSCORE_UNDERSCORE #define PETSC_HAVE_READLINK #define PETSC_HAVE_MEMMOVE #define PETSC_HAVE_DOUBLE_ALIGN_MALLOC #define PETSC_HAVE_MEMALIGN #define PETSC_HAVE_SYS_RESOURCE_H #define PETSC_SIZEOF_VOID_P 8 #define PETSC_SIZEOF_INT 4 #define PETSC_SIZEOF_DOUBLE 8 #define PETSC_BITS_PER_BYTE 8 #define PETSC_SIZEOF_FLOAT 4 #define PETSC_SIZEOF_LONG 8 #define PETSC_SIZEOF_LONG_LONG 8 #define PETSC_HAVE_RTLD_GLOBAL 1 #define PETSC_PRINTF_FORMAT_CHECK(a,b) __attribute__ ((format (printf, a,b))) #define PETSC_HAVE_SYS_UTSNAME_H #define PETSC_MISSING_SIGSYS #define PETSC_HAVE_CXX_NAMESPACE ----------------------------------------- Using include paths: -I/home/leep/petsc-2.1.6 -I/home/leep/petsc-2.1.6/bmake/linux64 -I/home/leep/petsc-2.1.6/include -I/home/leep/mpich/include ----------------------------------------- Using PETSc directory: /home/leep/petsc-2.1.6 Using PETSc arch: linux64 ------------------------------------------ Using C linker: gcc -g -Wl,-rpath,/home/leep/petsc-2.1.6/lib/libg/linux64 Using Fortran linker: g77 -g -Wl,-rpath,/home/leep/petsc-2.1.6/lib/libg/linux64 Using libraries: -L/home/leep/petsc-2.1.6/lib/libg/linux64 -lpetscgsolver -lpetscgrid -lpetscmesh -lpetscts -lpetscsnes -lpetscsles -lpetscdm -lpetscmat -lpetscvec -lpetsc -L/usr/X11R6/lib64 -lX11 -L/usr/lib64 -llapack -lblas -L/home/leep/mpich/lib -lmpich -lpmpich -ldl -lc -lg2c -lm ------------------------------------------ Using mpirun: /home/leep/mpich/bin/mpirun ========================================== rm -f -f /home/leep/petsc-2.1.6/lib/libg/linux64/* BEGINNING TO COMPILE LIBRARIES IN ALL DIRECTORIES ========================================= libfast in: /home/leep/petsc-2.1.6/src libfast in: /home/leep/petsc-2.1.6/src/inline libfast in: /home/leep/petsc-2.1.6/src/sys libfast in: /home/leep/petsc-2.1.6/src/sys/src libfast in: /home/leep/petsc-2.1.6/src/sys/src/viewer libfast in: /home/leep/petsc-2.1.6/src/sys/src/viewer/impls libfast in: /home/leep/petsc-2.1.6/src/sys/src/viewer/impls/socket libfast in: /home/leep/petsc-2.1.6/src/sys/src/viewer/impls/ascii libfast in: /home/leep/petsc-2.1.6/src/sys/src/viewer/impls/binary libfast in: /home/leep/petsc-2.1.6/src/sys/src/viewer/impls/string libfast in: /home/leep/petsc-2.1.6/src/sys/src/viewer/impls/draw libfast in: /home/leep/petsc-2.1.6/src/sys/src/viewer/impls/vu libfast in: /home/leep/petsc-2.1.6/src/sys/src/viewer/impls/mathematica libfast in: /home/leep/petsc-2.1.6/src/sys/src/viewer/impls/silo libfast in: /home/leep/petsc-2.1.6/src/sys/src/viewer/examples libfast in: /home/leep/petsc-2.1.6/src/sys/src/viewer/examples/tutorials libfast in: /home/leep/petsc-2.1.6/src/sys/src/viewer/examples/tests libfast in: /home/leep/petsc-2.1.6/src/sys/src/viewer/interface libfast in: /home/leep/petsc-2.1.6/src/sys/src/draw libfast in: /home/leep/petsc-2.1.6/src/sys/src/draw/interface libfast in: /home/leep/petsc-2.1.6/src/sys/src/draw/impls libfast in: /home/leep/petsc-2.1.6/src/sys/src/draw/impls/ps libfast in: /home/leep/petsc-2.1.6/src/sys/src/draw/examples libfast in: /home/leep/petsc-2.1.6/src/sys/src/draw/examples/tests libfast in: /home/leep/petsc-2.1.6/src/sys/src/draw/examples/tutorials libfast in: /home/leep/petsc-2.1.6/src/sys/src/draw/utils libfast in: /home/leep/petsc-2.1.6/src/sys/src/error libfast in: /home/leep/petsc-2.1.6/src/sys/src/dll libfast in: /home/leep/petsc-2.1.6/src/sys/src/fileio libfast in: /home/leep/petsc-2.1.6/src/sys/src/memory libfast in: /home/leep/petsc-2.1.6/src/sys/src/objects libfast in: /home/leep/petsc-2.1.6/src/sys/src/objects/ams libfast in: /home/leep/petsc-2.1.6/src/sys/src/time libfast in: /home/leep/petsc-2.1.6/src/sys/src/utils libfast in: /home/leep/petsc-2.1.6/src/sys/src/plog libfast in: /home/leep/petsc-2.1.6/src/sys/src/mpiuni libfast in: /home/leep/petsc-2.1.6/src/sys/examples libfast in: /home/leep/petsc-2.1.6/src/sys/examples/tests libfast in: /home/leep/petsc-2.1.6/src/sys/examples/tutorials libfast in: /home/leep/petsc-2.1.6/src/vec libfast in: /home/leep/petsc-2.1.6/src/vec/is libfast in: /home/leep/petsc-2.1.6/src/vec/is/interface libfast in: /home/leep/petsc-2.1.6/src/vec/is/impls libfast in: /home/leep/petsc-2.1.6/src/vec/is/impls/general libfast in: /home/leep/petsc-2.1.6/src/vec/is/impls/stride libfast in: /home/leep/petsc-2.1.6/src/vec/is/impls/block libfast in: /home/leep/petsc-2.1.6/src/vec/is/examples libfast in: /home/leep/petsc-2.1.6/src/vec/is/examples/tests libfast in: /home/leep/petsc-2.1.6/src/vec/is/examples/tutorials libfast in: /home/leep/petsc-2.1.6/src/vec/is/utils libfast in: /home/leep/petsc-2.1.6/src/vec/utils libfast in: /home/leep/petsc-2.1.6/src/vec/interface libfast in: /home/leep/petsc-2.1.6/src/vec/impls libfast in: /home/leep/petsc-2.1.6/src/vec/impls/seq libfast in: /home/leep/petsc-2.1.6/src/vec/impls/mpi libfast in: /home/leep/petsc-2.1.6/src/vec/impls/shared libfast in: /home/leep/petsc-2.1.6/src/vec/examples libfast in: /home/leep/petsc-2.1.6/src/vec/examples/tests libfast in: /home/leep/petsc-2.1.6/src/vec/examples/tutorials libfast in: /home/leep/petsc-2.1.6/src/mat libfast in: /home/leep/petsc-2.1.6/src/mat/interface libfast in: /home/leep/petsc-2.1.6/src/mat/impls libfast in: /home/leep/petsc-2.1.6/src/mat/impls/dense libfast in: /home/leep/petsc-2.1.6/src/mat/impls/dense/seq libfast in: /home/leep/petsc-2.1.6/src/mat/impls/dense/mpi libfast in: /home/leep/petsc-2.1.6/src/mat/impls/aij libfast in: /home/leep/petsc-2.1.6/src/mat/impls/aij/seq libfast in: /home/leep/petsc-2.1.6/src/mat/impls/aij/mpi libfast in: /home/leep/petsc-2.1.6/src/mat/impls/shell libfast in: /home/leep/petsc-2.1.6/src/mat/impls/bdiag libfast in: /home/leep/petsc-2.1.6/src/mat/impls/bdiag/seq libfast in: /home/leep/petsc-2.1.6/src/mat/impls/bdiag/mpi libfast in: /home/leep/petsc-2.1.6/src/mat/impls/baij libfast in: /home/leep/petsc-2.1.6/src/mat/impls/baij/seq libfast in: /home/leep/petsc-2.1.6/src/mat/impls/baij/mpi libfast in: /home/leep/petsc-2.1.6/src/mat/impls/adj libfast in: /home/leep/petsc-2.1.6/src/mat/impls/adj/mpi libfast in: /home/leep/petsc-2.1.6/src/mat/impls/maij libfast in: /home/leep/petsc-2.1.6/src/mat/impls/is libfast in: /home/leep/petsc-2.1.6/src/mat/impls/sbaij libfast in: /home/leep/petsc-2.1.6/src/mat/impls/sbaij/seq libfast in: /home/leep/petsc-2.1.6/src/mat/impls/sbaij/mpi libfast in: /home/leep/petsc-2.1.6/src/mat/impls/normal libfast in: /home/leep/petsc-2.1.6/src/mat/examples libfast in: /home/leep/petsc-2.1.6/src/mat/examples/tests libfast in: /home/leep/petsc-2.1.6/src/mat/examples/tutorials libfast in: /home/leep/petsc-2.1.6/src/mat/utils libfast in: /home/leep/petsc-2.1.6/src/mat/matfd libfast in: /home/leep/petsc-2.1.6/src/mat/partition libfast in: /home/leep/petsc-2.1.6/src/mat/partition/impls libfast in: /home/leep/petsc-2.1.6/src/mat/order libfast in: /home/leep/petsc-2.1.6/src/mat/color libfast in: /home/leep/petsc-2.1.6/src/sles libfast in: /home/leep/petsc-2.1.6/src/sles/interface libfast in: /home/leep/petsc-2.1.6/src/sles/pc libfast in: /home/leep/petsc-2.1.6/src/sles/pc/interface libfast in: /home/leep/petsc-2.1.6/src/sles/pc/impls libfast in: /home/leep/petsc-2.1.6/src/sles/pc/impls/jacobi libfast in: /home/leep/petsc-2.1.6/src/sles/pc/impls/none libfast in: /home/leep/petsc-2.1.6/src/sles/pc/impls/sor libfast in: /home/leep/petsc-2.1.6/src/sles/pc/impls/lu libfast in: /home/leep/petsc-2.1.6/src/sles/pc/impls/shell libfast in: /home/leep/petsc-2.1.6/src/sles/pc/impls/bjacobi libfast in: /home/leep/petsc-2.1.6/src/sles/pc/impls/mg libfast in: /home/leep/petsc-2.1.6/src/sles/pc/impls/eisens libfast in: /home/leep/petsc-2.1.6/src/sles/pc/impls/ilu libfast in: /home/leep/petsc-2.1.6/src/sles/pc/impls/icc libfast in: /home/leep/petsc-2.1.6/src/sles/pc/impls/asm libfast in: /home/leep/petsc-2.1.6/src/sles/pc/impls/sles libfast in: /home/leep/petsc-2.1.6/src/sles/pc/impls/composite libfast in: /home/leep/petsc-2.1.6/src/sles/pc/impls/redundant libfast in: /home/leep/petsc-2.1.6/src/sles/pc/impls/milu libfast in: /home/leep/petsc-2.1.6/src/sles/pc/impls/is libfast in: /home/leep/petsc-2.1.6/src/sles/pc/impls/is/nn libfast in: /home/leep/petsc-2.1.6/src/sles/pc/impls/cholesky libfast in: /home/leep/petsc-2.1.6/src/sles/pc/impls/pbjacobi libfast in: /home/leep/petsc-2.1.6/src/sles/pc/impls/ml libfast in: /home/leep/petsc-2.1.6/src/sles/pc/impls/schur libfast in: /home/leep/petsc-2.1.6/src/sles/pc/impls/mat libfast in: /home/leep/petsc-2.1.6/src/sles/pc/examples libfast in: /home/leep/petsc-2.1.6/src/sles/pc/examples/tests libfast in: /home/leep/petsc-2.1.6/src/sles/pc/examples/tutorials libfast in: /home/leep/petsc-2.1.6/src/sles/ksp libfast in: /home/leep/petsc-2.1.6/src/sles/ksp/interface libfast in: /home/leep/petsc-2.1.6/src/sles/ksp/impls libfast in: /home/leep/petsc-2.1.6/src/sles/ksp/impls/cr libfast in: /home/leep/petsc-2.1.6/src/sles/ksp/impls/bcgs libfast in: /home/leep/petsc-2.1.6/src/sles/ksp/impls/cg libfast in: /home/leep/petsc-2.1.6/src/sles/ksp/impls/cgs libfast in: /home/leep/petsc-2.1.6/src/sles/ksp/impls/gmres libfast in: /home/leep/petsc-2.1.6/src/sles/ksp/impls/cheby libfast in: /home/leep/petsc-2.1.6/src/sles/ksp/impls/rich libfast in: /home/leep/petsc-2.1.6/src/sles/ksp/impls/lsqr libfast in: /home/leep/petsc-2.1.6/src/sles/ksp/impls/preonly libfast in: /home/leep/petsc-2.1.6/src/sles/ksp/impls/tcqmr libfast in: /home/leep/petsc-2.1.6/src/sles/ksp/impls/tfqmr libfast in: /home/leep/petsc-2.1.6/src/sles/ksp/impls/qcg libfast in: /home/leep/petsc-2.1.6/src/sles/ksp/impls/bicg libfast in: /home/leep/petsc-2.1.6/src/sles/ksp/impls/fgmres libfast in: /home/leep/petsc-2.1.6/src/sles/ksp/impls/minres libfast in: /home/leep/petsc-2.1.6/src/sles/ksp/impls/symmlq libfast in: /home/leep/petsc-2.1.6/src/sles/ksp/impls/lgmres libfast in: /home/leep/petsc-2.1.6/src/sles/examples libfast in: /home/leep/petsc-2.1.6/src/sles/examples/tests libfast in: /home/leep/petsc-2.1.6/src/sles/examples/tutorials libfast in: /home/leep/petsc-2.1.6/src/sles/utils libfast in: /home/leep/petsc-2.1.6/src/snes libfast in: /home/leep/petsc-2.1.6/src/snes/interface libfast in: /home/leep/petsc-2.1.6/src/snes/interface/noise libfast in: /home/leep/petsc-2.1.6/src/snes/mf libfast in: /home/leep/petsc-2.1.6/src/snes/impls libfast in: /home/leep/petsc-2.1.6/src/snes/impls/ls libfast in: /home/leep/petsc-2.1.6/src/snes/impls/tr libfast in: /home/leep/petsc-2.1.6/src/snes/impls/test libfast in: /home/leep/petsc-2.1.6/src/snes/impls/ml libfast in: /home/leep/petsc-2.1.6/src/snes/examples libfast in: /home/leep/petsc-2.1.6/src/snes/examples/tests libfast in: /home/leep/petsc-2.1.6/src/snes/examples/tutorials libfast in: /home/leep/petsc-2.1.6/src/snes/examples/tutorials/ex10d libfast in: /home/leep/petsc-2.1.6/src/snes/utils libfast in: /home/leep/petsc-2.1.6/src/ts libfast in: /home/leep/petsc-2.1.6/src/ts/interface libfast in: /home/leep/petsc-2.1.6/src/ts/impls libfast in: /home/leep/petsc-2.1.6/src/ts/impls/explicit libfast in: /home/leep/petsc-2.1.6/src/ts/impls/explicit/euler libfast in: /home/leep/petsc-2.1.6/src/ts/impls/explicit/rk libfast in: /home/leep/petsc-2.1.6/src/ts/impls/implicit libfast in: /home/leep/petsc-2.1.6/src/ts/impls/implicit/beuler libfast in: /home/leep/petsc-2.1.6/src/ts/impls/implicit/cn libfast in: /home/leep/petsc-2.1.6/src/ts/impls/pseudo libfast in: /home/leep/petsc-2.1.6/src/ts/examples libfast in: /home/leep/petsc-2.1.6/src/ts/examples/tests libfast in: /home/leep/petsc-2.1.6/src/ts/examples/tutorials libfast in: /home/leep/petsc-2.1.6/src/dm libfast in: /home/leep/petsc-2.1.6/src/dm/ao libfast in: /home/leep/petsc-2.1.6/src/dm/ao/interface libfast in: /home/leep/petsc-2.1.6/src/dm/ao/impls libfast in: /home/leep/petsc-2.1.6/src/dm/ao/impls/basic libfast in: /home/leep/petsc-2.1.6/src/dm/ao/impls/mapping libfast in: /home/leep/petsc-2.1.6/src/dm/ao/examples libfast in: /home/leep/petsc-2.1.6/src/dm/ao/examples/tests libfast in: /home/leep/petsc-2.1.6/src/dm/ao/examples/tutorials libfast in: /home/leep/petsc-2.1.6/src/dm/ao/utils libfast in: /home/leep/petsc-2.1.6/src/dm/da libfast in: /home/leep/petsc-2.1.6/src/dm/da/src libfast in: /home/leep/petsc-2.1.6/src/dm/da/examples libfast in: /home/leep/petsc-2.1.6/src/dm/da/examples/tests libfast in: /home/leep/petsc-2.1.6/src/dm/da/examples/tutorials libfast in: /home/leep/petsc-2.1.6/src/dm/da/utils libfast in: /home/leep/petsc-2.1.6/src/dm/usg libfast in: /home/leep/petsc-2.1.6/src/dm/usg/utils libfast in: /home/leep/petsc-2.1.6/src/mesh libfast in: /home/leep/petsc-2.1.6/src/mesh/interface libfast in: /home/leep/petsc-2.1.6/src/mesh/impls libfast in: /home/leep/petsc-2.1.6/src/mesh/impls/triangular libfast in: /home/leep/petsc-2.1.6/src/mesh/impls/triangular/1d libfast in: /home/leep/petsc-2.1.6/src/mesh/impls/triangular/2d libfast in: /home/leep/petsc-2.1.6/src/mesh/order libfast in: /home/leep/petsc-2.1.6/src/mesh/examples libfast in: /home/leep/petsc-2.1.6/src/mesh/examples/tutorials libfast in: /home/leep/petsc-2.1.6/src/grid libfast in: /home/leep/petsc-2.1.6/src/grid/interface libfast in: /home/leep/petsc-2.1.6/src/grid/impls libfast in: /home/leep/petsc-2.1.6/src/grid/impls/triangular libfast in: /home/leep/petsc-2.1.6/src/grid/impls/triangular/1d libfast in: /home/leep/petsc-2.1.6/src/grid/impls/triangular/2d libfast in: /home/leep/petsc-2.1.6/src/grid/discretization libfast in: /home/leep/petsc-2.1.6/src/grid/discretization/interface libfast in: /home/leep/petsc-2.1.6/src/grid/discretization/impls libfast in: /home/leep/petsc-2.1.6/src/grid/discretization/impls/triangular libfast in: /home/leep/petsc-2.1.6/src/grid/discretization/impls/triangular/1d libfast in: /home/leep/petsc-2.1.6/src/grid/discretization/impls/triangular/1d/constant libfast in: /home/leep/petsc-2.1.6/src/grid/discretization/impls/triangular/1d/linear libfast in: /home/leep/petsc-2.1.6/src/grid/discretization/impls/triangular/1d/quadratic libfast in: /home/leep/petsc-2.1.6/src/grid/discretization/impls/triangular/2d libfast in: /home/leep/petsc-2.1.6/src/grid/discretization/impls/triangular/2d/linear libfast in: /home/leep/petsc-2.1.6/src/grid/discretization/impls/triangular/2d/quadratic libfast in: /home/leep/petsc-2.1.6/src/gvec libfast in: /home/leep/petsc-2.1.6/src/gvec/interface libfast in: /home/leep/petsc-2.1.6/src/gvec/impls libfast in: /home/leep/petsc-2.1.6/src/gvec/impls/triangular libfast in: /home/leep/petsc-2.1.6/src/gvec/impls/triangular/2d libfast in: /home/leep/petsc-2.1.6/src/gsolver libfast in: /home/leep/petsc-2.1.6/src/gsolver/interface libfast in: /home/leep/petsc-2.1.6/src/gsolver/impls libfast in: /home/leep/petsc-2.1.6/src/gsolver/impls/gbeuler libfast in: /home/leep/petsc-2.1.6/src/gsolver/impls/jacobic libfast in: /home/leep/petsc-2.1.6/src/gsolver/examples libfast in: /home/leep/petsc-2.1.6/src/gsolver/examples/tutorials libfast in: /home/leep/petsc-2.1.6/src/contrib libfast in: /home/leep/petsc-2.1.6/src/contrib/sda libfast in: /home/leep/petsc-2.1.6/src/contrib/sda/examples libfast in: /home/leep/petsc-2.1.6/src/contrib/sda/examples/tests libfast in: /home/leep/petsc-2.1.6/src/contrib/sda/examples/tutorials libfast in: /home/leep/petsc-2.1.6/src/contrib/sda/src libfast in: /home/leep/petsc-2.1.6/src/contrib/oberman libfast in: /home/leep/petsc-2.1.6/src/contrib/oberman/laplacian_q1 libfast in: /home/leep/petsc-2.1.6/src/contrib/oberman/laplacian_q1/scalable libfast in: /home/leep/petsc-2.1.6/src/contrib/oberman/burgers_vertex_based_q1 libfast in: /home/leep/petsc-2.1.6/src/contrib/oberman/burgers_df_based_q1 libfast in: /home/leep/petsc-2.1.6/src/contrib/oberman/ns_q1q0 libfast in: /home/leep/petsc-2.1.6/src/contrib/oberman/ns_q2q1 libfast in: /home/leep/petsc-2.1.6/src/contrib/lahaye libfast in: /home/leep/petsc-2.1.6/src/contrib/libtfs libfast in: /home/leep/petsc-2.1.6/src/contrib/adic libfast in: /home/leep/petsc-2.1.6/src/contrib/adic/adic libfast in: /home/leep/petsc-2.1.6/src/contrib/adic/adintrinsics libfast in: /home/leep/petsc-2.1.6/src/contrib/adic/Gradient libfast in: /home/leep/petsc-2.1.6/src/benchmarks libfast in: /home/leep/petsc-2.1.6/src/pf libfast in: /home/leep/petsc-2.1.6/src/pf/interface libfast in: /home/leep/petsc-2.1.6/src/pf/impls libfast in: /home/leep/petsc-2.1.6/src/pf/impls/constant libfast in: /home/leep/petsc-2.1.6/src/pf/impls/string libfast in: /home/leep/petsc-2.1.6/src/pf/examples libfast in: /home/leep/petsc-2.1.6/src/pf/examples/tutorials libfast in: /home/leep/petsc-2.1.6/src/fortran libfast in: /home/leep/petsc-2.1.6/src/fortran/auto libfast in: /home/leep/petsc-2.1.6/src/fortran/custom libfast in: /home/leep/petsc-2.1.6/src/fortran/fsrc g77 -Wno-globals -c -g -I/home/leep/petsc-2.1.6 -I/home/leep/petsc-2.1.6/bmake/linux64 -I/home/leep/petsc-2.1.6/include -I/home/leep/mpich/include -DPETSC_USE_DEBUG -DPETSC_USE_LOG -DPETSC_USE_BOPT_g -DPETSC_USE_STACK somefort.F /home/leep/mpich/include/mpif.h: In subroutine `petscsetcommonblock': /home/leep/mpich/include/mpif.h:192: PARAMETER (MPI_ADDRESS_KIND=) ^ Expression at (^) has incorrect data type or rank for its context /home/leep/mpich/include/mpif.h:193: PARAMETER (MPI_OFFSET_KIND=) ^ Expression at (^) has incorrect data type or rank for its context make[7]: [somefort.o] Error 1 (ignored) ar cr /home/leep/petsc-2.1.6/lib/libg/linux64/libpetscfortran.a somefort.o ar: somefort.o: No such file or directory make[7]: *** [libf] Error 1 libfast in: /home/leep/petsc-2.1.6/src/fortran/kernels g77 -Wno-globals -c -g -I/home/leep/petsc-2.1.6 -I/home/leep/petsc-2.1.6/bmake/linux64 -I/home/leep/petsc-2.1.6/include -I/home/leep/mpich/include -DPETSC_USE_DEBUG -DPETSC_USE_LOG -DPETSC_USE_BOPT_g -DPETSC_USE_STACK fmaxpy.F g77 -Wno-globals -c -g -I/home/leep/petsc-2.1.6 -I/home/leep/petsc-2.1.6/bmake/linux64 -I/home/leep/petsc-2.1.6/include -I/home/leep/mpich/include -DPETSC_USE_DEBUG -DPETSC_USE_LOG -DPETSC_USE_BOPT_g -DPETSC_USE_STACK fmdot.F g77 -Wno-globals -c -g -I/home/leep/petsc-2.1.6 -I/home/leep/petsc-2.1.6/bmake/linux64 -I/home/leep/petsc-2.1.6/include -I/home/leep/mpich/include -DPETSC_USE_DEBUG -DPETSC_USE_LOG -DPETSC_USE_BOPT_g -DPETSC_USE_STACK fnorm.F g77 -Wno-globals -c -g -I/home/leep/petsc-2.1.6 -I/home/leep/petsc-2.1.6/bmake/linux64 -I/home/leep/petsc-2.1.6/include -I/home/leep/mpich/include -DPETSC_USE_DEBUG -DPETSC_USE_LOG -DPETSC_USE_BOPT_g -DPETSC_USE_STACK fmult.F g77 -Wno-globals -c -g -I/home/leep/petsc-2.1.6 -I/home/leep/petsc-2.1.6/bmake/linux64 -I/home/leep/petsc-2.1.6/include -I/home/leep/mpich/include -DPETSC_USE_DEBUG -DPETSC_USE_LOG -DPETSC_USE_BOPT_g -DPETSC_USE_STACK fmultadd.F g77 -Wno-globals -c -g -I/home/leep/petsc-2.1.6 -I/home/leep/petsc-2.1.6/bmake/linux64 -I/home/leep/petsc-2.1.6/include -I/home/leep/mpich/include -DPETSC_USE_DEBUG -DPETSC_USE_LOG -DPETSC_USE_BOPT_g -DPETSC_USE_STACK fsolve.F g77 -Wno-globals -c -g -I/home/leep/petsc-2.1.6 -I/home/leep/petsc-2.1.6/bmake/linux64 -I/home/leep/petsc-2.1.6/include -I/home/leep/mpich/include -DPETSC_USE_DEBUG -DPETSC_USE_LOG -DPETSC_USE_BOPT_g -DPETSC_USE_STACK fsolvebaij.F g77 -Wno-globals -c -g -I/home/leep/petsc-2.1.6 -I/home/leep/petsc-2.1.6/bmake/linux64 -I/home/leep/petsc-2.1.6/include -I/home/leep/mpich/include -DPETSC_USE_DEBUG -DPETSC_USE_LOG -DPETSC_USE_BOPT_g -DPETSC_USE_STACK sgemv.F g77 -Wno-globals -c -g -I/home/leep/petsc-2.1.6 -I/home/leep/petsc-2.1.6/bmake/linux64 -I/home/leep/petsc-2.1.6/include -I/home/leep/mpich/include -DPETSC_USE_DEBUG -DPETSC_USE_LOG -DPETSC_USE_BOPT_g -DPETSC_USE_STACK frelax.F g77 -Wno-globals -c -g -I/home/leep/petsc-2.1.6 -I/home/leep/petsc-2.1.6/bmake/linux64 -I/home/leep/petsc-2.1.6/include -I/home/leep/mpich/include -DPETSC_USE_DEBUG -DPETSC_USE_LOG -DPETSC_USE_BOPT_g -DPETSC_USE_STACK fwaxpy.F g77 -Wno-globals -c -g -I/home/leep/petsc-2.1.6 -I/home/leep/petsc-2.1.6/bmake/linux64 -I/home/leep/petsc-2.1.6/include -I/home/leep/mpich/include -DPETSC_USE_DEBUG -DPETSC_USE_LOG -DPETSC_USE_BOPT_g -DPETSC_USE_STACK faypx.F g77 -Wno-globals -c -g -I/home/leep/petsc-2.1.6 -I/home/leep/petsc-2.1.6/bmake/linux64 -I/home/leep/petsc-2.1.6/include -I/home/leep/mpich/include -DPETSC_USE_DEBUG -DPETSC_USE_LOG -DPETSC_USE_BOPT_g -DPETSC_USE_STACK fcopy.F ar cr /home/leep/petsc-2.1.6/lib/libg/linux64/libpetsc.a fmaxpy.o fmdot.o fnorm.o fmult.o fmultadd.o fsolve.o fsolvebaij.o sgemv.o frelax.o fwaxpy.o faypx.o fcopy.o libfast in: /home/leep/petsc-2.1.6/include libfast in: /home/leep/petsc-2.1.6/include/finclude libfast in: /home/leep/petsc-2.1.6/include/f90impl libfast in: /home/leep/petsc-2.1.6/docs Completed building libraries ========================================= making shared libraries in /home/leep/petsc-2.1.6/lib/libg/linux64 building libpetsccontrib.so building libpetsc.so /usr/bin/ld: fsolvebaij.o: relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC fsolvebaij.o: could not read symbols: Bad value collect2: ld returned 1 exit status building libpetscmat.so /usr/bin/ld: /home/leep/mpich/lib/libmpich.a(isend.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC /home/leep/mpich/lib/libmpich.a: could not read symbols: Bad value collect2: ld returned 1 exit status building libpetscsles.so /usr/bin/ld: /home/leep/mpich/lib/libmpich.a(isend.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC /home/leep/mpich/lib/libmpich.a: could not read symbols: Bad value collect2: ld returned 1 exit status building libpetscsnes.so /usr/bin/ld: /home/leep/mpich/lib/libmpich.a(comm_size.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC /home/leep/mpich/lib/libmpich.a: could not read symbols: Bad value collect2: ld returned 1 exit status building libpetscts.so /usr/bin/ld: /home/leep/mpich/lib/libmpich.a(commcompare.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC /home/leep/mpich/lib/libmpich.a: could not read symbols: Bad value collect2: ld returned 1 exit status building libpetscvec.so /usr/bin/ld: /home/leep/mpich/lib/libmpich.a(isend.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC /home/leep/mpich/lib/libmpich.a: could not read symbols: Bad value collect2: ld returned 1 exit status building libpetscdm.so /usr/bin/ld: /home/leep/mpich/lib/libmpich.a(send.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC /home/leep/mpich/lib/libmpich.a: could not read symbols: Bad value collect2: ld returned 1 exit status building libpetscmesh.so /usr/bin/ld: /home/leep/mpich/lib/libmpich.a(comm_rank.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC /home/leep/mpich/lib/libmpich.a: could not read symbols: Bad value collect2: ld returned 1 exit status building libpetscgrid.so /usr/bin/ld: /home/leep/mpich/lib/libmpich.a(send.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC /home/leep/mpich/lib/libmpich.a: could not read symbols: Bad value collect2: ld returned 1 exit status building libpetscgsolver.so /usr/bin/ld: /home/leep/mpich/lib/libmpich.a(comm_rank.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC /home/leep/mpich/lib/libmpich.a: could not read symbols: Bad value collect2: ld returned 1 exit status make[1]: Leaving directory `/home/leep/petsc-2.1.6' From balay at mcs.anl.gov Thu Jun 15 11:48:11 2006 From: balay at mcs.anl.gov (Satish Balay) Date: Thu, 15 Jun 2006 11:48:11 -0500 (CDT) Subject: in the test compilation In-Reply-To: <1150389701.20376.5.camel@box106.cims.nyu.edu> References: <1150387562.20808.8.camel@box106.cims.nyu.edu> <1150389081.20376.2.camel@box106.cims.nyu.edu> <1150389701.20376.5.camel@box106.cims.nyu.edu> Message-ID: >>>>>> libfast in: /home/leep/petsc-2.1.6/src/fortran/fsrc g77 -Wno-globals -c -g -I/home/leep/petsc-2.1.6 -I/home/leep/petsc-2.1.6/bmake/linux64 -I/home/leep/petsc-2.1.6/include -I/home/leep/mpich/include -DPETSC_USE_DEBUG -DPETSC_USE_LOG -DPETSC_USE_BOPT_g -DPETSC_USE_STACK somefort.F /home/leep/mpich/include/mpif.h: In subroutine `petscsetcommonblock': /home/leep/mpich/include/mpif.h:192: PARAMETER (MPI_ADDRESS_KIND=) ^ Expression at (^) has incorrect data type or rank for its context /home/leep/mpich/include/mpif.h:193: PARAMETER (MPI_OFFSET_KIND=) ^ Expression at (^) has incorrect data type or rank for its context make[7]: [somefort.o] Error 1 (ignored) ar cr /home/leep/petsc-2.1.6/lib/libg/linux64/libpetscfortran.a somefort.o ar: somefort.o: No such file or directory make[7]: *** [libf] Error 1 libfast in: /home/leep/petsc-2.1.6/src/fortran/kernels >>>>>>>> Looks like your MPI is not installed properly. It has buggy code in mpif.h. Sugest reinstalling it. Satish On Thu, 15 Jun 2006, Pilhwa Lee wrote: > Here's the log file. > > Thanks, Pilhwa > > > On Thu, 2006-06-15 at 11:35 -0500, Satish Balay wrote: > > Its likely there were problems with the build of libraries. > > Can you send us this logfile? > > > > Satish > > > > On Thu, 15 Jun 2006, Pilhwa Lee wrote: > > > > > Hi Satish, > > > > > > Based on PETSc-2.1.6, I'm using SAMRAI. > > > > > > I get the following result. > > > > > > > > > > > > /home/leep/petsc-2.1.6/lib/libg/linux64/libpetscfortran.a:zstartf.o: > > > U petscsetcommonblock_ > > > > > > > > > > > > > > > Thanks, Pilhwa > > > > > > > > > > > > On Thu, 2006-06-15 at 11:13 -0500, Satish Balay wrote: > > > > Why use petsc-2.1.6 instead of the latest 2.3.1? > > > > > > > > What do you have for: > > > > > > > > nm -Ao /home/leep/petsc-2.1.6/lib/libg/linux64/*.a |grep -i petscsetcommonblock > > > > > > > > Satish > > > > > > > > > > > > On Thu, 15 Jun 2006, Pilhwa Lee wrote: > > > > > > > > > Hi, > > > > > > > > > > I'm in the stage of testing compilation of an example. I'm using PETSc > > > > > 2.1.6. In the course of compilation > > > > > of /petsc-2.1.6/src/vec/examples/tutorials/ex11f.F, the following errors > > > > > comes up. If any of you have some idea for solution, let me know please. > > > > > > > > > > thanks, Pilhwa > > > > > > > > > > the content of the log > > > > > -------------------------------------------------------------------- > > > > > g77 -Wno-globals -c -g -I/home/leep/petsc-2.1.6 - > > > > > I/home/leep/petsc-2.1.6/bmake/linux64 -I/home/leep/petsc-2.1.6/include - > > > > > I/home/leep/mpich/include -DPETSC_USE_DEBUG -DPETSC_USE_LOG - > > > > > DPETSC_USE_BOPT_g -DPETSC_USE_STACK ex11f.F > > > > > g77 -g -Wl,-rpath,/home/leep/petsc-2.1.6/lib/libg/linux64 -o ex11f > > > > > ex11f.o -L/home/leep/petsc-2.1.6/lib/libg/linux64 -lpetscfortran - > > > > > L/home/leep/petsc-2.1.6/lib/libg/linux64 -lpetscvec -lpetsc > > > > > -L/usr/X11R6/lib64 -lX11 > > > > > -L/usr/lib64 -llapack -lblas -L/home/leep/mpich/lib -lmpich -lpmpich - > > > > > ldl -lc -lg2c -lm > > > > > /usr/lib/gcc/x86_64-redhat-linux/3.4.5/../../../../lib64/crt1.o(.text > > > > > +0x21): In function `_start': > > > > > : undefined reference to `main' > > > > > /home/leep/petsc-2.1.6/lib/libg/linux64/libpetscfortran.a > > > > > (zstartf.o)(.text+0x4f): In function `PetscInitializeFortran': > > > > > /home/leep/petsc-2.1.6/src/fortran/custom/zstartf.c:58: undefined > > > > > reference to `petscsetcommonblock_' > > > > > collect2: ld returned 1 exit status > > > > > make: [ex11f] Error 1 (ignored) > > > > > rm -f -f ex11f.o > > > > > ------------------------------------------------------------------------ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > From letian.wang at ghiocel-tech.com Thu Jun 15 16:24:18 2006 From: letian.wang at ghiocel-tech.com (Letian Wang) Date: Thu, 15 Jun 2006 17:24:18 -0400 Subject: downloading problem Message-ID: <000001c690c2$17024e00$0b00a8c0@lele> Hi, Today I could not download PETSc from ftp://ftp.mcs.anl.gov/pub/petsc/petsc-lite-2.3.1.tar.gz, neither could I install PETSc from the old downloaded file. It failed to download f-blas-lapack. Is the ftp server down? Or did I miss something? I haven't downloaded anything for some time. Thanks. Letian -------------- next part -------------- An HTML attachment was scrubbed... URL: From balay at mcs.anl.gov Thu Jun 15 16:57:29 2006 From: balay at mcs.anl.gov (Satish Balay) Date: Thu, 15 Jun 2006 16:57:29 -0500 (CDT) Subject: downloading problem In-Reply-To: <000001c690c2$17024e00$0b00a8c0@lele> References: <000001c690c2$17024e00$0b00a8c0@lele> Message-ID: yeah the ftp server is down since morning. Our systems folks are trying to fix it. Will let you know once its up.. Satish On Thu, 15 Jun 2006, Letian Wang wrote: > Hi, > > > > Today I could not download PETSc from > ftp://ftp.mcs.anl.gov/pub/petsc/petsc-lite-2.3.1.tar.gz, neither could I > install PETSc from the old downloaded file. It failed to download > f-blas-lapack. Is the ftp server down? Or did I miss something? I haven't > downloaded anything for some time. Thanks. > > > > Letian > > > > From balay at mcs.anl.gov Fri Jun 16 14:45:27 2006 From: balay at mcs.anl.gov (Satish Balay) Date: Fri, 16 Jun 2006 14:45:27 -0500 (CDT) Subject: downloading problem In-Reply-To: References: <000001c690c2$17024e00$0b00a8c0@lele> Message-ID: The ftp serer is back up now. You can retry. Satish On Thu, 15 Jun 2006, Satish Balay wrote: > yeah the ftp server is down since morning. Our systems folks are > trying to fix it. > > Will let you know once its up.. > > Satish > > On Thu, 15 Jun 2006, Letian Wang wrote: > > > Hi, > > > > > > > > Today I could not download PETSc from > > ftp://ftp.mcs.anl.gov/pub/petsc/petsc-lite-2.3.1.tar.gz, neither could I > > install PETSc from the old downloaded file. It failed to download > > f-blas-lapack. Is the ftp server down? Or did I miss something? I haven't > > downloaded anything for some time. Thanks. > > > > > > > > Letian > > > > > > > > > > From metsch at iam.uni-bonn.de Mon Jun 19 03:26:00 2006 From: metsch at iam.uni-bonn.de (Bram Metsch) Date: Mon, 19 Jun 2006 10:26:00 +0200 Subject: PetscMap no longer public Message-ID: <20060619102600.eda53954.metsch@iam.uni-bonn.de> Hi, in PETSc 2.3.1, PetscMap is not longer a public object. However, my code depends quite a lot on this object and its functions like PetscMapGetGlobalRange. So far I have not managed to port my code to version 2.3.1. Is there another way to obtain functionality of the PetscMap object? Best regards, Bram Metsch -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 191 bytes Desc: not available URL: From diosady at MIT.EDU Mon Jun 19 09:54:52 2006 From: diosady at MIT.EDU (Laslo Tibor Diosady) Date: Mon, 19 Jun 2006 10:54:52 -0400 (EDT) Subject: Compiling with or without petsc Message-ID: Hi, I'm trying to create a distribution which can be built both with and without petsc. The idea behind this is that when only running uni-processor cases typically petsc will not be needed so that users do not need a copy of petsc on their machine. I was wondering if there is an easy way to detect the presence of petsc on your local machine and if petsc exists have a flag set which can be used in the makefile to comile with petsc. Also would it be possible to find the top petsc directory and specity the environment variables $PETSC_DIR and $PETSC_ARCH so that this does not need to be done manually by the user. Any help in this area would be greatly appreciated. Thanks, Laslo From balay at mcs.anl.gov Mon Jun 19 10:18:50 2006 From: balay at mcs.anl.gov (Satish Balay) Date: Mon, 19 Jun 2006 10:18:50 -0500 (CDT) Subject: Compiling with or without petsc In-Reply-To: References: Message-ID: On Mon, 19 Jun 2006, Laslo Tibor Diosady wrote: > Hi, > > I'm trying to create a distribution which can be built both with and without > petsc. The idea behind this is that when only running uni-processor cases > typically petsc will not be needed so that users do not need a copy of petsc > on their machine. I'm guesing this is the choice your code makes as PETSc+mpiuni or petsc+mpi works in uniproc mode as well. > I was wondering if there is an easy way to detect the > presence of petsc on your local machine and if petsc exists have a flag set > which can be used in the makefile to comile with petsc. Also would it be > possible to find the top petsc directory and specity the environment variables > $PETSC_DIR and $PETSC_ARCH so that this does not need to be done manually by > the user. This is a general configure problem. Its not easy to detect any package without a complicated detection system. [its easier for some packages that reside in /usr or use a single config format such as pkgconfig]. For PETSc, the detection code in 'BuildSystem'. This configure code attempts to autodetect all possible external packages PETSc might require [different types of mpi, blas etc..] - and if none exists - it can download-install them. The easiest way to detect PETSc is if PETSC_DIR/PETSC_ARCH are provided. The alternative would be to do a 'global find for petscconf.h' and then guess PETSC_DIR/PETSC_ARCH from this - and see if the libs are built & operational with this combination. But then, there could be multiple or non compliant installs of PETSc. For ex: - you might be expecting a c/real install of PETSc but might find a c++ or a complex install of PETSc. Satish > > Any help in this area would be greatly appreciated. > > Thanks, > > Laslo > > From bsmith at mcs.anl.gov Mon Jun 19 11:06:40 2006 From: bsmith at mcs.anl.gov (Barry Smith) Date: Mon, 19 Jun 2006 11:06:40 -0500 (CDT) Subject: PetscMap no longer public In-Reply-To: <20060619102600.eda53954.metsch@iam.uni-bonn.de> References: <20060619102600.eda53954.metsch@iam.uni-bonn.de> Message-ID: Bram, I appologize for excluding those functions from the last release. I will get them back into the development copy and send you a patch as soon as I can. Barry On Mon, 19 Jun 2006, Bram Metsch wrote: > Hi, > > in PETSc 2.3.1, PetscMap is not longer a public object. However, my code > depends quite a lot on this object and its functions like > PetscMapGetGlobalRange. So far I have not managed to port > my code to version 2.3.1. Is there another way to obtain functionality > of the PetscMap object? > > Best regards, > > Bram Metsch > From geenen at gmail.com Tue Jun 20 05:31:50 2006 From: geenen at gmail.com (Thomas Geenen) Date: Tue, 20 Jun 2006 12:31:50 +0200 Subject: about ghosted vectors and there local representation Message-ID: <200606201231.50565.geenen@gmail.com> Dear Petsc users, I think that I do not use the ghosted vector concept in the right way. I create a vector with ierr = VecCreateGhost(PETSC_COMM_WORLD, nc, PETSC_DECIDE, nghosts, ghosts, &x); The entries in ghost contain the global vector positions that I want to have available locally. I have a local representation so i apply (after having constructed the mapping of course) ierr = VecSetLocalToGlobalMapping(x,ltog); I now insert the values ierr = VecSetValuesLocal(x, nc, indx, x_values, INSERT_VALUES); VecAssemblyBegin(x); VecAssemblyEnd(x); I am now under the assumption that petsc divided the vector entries among processes according to his global representation of the vector. I solve my system of equations KSPSolve(ksp,b,x); afterwards i do ierr = KSPGetSolution(ksp, &x); ierr = VecGhostUpdateBegin(x,INSERT_VALUES,SCATTER_FORWARD); ierr = VecGhostUpdateEnd(x,INSERT_VALUES,SCATTER_FORWARD); ierr = VecGhostGetLocalForm(x, &lx); I now expect the vector to be in the local form. That means that the positions that I created as ghost points are filled with the solution corresponding to the global solution. I expect that they are inserted in the position in my local vector corresponding to there corresponding global position. apparently this is not what happens. a small example 2 cpu's each cpu contains 3 vector entries however there is an overlap of 1 on cpu 1 the vector contains points (1, 2, 3) on cpu 2 the vector contains points (3, 4, 5) I make position 1 on cpu 2 a ghost points with nghost=1 ghosts(3) after solving and restoring I expect vector lx to contain the solution as (3, 4, 5) I hope I have explained my misunderstanding of the underlying concept clear enough thanks for your help Thomas Geenen From knepley at gmail.com Tue Jun 20 06:32:52 2006 From: knepley at gmail.com (Matthew Knepley) Date: Tue, 20 Jun 2006 06:32:52 -0500 Subject: about ghosted vectors and there local representation In-Reply-To: <200606201231.50565.geenen@gmail.com> References: <200606201231.50565.geenen@gmail.com> Message-ID: > I now expect the vector to be in the local form. That means that the > positions > that I created as ghost points are filled with the solution corresponding > to > the global solution. I expect that they are inserted in the position in my > local vector corresponding to there corresponding global position. Not sure what you mean here. The local form is the same as the global vector in the owned spots, and then has the ghost points at the end. Matt -- "Failure has a thousand explanations. Success doesn't need one" -- Sir Alec Guiness -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Tue Jun 20 09:24:57 2006 From: knepley at gmail.com (Matthew Knepley) Date: Tue, 20 Jun 2006 09:24:57 -0500 Subject: about ghosted vectors and there local representation In-Reply-To: <200606201356.37824.geenen@gmail.com> References: <200606201231.50565.geenen@gmail.com> <200606201356.37824.geenen@gmail.com> Message-ID: In the DA we have some idea of topology, so we can make a sensible reordered local vector. The VecGhost is a lower level construct. All it does is maintain a vector of this form [ local values | ghost values ] The update maps from local values to ghost values with a scatter. The VecGhostGetLocalForm() just pulls out the pointer. We could add code which maps into a different local vector using an ordering, but this can already be done with an AO as well. Matt On 6/20/06, Thomas Geenen wrote: > > On Tuesday 20 June 2006 13:32, you wrote: > > > I now expect the vector to be in the local form. That means that the > > > positions > > > that I created as ghost points are filled with the solution > corresponding > > > to > > > the global solution. I expect that they are inserted in the position > in > > > my local vector corresponding to there corresponding global position. > > > > Not sure what you mean here. The local form is the same as the global > > vector > > in the owned spots, and then has the ghost points at the end. > oke so that means (4,5,3) ?? > So if I need the solution in the same positions as the ones that i filled > with > VecSetValuesLocal I will have to reorder the vector > What does VecGhostGetLocalForm do? inserts the global solution in the > ghost > points at the end? I thought VecGhostUpdateBegin VecGhostUpdateEnd did > that. > > thomas > > Matt > -- "Failure has a thousand explanations. Success doesn't need one" -- Sir Alec Guiness -------------- next part -------------- An HTML attachment was scrubbed... URL: From bsmith at mcs.anl.gov Tue Jun 20 13:39:59 2006 From: bsmith at mcs.anl.gov (Barry Smith) Date: Tue, 20 Jun 2006 13:39:59 -0500 (CDT) Subject: about ghosted vectors and there local representation In-Reply-To: <200606201231.50565.geenen@gmail.com> References: <200606201231.50565.geenen@gmail.com> Message-ID: The ltog has to exactly match the way the ghosts are provided to VecCreateGhost(). Are they? Please send the exact example code. Barry On Tue, 20 Jun 2006, Thomas Geenen wrote: > Dear Petsc users, > > I think that I do not use the ghosted vector concept in the right way. > > I create a vector with > ierr = VecCreateGhost(PETSC_COMM_WORLD, nc, > PETSC_DECIDE, nghosts, ghosts, &x); > The entries in ghost contain the global vector positions that I want to have > available locally. > > I have a local representation so i apply (after having constructed the mapping > of course) > ierr = VecSetLocalToGlobalMapping(x,ltog); > I now insert the values > ierr = VecSetValuesLocal(x, nc, indx, x_values, INSERT_VALUES); > VecAssemblyBegin(x); > VecAssemblyEnd(x); > I am now under the assumption that petsc divided the vector entries among > processes according to his global representation of the vector. > > I solve my system of equations > KSPSolve(ksp,b,x); > afterwards i do > ierr = KSPGetSolution(ksp, &x); > ierr = VecGhostUpdateBegin(x,INSERT_VALUES,SCATTER_FORWARD); > ierr = VecGhostUpdateEnd(x,INSERT_VALUES,SCATTER_FORWARD); > ierr = VecGhostGetLocalForm(x, &lx); > > I now expect the vector to be in the local form. That means that the positions > that I created as ghost points are filled with the solution corresponding to > the global solution. I expect that they are inserted in the position in my > local vector corresponding to there corresponding global position. > > apparently this is not what happens. > > a small example > 2 cpu's > each cpu contains 3 vector entries however there is an overlap of 1 > on cpu 1 the vector contains points (1, 2, 3) > on cpu 2 the vector contains points (3, 4, 5) > > I make position 1 on cpu 2 a ghost points with nghost=1 ghosts(3) > after solving and restoring I expect vector lx to contain the solution as (3, > 4, 5) > > > I hope I have explained my misunderstanding of the underlying concept clear > enough > > thanks for your help > Thomas Geenen > > From bsmith at mcs.anl.gov Wed Jun 21 09:15:21 2006 From: bsmith at mcs.anl.gov (Barry Smith) Date: Wed, 21 Jun 2006 09:15:21 -0500 (CDT) Subject: PetscMap no longer public In-Reply-To: <20060619102600.eda53954.metsch@iam.uni-bonn.de> References: <20060619102600.eda53954.metsch@iam.uni-bonn.de> Message-ID: Bram, Sorry for the delay. I've attached a new src/vec/vec/impls/mpi/pmap.c just drop it in and do make lib shared in that directory. Also add the following lines to include/private/vecimpl.h EXTERN PetscErrorCode PETSCVEC_DLLEXPORT PetscMapSetLocalSize(PetscMap*,PetscInt); EXTERN PetscErrorCode PETSCVEC_DLLEXPORT PetscMapGetLocalSize(PetscMap*,PetscInt *); PetscPolymorphicFunction(PetscMapGetLocalSize,(PetscMap m),(m,&s),PetscInt,s) EXTERN PetscErrorCode PETSCVEC_DLLEXPORT PetscMapSetSize(PetscMap*,PetscInt); EXTERN PetscErrorCode PETSCVEC_DLLEXPORT PetscMapGetSize(PetscMap*,PetscInt *); PetscPolymorphicFunction(PetscMapGetSize,(PetscMap m),(m,&s),PetscInt,s) EXTERN PetscErrorCode PETSCVEC_DLLEXPORT PetscMapGetLocalRange(PetscMap*,PetscInt *,PetscInt *); EXTERN PetscErrorCode PETSCVEC_DLLEXPORT PetscMapGetGlobalRange(PetscMap*,PetscInt *[]); EXTERN PetscErrorCode PETSCVEC_DLLEXPORT PetscMapSetSizeBlockSize(PetscMap*,PetscInt); EXTERN PetscErrorCode PETSCVEC_DLLEXPORT PetscMapGetSizeBlockSize(PetscMap*,PetscInt *); The manual pages are in the pmap.c file. Please let us know if you have any difficulties. Barry On Mon, 19 Jun 2006, Bram Metsch wrote: > Hi, > > in PETSc 2.3.1, PetscMap is not longer a public object. However, my code > depends quite a lot on this object and its functions like > PetscMapGetGlobalRange. So far I have not managed to port > my code to version 2.3.1. Is there another way to obtain functionality > of the PetscMap object? > > Best regards, > > Bram Metsch > -------------- next part -------------- #define PETSCVEC_DLL /* This file contains routines for basic map object implementation. */ #include "private/vecimpl.h" /*I "petscvec.h" I*/ /*@C PetscMapInitialize - given a map where you have set either the global or local size sets up the map so that it may be used. Collective on MPI_Comm Input Parameters: + comm - the MPI communicator - map - pointer to the map Level: intermediate Notes: You must call PetscMapSetBlockSize() and either PetscMapSetSize() or PetscMapSetLocalSize() before calling this routine. Unlike regular PETSc objects you work with a pointer to the object instead of the object directly. Fortran Notes: Not available from Fortran .seealso: PetscMapSetLocalSize(), PetscMapSetSize(), PetscMapGetSize(), PetscMapGetLocalSize(), PetscMapGetLocalRange(), PetscMapGetGlobalRange(), PetscMapSetBlockSize(), PetscMapGetBlockSize() @*/ #undef __FUNCT__ #define __FUNCT__ "PetscMapInitialize" PetscErrorCode PETSCVEC_DLLEXPORT PetscMapInitialize(MPI_Comm comm,PetscMap *map) { PetscMPIInt rank,size; PetscInt p; PetscErrorCode ierr; PetscFunctionBegin; ierr = MPI_Comm_size(comm, &size);CHKERRQ(ierr); ierr = MPI_Comm_rank(comm, &rank);CHKERRQ(ierr); if (map->bs <=0) {SETERRQ(PETSC_ERR_ARG_WRONGSTATE,"BlockSize not yet set");} if (map->n > 0) map->n = map->n/map->bs; if (map->N > 0) map->N = map->N/map->bs; ierr = PetscSplitOwnership(comm,&map->n,&map->N);CHKERRQ(ierr); map->n = map->n*map->bs; map->N = map->N*map->bs; if (!map->range) { ierr = PetscMalloc((size+1)*sizeof(PetscInt), &map->range);CHKERRQ(ierr); } ierr = MPI_Allgather(&map->n, 1, MPIU_INT, map->range+1, 1, MPIU_INT, comm);CHKERRQ(ierr); map->range[0] = 0; for(p = 2; p <= size; p++) { map->range[p] += map->range[p-1]; } map->rstart = map->range[rank]; map->rend = map->range[rank+1]; PetscFunctionReturn(0); } #undef __FUNCT__ #define __FUNCT__ "PetscMapCopy" PetscErrorCode PETSCVEC_DLLEXPORT PetscMapCopy(MPI_Comm comm,PetscMap *in,PetscMap *out) { PetscMPIInt size; PetscErrorCode ierr; PetscInt *range = out->range; PetscFunctionBegin; ierr = MPI_Comm_size(comm,&size);CHKERRQ(ierr); ierr = PetscMemcpy(out,in,sizeof(PetscMap));CHKERRQ(ierr); if (!range) { ierr = PetscMalloc((size+1)*sizeof(PetscInt),&out->range);CHKERRQ(ierr); } else { out->range = range; } ierr = PetscMemcpy(out->range,in->range,(size+1)*sizeof(PetscInt));CHKERRQ(ierr); PetscFunctionReturn(0); } /*@C PetscMapSetLocalSize - Sets the local size for a PetscMap object. Collective on PetscMap Input Parameters: + map - pointer to the map - n - the local size Level: intermediate Notes: Call this after the call to PetscMapInitialize() Unlike regular PETSc objects you work with a pointer to the object instead of the object directly. Fortran Notes: Not available from Fortran .seealso: PetscMapInitialize(), PetscMapSetSize(), PetscMapGetSize(), PetscMapGetLocalSize(), PetscMapGetLocalRange(), PetscMapGetGlobalRange(), PetscMapSetBlockSize(), PetscMapGetBlockSize() @*/ #undef __FUNCT__ #define __FUNCT__ "PetscMapSetLocalSize" PetscErrorCode PETSCVEC_DLLEXPORT PetscMapSetLocalSize(PetscMap *map,PetscInt n) { PetscFunctionBegin; map->n = n; PetscFunctionReturn(0); } /*@C PetscMapGetLocalSize - Gets the local size for a PetscMap object. Not Collective Input Parameters: . map - pointer to the map Output Parameters: . n - the local size Level: intermediate Notes: Call this after the call to PetscMapInitialize() Unlike regular PETSc objects you work with a pointer to the object instead of the object directly. Fortran Notes: Not available from Fortran .seealso: PetscMapInitialize(), PetscMapSetSize(), PetscMapGetSize(), PetscMapGetLocalSize(), PetscMapGetLocalRange(), PetscMapGetGlobalRange(), PetscMapSetBlockSize(), PetscMapGetBlockSize() @*/ #undef __FUNCT__ #define __FUNCT__ "PetscMapGetLocalSize" PetscErrorCode PETSCVEC_DLLEXPORT PetscMapGetLocalSize(PetscMap *map,PetscInt *n) { PetscFunctionBegin; *n = map->n; PetscFunctionReturn(0); } /*@C PetscMapSetSize - Sets the global size for a PetscMap object. Collective on PetscMap Input Parameters: + map - pointer to the map - n - the global size Level: intermediate Notes: Call this after the call to PetscMapInitialize() Unlike regular PETSc objects you work with a pointer to the object instead of the object directly. Fortran Notes: Not available from Fortran .seealso: PetscMapInitialize(), PetscMapSetLocalSize(), PetscMapGetLocalSize(), PetscMapGetSize(), PetscMapGetLocalRange(), PetscMapGetGlobalRange(), PetscMapSetBlockSize(), PetscMapGetBlockSize() @*/ #undef __FUNCT__ #define __FUNCT__ "PetscMapSetSize" PetscErrorCode PETSCVEC_DLLEXPORT PetscMapSetSize(PetscMap *map,PetscInt n) { PetscFunctionBegin; map->N = n; PetscFunctionReturn(0); } /*@C PetscMapGetSize - Gets the global size for a PetscMap object. Not Collective Input Parameters: . map - pointer to the map Output Parameters: . n - the global size Level: intermediate Notes: Call this after the call to PetscMapInitialize() Unlike regular PETSc objects you work with a pointer to the object instead of the object directly. Fortran Notes: Not available from Fortran .seealso: PetscMapInitialize(), PetscMapSetLocalSize(), PetscMapGetLocalSize(), PetscMapSetSize(), PetscMapGetLocalRange(), PetscMapGetGlobalRange(), PetscMapSetBlockSize(), PetscMapGetBlockSize() @*/ #undef __FUNCT__ #define __FUNCT__ "PetscMapGetSize" PetscErrorCode PETSCVEC_DLLEXPORT PetscMapGetSize(PetscMap *map,PetscInt *n) { PetscFunctionBegin; *n = map->n; PetscFunctionReturn(0); } /*@C PetscMapSetBlockSize - Sets the block size for a PetscMap object. Collective on PetscMap Input Parameters: + map - pointer to the map - bs - the size Level: intermediate Notes: Call this after the call to PetscMapInitialize() Unlike regular PETSc objects you work with a pointer to the object instead of the object directly. Fortran Notes: Not available from Fortran .seealso: PetscMapInitialize(), PetscMapSetLocalSize(), PetscMapGetLocalSize(), PetscMapGetBlockSize(), PetscMapGetLocalRange(), PetscMapGetGlobalRange(), PetscMapSetSize(), PetscMapGetSize() @*/ #undef __FUNCT__ #define __FUNCT__ "PetscMapSetBlockSize" PetscErrorCode PETSCVEC_DLLEXPORT PetscMapSetBlockSize(PetscMap *map,PetscInt bs) { PetscFunctionBegin; map->bs = bs; PetscFunctionReturn(0); } /*@C PetscMapGetBlockSize - Gets the block size for a PetscMap object. Not Collective Input Parameters: . map - pointer to the map Output Parameters: . bs - the size Level: intermediate Notes: Call this after the call to PetscMapInitialize() Unlike regular PETSc objects you work with a pointer to the object instead of the object directly. Fortran Notes: Not available from Fortran .seealso: PetscMapInitialize(), PetscMapSetLocalSize(), PetscMapGetLocalSize(), PetscMapSetSize(), PetscMapGetLocalRange(), PetscMapGetGlobalRange(), PetscMapSetBlockSize(), PetscMapGetSize() @*/ #undef __FUNCT__ #define __FUNCT__ "PetscMapGetBlockSize" PetscErrorCode PETSCVEC_DLLEXPORT PetscMapGetBlockSize(PetscMap *map,PetscInt *bs) { PetscFunctionBegin; *bs = map->bs; PetscFunctionReturn(0); } /*@C PetscMapGetLocalRange - gets the range of values owned by this process Not Collective Input Parameters: . map - pointer to the map Output Parameters: + rstart - first index owned by this process - rend - one more than the last index owned by this process Level: intermediate Notes: Call this after the call to PetscMapInitialize() Unlike regular PETSc objects you work with a pointer to the object instead of the object directly. Fortran Notes: Not available from Fortran .seealso: PetscMapInitialize(), PetscMapSetLocalSize(), PetscMapGetLocalSize(), PetscMapSetSize(), PetscMapGetSize(), PetscMapGetGlobalRange(), PetscMapSetBlockSize(), PetscMapGetSize() @*/ #undef __FUNCT__ #define __FUNCT__ "PetscMapGetLocalRange" PetscErrorCode PETSCVEC_DLLEXPORT PetscMapGetLocalRange(PetscMap *map,PetscInt *rstart,PetscInt *rend) { PetscFunctionBegin; if (rstart) *rstart = map->rstart; if (rend) *rend = map->rend; PetscFunctionReturn(0); } /*@C PetscMapGetGlobalRange - gets the range of values owned by all processes Not Collective Input Parameters: . map - pointer to the map Output Parameters: . range - start of each processors range of indices (the final entry is one more then the last index on the last process) Level: intermediate Notes: Call this after the call to PetscMapInitialize() Unlike regular PETSc objects you work with a pointer to the object instead of the object directly. Fortran Notes: Not available from Fortran .seealso: PetscMapInitialize(), PetscMapSetLocalSize(), PetscMapGetLocalSize(), PetscMapSetSize(), PetscMapGetSize(), PetscMapGetLocalRange(), PetscMapSetBlockSize(), PetscMapGetSize() @*/ #undef __FUNCT__ #define __FUNCT__ "PetscMapGetGlobalRange" PetscErrorCode PETSCVEC_DLLEXPORT PetscMapGetGlobalRange(PetscMap *map,PetscInt *range[]) { PetscFunctionBegin; *range = map->range; PetscFunctionReturn(0); } From geenen at gmail.com Thu Jun 22 02:30:14 2006 From: geenen at gmail.com (Thomas Geenen) Date: Thu, 22 Jun 2006 09:30:14 +0200 Subject: Fwd: Re: about ghosted vectors and there local representation In-Reply-To: <200606220920.46362.geenen@geo.uu.nl> References: <200606220920.46362.geenen@geo.uu.nl> Message-ID: <200606220930.14421.geenen@gmail.com> nrows is the global number of rows local2global is the local to global renumbering nghosts are the number of ghosts ghosts is the global row number i want to have local access to after the solve ISLocalToGlobalMappingCreate(PETSC_COMM_WORLD, nrows, local2global, <og); VecCreateGhost(PETSC_COMM_WORLD, nc, PETSC_DECIDE, nghosts[mype], ghosts, &x); VecSetLocalToGlobalMapping(x,ltog); VecSetValuesLocal(x, nc, indx, x_values, INSERT_VALUES); VecAssemblyBegin(x); VecAssemblyEnd(x); solve the system ierr = KSPGetSolution(ksp, &x); ierr = VecGhostUpdateBegin(x,INSERT_VALUES,SCATTER_FORWARD); ierr = VecGhostUpdateEnd(x,INSERT_VALUES,SCATTER_FORWARD); ierr = VecGhostGetLocalForm(x, &lx); nrows is the global number of rows local2global is the local to global renumbering nghosts are the number of ghosts ghosts is the global row number i want to have local access to after the solve thomas On Thursday 22 June 2006 09:20, you wrote: > ---------- Forwarded Message ---------- > > Subject: Re: about ghosted vectors and there local representation > Date: Tuesday 20 June 2006 20:39 > From: Barry Smith > To: petsc-users at mcs.anl.gov > > The ltog has to exactly match the way the ghosts are provided to > VecCreateGhost(). Are they? Please send the exact example code. > > Barry > > On Tue, 20 Jun 2006, Thomas Geenen wrote: > > Dear Petsc users, > > > > I think that I do not use the ghosted vector concept in the right way. > > > > I create a vector with > > ierr = VecCreateGhost(PETSC_COMM_WORLD, nc, > > PETSC_DECIDE, nghosts, ghosts, &x); > > The entries in ghost contain the global vector positions that I want to > > have available locally. > > > > I have a local representation so i apply (after having constructed the > > mapping of course) > > ierr = VecSetLocalToGlobalMapping(x,ltog); > > I now insert the values > > ierr = VecSetValuesLocal(x, nc, indx, x_values, INSERT_VALUES); > > VecAssemblyBegin(x); > > VecAssemblyEnd(x); > > I am now under the assumption that petsc divided the vector entries among > > processes according to his global representation of the vector. > > > > I solve my system of equations > > KSPSolve(ksp,b,x); > > afterwards i do > > ierr = KSPGetSolution(ksp, &x); > > ierr = VecGhostUpdateBegin(x,INSERT_VALUES,SCATTER_FORWARD); > > ierr = VecGhostUpdateEnd(x,INSERT_VALUES,SCATTER_FORWARD); > > ierr = VecGhostGetLocalForm(x, &lx); > > > > I now expect the vector to be in the local form. That means that the > > positions that I created as ghost points are filled with the solution > > corresponding to the global solution. I expect that they are inserted in > > the position in my local vector corresponding to there corresponding > > global position. > > > > apparently this is not what happens. > > > > a small example > > 2 cpu's > > each cpu contains 3 vector entries however there is an overlap of 1 > > on cpu 1 the vector contains points (1, 2, 3) > > on cpu 2 the vector contains points (3, 4, 5) > > > > I make position 1 on cpu 2 a ghost points with nghost=1 ghosts(3) > > after solving and restoring I expect vector lx to contain the solution as > > (3, 4, 5) > > > > > > I hope I have explained my misunderstanding of the underlying concept > > clear enough > > > > thanks for your help > > Thomas Geenen > > ------------------------------------------------------- From billy at dem.uminho.pt Thu Jun 22 09:30:40 2006 From: billy at dem.uminho.pt (billy at dem.uminho.pt) Date: Thu, 22 Jun 2006 15:30:40 +0100 Subject: Set values of symmetric matrices. Message-ID: <1150986640.449aa9908b2d4@serv-g1.ccom.uminho.pt> Hi, I use MatCreateMPIAIJ to create parallel matrices. I would like to use KSPCG to solve a symmetric matrices. I tried to implement it but the program exits with no error. Do I need only to set values on the diagonal and upper diagonal only or continue to set all non-zero entries of the matrix? Billy. From hzhang at mcs.anl.gov Thu Jun 22 11:16:06 2006 From: hzhang at mcs.anl.gov (Hong Zhang) Date: Thu, 22 Jun 2006 11:16:06 -0500 (CDT) Subject: Set values of symmetric matrices. In-Reply-To: <1150986640.449aa9908b2d4@serv-g1.ccom.uminho.pt> References: <1150986640.449aa9908b2d4@serv-g1.ccom.uminho.pt> Message-ID: Billy, We support cg with MPIAIJ and MPISBAIJ format. > I use MatCreateMPIAIJ to create parallel matrices. I would like to use KSPCG to > solve a symmetric matrices. I tried to implement it but the program exits with > no error. ^^^^^^^ Do you mean with error? If so, what error message? >Do I need only to set values on the diagonal and upper diagonal only > or continue to set all non-zero entries of the matrix? > If you use MPISBAIJ matrix format, then you only need to set the diagonal and upper diagonals. Setting all non-zero entries of the matrix also works - petsc ignores the lower triangular part. Hong > From billy at dem.uminho.pt Thu Jun 22 11:58:43 2006 From: billy at dem.uminho.pt (billy at dem.uminho.pt) Date: Thu, 22 Jun 2006 17:58:43 +0100 Subject: Set values of symmetric matrices. In-Reply-To: References: <1150986640.449aa9908b2d4@serv-g1.ccom.uminho.pt> Message-ID: <1150995523.449acc43111a0@serv-g1.ccom.uminho.pt> It exits with no error message. Usually I see several PETSC error messages before it exits. I tested with MPIAIJ. It works with KSPGMRES or KSPBCGS but with KSPCG it exits immediately. Maybe I am missing something. Billy. Quoting Hong Zhang : > > Billy, > > We support cg with MPIAIJ and MPISBAIJ format. > > > I use MatCreateMPIAIJ to create parallel matrices. I would like to use > KSPCG to > > solve a symmetric matrices. I tried to implement it but the program exits > with > > no error. > ^^^^^^^ > Do you mean with error? If so, what error message? > > >Do I need only to set values on the diagonal and upper diagonal only > > or continue to set all non-zero entries of the matrix? > > > If you use MPISBAIJ matrix format, then you only need to set the diagonal > and upper diagonals. Setting all non-zero entries of the matrix > also works - petsc ignores the lower triangular part. > > Hong > > > > From bsmith at mcs.anl.gov Thu Jun 22 15:11:01 2006 From: bsmith at mcs.anl.gov (Barry Smith) Date: Thu, 22 Jun 2006 15:11:01 -0500 (CDT) Subject: Set values of symmetric matrices. In-Reply-To: <1150995523.449acc43111a0@serv-g1.ccom.uminho.pt> References: <1150986640.449aa9908b2d4@serv-g1.ccom.uminho.pt> <1150995523.449acc43111a0@serv-g1.ccom.uminho.pt> Message-ID: Billy, A failed linear solve is not considered an "error" by PETSc. You should "always" call KSPGetConvergedReason() after a solve to determine if it converged, or if it failed why. My guess is that the CG algorithm is detecting that the matrix is not symmetric. If you use AIJ or BAIJ matrices you have to set all the values in the matrix, not just the upper part. Barry On Thu, 22 Jun 2006, billy at dem.uminho.pt wrote: > > It exits with no error message. Usually I see several PETSC error messages > before it exits. I tested with MPIAIJ. It works with KSPGMRES or KSPBCGS but > with KSPCG it exits immediately. Maybe I am missing something. > > Billy. > > > Quoting Hong Zhang : > >> >> Billy, >> >> We support cg with MPIAIJ and MPISBAIJ format. >> >>> I use MatCreateMPIAIJ to create parallel matrices. I would like to use >> KSPCG to >>> solve a symmetric matrices. I tried to implement it but the program exits >> with >>> no error. >> ^^^^^^^ >> Do you mean with error? If so, what error message? >> >>> Do I need only to set values on the diagonal and upper diagonal only >>> or continue to set all non-zero entries of the matrix? >>> >> If you use MPISBAIJ matrix format, then you only need to set the diagonal >> and upper diagonals. Setting all non-zero entries of the matrix >> also works - petsc ignores the lower triangular part. >> >> Hong >>> >> >> > > > From bsmith at mcs.anl.gov Thu Jun 22 15:13:57 2006 From: bsmith at mcs.anl.gov (Barry Smith) Date: Thu, 22 Jun 2006 15:13:57 -0500 (CDT) Subject: Fwd: Re: about ghosted vectors and there local representation In-Reply-To: <200606220930.14421.geenen@gmail.com> References: <200606220920.46362.geenen@geo.uu.nl> <200606220930.14421.geenen@gmail.com> Message-ID: Send the values of local2global, nc, ghosts, nrows and nghosts for all processors (2 I hope). Also note that nrows should equal nc + nghosts. Barry On Thu, 22 Jun 2006, Thomas Geenen wrote: > nrows is the global number of rows > local2global is the local to global renumbering > nghosts are the number of ghosts > ghosts is the global row number i want to have local access to after the solve > > > ISLocalToGlobalMappingCreate(PETSC_COMM_WORLD, nrows, local2global, <og); > VecCreateGhost(PETSC_COMM_WORLD, nc, > PETSC_DECIDE, nghosts[mype], ghosts, &x); > VecSetLocalToGlobalMapping(x,ltog); > VecSetValuesLocal(x, nc, indx, x_values, INSERT_VALUES); > VecAssemblyBegin(x); > VecAssemblyEnd(x); > > solve the system > > ierr = KSPGetSolution(ksp, &x); > ierr = VecGhostUpdateBegin(x,INSERT_VALUES,SCATTER_FORWARD); > ierr = VecGhostUpdateEnd(x,INSERT_VALUES,SCATTER_FORWARD); > ierr = VecGhostGetLocalForm(x, &lx); > > nrows is the global number of rows > local2global is the local to global renumbering > nghosts are the number of ghosts > ghosts is the global row number i want to have local access to after the solve > > > thomas > > On Thursday 22 June 2006 09:20, you wrote: >> ---------- Forwarded Message ---------- >> >> Subject: Re: about ghosted vectors and there local representation >> Date: Tuesday 20 June 2006 20:39 >> From: Barry Smith >> To: petsc-users at mcs.anl.gov >> >> The ltog has to exactly match the way the ghosts are provided to >> VecCreateGhost(). Are they? Please send the exact example code. >> >> Barry >> >> On Tue, 20 Jun 2006, Thomas Geenen wrote: >>> Dear Petsc users, >>> >>> I think that I do not use the ghosted vector concept in the right way. >>> >>> I create a vector with >>> ierr = VecCreateGhost(PETSC_COMM_WORLD, nc, >>> PETSC_DECIDE, nghosts, ghosts, &x); >>> The entries in ghost contain the global vector positions that I want to >>> have available locally. >>> >>> I have a local representation so i apply (after having constructed the >>> mapping of course) >>> ierr = VecSetLocalToGlobalMapping(x,ltog); >>> I now insert the values >>> ierr = VecSetValuesLocal(x, nc, indx, x_values, INSERT_VALUES); >>> VecAssemblyBegin(x); >>> VecAssemblyEnd(x); >>> I am now under the assumption that petsc divided the vector entries among >>> processes according to his global representation of the vector. >>> >>> I solve my system of equations >>> KSPSolve(ksp,b,x); >>> afterwards i do >>> ierr = KSPGetSolution(ksp, &x); >>> ierr = VecGhostUpdateBegin(x,INSERT_VALUES,SCATTER_FORWARD); >>> ierr = VecGhostUpdateEnd(x,INSERT_VALUES,SCATTER_FORWARD); >>> ierr = VecGhostGetLocalForm(x, &lx); >>> >>> I now expect the vector to be in the local form. That means that the >>> positions that I created as ghost points are filled with the solution >>> corresponding to the global solution. I expect that they are inserted in >>> the position in my local vector corresponding to there corresponding >>> global position. >>> >>> apparently this is not what happens. >>> >>> a small example >>> 2 cpu's >>> each cpu contains 3 vector entries however there is an overlap of 1 >>> on cpu 1 the vector contains points (1, 2, 3) >>> on cpu 2 the vector contains points (3, 4, 5) >>> >>> I make position 1 on cpu 2 a ghost points with nghost=1 ghosts(3) >>> after solving and restoring I expect vector lx to contain the solution as >>> (3, 4, 5) >>> >>> >>> I hope I have explained my misunderstanding of the underlying concept >>> clear enough >>> >>> thanks for your help >>> Thomas Geenen >> >> ------------------------------------------------------- > > From billy at dem.uminho.pt Fri Jun 23 09:05:38 2006 From: billy at dem.uminho.pt (billy at dem.uminho.pt) Date: Fri, 23 Jun 2006 15:05:38 +0100 Subject: AMG Message-ID: <1151071538.449bf532111a4@serv-g1.ccom.uminho.pt> Hi, Is there any plans to develop an Algebraic MultiGrid solver for PETSc? Billy. From knepley at gmail.com Fri Jun 23 09:15:57 2006 From: knepley at gmail.com (Matthew Knepley) Date: Fri, 23 Jun 2006 09:15:57 -0500 Subject: AMG In-Reply-To: <1151071538.449bf532111a4@serv-g1.ccom.uminho.pt> References: <1151071538.449bf532111a4@serv-g1.ccom.uminho.pt> Message-ID: You should use the HYPRE AMG preconditioner. You need to configure with --download-hypre, and then there will be a PC type 'boomeramg'. Matt On 6/23/06, billy at dem.uminho.pt wrote: > > > Hi, > > Is there any plans to develop an Algebraic MultiGrid solver for PETSc? > > Billy. > > -- "Failure has a thousand explanations. Success doesn't need one" -- Sir Alec Guiness -------------- next part -------------- An HTML attachment was scrubbed... URL: From bsmith at mcs.anl.gov Fri Jun 23 09:20:58 2006 From: bsmith at mcs.anl.gov (Barry Smith) Date: Fri, 23 Jun 2006 09:20:58 -0500 (CDT) Subject: AMG In-Reply-To: References: <1151071538.449bf532111a4@serv-g1.ccom.uminho.pt> Message-ID: Actually it a PC type of hypre and a -pc_hypre_type of boomeramg You can also use --download-ml and the pc type of ml We do not plan to write our own AMG, though contributions from users are always welcome. Barry On Fri, 23 Jun 2006, Matthew Knepley wrote: > You should use the HYPRE AMG preconditioner. You need to configure with > --download-hypre, and then there will be a PC type 'boomeramg'. > > Matt > > On 6/23/06, billy at dem.uminho.pt wrote: >> >> >> Hi, >> >> Is there any plans to develop an Algebraic MultiGrid solver for PETSc? >> >> Billy. >> >> > > > From geenen at gmail.com Sun Jun 25 08:49:21 2006 From: geenen at gmail.com (Thomas Geenen) Date: Sun, 25 Jun 2006 15:49:21 +0200 Subject: about ghosted vectors and there local representation In-Reply-To: <200606251520.22779.geenen@geo.uu.nl> References: <200606251520.22779.geenen@geo.uu.nl> Message-ID: <200606251549.21265.geenen@gmail.com> oke a small example with 2 cpu's local2global, [0] 0 0 [0] 1 1 [0] 2 2 [0] 3 3 [0] 4 4 [0] 5 5 [0] 6 6 [0] 7 7 [0] 8 8 [0] 9 9 [0] 10 10 [0] 11 11 [0] 12 12 [0] 13 13 [1] 0 0 [1] 1 1 [1] 2 14 [1] 3 15 [1] 4 16 [1] 5 17 [1] 6 18 [1] 7 19 [1] 8 20 [1] 9 21 [1] 10 22 [1] 11 23 [1] 12 24 [1] 13 25 on cpu0 nc = 14, nrows =14, nghosts=0 on cpu1 nc= 12, nrows=14, nghosts=2, ghosts=(0,1) ierr = KSPGetSolution(ksp, &x); ierr = VecGhostUpdateBegin(x,INSERT_VALUES,SCATTER_FORWARD); ierr = VecGhostUpdateEnd(x,INSERT_VALUES,SCATTER_FORWARD); ierr = VecGhostGetLocalForm(x, &lx); ierr = VecView(lx, PETSC_NULL); cpu0 -1.98507e-08 1.09281e-08 0.592588 0.160857 -0.666662 -34.895 8.93136 0.499999 4.22046e-08 0.2963 -0.0497465 0.666661 26.8951 -8.93131 cpu1 -0.2963 0.0497465 0.666662 -26.8951 8.93131 -0.499999 -1.70893e-08 -0.592588 -0.160857 -0.666661 34.895 -8.93136 -1.98507e-08 -1.98507e-08 1) ghost values are at the end of local solution array lx on cpu1 I do the renumering myself. would be nice if this could be done by petsc automaticly 2) the first two values on cpu0 are not equal to the last two at cpu1 thomas On Sunday 25 June 2006 15:20, you wrote: > ---------- Forwarded Message ---------- > > Subject: Re: Fwd: Re: about ghosted vectors and there local representation > Date: Thursday 22 June 2006 22:13 > From: Barry Smith > To: petsc-users at mcs.anl.gov > > Send the values of local2global, nc, ghosts, nrows and nghosts for all > processors (2 I hope). Also note that nrows should equal nc + nghosts. > > Barry > > On Thu, 22 Jun 2006, Thomas Geenen wrote: > > nrows is the global number of rows > > local2global is the local to global renumbering > > nghosts are the number of ghosts > > ghosts is the global row number i want to have local access to after the > > solve > > > > > > ISLocalToGlobalMappingCreate(PETSC_COMM_WORLD, nrows, local2global, > > <og); VecCreateGhost(PETSC_COMM_WORLD, nc, > > PETSC_DECIDE, nghosts[mype], ghosts, &x); > > VecSetLocalToGlobalMapping(x,ltog); > > VecSetValuesLocal(x, nc, indx, x_values, INSERT_VALUES); > > VecAssemblyBegin(x); > > VecAssemblyEnd(x); > > > > solve the system > > > > ierr = KSPGetSolution(ksp, &x); > > ierr = VecGhostUpdateBegin(x,INSERT_VALUES,SCATTER_FORWARD); > > ierr = VecGhostUpdateEnd(x,INSERT_VALUES,SCATTER_FORWARD); > > ierr = VecGhostGetLocalForm(x, &lx); > > > > nrows is the global number of rows > > local2global is the local to global renumbering > > nghosts are the number of ghosts > > ghosts is the global row number i want to have local access to after the > > solve > > > > > > thomas > > > > On Thursday 22 June 2006 09:20, you wrote: > >> ---------- Forwarded Message ---------- > >> > >> Subject: Re: about ghosted vectors and there local representation > >> Date: Tuesday 20 June 2006 20:39 > >> From: Barry Smith > >> To: petsc-users at mcs.anl.gov > >> > >> The ltog has to exactly match the way the ghosts are provided to > >> VecCreateGhost(). Are they? Please send the exact example code. > >> > >> Barry > >> > >> On Tue, 20 Jun 2006, Thomas Geenen wrote: > >>> Dear Petsc users, > >>> > >>> I think that I do not use the ghosted vector concept in the right way. > >>> > >>> I create a vector with > >>> ierr = VecCreateGhost(PETSC_COMM_WORLD, nc, > >>> PETSC_DECIDE, nghosts, ghosts, &x); > >>> The entries in ghost contain the global vector positions that I want to > >>> have available locally. > >>> > >>> I have a local representation so i apply (after having constructed the > >>> mapping of course) > >>> ierr = VecSetLocalToGlobalMapping(x,ltog); > >>> I now insert the values > >>> ierr = VecSetValuesLocal(x, nc, indx, x_values, INSERT_VALUES); > >>> VecAssemblyBegin(x); > >>> VecAssemblyEnd(x); > >>> I am now under the assumption that petsc divided the vector entries > >>> among processes according to his global representation of the vector. > >>> > >>> I solve my system of equations > >>> KSPSolve(ksp,b,x); > >>> afterwards i do > >>> ierr = KSPGetSolution(ksp, &x); > >>> ierr = VecGhostUpdateBegin(x,INSERT_VALUES,SCATTER_FORWARD); > >>> ierr = VecGhostUpdateEnd(x,INSERT_VALUES,SCATTER_FORWARD); > >>> ierr = VecGhostGetLocalForm(x, &lx); > >>> > >>> I now expect the vector to be in the local form. That means that the > >>> positions that I created as ghost points are filled with the solution > >>> corresponding to the global solution. I expect that they are inserted > >>> in the position in my local vector corresponding to there corresponding > >>> global position. > >>> > >>> apparently this is not what happens. > >>> > >>> a small example > >>> 2 cpu's > >>> each cpu contains 3 vector entries however there is an overlap of 1 > >>> on cpu 1 the vector contains points (1, 2, 3) > >>> on cpu 2 the vector contains points (3, 4, 5) > >>> > >>> I make position 1 on cpu 2 a ghost points with nghost=1 ghosts(3) > >>> after solving and restoring I expect vector lx to contain the solution > >>> as (3, 4, 5) > >>> > >>> > >>> I hope I have explained my misunderstanding of the underlying concept > >>> clear enough > >>> > >>> thanks for your help > >>> Thomas Geenen > >> > >> ------------------------------------------------------- > > ------------------------------------------------------- From bsmith at mcs.anl.gov Sun Jun 25 10:11:00 2006 From: bsmith at mcs.anl.gov (Barry Smith) Date: Sun, 25 Jun 2006 10:11:00 -0500 (CDT) Subject: about ghosted vectors and there local representation In-Reply-To: <200606251549.21265.geenen@gmail.com> References: <200606251520.22779.geenen@geo.uu.nl> <200606251549.21265.geenen@gmail.com> Message-ID: Thomas, As I told you in my last two emails the local2global mapping you supply to VecSetGlobalToGlobalMapping() has to match with the ghost values you used when creating the ghosted vector. Otherwise you have two different orderings that have nothing to do with each other so there is NO way it could possibly work. In the development copy of PETSc I have added the VecSetLocalToGlobalMapping() automatically to VecCreateGhost() so users need not add it. Here is a snipit of the code you can start with: /* set local to global mapping for ghosted vector */ ierr = PetscMalloc((n+nghost)*sizeof(PetscInt),&indices);CHKERRQ(ierr); ierr = VecGetOwnershipRange(*vv,&rstart,PETSC_NULL);CHKERRQ(ierr); for (i=0; i oke a small example with 2 cpu's > > local2global, > [0] 0 0 > [0] 1 1 > [0] 2 2 > [0] 3 3 > [0] 4 4 > [0] 5 5 > [0] 6 6 > [0] 7 7 > [0] 8 8 > [0] 9 9 > [0] 10 10 > [0] 11 11 > [0] 12 12 > [0] 13 13 > [1] 0 0 > [1] 1 1 > [1] 2 14 > [1] 3 15 > [1] 4 16 > [1] 5 17 > [1] 6 18 > [1] 7 19 > [1] 8 20 > [1] 9 21 > [1] 10 22 > [1] 11 23 > [1] 12 24 > [1] 13 25 > on cpu0 nc = 14, nrows =14, nghosts=0 > on cpu1 nc= 12, nrows=14, nghosts=2, ghosts=(0,1) > ierr = KSPGetSolution(ksp, &x); > ierr = VecGhostUpdateBegin(x,INSERT_VALUES,SCATTER_FORWARD); > ierr = VecGhostUpdateEnd(x,INSERT_VALUES,SCATTER_FORWARD); > ierr = VecGhostGetLocalForm(x, &lx); > ierr = VecView(lx, PETSC_NULL); > cpu0 > -1.98507e-08 > 1.09281e-08 > 0.592588 > 0.160857 > -0.666662 > -34.895 > 8.93136 > 0.499999 > 4.22046e-08 > 0.2963 > -0.0497465 > 0.666661 > 26.8951 > -8.93131 > cpu1 > -0.2963 > 0.0497465 > 0.666662 > -26.8951 > 8.93131 > -0.499999 > -1.70893e-08 > -0.592588 > -0.160857 > -0.666661 > 34.895 > -8.93136 > -1.98507e-08 > -1.98507e-08 > > 1) ghost values are at the end of local solution array lx on cpu1 I do the > renumering myself. would be nice if this could be done by petsc automaticly > 2) the first two values on cpu0 are not equal to the last two at cpu1 > > > thomas > > On Sunday 25 June 2006 15:20, you wrote: >> ---------- Forwarded Message ---------- >> >> Subject: Re: Fwd: Re: about ghosted vectors and there local representation >> Date: Thursday 22 June 2006 22:13 >> From: Barry Smith >> To: petsc-users at mcs.anl.gov >> >> Send the values of local2global, nc, ghosts, nrows and nghosts for all >> processors (2 I hope). Also note that nrows should equal nc + nghosts. >> >> Barry >> >> On Thu, 22 Jun 2006, Thomas Geenen wrote: >>> nrows is the global number of rows >>> local2global is the local to global renumbering >>> nghosts are the number of ghosts >>> ghosts is the global row number i want to have local access to after the >>> solve >>> >>> >>> ISLocalToGlobalMappingCreate(PETSC_COMM_WORLD, nrows, local2global, >>> <og); VecCreateGhost(PETSC_COMM_WORLD, nc, >>> PETSC_DECIDE, nghosts[mype], ghosts, &x); >>> VecSetLocalToGlobalMapping(x,ltog); >>> VecSetValuesLocal(x, nc, indx, x_values, INSERT_VALUES); >>> VecAssemblyBegin(x); >>> VecAssemblyEnd(x); >>> >>> solve the system >>> >>> ierr = KSPGetSolution(ksp, &x); >>> ierr = VecGhostUpdateBegin(x,INSERT_VALUES,SCATTER_FORWARD); >>> ierr = VecGhostUpdateEnd(x,INSERT_VALUES,SCATTER_FORWARD); >>> ierr = VecGhostGetLocalForm(x, &lx); >>> >>> nrows is the global number of rows >>> local2global is the local to global renumbering >>> nghosts are the number of ghosts >>> ghosts is the global row number i want to have local access to after the >>> solve >>> >>> >>> thomas >>> >>> On Thursday 22 June 2006 09:20, you wrote: >>>> ---------- Forwarded Message ---------- >>>> >>>> Subject: Re: about ghosted vectors and there local representation >>>> Date: Tuesday 20 June 2006 20:39 >>>> From: Barry Smith >>>> To: petsc-users at mcs.anl.gov >>>> >>>> The ltog has to exactly match the way the ghosts are provided to >>>> VecCreateGhost(). Are they? Please send the exact example code. >>>> >>>> Barry >>>> >>>> On Tue, 20 Jun 2006, Thomas Geenen wrote: >>>>> Dear Petsc users, >>>>> >>>>> I think that I do not use the ghosted vector concept in the right way. >>>>> >>>>> I create a vector with >>>>> ierr = VecCreateGhost(PETSC_COMM_WORLD, nc, >>>>> PETSC_DECIDE, nghosts, ghosts, &x); >>>>> The entries in ghost contain the global vector positions that I want to >>>>> have available locally. >>>>> >>>>> I have a local representation so i apply (after having constructed the >>>>> mapping of course) >>>>> ierr = VecSetLocalToGlobalMapping(x,ltog); >>>>> I now insert the values >>>>> ierr = VecSetValuesLocal(x, nc, indx, x_values, INSERT_VALUES); >>>>> VecAssemblyBegin(x); >>>>> VecAssemblyEnd(x); >>>>> I am now under the assumption that petsc divided the vector entries >>>>> among processes according to his global representation of the vector. >>>>> >>>>> I solve my system of equations >>>>> KSPSolve(ksp,b,x); >>>>> afterwards i do >>>>> ierr = KSPGetSolution(ksp, &x); >>>>> ierr = VecGhostUpdateBegin(x,INSERT_VALUES,SCATTER_FORWARD); >>>>> ierr = VecGhostUpdateEnd(x,INSERT_VALUES,SCATTER_FORWARD); >>>>> ierr = VecGhostGetLocalForm(x, &lx); >>>>> >>>>> I now expect the vector to be in the local form. That means that the >>>>> positions that I created as ghost points are filled with the solution >>>>> corresponding to the global solution. I expect that they are inserted >>>>> in the position in my local vector corresponding to there corresponding >>>>> global position. >>>>> >>>>> apparently this is not what happens. >>>>> >>>>> a small example >>>>> 2 cpu's >>>>> each cpu contains 3 vector entries however there is an overlap of 1 >>>>> on cpu 1 the vector contains points (1, 2, 3) >>>>> on cpu 2 the vector contains points (3, 4, 5) >>>>> >>>>> I make position 1 on cpu 2 a ghost points with nghost=1 ghosts(3) >>>>> after solving and restoring I expect vector lx to contain the solution >>>>> as (3, 4, 5) >>>>> >>>>> >>>>> I hope I have explained my misunderstanding of the underlying concept >>>>> clear enough >>>>> >>>>> thanks for your help >>>>> Thomas Geenen >>>> >>>> ------------------------------------------------------- >> >> ------------------------------------------------------- > > From geenen at gmail.com Sun Jun 25 13:49:56 2006 From: geenen at gmail.com (Thomas Geenen) Date: Sun, 25 Jun 2006 20:49:56 +0200 Subject: about ghosted vectors and there local representation In-Reply-To: References: <200606251520.22779.geenen@geo.uu.nl> <200606251549.21265.geenen@gmail.com> Message-ID: <200606252049.57057.geenen@gmail.com> Dear Barry, Sorry for not getting your point earlier. I made a mapping for my ghosted vector based on the code sample and things work as expected. Thanks for the help Thomas On Sunday 25 June 2006 17:11, Barry Smith wrote: > Thomas, > > As I told you in my last two emails the local2global mapping you > supply to VecSetGlobalToGlobalMapping() has to match with the ghost > values you used when creating the ghosted vector. Otherwise you have > two different orderings that have nothing to do with each other > so there is NO way it could possibly work. > > In the development copy of PETSc I have added the > VecSetLocalToGlobalMapping() automatically to VecCreateGhost() so users > need not add it. Here is a snipit of the code you can start with: > > /* set local to global mapping for ghosted vector */ > ierr = PetscMalloc((n+nghost)*sizeof(PetscInt),&indices);CHKERRQ(ierr); > ierr = VecGetOwnershipRange(*vv,&rstart,PETSC_NULL);CHKERRQ(ierr); > for (i=0; i indices[i] = rstart + i; > } > for (i=0; i indices[n+i] = ghosts[i]; > } > ierr = > ISLocalToGlobalMappingCreate(comm,n+nghost,indices,<og);CHKERRQ(ierr); > ierr = PetscFree(indices);CHKERRQ(ierr); > ierr = VecSetLocalToGlobalMapping(*vv,ltog);CHKERRQ(ierr); > ierr = ISLocalToGlobalMappingDestroy(ltog);CHKERRQ(ierr); > > This is the only localtoglobal mapping you can set if you expect the > ghost point stuff to work. > > Barry > > On Sun, 25 Jun 2006, Thomas Geenen wrote: > > oke a small example with 2 cpu's > > > > local2global, > > [0] 0 0 > > [0] 1 1 > > [0] 2 2 > > [0] 3 3 > > [0] 4 4 > > [0] 5 5 > > [0] 6 6 > > [0] 7 7 > > [0] 8 8 > > [0] 9 9 > > [0] 10 10 > > [0] 11 11 > > [0] 12 12 > > [0] 13 13 > > [1] 0 0 > > [1] 1 1 > > [1] 2 14 > > [1] 3 15 > > [1] 4 16 > > [1] 5 17 > > [1] 6 18 > > [1] 7 19 > > [1] 8 20 > > [1] 9 21 > > [1] 10 22 > > [1] 11 23 > > [1] 12 24 > > [1] 13 25 > > on cpu0 nc = 14, nrows =14, nghosts=0 > > on cpu1 nc= 12, nrows=14, nghosts=2, ghosts=(0,1) > > ierr = KSPGetSolution(ksp, &x); > > ierr = VecGhostUpdateBegin(x,INSERT_VALUES,SCATTER_FORWARD); > > ierr = VecGhostUpdateEnd(x,INSERT_VALUES,SCATTER_FORWARD); > > ierr = VecGhostGetLocalForm(x, &lx); > > ierr = VecView(lx, PETSC_NULL); > > cpu0 > > -1.98507e-08 > > 1.09281e-08 > > 0.592588 > > 0.160857 > > -0.666662 > > -34.895 > > 8.93136 > > 0.499999 > > 4.22046e-08 > > 0.2963 > > -0.0497465 > > 0.666661 > > 26.8951 > > -8.93131 > > cpu1 > > -0.2963 > > 0.0497465 > > 0.666662 > > -26.8951 > > 8.93131 > > -0.499999 > > -1.70893e-08 > > -0.592588 > > -0.160857 > > -0.666661 > > 34.895 > > -8.93136 > > -1.98507e-08 > > -1.98507e-08 > > > > 1) ghost values are at the end of local solution array lx on cpu1 I do > > the renumering myself. would be nice if this could be done by petsc > > automaticly 2) the first two values on cpu0 are not equal to the last two > > at cpu1 > > > > > > thomas > > > > On Sunday 25 June 2006 15:20, you wrote: > >> ---------- Forwarded Message ---------- > >> > >> Subject: Re: Fwd: Re: about ghosted vectors and there local > >> representation Date: Thursday 22 June 2006 22:13 > >> From: Barry Smith > >> To: petsc-users at mcs.anl.gov > >> > >> Send the values of local2global, nc, ghosts, nrows and nghosts for > >> all processors (2 I hope). Also note that nrows should equal nc + > >> nghosts. > >> > >> Barry > >> > >> On Thu, 22 Jun 2006, Thomas Geenen wrote: > >>> nrows is the global number of rows > >>> local2global is the local to global renumbering > >>> nghosts are the number of ghosts > >>> ghosts is the global row number i want to have local access to after > >>> the solve > >>> > >>> > >>> ISLocalToGlobalMappingCreate(PETSC_COMM_WORLD, nrows, local2global, > >>> <og); VecCreateGhost(PETSC_COMM_WORLD, nc, > >>> PETSC_DECIDE, nghosts[mype], ghosts, &x); > >>> VecSetLocalToGlobalMapping(x,ltog); > >>> VecSetValuesLocal(x, nc, indx, x_values, INSERT_VALUES); > >>> VecAssemblyBegin(x); > >>> VecAssemblyEnd(x); > >>> > >>> solve the system > >>> > >>> ierr = KSPGetSolution(ksp, &x); > >>> ierr = VecGhostUpdateBegin(x,INSERT_VALUES,SCATTER_FORWARD); > >>> ierr = VecGhostUpdateEnd(x,INSERT_VALUES,SCATTER_FORWARD); > >>> ierr = VecGhostGetLocalForm(x, &lx); > >>> > >>> nrows is the global number of rows > >>> local2global is the local to global renumbering > >>> nghosts are the number of ghosts > >>> ghosts is the global row number i want to have local access to after > >>> the solve > >>> > >>> > >>> thomas > >>> > >>> On Thursday 22 June 2006 09:20, you wrote: > >>>> ---------- Forwarded Message ---------- > >>>> > >>>> Subject: Re: about ghosted vectors and there local representation > >>>> Date: Tuesday 20 June 2006 20:39 > >>>> From: Barry Smith > >>>> To: petsc-users at mcs.anl.gov > >>>> > >>>> The ltog has to exactly match the way the ghosts are provided to > >>>> VecCreateGhost(). Are they? Please send the exact example code. > >>>> > >>>> Barry > >>>> > >>>> On Tue, 20 Jun 2006, Thomas Geenen wrote: > >>>>> Dear Petsc users, > >>>>> > >>>>> I think that I do not use the ghosted vector concept in the right > >>>>> way. > >>>>> > >>>>> I create a vector with > >>>>> ierr = VecCreateGhost(PETSC_COMM_WORLD, nc, > >>>>> PETSC_DECIDE, nghosts, ghosts, &x); > >>>>> The entries in ghost contain the global vector positions that I want > >>>>> to have available locally. > >>>>> > >>>>> I have a local representation so i apply (after having constructed > >>>>> the mapping of course) > >>>>> ierr = VecSetLocalToGlobalMapping(x,ltog); > >>>>> I now insert the values > >>>>> ierr = VecSetValuesLocal(x, nc, indx, x_values, INSERT_VALUES); > >>>>> VecAssemblyBegin(x); > >>>>> VecAssemblyEnd(x); > >>>>> I am now under the assumption that petsc divided the vector entries > >>>>> among processes according to his global representation of the vector. > >>>>> > >>>>> I solve my system of equations > >>>>> KSPSolve(ksp,b,x); > >>>>> afterwards i do > >>>>> ierr = KSPGetSolution(ksp, &x); > >>>>> ierr = VecGhostUpdateBegin(x,INSERT_VALUES,SCATTER_FORWARD); > >>>>> ierr = VecGhostUpdateEnd(x,INSERT_VALUES,SCATTER_FORWARD); > >>>>> ierr = VecGhostGetLocalForm(x, &lx); > >>>>> > >>>>> I now expect the vector to be in the local form. That means that the > >>>>> positions that I created as ghost points are filled with the solution > >>>>> corresponding to the global solution. I expect that they are inserted > >>>>> in the position in my local vector corresponding to there > >>>>> corresponding global position. > >>>>> > >>>>> apparently this is not what happens. > >>>>> > >>>>> a small example > >>>>> 2 cpu's > >>>>> each cpu contains 3 vector entries however there is an overlap of 1 > >>>>> on cpu 1 the vector contains points (1, 2, 3) > >>>>> on cpu 2 the vector contains points (3, 4, 5) > >>>>> > >>>>> I make position 1 on cpu 2 a ghost points with nghost=1 ghosts(3) > >>>>> after solving and restoring I expect vector lx to contain the > >>>>> solution as (3, 4, 5) > >>>>> > >>>>> > >>>>> I hope I have explained my misunderstanding of the underlying concept > >>>>> clear enough > >>>>> > >>>>> thanks for your help > >>>>> Thomas Geenen > >>>> > >>>> ------------------------------------------------------- > >> > >> ------------------------------------------------------- From diosady at MIT.EDU Mon Jun 26 09:21:40 2006 From: diosady at MIT.EDU (Laslo Tibor Diosady) Date: Mon, 26 Jun 2006 10:21:40 -0400 (EDT) Subject: Using External packages with PETSC In-Reply-To: References: <1151071538.449bf532111a4@serv-g1.ccom.uminho.pt> Message-ID: I'm trying to use ParMetis with PETSc but I already have the ParMetis distribution. As opposed to using the option --download-parmetis=1 is it possible to specify the location of the parmetis directory in the same manner as the mpi directory. In other words can I do something like --with-parmetis-dir=/usr/local/ParMetis-3.1/ I tried this particular line but I ran the configure script I got the error ********************************************************************************* UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for details): --------------------------------------------------------------------------------------- --with-parmetis-dir=/usr/local/ParMetis-3.1 did not work ********************************************************************************* Is there another way to specify the parmetis directory or should I just use --download-parmetis=1? Thanks, Laslo From bsmith at mcs.anl.gov Mon Jun 26 09:24:40 2006 From: bsmith at mcs.anl.gov (Barry Smith) Date: Mon, 26 Jun 2006 09:24:40 -0500 (CDT) Subject: Using External packages with PETSC In-Reply-To: References: <1151071538.449bf532111a4@serv-g1.ccom.uminho.pt> Message-ID: Laslo, You can do this; but for some reason config/configue.py rejected that directory. You can look in configure.log or send it to petsc-maint at mcs.anl.gov to see why it was rejected. (Often it is because it was compiled with a different compiler or different MPI or compiler options). Barry On Mon, 26 Jun 2006, Laslo Tibor Diosady wrote: > I'm trying to use ParMetis with PETSc but I already have the ParMetis > distribution. As opposed to using the option > --download-parmetis=1 is it possible to specify the location of the parmetis > directory in the same manner as the mpi directory. > In other words can I do something like > --with-parmetis-dir=/usr/local/ParMetis-3.1/ > > I tried this particular line but I ran the configure script I got the error > > ********************************************************************************* > UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for > details): > --------------------------------------------------------------------------------------- > --with-parmetis-dir=/usr/local/ParMetis-3.1 did not work > ********************************************************************************* > > Is there another way to specify the parmetis directory or should I just use > --download-parmetis=1? > > Thanks, > > Laslo > > From diosady at MIT.EDU Wed Jun 28 13:57:43 2006 From: diosady at MIT.EDU (Laslo Tibor Diosady) Date: Wed, 28 Jun 2006 14:57:43 -0400 (EDT) Subject: Configuration error: UNABLE to FIND MODULE Message-ID: I get the following error when trying to run configure ********************************************************************************* UNABLE to FIND MODULE for config/configure.py --------------------------------------------------------------------------------------- No module named packages.MPI ********************************************************************************* I used the command, and both PETSC_DIR and PETSC_ARCH have been set ./config/configure.py --download-parmetis=1 --download-mpich=1 --download-f-blas-lapack=1 --with-shared --with-dynamic I believe this exact same command worked last time I tried to configure petsc so I'm not sure why it would not work this time, Any help would be greatly appreciated, Thanks, Laslo From bsmith at mcs.anl.gov Wed Jun 28 14:23:10 2006 From: bsmith at mcs.anl.gov (Barry Smith) Date: Wed, 28 Jun 2006 14:23:10 -0500 (CDT) Subject: Configuration error: UNABLE to FIND MODULE In-Reply-To: References: Message-ID: You may need to update BuildSystem if you have not in a long time. Barry On Wed, 28 Jun 2006, Laslo Tibor Diosady wrote: > I get the following error when trying to run configure > > ********************************************************************************* > UNABLE to FIND MODULE for config/configure.py > --------------------------------------------------------------------------------------- > No module named packages.MPI > ********************************************************************************* > > I used the command, and both PETSC_DIR and PETSC_ARCH have been set > > ./config/configure.py --download-parmetis=1 --download-mpich=1 > --download-f-blas-lapack=1 --with-shared --with-dynamic > > I believe this exact same command worked last time I tried to configure petsc > so I'm not sure why it would not work this time, > > Any help would be greatly appreciated, > > Thanks, > > Laslo > > From diosady at MIT.EDU Wed Jun 28 14:32:59 2006 From: diosady at MIT.EDU (Laslo Tibor Diosady) Date: Wed, 28 Jun 2006 15:32:59 -0400 (EDT) Subject: Configuration error: UNABLE to FIND MODULE In-Reply-To: References: Message-ID: Hi Barry, Could you clarify what you mean by update BuildSystem? Thanks, Laslo On Wed, 28 Jun 2006, Barry Smith wrote: > > You may need to update BuildSystem if you have not in a long time. > > Barry > > On Wed, 28 Jun 2006, Laslo Tibor Diosady wrote: > >> I get the following error when trying to run configure >> >> ********************************************************************************* >> UNABLE to FIND MODULE for config/configure.py >> >> --------------------------------------------------------------------------------------- >> No module named packages.MPI >> ********************************************************************************* >> >> I used the command, and both PETSC_DIR and PETSC_ARCH have been set >> >> ./config/configure.py --download-parmetis=1 --download-mpich=1 >> --download-f-blas-lapack=1 --with-shared --with-dynamic >> >> I believe this exact same command worked last time I tried to configure >> petsc so I'm not sure why it would not work this time, >> >> Any help would be greatly appreciated, >> >> Thanks, >> >> Laslo >> >> > > From bsmith at mcs.anl.gov Wed Jun 28 14:37:34 2006 From: bsmith at mcs.anl.gov (Barry Smith) Date: Wed, 28 Jun 2006 14:37:34 -0500 (CDT) Subject: Configuration error: UNABLE to FIND MODULE In-Reply-To: References: Message-ID: ls python you will see a directory called BuildSystem. If you are using hg to get PETSc then do cd python/BuildSystem hg pull if you are using bk to get PETSc you will need to switch to hg see http://www-unix.mcs.anl.gov/petsc/petsc-as/developers/index.html Good luck, Barry On Wed, 28 Jun 2006, Laslo Tibor Diosady wrote: > Hi Barry, > > Could you clarify what you mean by update BuildSystem? > > Thanks, > > Laslo > > On Wed, 28 Jun 2006, Barry Smith wrote: > >> >> You may need to update BuildSystem if you have not in a long time. >> >> Barry >> >> On Wed, 28 Jun 2006, Laslo Tibor Diosady wrote: >> >>> I get the following error when trying to run configure >>> >>> ********************************************************************************* >>> UNABLE to FIND MODULE for config/configure.py >>> >>> >>> --------------------------------------------------------------------------------------- >>> No module named packages.MPI >>> ********************************************************************************* >>> >>> I used the command, and both PETSC_DIR and PETSC_ARCH have been set >>> >>> ./config/configure.py --download-parmetis=1 --download-mpich=1 >>> --download-f-blas-lapack=1 --with-shared --with-dynamic >>> >>> I believe this exact same command worked last time I tried to configure >>> petsc so I'm not sure why it would not work this time, >>> >>> Any help would be greatly appreciated, >>> >>> Thanks, >>> >>> Laslo >>> >>> >> >> > > From diosady at MIT.EDU Thu Jun 29 08:44:17 2006 From: diosady at MIT.EDU (Laslo Tibor Diosady) Date: Thu, 29 Jun 2006 09:44:17 -0400 (EDT) Subject: Configuration error: UNABLE to FIND MODULE In-Reply-To: References: Message-ID: Hi Barry, I was just the basic version of petsc by downloading petsc-lite-2.3.1.tar.gz, from the petsc web page, do I need to get the developer version to make this work? Laslo On Wed, 28 Jun 2006, Barry Smith wrote: > > ls python > you will see a directory called BuildSystem. > If you are using hg to get PETSc then do > cd python/BuildSystem > hg pull > if you are using bk to get PETSc you will need to switch to > hg see http://www-unix.mcs.anl.gov/petsc/petsc-as/developers/index.html > > Good luck, > > Barry > > > On Wed, 28 Jun 2006, Laslo Tibor Diosady wrote: > >> Hi Barry, >> >> Could you clarify what you mean by update BuildSystem? >> >> Thanks, >> >> Laslo >> >> On Wed, 28 Jun 2006, Barry Smith wrote: >> >>> >>> You may need to update BuildSystem if you have not in a long time. >>> >>> Barry >>> >>> On Wed, 28 Jun 2006, Laslo Tibor Diosady wrote: >>> >>>> I get the following error when trying to run configure >>>> >>>> ********************************************************************************* >>>> UNABLE to FIND MODULE for config/configure.py >>>> >>>> >>>> >>>> --------------------------------------------------------------------------------------- >>>> No module named packages.MPI >>>> ********************************************************************************* >>>> >>>> I used the command, and both PETSC_DIR and PETSC_ARCH have been set >>>> >>>> ./config/configure.py --download-parmetis=1 --download-mpich=1 >>>> --download-f-blas-lapack=1 --with-shared --with-dynamic >>>> >>>> I believe this exact same command worked last time I tried to configure >>>> petsc so I'm not sure why it would not work this time, >>>> >>>> Any help would be greatly appreciated, >>>> >>>> Thanks, >>>> >>>> Laslo >>>> >>>> >>> >>> >> >> > > From balay at mcs.anl.gov Thu Jun 29 11:03:09 2006 From: balay at mcs.anl.gov (Satish Balay) Date: Thu, 29 Jun 2006 11:03:09 -0500 (CDT) Subject: Configuration error: UNABLE to FIND MODULE In-Reply-To: References: Message-ID: Barry's instructions are for petsc-dev. If you are using petsc-2.3.1 - it should not need any such updates. Send configure.log for the failed build to petsc-maint at mcs.anl.gov - and we can take a look at it. However - try making sure that PETSC_DIR is set correctly - and do the following. 'rm -rf externalpackages' Now reattempt configure. [and if it fails send us the log] Satish On Thu, 29 Jun 2006, Laslo Tibor Diosady wrote: > Hi Barry, > > I was just the basic version of petsc by downloading petsc-lite-2.3.1.tar.gz, > from the petsc web page, do I need to get the developer version to make this > work? > > Laslo > > > On Wed, 28 Jun 2006, Barry Smith wrote: > > > > > ls python > > you will see a directory called BuildSystem. > > If you are using hg to get PETSc then do > > cd python/BuildSystem > > hg pull > > if you are using bk to get PETSc you will need to switch to > > hg see http://www-unix.mcs.anl.gov/petsc/petsc-as/developers/index.html > > > > Good luck, > > > > Barry > > > > > > On Wed, 28 Jun 2006, Laslo Tibor Diosady wrote: > > > > > Hi Barry, > > > > > > Could you clarify what you mean by update BuildSystem? > > > > > > Thanks, > > > > > > Laslo > > > > > > On Wed, 28 Jun 2006, Barry Smith wrote: > > > > > > > > > > > You may need to update BuildSystem if you have not in a long time. > > > > > > > > Barry > > > > > > > > On Wed, 28 Jun 2006, Laslo Tibor Diosady wrote: > > > > > > > > > I get the following error when trying to run configure > > > > > > > > > > ********************************************************************************* > > > > > UNABLE to FIND MODULE for config/configure.py > > > > > > > > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------------------------- > > > > > No module named packages.MPI > > > > > ********************************************************************************* > > > > > > > > > > I used the command, and both PETSC_DIR and PETSC_ARCH have been set > > > > > > > > > > ./config/configure.py --download-parmetis=1 --download-mpich=1 > > > > > --download-f-blas-lapack=1 --with-shared --with-dynamic > > > > > > > > > > I believe this exact same command worked last time I tried to > > > > > configure petsc so I'm not sure why it would not work this time, > > > > > > > > > > Any help would be greatly appreciated, > > > > > > > > > > Thanks, > > > > > > > > > > Laslo > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > From balay at mcs.anl.gov Thu Jun 29 11:27:40 2006 From: balay at mcs.anl.gov (Satish Balay) Date: Thu, 29 Jun 2006 11:27:40 -0500 (CDT) Subject: Configuration error: UNABLE to FIND MODULE In-Reply-To: References: Message-ID: I'm able to reproduce this problem with 2.3.1. Will take a look at it. Satish On Thu, 29 Jun 2006, Satish Balay wrote: > Barry's instructions are for petsc-dev. If you are using petsc-2.3.1 - > it should not need any such updates. > > Send configure.log for the failed build to petsc-maint at mcs.anl.gov - > and we can take a look at it. However - try making sure that PETSC_DIR > is set correctly - and do the following. > > 'rm -rf externalpackages' > > Now reattempt configure. [and if it fails send us the log] > > Satish > > On Thu, 29 Jun 2006, Laslo Tibor Diosady wrote: > > > Hi Barry, > > > > I was just the basic version of petsc by downloading petsc-lite-2.3.1.tar.gz, > > from the petsc web page, do I need to get the developer version to make this > > work? > > > > Laslo > > > > > > On Wed, 28 Jun 2006, Barry Smith wrote: > > > > > > > > ls python > > > you will see a directory called BuildSystem. > > > If you are using hg to get PETSc then do > > > cd python/BuildSystem > > > hg pull > > > if you are using bk to get PETSc you will need to switch to > > > hg see http://www-unix.mcs.anl.gov/petsc/petsc-as/developers/index.html > > > > > > Good luck, > > > > > > Barry > > > > > > > > > On Wed, 28 Jun 2006, Laslo Tibor Diosady wrote: > > > > > > > Hi Barry, > > > > > > > > Could you clarify what you mean by update BuildSystem? > > > > > > > > Thanks, > > > > > > > > Laslo > > > > > > > > On Wed, 28 Jun 2006, Barry Smith wrote: > > > > > > > > > > > > > > You may need to update BuildSystem if you have not in a long time. > > > > > > > > > > Barry > > > > > > > > > > On Wed, 28 Jun 2006, Laslo Tibor Diosady wrote: > > > > > > > > > > > I get the following error when trying to run configure > > > > > > > > > > > > ********************************************************************************* > > > > > > UNABLE to FIND MODULE for config/configure.py > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------------------------- > > > > > > No module named packages.MPI > > > > > > ********************************************************************************* > > > > > > > > > > > > I used the command, and both PETSC_DIR and PETSC_ARCH have been set > > > > > > > > > > > > ./config/configure.py --download-parmetis=1 --download-mpich=1 > > > > > > --download-f-blas-lapack=1 --with-shared --with-dynamic > > > > > > > > > > > > I believe this exact same command worked last time I tried to > > > > > > configure petsc so I'm not sure why it would not work this time, > > > > > > > > > > > > Any help would be greatly appreciated, > > > > > > > > > > > > Thanks, > > > > > > > > > > > > Laslo > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > From mafunk at nmsu.edu Fri Jun 30 18:46:02 2006 From: mafunk at nmsu.edu (Matt Funk) Date: Fri, 30 Jun 2006 17:46:02 -0600 Subject: matrix assembly In-Reply-To: References: Message-ID: <200606301746.04619.mafunk@nmsu.edu> Hi, i have a matrix stored in the matrix free format. I.e. an array indicating the row number, an array storing the column number and the array of corresponding values. I was wondering what the best way is to build the PETsC matrix using this. I was hoping that there is call to some sparse matrix assembler function to which is simply pass these three arrays and it builds the matrix for me. However, i did not find anything that simple. So i guess i need to do it row by row using the MatSetValues fcn() after allocating the memory for the matrix (i.e. pretty much as the procedure described on p.54 of the user manual)? mat On Friday 30 June 2006 14:30, Satish Balay wrote: > Added to petsc-dev now. > > Satish > > On Fri, 30 Jun 2006, Barry Smith wrote: > > Mathieu, > > > > Cool, thanks. > > > > Satish, > > > > Could you please apply the diff to petsc-dev now and then push > > so any future changes anyone makes will be combatiable with the new > > code. > > > > Thanks > > > > Barry > > > > On Fri, 30 Jun 2006, Mathieu Taillefumier wrote: > > > Good morning everybody, > > > > > > I finished to modify the code of the library in order to compile the > > > complex version with a C compiler. A few numbers of files have been > > > modified. This modifications include a modification of the file > > > language.py where I put in comment two lines forcing to compile the > > > library with a c++ compiler. Since I don't really know python, I just > > > put them as a comment, but i think it is better to put a message > > > indicating that compiling the complex version of Petsc needs a C90 > > > compliant compiler (gcc 3.4 and after work, it works also with icc) and > > > is experimental. Actually I am working with this modifications and it > > > seems to work like a charm (I had no problem with it). > > > I still need some time to convert the example programs which do not > > > compile but it will be done soon. > > > Note for all of us : > > > Don't use the name I as a variable anymore. It is a reserved word of > > > the language. > > > For most of us, the modifications must be transparent. > > > > > > Regards > > > > > > Mathieu From bsmith at mcs.anl.gov Fri Jun 30 20:04:47 2006 From: bsmith at mcs.anl.gov (Barry Smith) Date: Fri, 30 Jun 2006 20:04:47 -0500 (CDT) Subject: matrix assembly In-Reply-To: <200606301746.04619.mafunk@nmsu.edu> References: <200606301746.04619.mafunk@nmsu.edu> Message-ID: Mat, There is no routine like this. It would be possible for you or someone else to provide a routine that worked for a particular matrix format such as MatCreateSeqAIJFromCoordinates(comm,nz,i,j,values,&mat) It likely would be essentially like the code you have written except it would put the values directly into the data structure without having to use calls to MatSetValues()[You would need to look at MatSetValues_SeqAIJ() to see one way of getting the data directly in]. Similar code could be written for MPIAIJ though it gets more complicated because of the more complicated structure and if you place values off-processor. It could also be written for only PETSc matrix formats, BAIJ, SBAIJ, Bdiag etc. We haven't written this codes because we haven't needed them and much prefer to simply put the matrix values into the matrix WHEN they are generated rather then store them in some data-structure that has to be then converted into the PETSc format. If you would like to provide a routine like this we'd be glad to add it to PETSc and maintain it. Barry On Fri, 30 Jun 2006, Matt Funk wrote: > Hi, > > i have a matrix stored in the matrix free format. I.e. an array indicating the > row number, an array storing the column number and the array of corresponding > values. > > I was wondering what the best way is to build the PETsC matrix using this. I > was hoping that there is call to some sparse matrix assembler function to > which is simply pass these three arrays and it builds the matrix for me. > > However, i did not find anything that simple. So i guess i need to do it row > by row using the MatSetValues fcn() after allocating the memory for the > matrix (i.e. pretty much as the procedure described on p.54 of the user > manual)? > > mat > > > > > > On Friday 30 June 2006 14:30, Satish Balay wrote: >> Added to petsc-dev now. >> >> Satish >> >> On Fri, 30 Jun 2006, Barry Smith wrote: >>> Mathieu, >>> >>> Cool, thanks. >>> >>> Satish, >>> >>> Could you please apply the diff to petsc-dev now and then push >>> so any future changes anyone makes will be combatiable with the new >>> code. >>> >>> Thanks >>> >>> Barry >>> >>> On Fri, 30 Jun 2006, Mathieu Taillefumier wrote: >>>> Good morning everybody, >>>> >>>> I finished to modify the code of the library in order to compile the >>>> complex version with a C compiler. A few numbers of files have been >>>> modified. This modifications include a modification of the file >>>> language.py where I put in comment two lines forcing to compile the >>>> library with a c++ compiler. Since I don't really know python, I just >>>> put them as a comment, but i think it is better to put a message >>>> indicating that compiling the complex version of Petsc needs a C90 >>>> compliant compiler (gcc 3.4 and after work, it works also with icc) and >>>> is experimental. Actually I am working with this modifications and it >>>> seems to work like a charm (I had no problem with it). >>>> I still need some time to convert the example programs which do not >>>> compile but it will be done soon. >>>> Note for all of us : >>>> Don't use the name I as a variable anymore. It is a reserved word of >>>> the language. >>>> For most of us, the modifications must be transparent. >>>> >>>> Regards >>>> >>>> Mathieu > >