From billy at dem.uminho.pt Sun Feb 1 06:32:44 2009 From: billy at dem.uminho.pt (=?iso-8859-1?Q?Billy_Ara=FAjo?=) Date: Sun, 1 Feb 2009 12:32:44 -0000 Subject: Performance degradation after upgrade to 3.0.0 Message-ID: <1200D8BEDB3DD54DBA528E210F372BF3D944C3@BEFUNCIONARIOS.uminho.pt> Hi, I have also verified that there has been a degradation of performance using the new 3.0 version: This is my function calling PETSc: KSP ksp; PC pc; KSPCreate (PETSC_COMM_WORLD, &ksp); KSPSetOperators (ksp, *A, *A, DIFFERENT_NONZERO_PATTERN); KSPSetType (ksp, KSPFGMRES); KSPGetPC (ksp, &pc); PCSetType (pc, PrecondProc); KSPSetInitialGuessNonzero (ksp, PETSC_TRUE); KSPSetTolerances (ksp, 1E-50, maxtol, PETSC_DEFAULT, maxiter); KSPSetFromOptions (ksp); KSPSolve (ksp, *b, *x); KSPGetIterationNumber (ksp, iter); KSPGetResidualNorm (ksp, res); KSPDestroy (ksp); with previous version 2.3.3-p6: Number of iterations: 42 Residual: +7.073781E-13 Time: +8.615024E-03 now: Number of iterations: 500 Residual: +2.746161E-05 Time: +1.026870E-01 It is reaching maximum number of iterations. The only thing I changed was: MatSetOption (*A, MAT_SYMMETRIC); to MatSetOption (*A, MAT_SYMMETRIC, PETSC_TRUE); I think I didn't change anything else. Regards, Billy. -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Sun Feb 1 12:07:14 2009 From: knepley at gmail.com (Matthew Knepley) Date: Sun, 1 Feb 2009 12:07:14 -0600 Subject: Performance degradation after upgrade to 3.0.0 In-Reply-To: <1200D8BEDB3DD54DBA528E210F372BF3D944C3@BEFUNCIONARIOS.uminho.pt> References: <1200D8BEDB3DD54DBA528E210F372BF3D944C3@BEFUNCIONARIOS.uminho.pt> Message-ID: In order to determine what is happening you first should: 1) Confirm that the solver setup is identical using -ksp_view for both versions 2) Determine that the matrices are identical. Output both matrices using MatView() with a PetscBinaryViewer. You can diff the files, and you can also solver both matrices using KSP ex10. 3) Look at the residuals using -ksp_monitor. If they are different, something else has changed. Matt On Sun, Feb 1, 2009 at 6:32 AM, Billy Ara?jo wrote: > > Hi, > > I have also verified that there has been a degradation of performance using > the new 3.0 version: > > This is my function calling PETSc: > > KSP ksp; > PC pc; > > KSPCreate (PETSC_COMM_WORLD, &ksp); > > KSPSetOperators (ksp, *A, *A, DIFFERENT_NONZERO_PATTERN); > > KSPSetType (ksp, KSPFGMRES); > > KSPGetPC (ksp, &pc); > > PCSetType (pc, PrecondProc); > > KSPSetInitialGuessNonzero (ksp, PETSC_TRUE); > > KSPSetTolerances (ksp, 1E-50, maxtol, PETSC_DEFAULT, maxiter); > > KSPSetFromOptions (ksp); > > KSPSolve (ksp, *b, *x); > > KSPGetIterationNumber (ksp, iter); > > KSPGetResidualNorm (ksp, res); > > KSPDestroy (ksp); > > > with previous version 2.3.3-p6: > > Number of iterations: 42 Residual: +7.073781E-13 Time: +8.615024E-03 > > now: > > Number of iterations: 500 Residual: +2.746161E-05 Time: +1.026870E-01 > > It is reaching maximum number of iterations. The only thing I changed was: > > MatSetOption (*A, MAT_SYMMETRIC); > to > MatSetOption (*A, MAT_SYMMETRIC, PETSC_TRUE); > > I think I didn't change anything else. > > > Regards, > > Billy. > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener From billy at dem.uminho.pt Sun Feb 1 15:01:19 2009 From: billy at dem.uminho.pt (=?iso-8859-1?Q?Billy_Ara=FAjo?=) Date: Sun, 1 Feb 2009 21:01:19 -0000 Subject: Performance degradation after upgrade to 3.0.0 References: <1200D8BEDB3DD54DBA528E210F372BF3D944C3@BEFUNCIONARIOS.uminho.pt> Message-ID: <1200D8BEDB3DD54DBA528E210F372BF3D944C7@BEFUNCIONARIOS.uminho.pt> Hi, Here are the files that contain all the information below. You can see that the matrices are the same, unless I am missing something here. :) (I am resending them in compressed format). Regards, Billy. -----Original Message----- From: petsc-users-bounces at mcs.anl.gov on behalf of Matthew Knepley Sent: Sun 2/1/2009 6:07 PM To: PETSc users list Subject: Re: Performance degradation after upgrade to 3.0.0 In order to determine what is happening you first should: 1) Confirm that the solver setup is identical using -ksp_view for both versions 2) Determine that the matrices are identical. Output both matrices using MatView() with a PetscBinaryViewer. You can diff the files, and you can also solver both matrices using KSP ex10. 3) Look at the residuals using -ksp_monitor. If they are different, something else has changed. Matt On Sun, Feb 1, 2009 at 6:32 AM, Billy Ara?jo wrote: > > Hi, > > I have also verified that there has been a degradation of performance using > the new 3.0 version: > > This is my function calling PETSc: > > KSP ksp; > PC pc; > > KSPCreate (PETSC_COMM_WORLD, &ksp); > > KSPSetOperators (ksp, *A, *A, DIFFERENT_NONZERO_PATTERN); > > KSPSetType (ksp, KSPFGMRES); > > KSPGetPC (ksp, &pc); > > PCSetType (pc, PrecondProc); > > KSPSetInitialGuessNonzero (ksp, PETSC_TRUE); > > KSPSetTolerances (ksp, 1E-50, maxtol, PETSC_DEFAULT, maxiter); > > KSPSetFromOptions (ksp); > > KSPSolve (ksp, *b, *x); > > KSPGetIterationNumber (ksp, iter); > > KSPGetResidualNorm (ksp, res); > > KSPDestroy (ksp); > > > with previous version 2.3.3-p6: > > Number of iterations: 42 Residual: +7.073781E-13 Time: +8.615024E-03 > > now: > > Number of iterations: 500 Residual: +2.746161E-05 Time: +1.026870E-01 > > It is reaching maximum number of iterations. The only thing I changed was: > > MatSetOption (*A, MAT_SYMMETRIC); > to > MatSetOption (*A, MAT_SYMMETRIC, PETSC_TRUE); > > I think I didn't change anything else. > > > Regards, > > Billy. > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 34286 bytes Desc: not available URL: From knepley at gmail.com Sun Feb 1 15:29:11 2009 From: knepley at gmail.com (Matthew Knepley) Date: Sun, 1 Feb 2009 15:29:11 -0600 Subject: Performance degradation after upgrade to 3.0.0 In-Reply-To: <1200D8BEDB3DD54DBA528E210F372BF3D944C7@BEFUNCIONARIOS.uminho.pt> References: <1200D8BEDB3DD54DBA528E210F372BF3D944C3@BEFUNCIONARIOS.uminho.pt> <1200D8BEDB3DD54DBA528E210F372BF3D944C7@BEFUNCIONARIOS.uminho.pt> Message-ID: Can you send the matrix and rhs as PETSc binary output, and I will find out what the difference is. It looks to me like the default ICC ordering has changed. Matt On Sun, Feb 1, 2009 at 3:01 PM, Billy Ara?jo wrote: > Hi, > > Here are the files that contain all the information below. You can see that the matrices are the same, unless I am missing something here. :) > > (I am resending them in compressed format). > > Regards, > > Billy. > > > -----Original Message----- > From: petsc-users-bounces at mcs.anl.gov on behalf of Matthew Knepley > Sent: Sun 2/1/2009 6:07 PM > To: PETSc users list > Subject: Re: Performance degradation after upgrade to 3.0.0 > > In order to determine what is happening you first should: > > 1) Confirm that the solver setup is identical using -ksp_view for > both versions > > 2) Determine that the matrices are identical. Output both matrices using > MatView() with a PetscBinaryViewer. You can diff the files, and > you can also > solver both matrices using KSP ex10. > > 3) Look at the residuals using -ksp_monitor. If they are different, something > else has changed. > > Matt > > On Sun, Feb 1, 2009 at 6:32 AM, Billy Ara?jo wrote: >> >> Hi, >> >> I have also verified that there has been a degradation of performance using >> the new 3.0 version: >> >> This is my function calling PETSc: >> >> KSP ksp; >> PC pc; >> >> KSPCreate (PETSC_COMM_WORLD, &ksp); >> >> KSPSetOperators (ksp, *A, *A, DIFFERENT_NONZERO_PATTERN); >> >> KSPSetType (ksp, KSPFGMRES); >> >> KSPGetPC (ksp, &pc); >> >> PCSetType (pc, PrecondProc); >> >> KSPSetInitialGuessNonzero (ksp, PETSC_TRUE); >> >> KSPSetTolerances (ksp, 1E-50, maxtol, PETSC_DEFAULT, maxiter); >> >> KSPSetFromOptions (ksp); >> >> KSPSolve (ksp, *b, *x); >> >> KSPGetIterationNumber (ksp, iter); >> >> KSPGetResidualNorm (ksp, res); >> >> KSPDestroy (ksp); >> >> >> with previous version 2.3.3-p6: >> >> Number of iterations: 42 Residual: +7.073781E-13 Time: +8.615024E-03 >> >> now: >> >> Number of iterations: 500 Residual: +2.746161E-05 Time: +1.026870E-01 >> >> It is reaching maximum number of iterations. The only thing I changed was: >> >> MatSetOption (*A, MAT_SYMMETRIC); >> to >> MatSetOption (*A, MAT_SYMMETRIC, PETSC_TRUE); >> >> I think I didn't change anything else. >> >> >> Regards, >> >> Billy. >> > > > > -- > What most experimenters take for granted before they begin their > experiments is infinitely more interesting than any results to which > their experiments lead. > -- Norbert Wiener > > > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener From bsmith at mcs.anl.gov Sun Feb 1 17:24:05 2009 From: bsmith at mcs.anl.gov (Barry Smith) Date: Sun, 1 Feb 2009 17:24:05 -0600 Subject: Performance degradation after upgrade to 3.0.0 In-Reply-To: <1200D8BEDB3DD54DBA528E210F372BF3D944C7@BEFUNCIONARIOS.uminho.pt> References: <1200D8BEDB3DD54DBA528E210F372BF3D944C3@BEFUNCIONARIOS.uminho.pt> <1200D8BEDB3DD54DBA528E210F372BF3D944C7@BEFUNCIONARIOS.uminho.pt> Message-ID: winmail.dat? Come on, be serious, we'd like to help you but not all of us are chained to Bill Gates nightstand. Barry On Feb 1, 2009, at 3:01 PM, Billy Ara?jo wrote: > Hi, > > Here are the files that contain all the information below. You can > see that the matrices are the same, unless I am missing something > here. :) > > (I am resending them in compressed format). > > Regards, > > Billy. > > > -----Original Message----- > From: petsc-users-bounces at mcs.anl.gov on behalf of Matthew Knepley > Sent: Sun 2/1/2009 6:07 PM > To: PETSc users list > Subject: Re: Performance degradation after upgrade to 3.0.0 > > In order to determine what is happening you first should: > > 1) Confirm that the solver setup is identical using -ksp_view for > both versions > > 2) Determine that the matrices are identical. Output both matrices > using > MatView() with a PetscBinaryViewer. You can diff the files, and > you can also > solver both matrices using KSP ex10. > > 3) Look at the residuals using -ksp_monitor. If they are different, > something > else has changed. > > Matt > > On Sun, Feb 1, 2009 at 6:32 AM, Billy Ara?jo > wrote: >> >> Hi, >> >> I have also verified that there has been a degradation of >> performance using >> the new 3.0 version: >> >> This is my function calling PETSc: >> >> KSP ksp; >> PC pc; >> >> KSPCreate (PETSC_COMM_WORLD, &ksp); >> >> KSPSetOperators (ksp, *A, *A, DIFFERENT_NONZERO_PATTERN); >> >> KSPSetType (ksp, KSPFGMRES); >> >> KSPGetPC (ksp, &pc); >> >> PCSetType (pc, PrecondProc); >> >> KSPSetInitialGuessNonzero (ksp, PETSC_TRUE); >> >> KSPSetTolerances (ksp, 1E-50, maxtol, PETSC_DEFAULT, maxiter); >> >> KSPSetFromOptions (ksp); >> >> KSPSolve (ksp, *b, *x); >> >> KSPGetIterationNumber (ksp, iter); >> >> KSPGetResidualNorm (ksp, res); >> >> KSPDestroy (ksp); >> >> >> with previous version 2.3.3-p6: >> >> Number of iterations: 42 Residual: +7.073781E-13 Time: +8.615024E-03 >> >> now: >> >> Number of iterations: 500 Residual: +2.746161E-05 Time: +1.026870E-01 >> >> It is reaching maximum number of iterations. The only thing I >> changed was: >> >> MatSetOption (*A, MAT_SYMMETRIC); >> to >> MatSetOption (*A, MAT_SYMMETRIC, PETSC_TRUE); >> >> I think I didn't change anything else. >> >> >> Regards, >> >> Billy. >> > > > > -- > What most experimenters take for granted before they begin their > experiments is infinitely more interesting than any results to which > their experiments lead. > -- Norbert Wiener > > > From enjoywm at cs.wm.edu Sun Feb 1 20:24:26 2009 From: enjoywm at cs.wm.edu (enjoywm at cs.wm.edu) Date: Sun, 1 Feb 2009 21:24:26 -0500 (EST) Subject: share a data object Message-ID: <60612.68.229.127.174.1233541466.squirrel@mail.cs.wm.edu> Hi, I'm new to PETSC. If I have multicores with share memory. Can a data object is shared by different processes? Thanks. From billy at dem.uminho.pt Mon Feb 2 03:59:33 2009 From: billy at dem.uminho.pt (=?iso-8859-1?Q?Billy_Ara=FAjo?=) Date: Mon, 2 Feb 2009 09:59:33 -0000 Subject: Performance degradation after upgrade to 3.0.0 References: <1200D8BEDB3DD54DBA528E210F372BF3D944C3@BEFUNCIONARIOS.uminho.pt><1200D8BEDB3DD54DBA528E210F372BF3D944C7@BEFUNCIONARIOS.uminho.pt> Message-ID: <1200D8BEDB3DD54DBA528E210F372BF3D944C8@BEFUNCIONARIOS.uminho.pt> I didn't send winmail.dat. Maybe because was sent from outlook web access, I don't know... :) Billy. -----Original Message----- From: petsc-users-bounces at mcs.anl.gov on behalf of Barry Smith Sent: Sun 2/1/2009 11:24 PM To: PETSc users list Subject: Re: Performance degradation after upgrade to 3.0.0 winmail.dat? Come on, be serious, we'd like to help you but not all of us are chained to Bill Gates nightstand. Barry On Feb 1, 2009, at 3:01 PM, Billy Ara?jo wrote: > Hi, > > Here are the files that contain all the information below. You can > see that the matrices are the same, unless I am missing something > here. :) > > (I am resending them in compressed format). > > Regards, > > Billy. > > > -----Original Message----- > From: petsc-users-bounces at mcs.anl.gov on behalf of Matthew Knepley > Sent: Sun 2/1/2009 6:07 PM > To: PETSc users list > Subject: Re: Performance degradation after upgrade to 3.0.0 > > In order to determine what is happening you first should: > > 1) Confirm that the solver setup is identical using -ksp_view for > both versions > > 2) Determine that the matrices are identical. Output both matrices > using > MatView() with a PetscBinaryViewer. You can diff the files, and > you can also > solver both matrices using KSP ex10. > > 3) Look at the residuals using -ksp_monitor. If they are different, > something > else has changed. > > Matt > > On Sun, Feb 1, 2009 at 6:32 AM, Billy Ara?jo > wrote: >> >> Hi, >> >> I have also verified that there has been a degradation of >> performance using >> the new 3.0 version: >> >> This is my function calling PETSc: >> >> KSP ksp; >> PC pc; >> >> KSPCreate (PETSC_COMM_WORLD, &ksp); >> >> KSPSetOperators (ksp, *A, *A, DIFFERENT_NONZERO_PATTERN); >> >> KSPSetType (ksp, KSPFGMRES); >> >> KSPGetPC (ksp, &pc); >> >> PCSetType (pc, PrecondProc); >> >> KSPSetInitialGuessNonzero (ksp, PETSC_TRUE); >> >> KSPSetTolerances (ksp, 1E-50, maxtol, PETSC_DEFAULT, maxiter); >> >> KSPSetFromOptions (ksp); >> >> KSPSolve (ksp, *b, *x); >> >> KSPGetIterationNumber (ksp, iter); >> >> KSPGetResidualNorm (ksp, res); >> >> KSPDestroy (ksp); >> >> >> with previous version 2.3.3-p6: >> >> Number of iterations: 42 Residual: +7.073781E-13 Time: +8.615024E-03 >> >> now: >> >> Number of iterations: 500 Residual: +2.746161E-05 Time: +1.026870E-01 >> >> It is reaching maximum number of iterations. The only thing I >> changed was: >> >> MatSetOption (*A, MAT_SYMMETRIC); >> to >> MatSetOption (*A, MAT_SYMMETRIC, PETSC_TRUE); >> >> I think I didn't change anything else. >> >> >> Regards, >> >> Billy. >> > > > > -- > What most experimenters take for granted before they begin their > experiments is infinitely more interesting than any results to which > their experiments lead. > -- Norbert Wiener > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 4315 bytes Desc: not available URL: From billy at dem.uminho.pt Mon Feb 2 04:03:04 2009 From: billy at dem.uminho.pt (=?iso-8859-1?Q?Billy_Ara=FAjo?=) Date: Mon, 2 Feb 2009 10:03:04 -0000 Subject: Performance degradation after upgrade to 3.0.0 References: <1200D8BEDB3DD54DBA528E210F372BF3D944C3@BEFUNCIONARIOS.uminho.pt><1200D8BEDB3DD54DBA528E210F372BF3D944C7@BEFUNCIONARIOS.uminho.pt> Message-ID: <1200D8BEDB3DD54DBA528E210F372BF3D944C9@BEFUNCIONARIOS.uminho.pt> OK. I will try to send this ASAP. Billy. -----Original Message----- From: petsc-users-bounces at mcs.anl.gov on behalf of Matthew Knepley Sent: Sun 2/1/2009 9:29 PM To: PETSc users list Subject: Re: Performance degradation after upgrade to 3.0.0 Can you send the matrix and rhs as PETSc binary output, and I will find out what the difference is. It looks to me like the default ICC ordering has changed. Matt On Sun, Feb 1, 2009 at 3:01 PM, Billy Ara?jo wrote: > Hi, > > Here are the files that contain all the information below. You can see that the matrices are the same, unless I am missing something here. :) > > (I am resending them in compressed format). > > Regards, > > Billy. > > > -----Original Message----- > From: petsc-users-bounces at mcs.anl.gov on behalf of Matthew Knepley > Sent: Sun 2/1/2009 6:07 PM > To: PETSc users list > Subject: Re: Performance degradation after upgrade to 3.0.0 > > In order to determine what is happening you first should: > > 1) Confirm that the solver setup is identical using -ksp_view for > both versions > > 2) Determine that the matrices are identical. Output both matrices using > MatView() with a PetscBinaryViewer. You can diff the files, and > you can also > solver both matrices using KSP ex10. > > 3) Look at the residuals using -ksp_monitor. If they are different, something > else has changed. > > Matt > > On Sun, Feb 1, 2009 at 6:32 AM, Billy Ara?jo wrote: >> >> Hi, >> >> I have also verified that there has been a degradation of performance using >> the new 3.0 version: >> >> This is my function calling PETSc: >> >> KSP ksp; >> PC pc; >> >> KSPCreate (PETSC_COMM_WORLD, &ksp); >> >> KSPSetOperators (ksp, *A, *A, DIFFERENT_NONZERO_PATTERN); >> >> KSPSetType (ksp, KSPFGMRES); >> >> KSPGetPC (ksp, &pc); >> >> PCSetType (pc, PrecondProc); >> >> KSPSetInitialGuessNonzero (ksp, PETSC_TRUE); >> >> KSPSetTolerances (ksp, 1E-50, maxtol, PETSC_DEFAULT, maxiter); >> >> KSPSetFromOptions (ksp); >> >> KSPSolve (ksp, *b, *x); >> >> KSPGetIterationNumber (ksp, iter); >> >> KSPGetResidualNorm (ksp, res); >> >> KSPDestroy (ksp); >> >> >> with previous version 2.3.3-p6: >> >> Number of iterations: 42 Residual: +7.073781E-13 Time: +8.615024E-03 >> >> now: >> >> Number of iterations: 500 Residual: +2.746161E-05 Time: +1.026870E-01 >> >> It is reaching maximum number of iterations. The only thing I changed was: >> >> MatSetOption (*A, MAT_SYMMETRIC); >> to >> MatSetOption (*A, MAT_SYMMETRIC, PETSC_TRUE); >> >> I think I didn't change anything else. >> >> >> Regards, >> >> Billy. >> > > > > -- > What most experimenters take for granted before they begin their > experiments is infinitely more interesting than any results to which > their experiments lead. > -- Norbert Wiener > > > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 4291 bytes Desc: not available URL: From bsmith at mcs.anl.gov Mon Feb 2 07:30:19 2009 From: bsmith at mcs.anl.gov (Barry Smith) Date: Mon, 2 Feb 2009 07:30:19 -0600 Subject: Performance degradation after upgrade to 3.0.0 In-Reply-To: <1200D8BEDB3DD54DBA528E210F372BF3D944C8@BEFUNCIONARIOS.uminho.pt> References: <1200D8BEDB3DD54DBA528E210F372BF3D944C3@BEFUNCIONARIOS.uminho.pt><1200D8BEDB3DD54DBA528E210F372BF3D944C7@BEFUNCIONARIOS.uminho.pt> <1200D8BEDB3DD54DBA528E210F372BF3D944C8@BEFUNCIONARIOS.uminho.pt> Message-ID: <2EEE5C7F-760E-4769-97F0-EA3080DD8DCE@mcs.anl.gov> There may be some option (well hidden) in outlook web access that lets you deselect winmail.dat but it is using it by default. Barry On Feb 2, 2009, at 3:59 AM, Billy Ara?jo wrote: > > I didn't send winmail.dat. > > Maybe because was sent from outlook web access, I don't know... :) > > Billy. > > > -----Original Message----- > From: petsc-users-bounces at mcs.anl.gov on behalf of Barry Smith > Sent: Sun 2/1/2009 11:24 PM > To: PETSc users list > Subject: Re: Performance degradation after upgrade to 3.0.0 > > > winmail.dat? Come on, be serious, we'd like to help you but not > all of us are chained to Bill Gates nightstand. > > Barry > > On Feb 1, 2009, at 3:01 PM, Billy Ara?jo wrote: > >> Hi, >> >> Here are the files that contain all the information below. You can >> see that the matrices are the same, unless I am missing something >> here. :) >> >> (I am resending them in compressed format). >> >> Regards, >> >> Billy. >> >> >> -----Original Message----- >> From: petsc-users-bounces at mcs.anl.gov on behalf of Matthew Knepley >> Sent: Sun 2/1/2009 6:07 PM >> To: PETSc users list >> Subject: Re: Performance degradation after upgrade to 3.0.0 >> >> In order to determine what is happening you first should: >> >> 1) Confirm that the solver setup is identical using -ksp_view for >> both versions >> >> 2) Determine that the matrices are identical. Output both matrices >> using >> MatView() with a PetscBinaryViewer. You can diff the files, and >> you can also >> solver both matrices using KSP ex10. >> >> 3) Look at the residuals using -ksp_monitor. If they are different, >> something >> else has changed. >> >> Matt >> >> On Sun, Feb 1, 2009 at 6:32 AM, Billy Ara?jo >> wrote: >>> >>> Hi, >>> >>> I have also verified that there has been a degradation of >>> performance using >>> the new 3.0 version: >>> >>> This is my function calling PETSc: >>> >>> KSP ksp; >>> PC pc; >>> >>> KSPCreate (PETSC_COMM_WORLD, &ksp); >>> >>> KSPSetOperators (ksp, *A, *A, DIFFERENT_NONZERO_PATTERN); >>> >>> KSPSetType (ksp, KSPFGMRES); >>> >>> KSPGetPC (ksp, &pc); >>> >>> PCSetType (pc, PrecondProc); >>> >>> KSPSetInitialGuessNonzero (ksp, PETSC_TRUE); >>> >>> KSPSetTolerances (ksp, 1E-50, maxtol, PETSC_DEFAULT, maxiter); >>> >>> KSPSetFromOptions (ksp); >>> >>> KSPSolve (ksp, *b, *x); >>> >>> KSPGetIterationNumber (ksp, iter); >>> >>> KSPGetResidualNorm (ksp, res); >>> >>> KSPDestroy (ksp); >>> >>> >>> with previous version 2.3.3-p6: >>> >>> Number of iterations: 42 Residual: +7.073781E-13 Time: +8.615024E-03 >>> >>> now: >>> >>> Number of iterations: 500 Residual: +2.746161E-05 Time: >>> +1.026870E-01 >>> >>> It is reaching maximum number of iterations. The only thing I >>> changed was: >>> >>> MatSetOption (*A, MAT_SYMMETRIC); >>> to >>> MatSetOption (*A, MAT_SYMMETRIC, PETSC_TRUE); >>> >>> I think I didn't change anything else. >>> >>> >>> Regards, >>> >>> Billy. >>> >> >> >> >> -- >> What most experimenters take for granted before they begin their >> experiments is infinitely more interesting than any results to which >> their experiments lead. >> -- Norbert Wiener >> >> >> > > > From sdettrick at gmail.com Mon Feb 2 09:57:40 2009 From: sdettrick at gmail.com (Sean Dettrick) Date: Mon, 2 Feb 2009 07:57:40 -0800 Subject: Performance degradation after upgrade to 3.0.0 In-Reply-To: <2EEE5C7F-760E-4769-97F0-EA3080DD8DCE@mcs.anl.gov> References: <1200D8BEDB3DD54DBA528E210F372BF3D944C3@BEFUNCIONARIOS.uminho.pt><1200D8BEDB3DD54DBA528E210F372BF3D944C7@BEFUNCIONARIOS.uminho.pt> <1200D8BEDB3DD54DBA528E210F372BF3D944C8@BEFUNCIONARIOS.uminho.pt> <2EEE5C7F-760E-4769-97F0-EA3080DD8DCE@mcs.anl.gov> Message-ID: <7B39792C-BC3B-4018-AB54-711E9B0BFE32@gmail.com> This problem occurs when the MS user sends an attachment to an email which has rich text formatting. Format the email in plain text, attach, and try again. S On Feb 2, 2009, at 5:30 AM, Barry Smith wrote: > > There may be some option (well hidden) in outlook web access that > lets you deselect winmail.dat but it is using it by default. > > Barry > > On Feb 2, 2009, at 3:59 AM, Billy Ara?jo wrote: > >> >> I didn't send winmail.dat. >> >> Maybe because was sent from outlook web access, I don't know... :) >> >> Billy. >> >> >> -----Original Message----- >> From: petsc-users-bounces at mcs.anl.gov on behalf of Barry Smith >> Sent: Sun 2/1/2009 11:24 PM >> To: PETSc users list >> Subject: Re: Performance degradation after upgrade to 3.0.0 >> >> >> winmail.dat? Come on, be serious, we'd like to help you but not >> all of us are chained to Bill Gates nightstand. >> >> Barry >> >> On Feb 1, 2009, at 3:01 PM, Billy Ara?jo wrote: >> >>> Hi, >>> >>> Here are the files that contain all the information below. You can >>> see that the matrices are the same, unless I am missing something >>> here. :) >>> >>> (I am resending them in compressed format). >>> >>> Regards, >>> >>> Billy. >>> >>> >>> -----Original Message----- >>> From: petsc-users-bounces at mcs.anl.gov on behalf of Matthew Knepley >>> Sent: Sun 2/1/2009 6:07 PM >>> To: PETSc users list >>> Subject: Re: Performance degradation after upgrade to 3.0.0 >>> >>> In order to determine what is happening you first should: >>> >>> 1) Confirm that the solver setup is identical using -ksp_view for >>> both versions >>> >>> 2) Determine that the matrices are identical. Output both matrices >>> using >>> MatView() with a PetscBinaryViewer. You can diff the files, and >>> you can also >>> solver both matrices using KSP ex10. >>> >>> 3) Look at the residuals using -ksp_monitor. If they are different, >>> something >>> else has changed. >>> >>> Matt >>> >>> On Sun, Feb 1, 2009 at 6:32 AM, Billy Ara?jo >>> wrote: >>>> >>>> Hi, >>>> >>>> I have also verified that there has been a degradation of >>>> performance using >>>> the new 3.0 version: >>>> >>>> This is my function calling PETSc: >>>> >>>> KSP ksp; >>>> PC pc; >>>> >>>> KSPCreate (PETSC_COMM_WORLD, &ksp); >>>> >>>> KSPSetOperators (ksp, *A, *A, DIFFERENT_NONZERO_PATTERN); >>>> >>>> KSPSetType (ksp, KSPFGMRES); >>>> >>>> KSPGetPC (ksp, &pc); >>>> >>>> PCSetType (pc, PrecondProc); >>>> >>>> KSPSetInitialGuessNonzero (ksp, PETSC_TRUE); >>>> >>>> KSPSetTolerances (ksp, 1E-50, maxtol, PETSC_DEFAULT, maxiter); >>>> >>>> KSPSetFromOptions (ksp); >>>> >>>> KSPSolve (ksp, *b, *x); >>>> >>>> KSPGetIterationNumber (ksp, iter); >>>> >>>> KSPGetResidualNorm (ksp, res); >>>> >>>> KSPDestroy (ksp); >>>> >>>> >>>> with previous version 2.3.3-p6: >>>> >>>> Number of iterations: 42 Residual: +7.073781E-13 Time: >>>> +8.615024E-03 >>>> >>>> now: >>>> >>>> Number of iterations: 500 Residual: +2.746161E-05 Time: >>>> +1.026870E-01 >>>> >>>> It is reaching maximum number of iterations. The only thing I >>>> changed was: >>>> >>>> MatSetOption (*A, MAT_SYMMETRIC); >>>> to >>>> MatSetOption (*A, MAT_SYMMETRIC, PETSC_TRUE); >>>> >>>> I think I didn't change anything else. >>>> >>>> >>>> Regards, >>>> >>>> Billy. >>>> >>> >>> >>> >>> -- >>> What most experimenters take for granted before they begin their >>> experiments is infinitely more interesting than any results to which >>> their experiments lead. >>> -- Norbert Wiener >>> >>> >>> >> >> >> > From keita at cray.com Mon Feb 2 11:54:10 2009 From: keita at cray.com (Keita Teranishi) Date: Mon, 2 Feb 2009 11:54:10 -0600 Subject: Numbers of memory usage in -log_sumamry output Message-ID: <925346A443D4E340BEB20248BAFCDBDF096FE661@CFEVS1-IP.americas.cray.com> Dear PETSc users, I would like to know the exact meaning of memory usage numbers in -log_summary output. Are these numbers are per single MPI process or for the entire MPI processes? Thanks, ================================ Keita Teranishi Scientific Library Group Cray, Inc. keita at cray.com ================================ -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Mon Feb 2 13:28:01 2009 From: knepley at gmail.com (Matthew Knepley) Date: Mon, 2 Feb 2009 13:28:01 -0600 Subject: Numbers of memory usage in -log_sumamry output In-Reply-To: <925346A443D4E340BEB20248BAFCDBDF096FE661@CFEVS1-IP.americas.cray.com> References: <925346A443D4E340BEB20248BAFCDBDF096FE661@CFEVS1-IP.americas.cray.com> Message-ID: They are collective. Matt On Mon, Feb 2, 2009 at 11:54 AM, Keita Teranishi wrote: > Dear PETSc users, > > > > I would like to know the exact meaning of memory usage numbers in > ?log_summary output. Are these numbers are per single MPI process or for > the entire MPI processes? > > > > Thanks, > > ================================ > Keita Teranishi > Scientific Library Group > Cray, Inc. > keita at cray.com > ================================ > > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener From knepley at gmail.com Mon Feb 2 13:41:52 2009 From: knepley at gmail.com (Matthew Knepley) Date: Mon, 2 Feb 2009 13:41:52 -0600 Subject: share a data object In-Reply-To: <60612.68.229.127.174.1233541466.squirrel@mail.cs.wm.edu> References: <60612.68.229.127.174.1233541466.squirrel@mail.cs.wm.edu> Message-ID: On Sun, Feb 1, 2009 at 8:24 PM, wrote: > Hi, > I'm new to PETSC. If I have multicores with share memory. Can a data > object is shared by different processes? Everything in PETSc is MPI. There are shared memory versions. Matt > Thanks. -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener From enjoywm at cs.wm.edu Tue Feb 3 09:25:39 2009 From: enjoywm at cs.wm.edu (Yixun Liu) Date: Tue, 03 Feb 2009 10:25:39 -0500 Subject: space allocation for a parallel matrix Message-ID: <498861F3.5050703@cs.wm.edu> Hi, I am confusing to the allocation for a parallel matrix in PETSC manual, "If PETSC DECIDE is not used for the arguments m and n, then the user must ensure that they are chosen to be compatible with the vectors. To do this, one first considers the matrix-vector product y = Ax. The m that is used in the matrix creation routine MatCreateMPIAIJ() must match the local size used in the vector creation routine VecCreateMPI() for y. Likewise, the n used must match that used as the local size in VecCreateMPI() for x." Since the process holds all the columns, why does it only hold part of vector x? Is it convenient for the matrix vector multiplication? Thanks. Yixun From knepley at gmail.com Tue Feb 3 09:35:43 2009 From: knepley at gmail.com (Matthew Knepley) Date: Tue, 3 Feb 2009 09:35:43 -0600 Subject: space allocation for a parallel matrix In-Reply-To: <498861F3.5050703@cs.wm.edu> References: <498861F3.5050703@cs.wm.edu> Message-ID: On Tue, Feb 3, 2009 at 9:25 AM, Yixun Liu wrote: > Hi, > I am confusing to the allocation for a parallel matrix in PETSC manual, > > "If PETSC DECIDE is not used for the arguments m and n, then the user > must ensure that they are chosen > to be compatible with the vectors. To do this, one first considers the > matrix-vector product y = Ax. The m > that is used in the matrix creation routine MatCreateMPIAIJ() must match > the local size used in the vector > creation routine VecCreateMPI() for y. Likewise, the n used must match > that used as the local size in > VecCreateMPI() for x." > > Since the process holds all the columns, why does it only hold part of > vector x? Is it convenient for the matrix vector multiplication? I am not sure I understand your question. However, Mat objects do hold all columns of a row. The local column size 'n' is used to match against a Vec, not for storage. Matt > Thanks. > > Yixun -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener From enjoywm at cs.wm.edu Tue Feb 3 09:47:26 2009 From: enjoywm at cs.wm.edu (Yixun Liu) Date: Tue, 03 Feb 2009 10:47:26 -0500 Subject: space allocation for a parallel matrix In-Reply-To: References: <498861F3.5050703@cs.wm.edu> Message-ID: <4988670E.4050603@cs.wm.edu> Matthew Knepley wrote: > On Tue, Feb 3, 2009 at 9:25 AM, Yixun Liu wrote: > >> Hi, >> I am confusing to the allocation for a parallel matrix in PETSC manual, >> >> "If PETSC DECIDE is not used for the arguments m and n, then the user >> must ensure that they are chosen >> to be compatible with the vectors. To do this, one first considers the >> matrix-vector product y = Ax. The m >> that is used in the matrix creation routine MatCreateMPIAIJ() must match >> the local size used in the vector >> creation routine VecCreateMPI() for y. Likewise, the n used must match >> that used as the local size in >> VecCreateMPI() for x." >> >> Since the process holds all the columns, why does it only hold part of >> vector x? Is it convenient for the matrix vector multiplication? >> > > I am not sure I understand your question. However, Mat objects do hold > all columns of a row. The local column size 'n' is used to match against > a Vec, not for storage. > > Matt > > >> Thanks. >> >> Yixun >> What I mean is that the process holds all the column, but only part of the vector, how to do the multiplication? It needs communicate with other processes. Right? From knepley at gmail.com Tue Feb 3 09:50:16 2009 From: knepley at gmail.com (Matthew Knepley) Date: Tue, 3 Feb 2009 09:50:16 -0600 Subject: space allocation for a parallel matrix In-Reply-To: <4988670E.4050603@cs.wm.edu> References: <498861F3.5050703@cs.wm.edu> <4988670E.4050603@cs.wm.edu> Message-ID: On Tue, Feb 3, 2009 at 9:47 AM, Yixun Liu wrote: > Matthew Knepley wrote: >> On Tue, Feb 3, 2009 at 9:25 AM, Yixun Liu wrote: >> >>> Hi, >>> I am confusing to the allocation for a parallel matrix in PETSC manual, >>> >>> "If PETSC DECIDE is not used for the arguments m and n, then the user >>> must ensure that they are chosen >>> to be compatible with the vectors. To do this, one first considers the >>> matrix-vector product y = Ax. The m >>> that is used in the matrix creation routine MatCreateMPIAIJ() must match >>> the local size used in the vector >>> creation routine VecCreateMPI() for y. Likewise, the n used must match >>> that used as the local size in >>> VecCreateMPI() for x." >>> >>> Since the process holds all the columns, why does it only hold part of >>> vector x? Is it convenient for the matrix vector multiplication? >>> >> >> I am not sure I understand your question. However, Mat objects do hold >> all columns of a row. The local column size 'n' is used to match against >> a Vec, not for storage. >> >> Matt >> >> >>> Thanks. >>> >>> Yixun >>> > What I mean is that the process holds all the column, but only part of > the vector, how to do the multiplication? It needs communicate with > other processes. Right? Yes. This is explained fairly well in Yousef Saad's book "Iterative Methods for Sparse Linear Systems". Matt -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener From enjoywm at cs.wm.edu Tue Feb 3 09:56:34 2009 From: enjoywm at cs.wm.edu (Yixun Liu) Date: Tue, 03 Feb 2009 10:56:34 -0500 Subject: space allocation for a parallel matrix In-Reply-To: References: <498861F3.5050703@cs.wm.edu> <4988670E.4050603@cs.wm.edu> Message-ID: <49886932.5010209@cs.wm.edu> Matthew Knepley wrote: > On Tue, Feb 3, 2009 at 9:47 AM, Yixun Liu wrote: > >> Matthew Knepley wrote: >> >>> On Tue, Feb 3, 2009 at 9:25 AM, Yixun Liu wrote: >>> >>> >>>> Hi, >>>> I am confusing to the allocation for a parallel matrix in PETSC manual, >>>> >>>> "If PETSC DECIDE is not used for the arguments m and n, then the user >>>> must ensure that they are chosen >>>> to be compatible with the vectors. To do this, one first considers the >>>> matrix-vector product y = Ax. The m >>>> that is used in the matrix creation routine MatCreateMPIAIJ() must match >>>> the local size used in the vector >>>> creation routine VecCreateMPI() for y. Likewise, the n used must match >>>> that used as the local size in >>>> VecCreateMPI() for x." >>>> >>>> Since the process holds all the columns, why does it only hold part of >>>> vector x? Is it convenient for the matrix vector multiplication? >>>> >>>> >>> I am not sure I understand your question. However, Mat objects do hold >>> all columns of a row. The local column size 'n' is used to match against >>> a Vec, not for storage. >>> >>> Matt >>> >>> >>> >>>> Thanks. >>>> >>>> Yixun >>>> >>>> >> What I mean is that the process holds all the column, but only part of >> the vector, how to do the multiplication? It needs communicate with >> other processes. Right? >> > > Yes. This is explained fairly well in Yousef Saad's book "Iterative Methods > for Sparse Linear Systems". > > Matt > > It means that it is better to set n to be equal to the column to avoid the communication. Right? If it does, I am confusing why we need this parameter. Just for dealing with very large vector x? Thanks.! From knepley at gmail.com Tue Feb 3 09:59:53 2009 From: knepley at gmail.com (Matthew Knepley) Date: Tue, 3 Feb 2009 09:59:53 -0600 Subject: space allocation for a parallel matrix In-Reply-To: <49886932.5010209@cs.wm.edu> References: <498861F3.5050703@cs.wm.edu> <4988670E.4050603@cs.wm.edu> <49886932.5010209@cs.wm.edu> Message-ID: On Tue, Feb 3, 2009 at 9:56 AM, Yixun Liu wrote: > It means that it is better to set n to be equal to the column to avoid > the communication. Right? If it does, I am confusing why we need this > parameter. Just for dealing with very large vector x? > Thanks.! No. Please take a look at the book I recommended. If you do as you suggest, this is no longer parallel computing. Matt -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener From balay at mcs.anl.gov Tue Feb 3 11:25:04 2009 From: balay at mcs.anl.gov (Satish Balay) Date: Tue, 3 Feb 2009 11:25:04 -0600 (CST) Subject: space allocation for a parallel matrix In-Reply-To: References: <498861F3.5050703@cs.wm.edu> <4988670E.4050603@cs.wm.edu> <49886932.5010209@cs.wm.edu> Message-ID: One issue that migh be cause for confusion is: for sparse mat-vec - only a part of the vec from other procs is needed. This part is communicated during Mat-Vec [using VecScatters] So the 'whole 'vec' is not stored on each proc.. Satish On Tue, 3 Feb 2009, Matthew Knepley wrote: > On Tue, Feb 3, 2009 at 9:56 AM, Yixun Liu wrote: > > It means that it is better to set n to be equal to the column to avoid > > the communication. Right? If it does, I am confusing why we need this > > parameter. Just for dealing with very large vector x? > > Thanks.! > > No. Please take a look at the book I recommended. If you do as you suggest, > this is no longer parallel computing. > > Matt > > From billyaraujo at gmail.com Tue Feb 3 16:35:19 2009 From: billyaraujo at gmail.com (Billy Araujo) Date: Tue, 3 Feb 2009 22:35:19 +0000 Subject: Performance degradation after upgrade to 3.0.0 Message-ID: <3079e2ed0902031435y5af89467yedbde5dfac2c9621@mail.gmail.com> "Can you send the matrix and rhs as PETSc binary output, and I will find out what the difference is. It looks to me like the default ICC ordering has changed. Matt" Hi, Here are the files of the matrix and rhs as PETSc binary output. Regards, Billy. -------------- next part -------------- A non-text attachment was scrubbed... Name: matrix_2.3.3.bin Type: application/octet-stream Size: 52448 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: vector_2.3.3.bin Type: application/octet-stream Size: 6736 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: matrix_3.0.0.bin Type: application/octet-stream Size: 52448 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: vector_3.0.0.bin Type: application/octet-stream Size: 6736 bytes Desc: not available URL: From randy at geosystem.us Tue Feb 3 16:03:53 2009 From: randy at geosystem.us (Randall Mackie) Date: Tue, 03 Feb 2009 14:03:53 -0800 Subject: compiling PETSc with Intel MKL 10.0.1.14 In-Reply-To: <48B95756.7020702@ices.utexas.edu> References: <485970E1.1090104@gmail.com> <381F69EF-1C27-420C-8337-0EAEB70093E0@mcs.anl.gov> <48A5CD78.9070201@ices.utexas.edu> <48B95756.7020702@ices.utexas.edu> Message-ID: <4988BF49.10306@geosystem.us> Paul, Have you tried this with Petsc 3.0.0? I just tried to compile it using MKL 10.0.3.020, and I am having the same issue you specified below, in that Petsc is looking for -lmkl_lapack -lmkl -lguide etc and the compilation doesn't work. Randy Paul T. Bauman wrote: > Sorry this took so long to get around to doing. So it turns out that > there's a newer version of 2.3.3p13 posted at the PETSc ftp server. This > worked flawlessly with the new MKL. I guess it got fixed and checked-in, > but not under a new patch? > > Thanks, > > Paul > > Barry Smith wrote: >> >> Please send the configure.log to petsc-maint at mcs.anl.gov >> >> Barry >> >> On Aug 15, 2008, at 1:39 PM, Paul T. Bauman wrote: >> >>> Was there ever a fix/workaround introduced for this? I'm using >>> 2.3.3p13 and I'm having trouble getting the config to recognize mkl >>> 10.0.3.020. >>> >>> Thanks, >>> >>> Paul >>> >>> Barry Smith wrote: >>>> >>>> Could you email to petsc-maint at mcs.anl.gov ALL the messages as to >>>> what goes wrong with >>>> our current linking so we can fix it? >>>> >>>> Thanks >>>> >>>> Barry >>>> >>>> On Jun 18, 2008, at 3:32 PM, Randall Mackie wrote: >>>> >>>>> We've upgraded Intel MKL to version 10.0, but in this version, >>>>> Intel has >>>>> changed how libraries are suppose to be linked. For example, the >>>>> libmkl_lapack.a >>>>> is a dummy library, but that's what the PETSc configure script >>>>> looks for. >>>>> >>>>> The documentation says, for example, to compile LAPACK in the >>>>> static case, >>>>> use libmkl_lapack.a libmkl_em64t.a >>>>> >>>>> and in the layered pure case to use >>>>> libmkl_intel_lp64.a libmkl_intel_thread.a libmkl_core.a >>>>> >>>>> However, the PETSC configuration wants -lmkl_lapack -lmkl -lguide >>>>> -lpthread >>>>> >>>>> Any suggestions are appreciated. >>>>> >>>>> 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 balay at mcs.anl.gov Tue Feb 3 17:25:20 2009 From: balay at mcs.anl.gov (Satish Balay) Date: Tue, 3 Feb 2009 17:25:20 -0600 (CST) Subject: compiling PETSc with Intel MKL 10.0.1.14 In-Reply-To: <4988BF49.10306@geosystem.us> References: <485970E1.1090104@gmail.com> <381F69EF-1C27-420C-8337-0EAEB70093E0@mcs.anl.gov> <48A5CD78.9070201@ices.utexas.edu> <48B95756.7020702@ices.utexas.edu> <4988BF49.10306@geosystem.us> Message-ID: I just successfully compiled petsc-dev [which is almost same as petsc-3.0.0-p3] & MLK successfully with both intel & gnu compilers. ./configure --with-blas-lapack-dir=/gfs/software/software/intel/compilersuite/10.1/mkl/10.0.011 --with-mpi=0 PETSC_ARCH=linux-mkl ./configure --with-blas-lapack-dir=/gfs/software/software/intel/compilersuite/10.1/mkl/10.0.011 --with-mpi=0 PETSC_ARCH=linux-icc-mkl CC=icc FC=ifort What problems are you encountering? Send configure.log to petsc-maint.. Satish On Tue, 3 Feb 2009, Randall Mackie wrote: > Paul, > > Have you tried this with Petsc 3.0.0? I just tried to compile it using > MKL 10.0.3.020, and I am having the same issue you specified below, in that > Petsc is looking for -lmkl_lapack -lmkl -lguide etc and the compilation > doesn't work. > > Randy > > > > > Paul T. Bauman wrote: > > Sorry this took so long to get around to doing. So it turns out that there's > > a newer version of 2.3.3p13 posted at the PETSc ftp server. This worked > > flawlessly with the new MKL. I guess it got fixed and checked-in, but not > > under a new patch? > > > > Thanks, > > > > Paul > > > > Barry Smith wrote: > > > > > > Please send the configure.log to petsc-maint at mcs.anl.gov > > > > > > Barry > > > > > > On Aug 15, 2008, at 1:39 PM, Paul T. Bauman wrote: > > > > > > > Was there ever a fix/workaround introduced for this? I'm using 2.3.3p13 > > > > and I'm having trouble getting the config to recognize mkl 10.0.3.020. > > > > > > > > Thanks, > > > > > > > > Paul > > > > > > > > Barry Smith wrote: > > > > > > > > > > Could you email to petsc-maint at mcs.anl.gov ALL the messages as to > > > > > what goes wrong with > > > > > our current linking so we can fix it? > > > > > > > > > > Thanks > > > > > > > > > > Barry > > > > > > > > > > On Jun 18, 2008, at 3:32 PM, Randall Mackie wrote: > > > > > > > > > > > We've upgraded Intel MKL to version 10.0, but in this version, Intel > > > > > > has > > > > > > changed how libraries are suppose to be linked. For example, the > > > > > > libmkl_lapack.a > > > > > > is a dummy library, but that's what the PETSc configure script looks > > > > > > for. > > > > > > > > > > > > The documentation says, for example, to compile LAPACK in the static > > > > > > case, > > > > > > use libmkl_lapack.a libmkl_em64t.a > > > > > > > > > > > > and in the layered pure case to use > > > > > > libmkl_intel_lp64.a libmkl_intel_thread.a libmkl_core.a > > > > > > > > > > > > However, the PETSC configuration wants -lmkl_lapack -lmkl -lguide > > > > > > -lpthread > > > > > > > > > > > > Any suggestions are appreciated. > > > > > > > > > > > > Randy > > > > > > > > > > > > > > > > > > > > > > > > > > > From pbauman at ices.utexas.edu Tue Feb 3 17:29:57 2009 From: pbauman at ices.utexas.edu (Paul T. Bauman) Date: Tue, 03 Feb 2009 17:29:57 -0600 Subject: compiling PETSc with Intel MKL 10.0.1.14 In-Reply-To: <4988BF49.10306@geosystem.us> References: <485970E1.1090104@gmail.com> <381F69EF-1C27-420C-8337-0EAEB70093E0@mcs.anl.gov> <48A5CD78.9070201@ices.utexas.edu> <48B95756.7020702@ices.utexas.edu> <4988BF49.10306@geosystem.us> Message-ID: <4988D375.4040408@ices.utexas.edu> Hi Randy, I've successfully built petsc-3.0.0-p2 with MKL 10.0.3.020. Here were the relevant blas/lapack specifications: --with-blas-lib=[/opt/intel/mkl/10.0.3.020/lib/em64t/libmkl.so,/opt/intel/mkl/10.0.3.020/lib/em64t/libguide.so] --with-lapack-lib=/opt/intel/mkl/10.0.3.020/lib/em64t/libmkl_lapack.so HTH, Paul Randall Mackie wrote: > Paul, > > Have you tried this with Petsc 3.0.0? I just tried to compile it using > MKL 10.0.3.020, and I am having the same issue you specified below, in > that > Petsc is looking for -lmkl_lapack -lmkl -lguide etc and the compilation > doesn't work. > > Randy > > > > > Paul T. Bauman wrote: >> Sorry this took so long to get around to doing. So it turns out that >> there's a newer version of 2.3.3p13 posted at the PETSc ftp server. >> This worked flawlessly with the new MKL. I guess it got fixed and >> checked-in, but not under a new patch? >> >> Thanks, >> >> Paul >> >> Barry Smith wrote: >>> >>> Please send the configure.log to petsc-maint at mcs.anl.gov >>> >>> Barry >>> >>> On Aug 15, 2008, at 1:39 PM, Paul T. Bauman wrote: >>> >>>> Was there ever a fix/workaround introduced for this? I'm using >>>> 2.3.3p13 and I'm having trouble getting the config to recognize mkl >>>> 10.0.3.020. >>>> >>>> Thanks, >>>> >>>> Paul >>>> >>>> Barry Smith wrote: >>>>> >>>>> Could you email to petsc-maint at mcs.anl.gov ALL the messages as to >>>>> what goes wrong with >>>>> our current linking so we can fix it? >>>>> >>>>> Thanks >>>>> >>>>> Barry >>>>> >>>>> On Jun 18, 2008, at 3:32 PM, Randall Mackie wrote: >>>>> >>>>>> We've upgraded Intel MKL to version 10.0, but in this version, >>>>>> Intel has >>>>>> changed how libraries are suppose to be linked. For example, the >>>>>> libmkl_lapack.a >>>>>> is a dummy library, but that's what the PETSc configure script >>>>>> looks for. >>>>>> >>>>>> The documentation says, for example, to compile LAPACK in the >>>>>> static case, >>>>>> use libmkl_lapack.a libmkl_em64t.a >>>>>> >>>>>> and in the layered pure case to use >>>>>> libmkl_intel_lp64.a libmkl_intel_thread.a libmkl_core.a >>>>>> >>>>>> However, the PETSC configuration wants -lmkl_lapack -lmkl -lguide >>>>>> -lpthread >>>>>> >>>>>> Any suggestions are appreciated. >>>>>> >>>>>> Randy >>>>>> >>>>> >>>> >>> >>> >> >> > From balay at mcs.anl.gov Tue Feb 3 17:36:36 2009 From: balay at mcs.anl.gov (Satish Balay) Date: Tue, 3 Feb 2009 17:36:36 -0600 (CST) Subject: compiling PETSc with Intel MKL 10.0.1.14 In-Reply-To: References: <485970E1.1090104@gmail.com> <381F69EF-1C27-420C-8337-0EAEB70093E0@mcs.anl.gov> <48A5CD78.9070201@ices.utexas.edu> <48B95756.7020702@ices.utexas.edu> <4988BF49.10306@geosystem.us> Message-ID: I should add: configure detects the following for BLAS/LAPACK - in both cases. BLAS/LAPACK: -Wl,-rpath,/gfs/software/software/intel/compilersuite/10.1/mkl/10.0.011/lib/em64t -L/gfs/software/software/intel/compilersuite/10.1/mkl/10.0.011/lib/em64t -lmkl_lapack -lmkl -lguide -lpthread Satish On Tue, 3 Feb 2009, Satish Balay wrote: > I just successfully compiled petsc-dev [which is almost same as > petsc-3.0.0-p3] & MLK successfully with both intel & gnu compilers. > > ./configure --with-blas-lapack-dir=/gfs/software/software/intel/compilersuite/10.1/mkl/10.0.011 --with-mpi=0 PETSC_ARCH=linux-mkl > > > ./configure --with-blas-lapack-dir=/gfs/software/software/intel/compilersuite/10.1/mkl/10.0.011 --with-mpi=0 PETSC_ARCH=linux-icc-mkl CC=icc FC=ifort > > What problems are you encountering? Send configure.log to petsc-maint.. > > Satish > > On Tue, 3 Feb 2009, Randall Mackie wrote: > > > Paul, > > > > Have you tried this with Petsc 3.0.0? I just tried to compile it using > > MKL 10.0.3.020, and I am having the same issue you specified below, in that > > Petsc is looking for -lmkl_lapack -lmkl -lguide etc and the compilation > > doesn't work. > > > > Randy > > > > > > > > > > Paul T. Bauman wrote: > > > Sorry this took so long to get around to doing. So it turns out that there's > > > a newer version of 2.3.3p13 posted at the PETSc ftp server. This worked > > > flawlessly with the new MKL. I guess it got fixed and checked-in, but not > > > under a new patch? > > > > > > Thanks, > > > > > > Paul > > > > > > Barry Smith wrote: > > > > > > > > Please send the configure.log to petsc-maint at mcs.anl.gov > > > > > > > > Barry > > > > > > > > On Aug 15, 2008, at 1:39 PM, Paul T. Bauman wrote: > > > > > > > > > Was there ever a fix/workaround introduced for this? I'm using 2.3.3p13 > > > > > and I'm having trouble getting the config to recognize mkl 10.0.3.020. > > > > > > > > > > Thanks, > > > > > > > > > > Paul > > > > > > > > > > Barry Smith wrote: > > > > > > > > > > > > Could you email to petsc-maint at mcs.anl.gov ALL the messages as to > > > > > > what goes wrong with > > > > > > our current linking so we can fix it? > > > > > > > > > > > > Thanks > > > > > > > > > > > > Barry > > > > > > > > > > > > On Jun 18, 2008, at 3:32 PM, Randall Mackie wrote: > > > > > > > > > > > > > We've upgraded Intel MKL to version 10.0, but in this version, Intel > > > > > > > has > > > > > > > changed how libraries are suppose to be linked. For example, the > > > > > > > libmkl_lapack.a > > > > > > > is a dummy library, but that's what the PETSc configure script looks > > > > > > > for. > > > > > > > > > > > > > > The documentation says, for example, to compile LAPACK in the static > > > > > > > case, > > > > > > > use libmkl_lapack.a libmkl_em64t.a > > > > > > > > > > > > > > and in the layered pure case to use > > > > > > > libmkl_intel_lp64.a libmkl_intel_thread.a libmkl_core.a > > > > > > > > > > > > > > However, the PETSC configuration wants -lmkl_lapack -lmkl -lguide > > > > > > > -lpthread > > > > > > > > > > > > > > Any suggestions are appreciated. > > > > > > > > > > > > > > Randy > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > From rlmackie862 at gmail.com Tue Feb 3 19:18:37 2009 From: rlmackie862 at gmail.com (Randall Mackie) Date: Tue, 3 Feb 2009 17:18:37 -0800 Subject: compiling PETSc with Intel MKL 10.0.1.14 In-Reply-To: References: <485970E1.1090104@gmail.com> <381F69EF-1C27-420C-8337-0EAEB70093E0@mcs.anl.gov> <48A5CD78.9070201@ices.utexas.edu> <48B95756.7020702@ices.utexas.edu> <4988BF49.10306@geosystem.us> Message-ID: <6c61ad530902031718g4d049bb2t69735e281e688daa@mail.gmail.com> Hi Satish, I compiled PETSC with the following options: ./configure PETSC_ARCH=linux-intel-opt --with-fortran-kernels=generic --with-blas-lapack-dir =/opt/intel/mkl/10.0.3.020/lib/64 --with-scalar-type=complex --with-debugging=0 PETSc compiled just fine, but when I tried to compile my application, or run the tests within PETSC, it bombed out looking for the MKL libraries like: mpif90 -O -o d3inv_DA_1_1_4_petsc ... ,-rpath,/opt/intel/mkl/ 10.0.3.020/lib/64 -L/opt/intel/mkl/10.0.3.020/lib/64 -lmkl_lapack -lmkl -lguide -lpthread -lPEPCF9r/lib64 -L/usr/mpi/intel/mvapich-1.0.1/lib/shared -L/usr/mpi/intel/mvapich-1.0.1/lib -ldl -lmpich -libverbs -libumad -libcommon -lpthread -lrt -L/opt/intel/mkl/ 10.0.3.020/libopt/intel/mkl/10.0.3.020/lib/em64t ...... ld: skipping incompatible /opt/intel/mkl/10.0.3.020/lib/64/libmkl_lapack.sowhen searching for -lmkl_lapack etc. I'll try Paul's method of specifying the exact libraries to be included. If you want, I can still send you the configure log. Randy On Tue, Feb 3, 2009 at 3:25 PM, Satish Balay wrote: > I just successfully compiled petsc-dev [which is almost same as > petsc-3.0.0-p3] & MLK successfully with both intel & gnu compilers. > > ./configure > --with-blas-lapack-dir=/gfs/software/software/intel/compilersuite/10.1/mkl/10.0.011 > --with-mpi=0 PETSC_ARCH=linux-mkl > > > ./configure > --with-blas-lapack-dir=/gfs/software/software/intel/compilersuite/10.1/mkl/10.0.011 > --with-mpi=0 PETSC_ARCH=linux-icc-mkl CC=icc FC=ifort > > What problems are you encountering? Send configure.log to petsc-maint.. > > Satish > > On Tue, 3 Feb 2009, Randall Mackie wrote: > > > Paul, > > > > Have you tried this with Petsc 3.0.0? I just tried to compile it using > > MKL 10.0.3.020, and I am having the same issue you specified below, in > that > > Petsc is looking for -lmkl_lapack -lmkl -lguide etc and the compilation > > doesn't work. > > > > Randy > > > > > > > > > > Paul T. Bauman wrote: > > > Sorry this took so long to get around to doing. So it turns out that > there's > > > a newer version of 2.3.3p13 posted at the PETSc ftp server. This worked > > > flawlessly with the new MKL. I guess it got fixed and checked-in, but > not > > > under a new patch? > > > > > > Thanks, > > > > > > Paul > > > > > > Barry Smith wrote: > > > > > > > > Please send the configure.log to petsc-maint at mcs.anl.gov > > > > > > > > Barry > > > > > > > > On Aug 15, 2008, at 1:39 PM, Paul T. Bauman wrote: > > > > > > > > > Was there ever a fix/workaround introduced for this? I'm using > 2.3.3p13 > > > > > and I'm having trouble getting the config to recognize mkl > 10.0.3.020. > > > > > > > > > > Thanks, > > > > > > > > > > Paul > > > > > > > > > > Barry Smith wrote: > > > > > > > > > > > > Could you email to petsc-maint at mcs.anl.gov ALL the messages as > to > > > > > > what goes wrong with > > > > > > our current linking so we can fix it? > > > > > > > > > > > > Thanks > > > > > > > > > > > > Barry > > > > > > > > > > > > On Jun 18, 2008, at 3:32 PM, Randall Mackie wrote: > > > > > > > > > > > > > We've upgraded Intel MKL to version 10.0, but in this version, > Intel > > > > > > > has > > > > > > > changed how libraries are suppose to be linked. For example, > the > > > > > > > libmkl_lapack.a > > > > > > > is a dummy library, but that's what the PETSc configure script > looks > > > > > > > for. > > > > > > > > > > > > > > The documentation says, for example, to compile LAPACK in the > static > > > > > > > case, > > > > > > > use libmkl_lapack.a libmkl_em64t.a > > > > > > > > > > > > > > and in the layered pure case to use > > > > > > > libmkl_intel_lp64.a libmkl_intel_thread.a libmkl_core.a > > > > > > > > > > > > > > However, the PETSC configuration wants -lmkl_lapack -lmkl > -lguide > > > > > > > -lpthread > > > > > > > > > > > > > > Any suggestions are appreciated. > > > > > > > > > > > > > > Randy > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From balay at mcs.anl.gov Tue Feb 3 19:29:52 2009 From: balay at mcs.anl.gov (Satish Balay) Date: Tue, 3 Feb 2009 19:29:52 -0600 (CST) Subject: compiling PETSc with Intel MKL 10.0.1.14 In-Reply-To: <6c61ad530902031718g4d049bb2t69735e281e688daa@mail.gmail.com> References: <485970E1.1090104@gmail.com> <381F69EF-1C27-420C-8337-0EAEB70093E0@mcs.anl.gov> <48A5CD78.9070201@ices.utexas.edu> <48B95756.7020702@ices.utexas.edu> <4988BF49.10306@geosystem.us> <6c61ad530902031718g4d049bb2t69735e281e688daa@mail.gmail.com> Message-ID: Please send configure.log - and a complete compile output when compiling a PETSc example [say src/ksp/ksp/examples/tutorials/ex2f.F] to petsc-maint. thanks, Satish On Tue, 3 Feb 2009, Randall Mackie wrote: > Hi Satish, > > I compiled PETSC with the following options: > > ./configure PETSC_ARCH=linux-intel-opt --with-fortran-kernels=generic > --with-blas-lapack-dir > =/opt/intel/mkl/10.0.3.020/lib/64 --with-scalar-type=complex > --with-debugging=0 > > PETSc compiled just fine, but when I tried to compile my application, or run > the tests > within PETSC, it bombed out looking for the MKL libraries like: > > > mpif90 -O -o d3inv_DA_1_1_4_petsc ... ,-rpath,/opt/intel/mkl/ > 10.0.3.020/lib/64 -L/opt/intel/mkl/10.0.3.020/lib/64 -lmkl_lapack -lmkl > -lguide -lpthread -lPEPCF9r/lib64 -L/usr/mpi/intel/mvapich-1.0.1/lib/shared > -L/usr/mpi/intel/mvapich-1.0.1/lib -ldl -lmpich -libverbs -libumad > -libcommon -lpthread -lrt -L/opt/intel/mkl/ > 10.0.3.020/libopt/intel/mkl/10.0.3.020/lib/em64t ...... > > ld: skipping incompatible > /opt/intel/mkl/10.0.3.020/lib/64/libmkl_lapack.sowhen searching for > -lmkl_lapack > etc. > > I'll try Paul's method of specifying the exact libraries to be included. If > you want, I can > still send you the configure log. > > Randy > > On Tue, Feb 3, 2009 at 3:25 PM, Satish Balay wrote: > > > I just successfully compiled petsc-dev [which is almost same as > > petsc-3.0.0-p3] & MLK successfully with both intel & gnu compilers. > > > > ./configure > > --with-blas-lapack-dir=/gfs/software/software/intel/compilersuite/10.1/mkl/10.0.011 > > --with-mpi=0 PETSC_ARCH=linux-mkl > > > > > > ./configure > > --with-blas-lapack-dir=/gfs/software/software/intel/compilersuite/10.1/mkl/10.0.011 > > --with-mpi=0 PETSC_ARCH=linux-icc-mkl CC=icc FC=ifort > > > > What problems are you encountering? Send configure.log to petsc-maint.. > > > > Satish > > > > On Tue, 3 Feb 2009, Randall Mackie wrote: > > > > > Paul, > > > > > > Have you tried this with Petsc 3.0.0? I just tried to compile it using > > > MKL 10.0.3.020, and I am having the same issue you specified below, in > > that > > > Petsc is looking for -lmkl_lapack -lmkl -lguide etc and the compilation > > > doesn't work. > > > > > > Randy > > > > > > > > > > > > > > > Paul T. Bauman wrote: > > > > Sorry this took so long to get around to doing. So it turns out that > > there's > > > > a newer version of 2.3.3p13 posted at the PETSc ftp server. This worked > > > > flawlessly with the new MKL. I guess it got fixed and checked-in, but > > not > > > > under a new patch? > > > > > > > > Thanks, > > > > > > > > Paul > > > > > > > > Barry Smith wrote: > > > > > > > > > > Please send the configure.log to petsc-maint at mcs.anl.gov > > > > > > > > > > Barry > > > > > > > > > > On Aug 15, 2008, at 1:39 PM, Paul T. Bauman wrote: > > > > > > > > > > > Was there ever a fix/workaround introduced for this? I'm using > > 2.3.3p13 > > > > > > and I'm having trouble getting the config to recognize mkl > > 10.0.3.020. > > > > > > > > > > > > Thanks, > > > > > > > > > > > > Paul > > > > > > > > > > > > Barry Smith wrote: > > > > > > > > > > > > > > Could you email to petsc-maint at mcs.anl.gov ALL the messages as > > to > > > > > > > what goes wrong with > > > > > > > our current linking so we can fix it? > > > > > > > > > > > > > > Thanks > > > > > > > > > > > > > > Barry > > > > > > > > > > > > > > On Jun 18, 2008, at 3:32 PM, Randall Mackie wrote: > > > > > > > > > > > > > > > We've upgraded Intel MKL to version 10.0, but in this version, > > Intel > > > > > > > > has > > > > > > > > changed how libraries are suppose to be linked. For example, > > the > > > > > > > > libmkl_lapack.a > > > > > > > > is a dummy library, but that's what the PETSc configure script > > looks > > > > > > > > for. > > > > > > > > > > > > > > > > The documentation says, for example, to compile LAPACK in the > > static > > > > > > > > case, > > > > > > > > use libmkl_lapack.a libmkl_em64t.a > > > > > > > > > > > > > > > > and in the layered pure case to use > > > > > > > > libmkl_intel_lp64.a libmkl_intel_thread.a libmkl_core.a > > > > > > > > > > > > > > > > However, the PETSC configuration wants -lmkl_lapack -lmkl > > -lguide > > > > > > > > -lpthread > > > > > > > > > > > > > > > > Any suggestions are appreciated. > > > > > > > > > > > > > > > > Randy > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > From balay at mcs.anl.gov Tue Feb 3 20:12:01 2009 From: balay at mcs.anl.gov (Satish Balay) Date: Tue, 3 Feb 2009 20:12:01 -0600 (CST) Subject: compiling PETSc with Intel MKL 10.0.1.14 In-Reply-To: <6c61ad530902031718g4d049bb2t69735e281e688daa@mail.gmail.com> References: <485970E1.1090104@gmail.com> <381F69EF-1C27-420C-8337-0EAEB70093E0@mcs.anl.gov> <48A5CD78.9070201@ices.utexas.edu> <48B95756.7020702@ices.utexas.edu> <4988BF49.10306@geosystem.us> <6c61ad530902031718g4d049bb2t69735e281e688daa@mail.gmail.com> Message-ID: Ok - for one you are on a x86_64 machine. So --with-blas-lapack-dir=/opt/intel/mkl/10.0.3.020/lib/64 is incorrect. --with-blas-lapack-dir=/opt/intel/mkl/10.0.3.020/lib/em64t would be the correct thing [or --with-blas-lapack-dir=/opt/intel/mkl/10.0.3.020 - so that configure determines the correct subdir in lib] Note: intel calls 'x86_64' [i.e AMD64] as 'em64t', and IA64 [i.e itanium] as '64' However currently you get link time warnings. The exectuable gets created - so it should run correctly. Can you confirm this? [I don't see any errors in the output you sent.] And I don't think you'll be able to get rid of these warnings. Your compiler is already configured to look into both locations. run 'mpicc -v foo.c' [on any simple c code] - and you'll see the following link paths. "-L/opt/intel/mkl/10.0.3.020/lib/64" "-L/opt/intel/mkl/10.0.3.020/lib/em64t" [It should not be linking agaings '64' version. It should only use 'em64t' version] Satish On Tue, 3 Feb 2009, Randall Mackie wrote: > Hi Satish, > > I compiled PETSC with the following options: > > ./configure PETSC_ARCH=linux-intel-opt --with-fortran-kernels=generic > --with-blas-lapack-dir > =/opt/intel/mkl/10.0.3.020/lib/64 --with-scalar-type=complex > --with-debugging=0 > > PETSc compiled just fine, but when I tried to compile my application, or run > the tests > within PETSC, it bombed out looking for the MKL libraries like: > > > mpif90 -O -o d3inv_DA_1_1_4_petsc ... ,-rpath,/opt/intel/mkl/ > 10.0.3.020/lib/64 -L/opt/intel/mkl/10.0.3.020/lib/64 -lmkl_lapack -lmkl > -lguide -lpthread -lPEPCF9r/lib64 -L/usr/mpi/intel/mvapich-1.0.1/lib/shared > -L/usr/mpi/intel/mvapich-1.0.1/lib -ldl -lmpich -libverbs -libumad > -libcommon -lpthread -lrt -L/opt/intel/mkl/ > 10.0.3.020/libopt/intel/mkl/10.0.3.020/lib/em64t ...... > > ld: skipping incompatible > /opt/intel/mkl/10.0.3.020/lib/64/libmkl_lapack.sowhen searching for > -lmkl_lapack > etc. > > I'll try Paul's method of specifying the exact libraries to be included. If > you want, I can > still send you the configure log. > > Randy > > On Tue, Feb 3, 2009 at 3:25 PM, Satish Balay wrote: > > > I just successfully compiled petsc-dev [which is almost same as > > petsc-3.0.0-p3] & MLK successfully with both intel & gnu compilers. > > > > ./configure > > --with-blas-lapack-dir=/gfs/software/software/intel/compilersuite/10.1/mkl/10.0.011 > > --with-mpi=0 PETSC_ARCH=linux-mkl > > > > > > ./configure > > --with-blas-lapack-dir=/gfs/software/software/intel/compilersuite/10.1/mkl/10.0.011 > > --with-mpi=0 PETSC_ARCH=linux-icc-mkl CC=icc FC=ifort > > > > What problems are you encountering? Send configure.log to petsc-maint.. > > > > Satish > > > > On Tue, 3 Feb 2009, Randall Mackie wrote: > > > > > Paul, > > > > > > Have you tried this with Petsc 3.0.0? I just tried to compile it using > > > MKL 10.0.3.020, and I am having the same issue you specified below, in > > that > > > Petsc is looking for -lmkl_lapack -lmkl -lguide etc and the compilation > > > doesn't work. > > > > > > Randy > > > > > > > > > > > > > > > Paul T. Bauman wrote: > > > > Sorry this took so long to get around to doing. So it turns out that > > there's > > > > a newer version of 2.3.3p13 posted at the PETSc ftp server. This worked > > > > flawlessly with the new MKL. I guess it got fixed and checked-in, but > > not > > > > under a new patch? > > > > > > > > Thanks, > > > > > > > > Paul > > > > > > > > Barry Smith wrote: > > > > > > > > > > Please send the configure.log to petsc-maint at mcs.anl.gov > > > > > > > > > > Barry > > > > > > > > > > On Aug 15, 2008, at 1:39 PM, Paul T. Bauman wrote: > > > > > > > > > > > Was there ever a fix/workaround introduced for this? I'm using > > 2.3.3p13 > > > > > > and I'm having trouble getting the config to recognize mkl > > 10.0.3.020. > > > > > > > > > > > > Thanks, > > > > > > > > > > > > Paul > > > > > > > > > > > > Barry Smith wrote: > > > > > > > > > > > > > > Could you email to petsc-maint at mcs.anl.gov ALL the messages as > > to > > > > > > > what goes wrong with > > > > > > > our current linking so we can fix it? > > > > > > > > > > > > > > Thanks > > > > > > > > > > > > > > Barry > > > > > > > > > > > > > > On Jun 18, 2008, at 3:32 PM, Randall Mackie wrote: > > > > > > > > > > > > > > > We've upgraded Intel MKL to version 10.0, but in this version, > > Intel > > > > > > > > has > > > > > > > > changed how libraries are suppose to be linked. For example, > > the > > > > > > > > libmkl_lapack.a > > > > > > > > is a dummy library, but that's what the PETSc configure script > > looks > > > > > > > > for. > > > > > > > > > > > > > > > > The documentation says, for example, to compile LAPACK in the > > static > > > > > > > > case, > > > > > > > > use libmkl_lapack.a libmkl_em64t.a > > > > > > > > > > > > > > > > and in the layered pure case to use > > > > > > > > libmkl_intel_lp64.a libmkl_intel_thread.a libmkl_core.a > > > > > > > > > > > > > > > > However, the PETSC configuration wants -lmkl_lapack -lmkl > > -lguide > > > > > > > > -lpthread > > > > > > > > > > > > > > > > Any suggestions are appreciated. > > > > > > > > > > > > > > > > Randy > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > From rlmackie862 at gmail.com Tue Feb 3 20:51:05 2009 From: rlmackie862 at gmail.com (Randall Mackie) Date: Tue, 03 Feb 2009 18:51:05 -0800 Subject: compiling PETSc with Intel MKL 10.0.1.14 In-Reply-To: References: <485970E1.1090104@gmail.com> <381F69EF-1C27-420C-8337-0EAEB70093E0@mcs.anl.gov> <48A5CD78.9070201@ices.utexas.edu> <48B95756.7020702@ices.utexas.edu> <4988BF49.10306@geosystem.us> <6c61ad530902031718g4d049bb2t69735e281e688daa@mail.gmail.com> Message-ID: <49890299.1010900@gmail.com> Satish, Thanks for the clarification concerning em64t and 64. They've always been a bit of a mystery to me. I tried both your method below of specifying the correct library, and doing it Paul's way, and both seem to work, but you're right, I continue to get those warnings. Additionally an executable is created, and appears to run, although I need to look at this a bit more carefully to be completely sure. Do you have an idea of how much difference there is in computation times using the Intel MKL optimized libraries versus just having PETSc download and compile them itself? Thanks for your help, I'll continue to work on this tomorrow. Randy Satish Balay wrote: > Ok - for one you are on a x86_64 machine. So > --with-blas-lapack-dir=/opt/intel/mkl/10.0.3.020/lib/64 is incorrect. > > --with-blas-lapack-dir=/opt/intel/mkl/10.0.3.020/lib/em64t would be > the correct thing [or --with-blas-lapack-dir=/opt/intel/mkl/10.0.3.020 > - so that configure determines the correct subdir in lib] > > Note: intel calls 'x86_64' [i.e AMD64] as 'em64t', and IA64 [i.e itanium] as '64' > > > However currently you get link time warnings. The exectuable gets > created - so it should run correctly. Can you confirm this? [I don't > see any errors in the output you sent.] > > And I don't think you'll be able to get rid of these warnings. Your > compiler is already configured to look into both locations. > > run 'mpicc -v foo.c' [on any simple c code] - and you'll see the > following link paths. > > "-L/opt/intel/mkl/10.0.3.020/lib/64" "-L/opt/intel/mkl/10.0.3.020/lib/em64t" > > [It should not be linking agaings '64' version. It should only use 'em64t' version] > > Satish > > On Tue, 3 Feb 2009, Randall Mackie wrote: > >> Hi Satish, >> >> I compiled PETSC with the following options: >> >> ./configure PETSC_ARCH=linux-intel-opt --with-fortran-kernels=generic >> --with-blas-lapack-dir >> =/opt/intel/mkl/10.0.3.020/lib/64 --with-scalar-type=complex >> --with-debugging=0 >> >> PETSc compiled just fine, but when I tried to compile my application, or run >> the tests >> within PETSC, it bombed out looking for the MKL libraries like: >> >> >> mpif90 -O -o d3inv_DA_1_1_4_petsc ... ,-rpath,/opt/intel/mkl/ >> 10.0.3.020/lib/64 -L/opt/intel/mkl/10.0.3.020/lib/64 -lmkl_lapack -lmkl >> -lguide -lpthread -lPEPCF9r/lib64 -L/usr/mpi/intel/mvapich-1.0.1/lib/shared >> -L/usr/mpi/intel/mvapich-1.0.1/lib -ldl -lmpich -libverbs -libumad >> -libcommon -lpthread -lrt -L/opt/intel/mkl/ >> 10.0.3.020/libopt/intel/mkl/10.0.3.020/lib/em64t ...... >> >> ld: skipping incompatible >> /opt/intel/mkl/10.0.3.020/lib/64/libmkl_lapack.sowhen searching for >> -lmkl_lapack >> etc. >> >> I'll try Paul's method of specifying the exact libraries to be included. If >> you want, I can >> still send you the configure log. >> >> Randy >> >> On Tue, Feb 3, 2009 at 3:25 PM, Satish Balay wrote: >> >>> I just successfully compiled petsc-dev [which is almost same as >>> petsc-3.0.0-p3] & MLK successfully with both intel & gnu compilers. >>> >>> ./configure >>> --with-blas-lapack-dir=/gfs/software/software/intel/compilersuite/10.1/mkl/10.0.011 >>> --with-mpi=0 PETSC_ARCH=linux-mkl >>> >>> >>> ./configure >>> --with-blas-lapack-dir=/gfs/software/software/intel/compilersuite/10.1/mkl/10.0.011 >>> --with-mpi=0 PETSC_ARCH=linux-icc-mkl CC=icc FC=ifort >>> >>> What problems are you encountering? Send configure.log to petsc-maint.. >>> >>> Satish >>> >>> On Tue, 3 Feb 2009, Randall Mackie wrote: >>> >>>> Paul, >>>> >>>> Have you tried this with Petsc 3.0.0? I just tried to compile it using >>>> MKL 10.0.3.020, and I am having the same issue you specified below, in >>> that >>>> Petsc is looking for -lmkl_lapack -lmkl -lguide etc and the compilation >>>> doesn't work. >>>> >>>> Randy >>>> >>>> >>>> >>>> >>>> Paul T. Bauman wrote: >>>>> Sorry this took so long to get around to doing. So it turns out that >>> there's >>>>> a newer version of 2.3.3p13 posted at the PETSc ftp server. This worked >>>>> flawlessly with the new MKL. I guess it got fixed and checked-in, but >>> not >>>>> under a new patch? >>>>> >>>>> Thanks, >>>>> >>>>> Paul >>>>> >>>>> Barry Smith wrote: >>>>>> Please send the configure.log to petsc-maint at mcs.anl.gov >>>>>> >>>>>> Barry >>>>>> >>>>>> On Aug 15, 2008, at 1:39 PM, Paul T. Bauman wrote: >>>>>> >>>>>>> Was there ever a fix/workaround introduced for this? I'm using >>> 2.3.3p13 >>>>>>> and I'm having trouble getting the config to recognize mkl >>> 10.0.3.020. >>>>>>> Thanks, >>>>>>> >>>>>>> Paul >>>>>>> >>>>>>> Barry Smith wrote: >>>>>>>> Could you email to petsc-maint at mcs.anl.gov ALL the messages as >>> to >>>>>>>> what goes wrong with >>>>>>>> our current linking so we can fix it? >>>>>>>> >>>>>>>> Thanks >>>>>>>> >>>>>>>> Barry >>>>>>>> >>>>>>>> On Jun 18, 2008, at 3:32 PM, Randall Mackie wrote: >>>>>>>> >>>>>>>>> We've upgraded Intel MKL to version 10.0, but in this version, >>> Intel >>>>>>>>> has >>>>>>>>> changed how libraries are suppose to be linked. For example, >>> the >>>>>>>>> libmkl_lapack.a >>>>>>>>> is a dummy library, but that's what the PETSc configure script >>> looks >>>>>>>>> for. >>>>>>>>> >>>>>>>>> The documentation says, for example, to compile LAPACK in the >>> static >>>>>>>>> case, >>>>>>>>> use libmkl_lapack.a libmkl_em64t.a >>>>>>>>> >>>>>>>>> and in the layered pure case to use >>>>>>>>> libmkl_intel_lp64.a libmkl_intel_thread.a libmkl_core.a >>>>>>>>> >>>>>>>>> However, the PETSC configuration wants -lmkl_lapack -lmkl >>> -lguide >>>>>>>>> -lpthread >>>>>>>>> >>>>>>>>> Any suggestions are appreciated. >>>>>>>>> >>>>>>>>> Randy >>>>>>>>> >>>>>> >>>>> >>>> >>> > From balay at mcs.anl.gov Tue Feb 3 21:07:06 2009 From: balay at mcs.anl.gov (Satish Balay) Date: Tue, 3 Feb 2009 21:07:06 -0600 (CST) Subject: compiling PETSc with Intel MKL 10.0.1.14 In-Reply-To: <49890299.1010900@gmail.com> References: <485970E1.1090104@gmail.com> <381F69EF-1C27-420C-8337-0EAEB70093E0@mcs.anl.gov> <48A5CD78.9070201@ices.utexas.edu> <48B95756.7020702@ices.utexas.edu> <4988BF49.10306@geosystem.us> <6c61ad530902031718g4d049bb2t69735e281e688daa@mail.gmail.com> <49890299.1010900@gmail.com> Message-ID: On Tue, 3 Feb 2009, Randall Mackie wrote: > Do you have an idea of how much difference there is in computation times > using the Intel MKL optimized libraries versus just having PETSc download > and compile them itself? Well - petsc primarily uses blas1. And depending upon the application's usage of PETSc - blas could be a reasonable part - but not dominant part of the total run-time. So a higher performance blas should make at most a few percentage points [ perhaps less than 10%] improvement on the total runtime. Typically - it could be much less than that.. -log_summary would be a good place to look at the performance differences.. Satish From rlmackie862 at gmail.com Wed Feb 4 12:25:16 2009 From: rlmackie862 at gmail.com (Randall Mackie) Date: Wed, 04 Feb 2009 10:25:16 -0800 Subject: compiling PETSc with Intel MKL 10.0.1.14 In-Reply-To: References: <485970E1.1090104@gmail.com> <381F69EF-1C27-420C-8337-0EAEB70093E0@mcs.anl.gov> <48A5CD78.9070201@ices.utexas.edu> <48B95756.7020702@ices.utexas.edu> <4988BF49.10306@geosystem.us> <6c61ad530902031718g4d049bb2t69735e281e688daa@mail.gmail.com> Message-ID: <4989DD8C.1060103@gmail.com> Hi Satish, I can now confirm that even though I get those warning messages when I link my code, that it runs properly on my test models. Thanks for your help and clarifications. Randy Satish Balay wrote: > Ok - for one you are on a x86_64 machine. So > --with-blas-lapack-dir=/opt/intel/mkl/10.0.3.020/lib/64 is incorrect. > > --with-blas-lapack-dir=/opt/intel/mkl/10.0.3.020/lib/em64t would be > the correct thing [or --with-blas-lapack-dir=/opt/intel/mkl/10.0.3.020 > - so that configure determines the correct subdir in lib] > > Note: intel calls 'x86_64' [i.e AMD64] as 'em64t', and IA64 [i.e itanium] as '64' > > > However currently you get link time warnings. The exectuable gets > created - so it should run correctly. Can you confirm this? [I don't > see any errors in the output you sent.] > > And I don't think you'll be able to get rid of these warnings. Your > compiler is already configured to look into both locations. > > run 'mpicc -v foo.c' [on any simple c code] - and you'll see the > following link paths. > > "-L/opt/intel/mkl/10.0.3.020/lib/64" "-L/opt/intel/mkl/10.0.3.020/lib/em64t" > > [It should not be linking agaings '64' version. It should only use 'em64t' version] > > Satish > > On Tue, 3 Feb 2009, Randall Mackie wrote: > >> Hi Satish, >> >> I compiled PETSC with the following options: >> >> ./configure PETSC_ARCH=linux-intel-opt --with-fortran-kernels=generic >> --with-blas-lapack-dir >> =/opt/intel/mkl/10.0.3.020/lib/64 --with-scalar-type=complex >> --with-debugging=0 >> >> PETSc compiled just fine, but when I tried to compile my application, or run >> the tests >> within PETSC, it bombed out looking for the MKL libraries like: >> >> >> mpif90 -O -o d3inv_DA_1_1_4_petsc ... ,-rpath,/opt/intel/mkl/ >> 10.0.3.020/lib/64 -L/opt/intel/mkl/10.0.3.020/lib/64 -lmkl_lapack -lmkl >> -lguide -lpthread -lPEPCF9r/lib64 -L/usr/mpi/intel/mvapich-1.0.1/lib/shared >> -L/usr/mpi/intel/mvapich-1.0.1/lib -ldl -lmpich -libverbs -libumad >> -libcommon -lpthread -lrt -L/opt/intel/mkl/ >> 10.0.3.020/libopt/intel/mkl/10.0.3.020/lib/em64t ...... >> >> ld: skipping incompatible >> /opt/intel/mkl/10.0.3.020/lib/64/libmkl_lapack.sowhen searching for >> -lmkl_lapack >> etc. >> >> I'll try Paul's method of specifying the exact libraries to be included. If >> you want, I can >> still send you the configure log. >> >> Randy >> >> On Tue, Feb 3, 2009 at 3:25 PM, Satish Balay wrote: >> >>> I just successfully compiled petsc-dev [which is almost same as >>> petsc-3.0.0-p3] & MLK successfully with both intel & gnu compilers. >>> >>> ./configure >>> --with-blas-lapack-dir=/gfs/software/software/intel/compilersuite/10.1/mkl/10.0.011 >>> --with-mpi=0 PETSC_ARCH=linux-mkl >>> >>> >>> ./configure >>> --with-blas-lapack-dir=/gfs/software/software/intel/compilersuite/10.1/mkl/10.0.011 >>> --with-mpi=0 PETSC_ARCH=linux-icc-mkl CC=icc FC=ifort >>> >>> What problems are you encountering? Send configure.log to petsc-maint.. >>> >>> Satish >>> >>> On Tue, 3 Feb 2009, Randall Mackie wrote: >>> >>>> Paul, >>>> >>>> Have you tried this with Petsc 3.0.0? I just tried to compile it using >>>> MKL 10.0.3.020, and I am having the same issue you specified below, in >>> that >>>> Petsc is looking for -lmkl_lapack -lmkl -lguide etc and the compilation >>>> doesn't work. >>>> >>>> Randy >>>> >>>> >>>> >>>> >>>> Paul T. Bauman wrote: >>>>> Sorry this took so long to get around to doing. So it turns out that >>> there's >>>>> a newer version of 2.3.3p13 posted at the PETSc ftp server. This worked >>>>> flawlessly with the new MKL. I guess it got fixed and checked-in, but >>> not >>>>> under a new patch? >>>>> >>>>> Thanks, >>>>> >>>>> Paul >>>>> >>>>> Barry Smith wrote: >>>>>> Please send the configure.log to petsc-maint at mcs.anl.gov >>>>>> >>>>>> Barry >>>>>> >>>>>> On Aug 15, 2008, at 1:39 PM, Paul T. Bauman wrote: >>>>>> >>>>>>> Was there ever a fix/workaround introduced for this? I'm using >>> 2.3.3p13 >>>>>>> and I'm having trouble getting the config to recognize mkl >>> 10.0.3.020. >>>>>>> Thanks, >>>>>>> >>>>>>> Paul >>>>>>> >>>>>>> Barry Smith wrote: >>>>>>>> Could you email to petsc-maint at mcs.anl.gov ALL the messages as >>> to >>>>>>>> what goes wrong with >>>>>>>> our current linking so we can fix it? >>>>>>>> >>>>>>>> Thanks >>>>>>>> >>>>>>>> Barry >>>>>>>> >>>>>>>> On Jun 18, 2008, at 3:32 PM, Randall Mackie wrote: >>>>>>>> >>>>>>>>> We've upgraded Intel MKL to version 10.0, but in this version, >>> Intel >>>>>>>>> has >>>>>>>>> changed how libraries are suppose to be linked. For example, >>> the >>>>>>>>> libmkl_lapack.a >>>>>>>>> is a dummy library, but that's what the PETSc configure script >>> looks >>>>>>>>> for. >>>>>>>>> >>>>>>>>> The documentation says, for example, to compile LAPACK in the >>> static >>>>>>>>> case, >>>>>>>>> use libmkl_lapack.a libmkl_em64t.a >>>>>>>>> >>>>>>>>> and in the layered pure case to use >>>>>>>>> libmkl_intel_lp64.a libmkl_intel_thread.a libmkl_core.a >>>>>>>>> >>>>>>>>> However, the PETSC configuration wants -lmkl_lapack -lmkl >>> -lguide >>>>>>>>> -lpthread >>>>>>>>> >>>>>>>>> Any suggestions are appreciated. >>>>>>>>> >>>>>>>>> Randy >>>>>>>>> >>>>>> >>>>> >>>> >>> > From knepley at gmail.com Wed Feb 4 16:46:49 2009 From: knepley at gmail.com (Matthew Knepley) Date: Wed, 4 Feb 2009 16:46:49 -0600 Subject: Performance degradation after upgrade to 3.0.0 In-Reply-To: <3079e2ed0902031435y5af89467yedbde5dfac2c9621@mail.gmail.com> References: <3079e2ed0902031435y5af89467yedbde5dfac2c9621@mail.gmail.com> Message-ID: On Tue, Feb 3, 2009 at 4:35 PM, Billy Araujo wrote: > "Can you send the matrix and rhs as PETSc binary output, and I will find out > what the difference is. It looks to me like the default ICC ordering > has changed. Okay, I have the explanation. The default factorization options changed in 3.0.0. No, by default, we use a diagonal shift to remedy zero diagonal elements, like -pc_factor_shift_positive_definite TRUE You do not have a zero per se, but you do have a singular matrix, which you can check using -ksp_type preonly -pc_type lu, so the last row has a zero diagonal. Since nothing is ever divided by it, it causes no problems if you do nothing. However, shifting generates a much poorer preconditioner. You can recover the original behavior using -pc_factor_shift_positive_definite FALSE However, I would also advise uncovering the source of the singularity. Thanks, Matt -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener From billy at dem.uminho.pt Thu Feb 5 04:04:39 2009 From: billy at dem.uminho.pt (=?iso-8859-1?Q?Billy_Ara=FAjo?=) Date: Thu, 5 Feb 2009 10:04:39 -0000 Subject: Performance degradation after upgrade to 3.0.0 References: <3079e2ed0902031435y5af89467yedbde5dfac2c9621@mail.gmail.com> Message-ID: <1200D8BEDB3DD54DBA528E210F372BF3D944D0@BEFUNCIONARIOS.uminho.pt> Thanks for the explanation. -----Original Message----- From: Matthew Knepley [mailto:knepley at gmail.com] Sent: Wed 2/4/2009 10:46 PM To: PETSc users list Cc: petsc-maint Maintenance; Billy Ara?jo Subject: Re: Performance degradation after upgrade to 3.0.0 On Tue, Feb 3, 2009 at 4:35 PM, Billy Araujo wrote: > "Can you send the matrix and rhs as PETSc binary output, and I will find out > what the difference is. It looks to me like the default ICC ordering > has changed. Okay, I have the explanation. The default factorization options changed in 3.0.0. No, by default, we use a diagonal shift to remedy zero diagonal elements, like -pc_factor_shift_positive_definite TRUE You do not have a zero per se, but you do have a singular matrix, which you can check using -ksp_type preonly -pc_type lu, so the last row has a zero diagonal. Since nothing is ever divided by it, it causes no problems if you do nothing. However, shifting generates a much poorer preconditioner. You can recover the original behavior using -pc_factor_shift_positive_definite FALSE However, I would also advise uncovering the source of the singularity. Thanks, Matt -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From billy at dem.uminho.pt Thu Feb 5 15:56:27 2009 From: billy at dem.uminho.pt (=?iso-8859-1?Q?Billy_Ara=FAjo?=) Date: Thu, 5 Feb 2009 21:56:27 -0000 Subject: Performance degradation after upgrade to 3.0.0 References: <3079e2ed0902031435y5af89467yedbde5dfac2c9621@mail.gmail.com> <1200D8BEDB3DD54DBA528E210F372BF3D944D0@BEFUNCIONARIOS.uminho.pt> Message-ID: <1200D8BEDB3DD54DBA528E210F372BF3D944D1@BEFUNCIONARIOS.uminho.pt> Matthew, After all, the problem was mine. I had a bug in the code and I didn't notice it until this PETSc version. Thanks once again. Keep up the good work. Billy. -----Original Message----- From: petsc-users-bounces at mcs.anl.gov on behalf of Billy Ara?jo Sent: Thu 2/5/2009 10:04 AM To: Matthew Knepley; PETSc users list Cc: petsc-maint Maintenance Subject: RE: Performance degradation after upgrade to 3.0.0 Thanks for the explanation. -----Original Message----- From: Matthew Knepley [mailto:knepley at gmail.com] Sent: Wed 2/4/2009 10:46 PM To: PETSc users list Cc: petsc-maint Maintenance; Billy Ara?jo Subject: Re: Performance degradation after upgrade to 3.0.0 On Tue, Feb 3, 2009 at 4:35 PM, Billy Araujo wrote: > "Can you send the matrix and rhs as PETSc binary output, and I will find out > what the difference is. It looks to me like the default ICC ordering > has changed. Okay, I have the explanation. The default factorization options changed in 3.0.0. No, by default, we use a diagonal shift to remedy zero diagonal elements, like -pc_factor_shift_positive_definite TRUE You do not have a zero per se, but you do have a singular matrix, which you can check using -ksp_type preonly -pc_type lu, so the last row has a zero diagonal. Since nothing is ever divided by it, it causes no problems if you do nothing. However, shifting generates a much poorer preconditioner. You can recover the original behavior using -pc_factor_shift_positive_definite FALSE However, I would also advise uncovering the source of the singularity. Thanks, Matt -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 3775 bytes Desc: not available URL: From schuang at ats.ucla.edu Thu Feb 5 19:48:56 2009 From: schuang at ats.ucla.edu (Shao-Ching Huang) Date: Thu, 05 Feb 2009 17:48:56 -0800 Subject: VecView and MPI IO Message-ID: <498B9708.2090007@ats.ucla.edu> Hi, I am trying to create restart/check-pointing files for a time-stepping simulation (by writing out vectors to files). 1. Does VecView always use the MPI collective I/O? The HTML documentation of PetscViewerBinaryOpen says: "For writing files it only opens the file on processor 0 in the communicator." 2. Do I have to set anything to enable MPI I/O when configuring PETSc? (My MPI library has MPI I/O.) Thank you. Shao-Ching From knepley at gmail.com Thu Feb 5 20:32:29 2009 From: knepley at gmail.com (Matthew Knepley) Date: Thu, 5 Feb 2009 20:32:29 -0600 Subject: VecView and MPI IO In-Reply-To: <498B9708.2090007@ats.ucla.edu> References: <498B9708.2090007@ats.ucla.edu> Message-ID: On Thu, Feb 5, 2009 at 7:48 PM, Shao-Ching Huang wrote: > Hi, > > I am trying to create restart/check-pointing files for a time-stepping > simulation (by writing out vectors to files). > > 1. Does VecView always use the MPI collective I/O? > > The HTML documentation of PetscViewerBinaryOpen says: "For writing > files it only opens the file on processor 0 in the communicator." You must run with -viewer_binary_mpiio. However, I recommend very very strongly that you profile this first. We have not need to use MPI/IO below several thousand processors. > 2. Do I have to set anything to enable MPI I/O when configuring PETSc? > (My MPI library has MPI I/O.) This should happen automatically. Matt > Thank you. > > Shao-Ching -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener From schuang at ats.ucla.edu Thu Feb 5 21:01:39 2009 From: schuang at ats.ucla.edu (Shao-Ching Huang) Date: Thu, 05 Feb 2009 19:01:39 -0800 Subject: VecView and MPI IO In-Reply-To: References: <498B9708.2090007@ats.ucla.edu> Message-ID: <498BA813.6030001@ats.ucla.edu> Thanks for the tips! Shao-Ching Matthew Knepley wrote: > On Thu, Feb 5, 2009 at 7:48 PM, Shao-Ching Huang wrote: >> Hi, >> >> I am trying to create restart/check-pointing files for a time-stepping >> simulation (by writing out vectors to files). >> >> 1. Does VecView always use the MPI collective I/O? >> >> The HTML documentation of PetscViewerBinaryOpen says: "For writing >> files it only opens the file on processor 0 in the communicator." > > You must run with -viewer_binary_mpiio. However, I recommend very very > strongly that you profile this first. We have not need to use MPI/IO below > several thousand processors. > >> 2. Do I have to set anything to enable MPI I/O when configuring PETSc? >> (My MPI library has MPI I/O.) > > This should happen automatically. > > Matt > >> Thank you. >> >> Shao-Ching From enjoywm at cs.wm.edu Thu Feb 5 22:39:20 2009 From: enjoywm at cs.wm.edu (enjoywm at cs.wm.edu) Date: Thu, 5 Feb 2009 23:39:20 -0500 (EST) Subject: solve successive linear systems Message-ID: <56916d5ffe496d4707c69d24cde0e31b.squirrel@mail.cs.wm.edu> Hi, I have a linear system KU=F. I need to solve it successively in several iterations. Both K and F will be chaged in each iteration. Q1. In each iteration I need to chage some elements in K and F. How to allocate the space for K and F to make this changing efficiently? In another words, to avoid copy operations. Q2. Manual said to solve successive linear system with different preconditioner matrix (The preconditioner matrix is same with K, so preconditioner matrix is different as K changes) user must call KSPSetOperators() and KSPSolve() for each solve. How to set the flag in each solve? Thanks! Yixun From knepley at gmail.com Fri Feb 6 08:20:48 2009 From: knepley at gmail.com (Matthew Knepley) Date: Fri, 6 Feb 2009 08:20:48 -0600 Subject: solve successive linear systems In-Reply-To: <56916d5ffe496d4707c69d24cde0e31b.squirrel@mail.cs.wm.edu> References: <56916d5ffe496d4707c69d24cde0e31b.squirrel@mail.cs.wm.edu> Message-ID: On Thu, Feb 5, 2009 at 10:39 PM, wrote: > Hi, > I have a linear system KU=F. I need to solve it successively in several > iterations. Both K and F will be chaged in each iteration. > Q1. In each iteration I need to chage some elements in K and F. How to > allocate the space for K and F to make this changing efficiently? In > another words, to avoid copy operations. If you know the eventual nonzero pattern, allocate the whole thing up front. If not, we do not have a dynamic structure for this. However, I suggest profiling first to make sure that any copy is a significant part of the runtime. We always find that the solve dominates, which is why we never coded it. > Q2. Manual said to solve successive linear system with different > preconditioner matrix (The preconditioner matrix is same with K, so > preconditioner matrix is different as K changes) user must call > KSPSetOperators() and KSPSolve() for each solve. How to set the flag in > each solve? Which flag? Just call KSPSetOperators() each time you solve. Matt > Thanks! > > Yixun > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener From likask at civil.gla.ac.uk Thu Feb 5 10:16:40 2009 From: likask at civil.gla.ac.uk (Lukasz Kaczmarczyk) Date: Thu, 05 Feb 2009 16:16:40 -0000 Subject: Deactivation of X11 Message-ID: Hello I deactivated graphics by using switches --with-x=0 --with-x11=0. However, when I compile may program I get following errors. /golem/civil/likask/YaFEMS/petsc-2.3.3-p13/lib/linux-gnu-c-debug/libpetsc.a(xops.o): In function `PetscDrawLine_X': /golem/civil/likask/YaFEMS/petsc-2.3.3-p13/src/sys/draw/impls/x/xops.c:29: undefined reference to `XSetForeground' /golem/civil/likask/YaFEMS/petsc-2.3.3-p13/src/sys/draw/impls/x/xops.c:32: undefined reference to `XDrawLine' >> cut here What I have to do to make it working? Thank You for help, Lukasz From balay at mcs.anl.gov Fri Feb 6 10:17:19 2009 From: balay at mcs.anl.gov (Satish Balay) Date: Fri, 6 Feb 2009 10:17:19 -0600 (CST) Subject: Deactivation of X11 In-Reply-To: References: Message-ID: Disabling X11 should work. [with the switch --with-x=0] Send us the corresponding configure.log & make.log at petsc-maint at mcs.anl.gov - so that we chan check what went wrong. BTW: You should consider upgrading to latest PETSc release - 3.0.0 Satish On Thu, 5 Feb 2009, Lukasz Kaczmarczyk wrote: > Hello > I deactivated graphics by using switches --with-x=0 --with-x11=0. However, > when I compile may program I get following errors. > > /golem/civil/likask/YaFEMS/petsc-2.3.3-p13/lib/linux-gnu-c-debug/libpetsc.a(xops.o): > In function `PetscDrawLine_X': > /golem/civil/likask/YaFEMS/petsc-2.3.3-p13/src/sys/draw/impls/x/xops.c:29: > undefined reference to `XSetForeground' > /golem/civil/likask/YaFEMS/petsc-2.3.3-p13/src/sys/draw/impls/x/xops.c:32: > undefined reference to `XDrawLine' > > > cut here > > What I have to do to make it working? > > Thank You for help, > Lukasz From xmailerpro at gmx.net Fri Feb 6 10:36:37 2009 From: xmailerpro at gmx.net (Jean-Marc Haudin) Date: Fri, 6 Feb 2009 16:36:37 +0000 Subject: FreeCFD Message-ID: <20090206163641.76511348035@mailgw.mcs.anl.gov> Free CFD is an open source CFD code written in C++. It has an implicit density based solver for unstructured grids in 3D. The project is fairly new (Feb 2009) and still lacks some important functionality, like turbulence modeling. It looks very promising though and it will be very interesting to see how it develops. If you think that OpenFOAM is too complex and too large, Free CFD can be an interesting alternative, especially of you want a density based solver suitable for high-speed flows. http://www.freecfd.com/ ------ Gesendet mit X-Mailer .... http://sourceforge.net/projects/x-mailer/ From schuang at ats.ucla.edu Fri Feb 6 18:27:49 2009 From: schuang at ats.ucla.edu (Shao-Ching Huang) Date: Fri, 06 Feb 2009 16:27:49 -0800 Subject: VecView and MPI IO In-Reply-To: References: <498B9708.2090007@ats.ucla.edu> Message-ID: <498CD585.8030507@ats.ucla.edu> Hi I am getting a zero-sized file "foo.info" when I write a vector, say "my_vec", to disk file "foo": MPI_Comm comm; PetscViewer viewer; Vec my_vec; ... PetscViewerBinaryOpen(comm, "foo", FILE_MODE_WRITE, &viewer); VecView(my_vec, viewer); PetscViewerDestroy(viewer); My questions are: 1. Can I safely ignore the .info file? (Is it useful?) 2. How can I prevent the .info file from being generated? Thanks, Shao-Ching Matthew Knepley wrote: > On Thu, Feb 5, 2009 at 7:48 PM, Shao-Ching Huang wrote: >> Hi, >> >> I am trying to create restart/check-pointing files for a time-stepping >> simulation (by writing out vectors to files). >> >> 1. Does VecView always use the MPI collective I/O? >> >> The HTML documentation of PetscViewerBinaryOpen says: "For writing >> files it only opens the file on processor 0 in the communicator." > > You must run with -viewer_binary_mpiio. However, I recommend very very > strongly that you profile this first. We have not need to use MPI/IO below > several thousand processors. > >> 2. Do I have to set anything to enable MPI I/O when configuring PETSc? >> (My MPI library has MPI I/O.) > > This should happen automatically. > > Matt > >> Thank you. >> >> Shao-Ching From bsmith at mcs.anl.gov Fri Feb 6 20:02:20 2009 From: bsmith at mcs.anl.gov (Barry Smith) Date: Fri, 6 Feb 2009 20:02:20 -0600 Subject: VecView and MPI IO In-Reply-To: <498CD585.8030507@ats.ucla.edu> References: <498B9708.2090007@ats.ucla.edu> <498CD585.8030507@ats.ucla.edu> Message-ID: <2AE4BD45-2F38-4F0F-811F-FCB103B834E8@mcs.anl.gov> From the manual page /*@ PetscViewerBinarySkipInfo - Binary file will not have .info file created with it Not Collective Input Paramter: . viewer - PetscViewer context, obtained from PetscViewerCreate() Options Database Key: . -viewer_binary_skip_info Level: advanced Notes: This must be called after PetscViewerSetType() but before PetscViewerFileSetName(). If you use PetscViewerBinaryOpen() then you can only skip the info file with the -viewer_binary_skip_info flag. To use the function you must open the viewer with PetscViewerCreate(), PetscViewerSetType(), PetscViewerFileSetName(). The .info contains meta information about the data in the binary file, for example the block size if it was set for a vector or matrix. Concepts: PetscViewerBinary^accessing info file .seealso: PetscViewerBinaryOpen(), PetscViewerBinaryGetDescriptor(), PetscViewerBinarySetSkipOptions(), PetscViewerBinaryGetSkipOptions() @*/ On Feb 6, 2009, at 6:27 PM, Shao-Ching Huang wrote: > Hi > > I am getting a zero-sized file "foo.info" when I write a vector, say > "my_vec", to disk file "foo": > > MPI_Comm comm; > PetscViewer viewer; > Vec my_vec; > ... > PetscViewerBinaryOpen(comm, "foo", FILE_MODE_WRITE, &viewer); > VecView(my_vec, viewer); > PetscViewerDestroy(viewer); > > My questions are: > 1. Can I safely ignore the .info file? (Is it useful?) > 2. How can I prevent the .info file from being generated? > > Thanks, > > Shao-Ching > > > Matthew Knepley wrote: >> On Thu, Feb 5, 2009 at 7:48 PM, Shao-Ching Huang > > wrote: >>> Hi, >>> >>> I am trying to create restart/check-pointing files for a time- >>> stepping >>> simulation (by writing out vectors to files). >>> >>> 1. Does VecView always use the MPI collective I/O? >>> >>> The HTML documentation of PetscViewerBinaryOpen says: "For writing >>> files it only opens the file on processor 0 in the communicator." >> You must run with -viewer_binary_mpiio. However, I recommend very >> very >> strongly that you profile this first. We have not need to use MPI/ >> IO below >> several thousand processors. >>> 2. Do I have to set anything to enable MPI I/O when configuring >>> PETSc? >>> (My MPI library has MPI I/O.) >> This should happen automatically. >> Matt >>> Thank you. >>> >>> Shao-Ching From schuang at ats.ucla.edu Sat Feb 7 12:39:51 2009 From: schuang at ats.ucla.edu (Shao-Ching Huang) Date: Sat, 07 Feb 2009 10:39:51 -0800 Subject: VecView and MPI IO In-Reply-To: <2AE4BD45-2F38-4F0F-811F-FCB103B834E8@mcs.anl.gov> References: <498B9708.2090007@ats.ucla.edu> <498CD585.8030507@ats.ucla.edu> <2AE4BD45-2F38-4F0F-811F-FCB103B834E8@mcs.anl.gov> Message-ID: <498DD577.1010908@ats.ucla.edu> Yes, it works. So to suppress the .info file, I either replace PetscViewerBinaryOpen(comm, fn, FILE_MODE_WRITE, &viewer); with PetscViewerCreate(comm, &viewer); PetscViewerSetType(viewer,PETSC_VIEWER_BINARY); PetscViewerBinarySkipInfo(viewer); PetscViewerFileSetMode(viewer, FILE_MODE_WRITE); PetscViewerFileSetName(viewer,fn); in my code, or use "-viewer_binary_skip_info" at run time. Thanks. Shao-Ching Barry Smith wrote: > > From the manual page > > /*@ > PetscViewerBinarySkipInfo - Binary file will not have .info file > created with it > > Not Collective > > Input Paramter: > . viewer - PetscViewer context, obtained from PetscViewerCreate() > > Options Database Key: > . -viewer_binary_skip_info > > Level: advanced > > Notes: This must be called after PetscViewerSetType() but before > PetscViewerFileSetName(). If you use PetscViewerBinaryOpen() then > you can only skip the info file with the -viewer_binary_skip_info > flag. To use the function you must open the > viewer with PetscViewerCreate(), PetscViewerSetType(), > PetscViewerFileSetName(). > > The .info contains meta information about the data in the binary > file, for example the block size if it was > set for a vector or matrix. > > Concepts: PetscViewerBinary^accessing info file > > .seealso: PetscViewerBinaryOpen(), PetscViewerBinaryGetDescriptor(), > PetscViewerBinarySetSkipOptions(), > PetscViewerBinaryGetSkipOptions() > @*/ > > On Feb 6, 2009, at 6:27 PM, Shao-Ching Huang wrote: > >> Hi >> >> I am getting a zero-sized file "foo.info" when I write a vector, say >> "my_vec", to disk file "foo": >> >> MPI_Comm comm; >> PetscViewer viewer; >> Vec my_vec; >> ... >> PetscViewerBinaryOpen(comm, "foo", FILE_MODE_WRITE, &viewer); >> VecView(my_vec, viewer); >> PetscViewerDestroy(viewer); >> >> My questions are: >> 1. Can I safely ignore the .info file? (Is it useful?) >> 2. How can I prevent the .info file from being generated? >> >> Thanks, >> >> Shao-Ching >> >> >> Matthew Knepley wrote: >>> On Thu, Feb 5, 2009 at 7:48 PM, Shao-Ching Huang >>> wrote: >>>> Hi, >>>> >>>> I am trying to create restart/check-pointing files for a time-stepping >>>> simulation (by writing out vectors to files). >>>> >>>> 1. Does VecView always use the MPI collective I/O? >>>> >>>> The HTML documentation of PetscViewerBinaryOpen says: "For writing >>>> files it only opens the file on processor 0 in the communicator." >>> You must run with -viewer_binary_mpiio. However, I recommend very very >>> strongly that you profile this first. We have not need to use MPI/IO >>> below >>> several thousand processors. >>>> 2. Do I have to set anything to enable MPI I/O when configuring PETSc? >>>> (My MPI library has MPI I/O.) >>> This should happen automatically. >>> Matt >>>> Thank you. >>>> >>>> Shao-Ching > From stephan.kramer at imperial.ac.uk Tue Feb 10 14:11:26 2009 From: stephan.kramer at imperial.ac.uk (Stephan Kramer) Date: Tue, 10 Feb 2009 20:11:26 +0000 Subject: redistribution of vectors Message-ID: <4991DF6E.50005@imperial.ac.uk> Hi, I'm trying to pick up a linear system (matrix and rhs) that I've written out in a previous parallel run using MatView and VecView in binary mode. Now when I've read the matrix and rhs vector the rows are evenly distributed by PETSc over the processes. The partioning previously used in the parallel run however doesn't in general correspond to this even distribution (the global node numbering is the same, but number of rows are not exactly equal per process due to other constraints). So what I'm trying to do is redistribute the read in matrix and vector to match the previously used partioning. I've found that for the matrix this is easy to do using MatGetSubMatrix(), but I'm a little stuck on how to do this for the vector. Is there a similar way of doing this for the vector? There seems to be no way of extracting vector values not stored on this processor. I've tried to look at src/ksp/ksp/examples/tutorials/example10.c where something similar is done for a repartioning created by MatPartioning. It does the redistribution of the matrix with MatGetSubMatrix() as I expected, but then seems to do nothing for the vector (there is only a comment: /* need to move the vector also */ ). Does this mean I just have to extract the vector values locally and do some redistributing with MPI myself? Cheers Stephan From knepley at gmail.com Tue Feb 10 14:21:50 2009 From: knepley at gmail.com (Matthew Knepley) Date: Tue, 10 Feb 2009 14:21:50 -0600 Subject: redistribution of vectors In-Reply-To: <4991DF6E.50005@imperial.ac.uk> References: <4991DF6E.50005@imperial.ac.uk> Message-ID: On Tue, Feb 10, 2009 at 2:11 PM, Stephan Kramer wrote: > Hi, > > I'm trying to pick up a linear system (matrix and rhs) that I've written out > in a previous parallel run using MatView and VecView in binary mode. Now > when I've read the matrix and rhs vector the rows are evenly distributed by > PETSc over the processes. The partioning previously used in the parallel run > however doesn't in general correspond to this even distribution (the global > node numbering is the same, but number of rows are not exactly equal per > process due to other constraints). So what I'm trying to do is redistribute > the read in matrix and vector to match the previously used partioning. I've > found that for the matrix this is easy to do using MatGetSubMatrix(), but > I'm a little stuck on how to do this for the vector. Is there a similar way > of doing this for the vector? There seems to be no way of extracting vector > values not stored on this processor. > > I've tried to look at src/ksp/ksp/examples/tutorials/example10.c where > something similar is done for a repartioning created by MatPartioning. It > does the redistribution of the matrix with MatGetSubMatrix() as I expected, > but then seems to do nothing for the vector (there is only a comment: /* > need to move the vector also */ ). > > Does this mean I just have to extract the vector values locally and do some > redistributing with MPI myself? You can certainly use a VecScatter to redistribute a vector. You already have the indices from MatGetSubMatrix() so it should be easy. However, you can also use VecLoadIntoVector() and provide an initial partitioning. Matt > Cheers > Stephan -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener From stephan.kramer at imperial.ac.uk Tue Feb 10 17:01:55 2009 From: stephan.kramer at imperial.ac.uk (Stephan Kramer) Date: Tue, 10 Feb 2009 23:01:55 +0000 Subject: redistribution of vectors In-Reply-To: References: <4991DF6E.50005@imperial.ac.uk> Message-ID: <49920763.5080203@imperial.ac.uk> Matthew Knepley wrote: > On Tue, Feb 10, 2009 at 2:11 PM, Stephan Kramer > wrote: > >> Hi, >> >> I'm trying to pick up a linear system (matrix and rhs) that I've written out >> in a previous parallel run using MatView and VecView in binary mode. Now >> when I've read the matrix and rhs vector the rows are evenly distributed by >> PETSc over the processes. The partioning previously used in the parallel run >> however doesn't in general correspond to this even distribution (the global >> node numbering is the same, but number of rows are not exactly equal per >> process due to other constraints). So what I'm trying to do is redistribute >> the read in matrix and vector to match the previously used partioning. I've >> found that for the matrix this is easy to do using MatGetSubMatrix(), but >> I'm a little stuck on how to do this for the vector. Is there a similar way >> of doing this for the vector? There seems to be no way of extracting vector >> values not stored on this processor. >> >> I've tried to look at src/ksp/ksp/examples/tutorials/example10.c where >> something similar is done for a repartioning created by MatPartioning. It >> does the redistribution of the matrix with MatGetSubMatrix() as I expected, >> but then seems to do nothing for the vector (there is only a comment: /* >> need to move the vector also */ ). >> >> Does this mean I just have to extract the vector values locally and do some >> redistributing with MPI myself? >> > > You can certainly use a VecScatter to redistribute a vector. You > already have the > indices from MatGetSubMatrix() so it should be easy. > > However, you can also use VecLoadIntoVector() and provide an initial > partitioning. > > Matt > Ah brilliant, I must have overlooked these options (there are so many in PETSc!). In that case is there also something like VecLoadIntoVector for MatLoad, i.e. where I specify the distribution beforehand, otherwise I'll just go for the MatGetSubMatrix() + VecScatter(). Just a small related question, for MatGetSubMatrix where I ask for the rows owned by each process but all columns, should I really assemble an index set ranging over all global indices? This seems a bit wasteful and non-scalable. Or should I put in the effort and, using information I have over my halo regions, work out which columns might have nonzeros for these rows. Or am I missing something and is there an easier short-cut? Thanks a lot Stephan > >> Cheers >> Stephan >> From bsmith at mcs.anl.gov Tue Feb 10 17:08:43 2009 From: bsmith at mcs.anl.gov (Barry Smith) Date: Tue, 10 Feb 2009 17:08:43 -0600 Subject: redistribution of vectors In-Reply-To: <49920763.5080203@imperial.ac.uk> References: <4991DF6E.50005@imperial.ac.uk> <49920763.5080203@imperial.ac.uk> Message-ID: <97047C7D-9D90-4214-A0BD-403A1BBC63A1@mcs.anl.gov> On Feb 10, 2009, at 5:01 PM, Stephan Kramer wrote: >> >>> >>> >> >> You can certainly use a VecScatter to redistribute a vector. You >> already have the >> indices from MatGetSubMatrix() so it should be easy. >> >> However, you can also use VecLoadIntoVector() and provide an initial >> partitioning. >> >> Matt >> > Ah brilliant, I must have overlooked these options (there are so > many in PETSc!). In that case is there also something like > VecLoadIntoVector for MatLoad, i.e. where I specify the distribution > beforehand, otherwise I'll just go for the MatGetSubMatrix() + > VecScatter(). We don't currently have a MatLoadIntoVector(). The current plan is to actually remove VecLoadIntoVector() and have both VecLoad() and MatLoad() be essentially "load into" operations where one is free to define the layout of the vector and matrix before or not thus getting the full spectrum of possibilities in one clean interface. Sadly we haven't done this reorganization due to having many other things to do. > > > Just a small related question, for MatGetSubMatrix where I ask for > the rows owned by each process but all columns, should I really > assemble an index set ranging over all global indices? This seems a > bit wasteful and non-scalable. Or should I put in the effort and, > using information I have over my halo regions, work out which > columns might have nonzeros for these rows. Or am I missing > something and is there an easier short-cut? It is true that it is not totally scalable but then dumping some huge honkying sparse matrix to a file and reading it in is not scalable either. We've never had a problem with this yet for reasonable matrix sizes. Rather than fixing this MatGetSubMatrix() , in your case, having a better MatLoad() merged with MatLoadIntoMatrix() would be the thing I recommend optimizing. But frankly until you get up to 1 billion unknowns what is there now is probably good enough. Barry > > > Thanks a lot > Stephan > >> >>> Cheers >>> Stephan >>> > From enjoywm at cs.wm.edu Tue Feb 10 17:31:50 2009 From: enjoywm at cs.wm.edu (Yixun Liu) Date: Tue, 10 Feb 2009 18:31:50 -0500 Subject: make test Message-ID: <49920E66.9070603@cs.wm.edu> Hi, I install petsc and make test, but there are some errors. I cannot find the solution in the troubleshooting. Running test examples to verify correct installation C/C++ example src/snes/examples/tutorials/ex19 run successfully with 1 MPI process C/C++ example src/snes/examples/tutorials/ex19 run successfully with 2 MPI processes Graphics example src/snes/examples/tutorials/ex19 run successfully with 1 MPI process --------------Error detected during compile or link!----------------------- See http://www.mcs.anl.gov/petsc/petsc-2/documentation/troubleshooting.html mpif77 -c -Wall -Wno-unused-variable -g -I/home/scratch/yixun/petsc-3.0.0-p3/linux-gnu-c-debug/include -I/home/scratch/yixun/petsc-3.0.0-p3/include -I/usr/include -o ex5f.o ex5f.F Warning: Nonconforming tab character in column 1 of line 899 Warning: Nonconforming tab character in column 1 of line 2818 Warning: Nonconforming tab character in column 1 of line 4373 Warning: Nonconforming tab character in column 1 of line 5927 Warning: Nonconforming tab character in column 1 of line 7520 mpif77 -Wall -Wno-unused-variable -g -o ex5f ex5f.o -Wl,-rpath,/home/scratch/yixun/petsc-3.0.0-p3/linux-gnu-c-debug/lib -L/home/scratch/yixun/petsc-3.0.0-p3/linux-gnu-c-debug/lib -lpetscsnes -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetsc -lX11 -llapack -lblas -lm -L/usr/lib64 -L/usr/lib64/gcc/x86_64-suse-linux/4.2.1 -L/lib64 -L/usr/x86_64-suse-linux/lib -ldl -llammpio -llamf77mpi -lmpi -llam -lutil -lgcc_s -lpthread -lgfortranbegin -lgfortran -lm -lm -ldl -llammpio -llamf77mpi -lmpi -llam -lutil -lgcc_s -lpthread -ldl /bin/rm -f ex5f.o Fortran example src/snes/examples/tutorials/ex5f run successfully with 1 MPI process Completed test examples Thanks. From stephan.kramer at imperial.ac.uk Tue Feb 10 17:51:52 2009 From: stephan.kramer at imperial.ac.uk (Stephan Kramer) Date: Tue, 10 Feb 2009 23:51:52 +0000 Subject: redistribution of vectors In-Reply-To: <97047C7D-9D90-4214-A0BD-403A1BBC63A1@mcs.anl.gov> References: <4991DF6E.50005@imperial.ac.uk> <49920763.5080203@imperial.ac.uk> <97047C7D-9D90-4214-A0BD-403A1BBC63A1@mcs.anl.gov> Message-ID: <49921318.1080000@imperial.ac.uk> Barry Smith wrote: > > On Feb 10, 2009, at 5:01 PM, Stephan Kramer wrote: > >>> > >>>> >>>> >>> >>> You can certainly use a VecScatter to redistribute a vector. You >>> already have the >>> indices from MatGetSubMatrix() so it should be easy. >>> >>> However, you can also use VecLoadIntoVector() and provide an initial >>> partitioning. >>> >>> Matt >>> >> Ah brilliant, I must have overlooked these options (there are so many >> in PETSc!). In that case is there also something like >> VecLoadIntoVector for MatLoad, i.e. where I specify the distribution >> beforehand, otherwise I'll just go for the MatGetSubMatrix() + >> VecScatter(). > > We don't currently have a MatLoadIntoVector(). The current plan is > to actually remove VecLoadIntoVector() and have both VecLoad() and > MatLoad() be essentially "load into" operations where one is free to > define the layout of the vector and matrix before or not thus getting > the full spectrum of possibilities in one clean interface. Sadly we > haven't done this reorganization due to having many other things to do. >> >> >> Just a small related question, for MatGetSubMatrix where I ask for >> the rows owned by each process but all columns, should I really >> assemble an index set ranging over all global indices? This seems a >> bit wasteful and non-scalable. Or should I put in the effort and, >> using information I have over my halo regions, work out which columns >> might have nonzeros for these rows. Or am I missing something and is >> there an easier short-cut? > > It is true that it is not totally scalable but then dumping some > huge honkying sparse matrix to a file and reading it in is not > scalable either. We've never had a problem with this yet for > reasonable matrix sizes. Rather than fixing this MatGetSubMatrix() , > in your case, having a better MatLoad() merged with > MatLoadIntoMatrix() would be the thing I recommend optimizing. But > frankly until you get up to 1 billion unknowns what is there now is > probably good enough. > > Barry > Good point. No, wasn't really planning on using this for anything that huge. Thanks a lot for your answers Cheers Stephan >> >> >> Thanks a lot >> Stephan >> >>> >>>> Cheers >>>> Stephan >>>> >> > > From knepley at gmail.com Tue Feb 10 19:06:37 2009 From: knepley at gmail.com (Matthew Knepley) Date: Tue, 10 Feb 2009 19:06:37 -0600 Subject: make test In-Reply-To: <49920E66.9070603@cs.wm.edu> References: <49920E66.9070603@cs.wm.edu> Message-ID: There were no errors, just some compiler warnings. Matt On Tue, Feb 10, 2009 at 5:31 PM, Yixun Liu wrote: > Hi, > I install petsc and make test, but there are some errors. I cannot find > the solution in the troubleshooting. > > Running test examples to verify correct installation > C/C++ example src/snes/examples/tutorials/ex19 run successfully with 1 > MPI process > C/C++ example src/snes/examples/tutorials/ex19 run successfully with 2 > MPI processes > Graphics example src/snes/examples/tutorials/ex19 run successfully with > 1 MPI process > --------------Error detected during compile or link!----------------------- > See http://www.mcs.anl.gov/petsc/petsc-2/documentation/troubleshooting.html > mpif77 -c -Wall -Wno-unused-variable -g > -I/home/scratch/yixun/petsc-3.0.0-p3/linux-gnu-c-debug/include > -I/home/scratch/yixun/petsc-3.0.0-p3/include -I/usr/include -o > ex5f.o ex5f.F > Warning: Nonconforming tab character in column 1 of line 899 > Warning: Nonconforming tab character in column 1 of line 2818 > Warning: Nonconforming tab character in column 1 of line 4373 > Warning: Nonconforming tab character in column 1 of line 5927 > Warning: Nonconforming tab character in column 1 of line 7520 > mpif77 -Wall -Wno-unused-variable -g -o ex5f ex5f.o > -Wl,-rpath,/home/scratch/yixun/petsc-3.0.0-p3/linux-gnu-c-debug/lib > -L/home/scratch/yixun/petsc-3.0.0-p3/linux-gnu-c-debug/lib -lpetscsnes > -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetsc -lX11 -llapack > -lblas -lm -L/usr/lib64 -L/usr/lib64/gcc/x86_64-suse-linux/4.2.1 > -L/lib64 -L/usr/x86_64-suse-linux/lib -ldl -llammpio -llamf77mpi -lmpi > -llam -lutil -lgcc_s -lpthread -lgfortranbegin -lgfortran -lm -lm -ldl > -llammpio -llamf77mpi -lmpi -llam -lutil -lgcc_s -lpthread -ldl > /bin/rm -f ex5f.o > Fortran example src/snes/examples/tutorials/ex5f run successfully with 1 > MPI process > Completed test examples > > Thanks. > > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener From enjoywm at cs.wm.edu Wed Feb 11 09:16:35 2009 From: enjoywm at cs.wm.edu (Yixun Liu) Date: Wed, 11 Feb 2009 10:16:35 -0500 Subject: Partitioning Message-ID: <4992EBD3.3010405@cs.wm.edu> Hi, I have 4 processors and I want to distribute the mesh on these four processors. For the partial mesh on processor 1, I want its vertex number to be in the range, let's say, 0 to 99 and for the mesh on processor 2, 100 to 199 etc. Does PETSC provide some routine to do it? Thanks. Yixun From knepley at gmail.com Wed Feb 11 09:27:04 2009 From: knepley at gmail.com (Matthew Knepley) Date: Wed, 11 Feb 2009 09:27:04 -0600 Subject: Partitioning In-Reply-To: <4992EBD3.3010405@cs.wm.edu> References: <4992EBD3.3010405@cs.wm.edu> Message-ID: I think you want MatPartitioning http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/MatOrderings/MatPartitioningCreate.html Matt On Wed, Feb 11, 2009 at 9:16 AM, Yixun Liu wrote: > Hi, > I have 4 processors and I want to distribute the mesh on these four > processors. For the partial mesh on processor 1, I want its vertex > number to be in the range, let's say, 0 to 99 and for the mesh on > processor 2, 100 to 199 etc. Does PETSC provide some routine to do it? > > Thanks. > > Yixun > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener From Hung.V.Nguyen at usace.army.mil Wed Feb 11 09:52:14 2009 From: Hung.V.Nguyen at usace.army.mil (Nguyen, Hung V ERDC-ITL-MS) Date: Wed, 11 Feb 2009 09:52:14 -0600 Subject: Using -pc_jacobi_rowmax or -pc_jacobi_rowsum Message-ID: All, I tried to use the jacobi preconditioner with maximum entry in each row as the diagonal preconditioner and got the error message below. The matrix was built with mpiaij type. Does it require different type of matrix? Thank you. -Hung hvnguyen:jade20% aprun -n 2 ./test_read_petsc -ksp_type cg -pc_type jacobi -ksp_rtol 1.0e-12 -ksp_max_it 50000 Time in PETSc solver: 4.725237 seconds The number of iteration = 670 The solution residual error = 3.221739e-09 2 norm 4.813996e-04 infinity norm 5.369620e-06 1 norm 1.255338e-01 Application 555708 resources: utime 486, stime 12 hvnguyen:jade20% hvnguyen:jade20% aprun -n 2 ./test_read_petsc -ksp_type cg -pc_type jacobi -ksp_rtol 1.0e-12 -ksp_max_it 50000 -pc_jacobi_rowmax [1]PETSC ERROR: [0]PETSC ERROR: --------------------- Error Message ------------------------------------ --------------------- Error Message ------------------------------------ [1]PETSC ERROR: [0]PETSC ERROR: No support for this operation for this object type! [1]PETSC ERROR: Mat type mpiaij! [1]PETSC ERROR: ------------------------------------------------------------------------ [1]PETSC ERROR: No support for this operation for this object type! [0]PETSC ERROR: Mat type mpiaij! [0]PETSC ERROR: Petsc Release Version 2.3.3, Patch 15, Tue Sep 23 10:02:49 CDT 2008 HG revision: 31306062cd1a6f6a2496fccb4878f485c9b91760------------------------------------- ----------------------------------- [1]PETSC ERROR: See docs/changes/index.html for recent updates. [1]PETSC ERROR: See docs/faq.html for hints about trouble shooting. [1]PETSC ERROR: See docs/index.html for manual pages. From balay at mcs.anl.gov Wed Feb 11 09:56:55 2009 From: balay at mcs.anl.gov (Satish Balay) Date: Wed, 11 Feb 2009 09:56:55 -0600 (CST) Subject: Partitioning In-Reply-To: References: <4992EBD3.3010405@cs.wm.edu> Message-ID: Perhaps you need: http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/DA/DACreate2d.html Satish On Wed, 11 Feb 2009, Matthew Knepley wrote: > I think you want MatPartitioning > > http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/MatOrderings/MatPartitioningCreate.html > > Matt > > On Wed, Feb 11, 2009 at 9:16 AM, Yixun Liu wrote: > > Hi, > > I have 4 processors and I want to distribute the mesh on these four > > processors. For the partial mesh on processor 1, I want its vertex > > number to be in the range, let's say, 0 to 99 and for the mesh on > > processor 2, 100 to 199 etc. Does PETSC provide some routine to do it? > > > > Thanks. > > > > Yixun > > > > > > From knepley at gmail.com Wed Feb 11 10:40:48 2009 From: knepley at gmail.com (Matthew Knepley) Date: Wed, 11 Feb 2009 10:40:48 -0600 Subject: Using -pc_jacobi_rowmax or -pc_jacobi_rowsum In-Reply-To: References: Message-ID: On Wed, Feb 11, 2009 at 9:52 AM, Nguyen, Hung V ERDC-ITL-MS wrote: > All, > > I tried to use the jacobi preconditioner with maximum entry in each row as > the diagonal preconditioner and got the error message below. The matrix was > built with mpiaij type. Does it require different type of matrix? 1) We need the entire error message, which will include a stack trace. 2) What version of PETSc are you running? 3) I cannot reproduce this problem in PETSc 3.0.0 cd $PETSC_DIR/src/ksp/ksp/examples/tutorials make ex2 $MPIEXEC -n 2 ./ex2 -pc_type jacobi -pc_jacobi_rowmax Thanks, Matt > Thank you. > > -Hung > > hvnguyen:jade20% aprun -n 2 ./test_read_petsc -ksp_type cg -pc_type jacobi > -ksp_rtol 1.0e-12 -ksp_max_it 50000 > Time in PETSc solver: 4.725237 seconds > The number of iteration = 670 > The solution residual error = 3.221739e-09 > 2 norm 4.813996e-04 > infinity norm 5.369620e-06 > 1 norm 1.255338e-01 > Application 555708 resources: utime 486, stime 12 > hvnguyen:jade20% > > hvnguyen:jade20% aprun -n 2 ./test_read_petsc -ksp_type cg -pc_type jacobi > -ksp_rtol 1.0e-12 -ksp_max_it 50000 -pc_jacobi_rowmax > [1]PETSC ERROR: [0]PETSC ERROR: --------------------- Error Message > ------------------------------------ > --------------------- Error Message ------------------------------------ > [1]PETSC ERROR: [0]PETSC ERROR: No support for this operation for this object > type! > [1]PETSC ERROR: Mat type mpiaij! > [1]PETSC ERROR: > ------------------------------------------------------------------------ > [1]PETSC ERROR: No support for this operation for this object type! > [0]PETSC ERROR: Mat type mpiaij! > [0]PETSC ERROR: Petsc Release Version 2.3.3, Patch 15, Tue Sep 23 10:02:49 > CDT 2008 HG revision: > 31306062cd1a6f6a2496fccb4878f485c9b91760------------------------------------- > ----------------------------------- > [1]PETSC ERROR: See docs/changes/index.html for recent updates. > [1]PETSC ERROR: See docs/faq.html for hints about trouble shooting. > [1]PETSC ERROR: See docs/index.html for manual pages. > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener From Hung.V.Nguyen at usace.army.mil Wed Feb 11 11:01:49 2009 From: Hung.V.Nguyen at usace.army.mil (Nguyen, Hung V ERDC-ITL-MS) Date: Wed, 11 Feb 2009 11:01:49 -0600 Subject: Using -pc_jacobi_rowmax or -pc_jacobi_rowsum In-Reply-To: References: Message-ID: Hello Mathew, >1) We need the entire error message, which will include a stack trace. The entire error message is the same as running ex2.c in $PETSC_DIR/src/ksp/ksp/examples/tutorials, see below. > 2) What version of PETSc are you running? /usr/local/usp/PETtools/CE/MATH/petsc-2.3.3-p15 >3) I cannot reproduce this problem in PETSc 3.0.0 I can reproduce this problem with PETSc 2.3.3-p15 hvnguyen:jade20% aprun -n 2 ./ex2 -ksp_type cg -pc_type jacobi Norm of error 1.6744e-05 iterations 13 Application 555812 resources: utime 0, stime 5 hvnguyen:jade20% aprun -n 2 ./ex2 -ksp_type cg -pc_type jacobi -pc_jacobi_rowmax [1]PETSC ERROR: [0]PETSC ERROR: --------------------- Error Message ------------------------------------ --------------------- Error Message ------------------------------------ [1]PETSC ERROR: No support for this operation for this object type! [0]PETSC ERROR: [1]PETSC ERROR: Mat type mpiaij! [1]PETSC ERROR: ------------------------------------------------------------------------ [1]PETSC ERROR: Petsc Release Version 2.3.3, Patch 15, Tue Sep 23 10:02:49 CDT 2008 HG revision: 31306062cd1a6f6a2496fccb4878f485c9b91760 [1]PETSC ERROR: See docs/changes/index.html for recent updates. [1]PETSC ERROR: See docs/faq.html for hints about trouble shooting. [1]PETSC ERROR: See docs/index.html for manual pages. [1]PETSC ERROR: ------------------------------------------------------------------------ [1]PETSC ERROR: No support for this operation for this object type! ./ex2 on a CrayXT4-O named nid01795 by Unknown Wed Feb 11 16:57:45 2009 [1]PETSC ERROR: Libraries linked from /usr/local/usp/PETtools/CE/MATH/petsc-2.3.3-p15/lib/CrayXT4-O [1]PETSC ERROR: Configure run at Tue Oct 28 15:32:12 2008 [1]PETSC ERROR: [0]PETSC ERROR: Mat type mpiaij! [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: Petsc Release Version 2.3.3, Patch 15, Tue Sep 23 10:02:49 CDT 2008 HG revision: 31306062cd1a6f6a2496fccb4878f485c9b91760 [0]PETSC ERROR: See docs/changes/index.html for recent updates. [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. [0]PETSC ERROR: See docs/index.html for manual pages. [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: Configure options --with-memcmp-ok --sizeof_char=1 --sizeof_void_p=8 --sizeof_short=2 --sizeof_int=4 --sizeof_long=8 --sizeof_long_long=8 --sizeof_float=4 --sizeof_double=8 --bits_per_byte=8 --sizeof_MPI_Comm=4 --sizeof_MPI_Fint=4 --with-batch=1 --with-fc=ftn --with-cc=cc --with-blas-lib=-lsci --with-lapack-lib=-lsci --with-mpi-dir=/opt/xt-mpt/2.0.49/mpich2-64/P2 --with-mpi-shared=0 --with-shared=0 --with-debugging=0 --with-error-checking=0 -PETSC_ARCH=CrayXT4-O [1]PETSC ERROR: ./ex2 on a CrayXT4-O named nid01795 by Unknown Wed Feb 11 16:57:45 2009 [0]PETSC ERROR: ------------------------------------------------------------------------ [1]PETSC ERROR: Libraries linked from /usr/local/usp/PETtools/CE/MATH/petsc-2.3.3-p15/lib/CrayXT4-O [0]PETSC ERROR: Configure run at Tue Oct 28 15:32:12 2008 [0]PETSC ERROR: aborting job: application called MPI_Abort(MPI_COMM_WORLD, 1) - process 1 aborting job: application called MPI_Abort(MPI_COMM_WORLD, 1) - process 0 MatGetRowMaxAbs() line 3405 in src/mat/interface/matrix.c Configure options --with-memcmp-ok --sizeof_char=1 --sizeof_void_p=8 --sizeof_short=2 --sizeof_int=4 --sizeof_long=8 --sizeof_long_long=8 --sizeof_float=4 --sizeof_double=8 --bits_per_byte=8 --sizeof_MPI_Comm=4 --sizeof_MPI_Fint=4 --with-batch=1 --with-fc=ftn --with-cc=cc --with-blas-lib=-lsci --with-lapack-lib=-lsci --with-mpi-dir=/opt/xt-mpt/2.0.49/mpich2-64/P2 --with-mpi-shared=0 --with-shared=0 --with-debugging=0 --with-error-checking=0 -PETSC_ARCH=CrayXT4-O [0]PETSC ERROR: [1]PETSC ERROR: ------------------------------------------------------------------------ PCSetUp_Jacobi() line 162 in src/ksp/pc/impls/jacobi/jacobi.c [0]PETSC ERROR: [1]PETSC ERROR: MatGetRowMaxAbs() line 3405 in src/mat/interface/matrix.c PCSetUp_Jacobi_NonSymmetric() line 249 in src/ksp/pc/impls/jacobi/jacobi.c [1]PETSC ERROR: [0]PETSC ERROR: PCApply_Jacobi() line 274 in src/ksp/pc/impls/jacobi/jacobi.c PCSetUp_Jacobi() line 162 in src/ksp/pc/impls/jacobi/jacobi.c [1]PETSC ERROR: [0]PETSC ERROR: PCApply() line 356 in src/ksp/pc/interface/precon.c PCSetUp_Jacobi_NonSymmetric() line 249 in src/ksp/pc/impls/jacobi/jacobi.c [1]PETSC ERROR: [0]PETSC ERROR: KSPSolve_CG() line 146 in src/ksp/ksp/impls/cg/cg.c PCApply_Jacobi() line 274 in src/ksp/pc/impls/jacobi/jacobi.c [1]PETSC ERROR: [0]PETSC ERROR: KSPSolve() line 379 in src/ksp/ksp/interface/itfunc.c PCApply() line 356 in src/ksp/pc/interface/precon.c [1]PETSC ERROR: [0]PETSC ERROR: main() line 192 in src/ksp/ksp/examples/tutorials/ex2.c KSPSolve_CG() line 146 in src/ksp/ksp/impls/cg/cg.c [0]PETSC ERROR: KSPSolve() line 379 in src/ksp/ksp/interface/itfunc.c [0]PETSC ERROR: main() line 192 in src/ksp/ksp/examples/tutorials/ex2.c [NID 1795]Apid 555813: initiated application termination Application 555813 exit codes: 1 Application 555813 resources: utime 0, stime 6 hvnguyen:jade20% -----Original Message----- From: petsc-users-bounces at mcs.anl.gov [mailto:petsc-users-bounces at mcs.anl.gov] On Behalf Of Matthew Knepley Sent: Wednesday, February 11, 2009 10:41 AM To: PETSc users list Subject: Re: Using -pc_jacobi_rowmax or -pc_jacobi_rowsum On Wed, Feb 11, 2009 at 9:52 AM, Nguyen, Hung V ERDC-ITL-MS wrote: > All, > > I tried to use the jacobi preconditioner with maximum entry in each > row as the diagonal preconditioner and got the error message below. > The matrix was built with mpiaij type. Does it require different type of matrix? 1) We need the entire error message, which will include a stack trace. 2) What version of PETSc are you running? 3) I cannot reproduce this problem in PETSc 3.0.0 cd $PETSC_DIR/src/ksp/ksp/examples/tutorials make ex2 $MPIEXEC -n 2 ./ex2 -pc_type jacobi -pc_jacobi_rowmax Thanks, Matt > Thank you. > > -Hung > > hvnguyen:jade20% aprun -n 2 ./test_read_petsc -ksp_type cg -pc_type > jacobi -ksp_rtol 1.0e-12 -ksp_max_it 50000 Time in PETSc solver: > 4.725237 seconds > The number of iteration = 670 > The solution residual error = 3.221739e-09 > 2 norm 4.813996e-04 > infinity norm 5.369620e-06 > 1 norm 1.255338e-01 > Application 555708 resources: utime 486, stime 12 hvnguyen:jade20% > > hvnguyen:jade20% aprun -n 2 ./test_read_petsc -ksp_type cg -pc_type > jacobi -ksp_rtol 1.0e-12 -ksp_max_it 50000 -pc_jacobi_rowmax [1]PETSC > ERROR: [0]PETSC ERROR: --------------------- Error Message > ------------------------------------ > --------------------- Error Message > ------------------------------------ > [1]PETSC ERROR: [0]PETSC ERROR: No support for this operation for this > object type! > [1]PETSC ERROR: Mat type mpiaij! > [1]PETSC ERROR: > ---------------------------------------------------------------------- > -- [1]PETSC ERROR: No support for this operation for this object type! > [0]PETSC ERROR: Mat type mpiaij! > [0]PETSC ERROR: Petsc Release Version 2.3.3, Patch 15, Tue Sep 23 > 10:02:49 CDT 2008 HG revision: > 31306062cd1a6f6a2496fccb4878f485c9b91760------------------------------ > ------- > ----------------------------------- > [1]PETSC ERROR: See docs/changes/index.html for recent updates. > [1]PETSC ERROR: See docs/faq.html for hints about trouble shooting. > [1]PETSC ERROR: See docs/index.html for manual pages. > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener From knepley at gmail.com Wed Feb 11 11:06:41 2009 From: knepley at gmail.com (Matthew Knepley) Date: Wed, 11 Feb 2009 11:06:41 -0600 Subject: Using -pc_jacobi_rowmax or -pc_jacobi_rowsum In-Reply-To: References: Message-ID: On Wed, Feb 11, 2009 at 11:01 AM, Nguyen, Hung V ERDC-ITL-MS wrote: > > Hello Mathew, > > >>1) We need the entire error message, which will include a stack trace. > > The entire error message is the same as running ex2.c in > $PETSC_DIR/src/ksp/ksp/examples/tutorials, see below. > >> 2) What version of PETSc are you running? > > /usr/local/usp/PETtools/CE/MATH/petsc-2.3.3-p15 > >>3) I cannot reproduce this problem in PETSc 3.0.0 > > I can reproduce this problem with PETSc 2.3.3-p15 2.3.3 is now nearly 2 years old, and these methods were not implemented. Please upgrade to the latest release, and you will not have this problem. Thanks, Matt -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener From Hung.V.Nguyen at usace.army.mil Wed Feb 11 11:26:16 2009 From: Hung.V.Nguyen at usace.army.mil (Nguyen, Hung V ERDC-ITL-MS) Date: Wed, 11 Feb 2009 11:26:16 -0600 Subject: Using -pc_jacobi_rowmax or -pc_jacobi_rowsum In-Reply-To: References: Message-ID: Hello Matthew, Thanks for the info. I will upgrade to the new PETSc version. -hung -----Original Message----- From: petsc-users-bounces at mcs.anl.gov [mailto:petsc-users-bounces at mcs.anl.gov] On Behalf Of Matthew Knepley Sent: Wednesday, February 11, 2009 11:07 AM To: PETSc users list Subject: Re: Using -pc_jacobi_rowmax or -pc_jacobi_rowsum On Wed, Feb 11, 2009 at 11:01 AM, Nguyen, Hung V ERDC-ITL-MS wrote: > > Hello Mathew, > > >>1) We need the entire error message, which will include a stack trace. > > The entire error message is the same as running ex2.c in > $PETSC_DIR/src/ksp/ksp/examples/tutorials, see below. > >> 2) What version of PETSc are you running? > > /usr/local/usp/PETtools/CE/MATH/petsc-2.3.3-p15 > >>3) I cannot reproduce this problem in PETSc 3.0.0 > > I can reproduce this problem with PETSc 2.3.3-p15 2.3.3 is now nearly 2 years old, and these methods were not implemented. Please upgrade to the latest release, and you will not have this problem. Thanks, Matt -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener From enjoywm at cs.wm.edu Wed Feb 11 13:10:23 2009 From: enjoywm at cs.wm.edu (Yixun Liu) Date: Wed, 11 Feb 2009 14:10:23 -0500 Subject: MatMult Message-ID: <4993229F.9040208@cs.wm.edu> Hi, I saw MatMult() is used in ex2 as, Vec u, b; ierr = MatMult(A,u,b); MatMult is defined as, PetscErrorCode MatMult(Mat mat,Vec x,Vec y) Should be PetscErrorCode MatMult(Mat mat,Vec x,Vec &y)? Thanks. Yixun From knepley at gmail.com Wed Feb 11 13:13:13 2009 From: knepley at gmail.com (Matthew Knepley) Date: Wed, 11 Feb 2009 13:13:13 -0600 Subject: MatMult In-Reply-To: <4993229F.9040208@cs.wm.edu> References: <4993229F.9040208@cs.wm.edu> Message-ID: No, PETSc is all C, so that has no meaning. Matt On Wed, Feb 11, 2009 at 1:10 PM, Yixun Liu wrote: > Hi, > I saw MatMult() is used in ex2 as, > Vec u, b; > ierr = MatMult(A,u,b); > > MatMult is defined as, > PetscErrorCode MatMult(Mat mat,Vec x,Vec y) > > Should be PetscErrorCode MatMult(Mat mat,Vec x,Vec &y)? > > Thanks. > > Yixun > > > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From balay at mcs.anl.gov Wed Feb 11 13:14:03 2009 From: balay at mcs.anl.gov (Satish Balay) Date: Wed, 11 Feb 2009 13:14:03 -0600 (CST) Subject: MatMult In-Reply-To: <4993229F.9040208@cs.wm.edu> References: <4993229F.9040208@cs.wm.edu> Message-ID: On Wed, 11 Feb 2009, Yixun Liu wrote: > Hi, > I saw MatMult() is used in ex2 as, > Vec u, b; > ierr = MatMult(A,u,b); > > MatMult is defined as, > PetscErrorCode MatMult(Mat mat,Vec x,Vec y) > > Should be PetscErrorCode MatMult(Mat mat,Vec x,Vec &y)? Vec is an object - not an array. So the current syntax is correct. You should notice 'VecDuplicate(u,&b);' where the object 'b' gets created. Satish From enjoywm at cs.wm.edu Wed Feb 11 13:46:53 2009 From: enjoywm at cs.wm.edu (Yixun Liu) Date: Wed, 11 Feb 2009 14:46:53 -0500 Subject: KSPSetOperators Message-ID: <49932B2D.70600@cs.wm.edu> Hi, In ksp/ex2.c /* Set operators. Here the matrix that defines the linear system also serves as the preconditioning matrix. */ ierr = KSPSetOperators(ksp,A,A,DIFFERENT_NONZERO_PATTERN);CHKERRQ(ierr); The matrix related with linear system is same with the preconditioning matrix, why set the flat to be DIFFERENT_NONZERO_PATTERN? Thanks. From knepley at gmail.com Wed Feb 11 14:02:51 2009 From: knepley at gmail.com (Matthew Knepley) Date: Wed, 11 Feb 2009 14:02:51 -0600 Subject: KSPSetOperators In-Reply-To: <49932B2D.70600@cs.wm.edu> References: <49932B2D.70600@cs.wm.edu> Message-ID: On Wed, Feb 11, 2009 at 1:46 PM, Yixun Liu wrote: > Hi, > In ksp/ex2.c > > /* > Set operators. Here the matrix that defines the linear system > also serves as the preconditioning matrix. > */ > ierr = KSPSetOperators(ksp,A,A,DIFFERENT_NONZERO_PATTERN);CHKERRQ(ierr); > > The matrix related with linear system is same with the preconditioning > matrix, why set the flat to be DIFFERENT_NONZERO_PATTERN? This flag has to do with whether the PC is reformed. There is a section in the manual on this. Matt > > Thanks. > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From fredrik.bengzon at math.umu.se Wed Feb 11 13:49:47 2009 From: fredrik.bengzon at math.umu.se (Fredrik Bengzon) Date: Wed, 11 Feb 2009 20:49:47 +0100 Subject: range check on VecGetArray Message-ID: <49932BDB.8040504@math.umu.se> Hi, When using VecGetArray(vec, &ptr2vec) on a vector, vec, with ghost nodes, is there a way of getting the size (length) of the ptr2vec array? In other words, how can I avoid out-of-range errors when accessing elements of ptr2vec? Best Regards Fredrik Bengzon, Ume?, Sweden From knepley at gmail.com Wed Feb 11 14:31:39 2009 From: knepley at gmail.com (Matthew Knepley) Date: Wed, 11 Feb 2009 14:31:39 -0600 Subject: range check on VecGetArray In-Reply-To: <49932BDB.8040504@math.umu.se> References: <49932BDB.8040504@math.umu.se> Message-ID: The intention is that you use VecGhostGetLocalForm() first, and then VecGetArray(). That way the size is just the Vec length. Matt On Wed, Feb 11, 2009 at 1:49 PM, Fredrik Bengzon < fredrik.bengzon at math.umu.se> wrote: > Hi, > When using VecGetArray(vec, &ptr2vec) on a vector, vec, with ghost nodes, > is there a way of getting the size (length) of the ptr2vec array? In other > words, how can I avoid out-of-range errors when accessing elements of > ptr2vec? > Best Regards > Fredrik Bengzon, Ume?, Sweden > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From enjoywm at cs.wm.edu Wed Feb 11 15:47:08 2009 From: enjoywm at cs.wm.edu (Yixun Liu) Date: Wed, 11 Feb 2009 16:47:08 -0500 Subject: preallocate space Message-ID: <4993475C.60607@cs.wm.edu> Hi, In ex2, ierr = MatMPIAIJSetPreallocation(A,5,PETSC_NULL,5,PETSC_NULL);CHKERRQ(ierr); ierr = MatSeqAIJSetPreallocation(A,5,PETSC_NULL);CHKERRQ(ierr); It means that two spaces are allocated for matrix A? Thanks. From knepley at gmail.com Wed Feb 11 15:51:51 2009 From: knepley at gmail.com (Matthew Knepley) Date: Wed, 11 Feb 2009 15:51:51 -0600 Subject: preallocate space In-Reply-To: <4993475C.60607@cs.wm.edu> References: <4993475C.60607@cs.wm.edu> Message-ID: No only the one that matches the Mat type. Matt On Wed, Feb 11, 2009 at 3:47 PM, Yixun Liu wrote: > Hi, > In ex2, > ierr = > MatMPIAIJSetPreallocation(A,5,PETSC_NULL,5,PETSC_NULL);CHKERRQ(ierr); > ierr = MatSeqAIJSetPreallocation(A,5,PETSC_NULL);CHKERRQ(ierr); > > It means that two spaces are allocated for matrix A? > > Thanks. > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From bsmith at mcs.anl.gov Wed Feb 11 16:13:16 2009 From: bsmith at mcs.anl.gov (Barry Smith) Date: Wed, 11 Feb 2009 16:13:16 -0600 Subject: Partitioning In-Reply-To: <4992EBD3.3010405@cs.wm.edu> References: <4992EBD3.3010405@cs.wm.edu> Message-ID: It is very unclear what you want. Unless you are using PETSc's Sieve software, we do not provide any mesh management software. So we cannot simply "distribute a mesh on these four processes " Barry On Feb 11, 2009, at 9:16 AM, Yixun Liu wrote: > Hi, > I have 4 processors and I want to distribute the mesh on these four > processors. For the partial mesh on processor 1, I want its vertex > number to be in the range, let's say, 0 to 99 and for the mesh on > processor 2, 100 to 199 etc. Does PETSC provide some routine to do it? > > Thanks. > > Yixun From enjoywm at cs.wm.edu Wed Feb 11 19:56:34 2009 From: enjoywm at cs.wm.edu (Yixun Liu) Date: Wed, 11 Feb 2009 20:56:34 -0500 Subject: link error Message-ID: <499381D2.9090709@cs.wm.edu> Hi, I compile petsc successfully, but when I run a simple petsc example, some errors appear. It seems that I miss x11 lib. /home/scratch/yixun/petsc-3.0.0-p3/linux-gnu-c-debug/lib/libpetsc.a(xops.o): In function `PetscDrawLine_X': /home/scratch/yixun/petsc-3.0.0-p3/src/sys/draw/impls/x/xops.c:29: undefined reference to `XSetForeground' /home/scratch/yixun/petsc-3.0.0-p3/src/sys/draw/impls/x/xops.c:32: undefined reference to `XDrawLine' /home/scratch/yixun/petsc-3.0.0-p3/linux-gnu-c-debug/lib/libpetsc.a(xops.o): In function `PetscDrawPoint_X': /home/scratch/yixun/petsc-3.0.0-p3/src/sys/draw/impls/x/xops.c:45: undefined reference to `XSetForeground' /home/scratch/yixun/petsc-3.0.0-p3/src/sys/draw/impls/x/xops.c:46: undefined reference to `XDrawPoint' Thanks. From balay at mcs.anl.gov Wed Feb 11 20:28:34 2009 From: balay at mcs.anl.gov (Satish Balay) Date: Wed, 11 Feb 2009 20:28:34 -0600 (CST) Subject: link error In-Reply-To: <499381D2.9090709@cs.wm.edu> References: <499381D2.9090709@cs.wm.edu> Message-ID: This truncated message is not useful... Please send complete compile commands - when encountering compile errors. Which PETSc example is this? Are you using a PETSc makefile? Satish On Wed, 11 Feb 2009, Yixun Liu wrote: > Hi, > I compile petsc successfully, but when I run a simple petsc example, > some errors appear. It seems that I miss x11 lib. > > /home/scratch/yixun/petsc-3.0.0-p3/linux-gnu-c-debug/lib/libpetsc.a(xops.o): > In function `PetscDrawLine_X': > /home/scratch/yixun/petsc-3.0.0-p3/src/sys/draw/impls/x/xops.c:29: > undefined reference to `XSetForeground' > /home/scratch/yixun/petsc-3.0.0-p3/src/sys/draw/impls/x/xops.c:32: > undefined reference to `XDrawLine' > /home/scratch/yixun/petsc-3.0.0-p3/linux-gnu-c-debug/lib/libpetsc.a(xops.o): > In function `PetscDrawPoint_X': > /home/scratch/yixun/petsc-3.0.0-p3/src/sys/draw/impls/x/xops.c:45: > undefined reference to `XSetForeground' > /home/scratch/yixun/petsc-3.0.0-p3/src/sys/draw/impls/x/xops.c:46: > undefined reference to `XDrawPoint' > > > Thanks. > From enjoywm at cs.wm.edu Wed Feb 11 20:57:05 2009 From: enjoywm at cs.wm.edu (Yixun Liu) Date: Wed, 11 Feb 2009 21:57:05 -0500 Subject: link error In-Reply-To: References: <499381D2.9090709@cs.wm.edu> Message-ID: <49939001.2020008@cs.wm.edu> Satish Balay wrote: > This truncated message is not useful... Please send complete compile > commands - when encountering compile errors. > > Which PETSc example is this? Are you using a PETSc makefile? > > Satish > > On Wed, 11 Feb 2009, Yixun Liu wrote: > > >> Hi, >> I compile petsc successfully, but when I run a simple petsc example, >> some errors appear. It seems that I miss x11 lib. >> >> /home/scratch/yixun/petsc-3.0.0-p3/linux-gnu-c-debug/lib/libpetsc.a(xops.o): >> In function `PetscDrawLine_X': >> /home/scratch/yixun/petsc-3.0.0-p3/src/sys/draw/impls/x/xops.c:29: >> undefined reference to `XSetForeground' >> /home/scratch/yixun/petsc-3.0.0-p3/src/sys/draw/impls/x/xops.c:32: >> undefined reference to `XDrawLine' >> /home/scratch/yixun/petsc-3.0.0-p3/linux-gnu-c-debug/lib/libpetsc.a(xops.o): >> In function `PetscDrawPoint_X': >> /home/scratch/yixun/petsc-3.0.0-p3/src/sys/draw/impls/x/xops.c:45: >> undefined reference to `XSetForeground' >> /home/scratch/yixun/petsc-3.0.0-p3/src/sys/draw/impls/x/xops.c:46: >> undefined reference to `XDrawPoint' >> >> >> Thanks. >> >> > I can successfully compile the example with PETSC makefile. However, I need integrate PETSC into an existing application, which use CMake to generate makefile. I add the following into CMakelist.txt and use CMake to generate makefile and then make. > #---------- # PETSc #---------- SET(PETSC_DIR /home/scratch/yixun/petsc-3.0.0-p3) SET(PETSC_ARCH /linux-gnu-c-debug) SET(X11_DIR /usr/X11R6) SET(PETSC_INCLUDE_DIR ${PETSC_DIR}/include ${PETSC_DIR}/${PETSC_ARCH}/include) SET(PETSC_LIB_DIR ${PETSC_DIR}/${PETSC_ARCH}/lib ${X11_DIR}/lib64 ${X11_DIR}/lib/X11) Thanks. From balay at mcs.anl.gov Wed Feb 11 22:35:53 2009 From: balay at mcs.anl.gov (Satish Balay) Date: Wed, 11 Feb 2009 22:35:53 -0600 (CST) Subject: link error In-Reply-To: <49939001.2020008@cs.wm.edu> References: <499381D2.9090709@cs.wm.edu> <49939001.2020008@cs.wm.edu> Message-ID: Don't know cmake. You'll have to make sure 'all' compiler options used to compile the PETSc example are also used in your build system. If you miss something - you'll have to go back - and add it in. So: - look at the make output of compiling a PETSc example - look at the make output from compiling your code. - look for whats missing - and add it to your cmake stuff.. [most likely you are missing "-lX11" at link time.] Satish On Wed, 11 Feb 2009, Yixun Liu wrote: > I can successfully compile the example with PETSC > makefile. However, I need integrate PETSC into an existing > application, which use CMake to generate makefile. I add the > following into CMakelist.txt and use CMake to generate makefile and > then make. > #---------- > # PETSc > #---------- > SET(PETSC_DIR /home/scratch/yixun/petsc-3.0.0-p3) > SET(PETSC_ARCH /linux-gnu-c-debug) > SET(X11_DIR /usr/X11R6) > SET(PETSC_INCLUDE_DIR ${PETSC_DIR}/include > ${PETSC_DIR}/${PETSC_ARCH}/include) > SET(PETSC_LIB_DIR ${PETSC_DIR}/${PETSC_ARCH}/lib ${X11_DIR}/lib64 > ${X11_DIR}/lib/X11) From jed at 59A2.org Thu Feb 12 02:34:14 2009 From: jed at 59A2.org (Jed Brown) Date: Thu, 12 Feb 2009 09:34:14 +0100 Subject: link error In-Reply-To: References: <499381D2.9090709@cs.wm.edu> <49939001.2020008@cs.wm.edu> Message-ID: <20090212083414.GD3781@brakk.ethz.ch> On Wed 2009-02-11 22:35, Satish Balay wrote: > Don't know cmake. > > You'll have to make sure 'all' compiler options used to compile the > PETSc example are also used in your build system. If you miss > something - you'll have to go back - and add it in. > > So: > > - look at the make output of compiling a PETSc example > - look at the make output from compiling your code. > - look for whats missing - and add it to your cmake stuff.. Yixun, please have a look at my FindPETSc.cmake module at http://github.com/jedbrown/cmake-modules It should do the right thing with both shared and static libs. Let me know if you have any trouble with it. Jed -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: not available URL: From enjoywm at cs.wm.edu Thu Feb 12 08:00:13 2009 From: enjoywm at cs.wm.edu (Yixun Liu) Date: Thu, 12 Feb 2009 09:00:13 -0500 Subject: link error In-Reply-To: <20090212083414.GD3781@brakk.ethz.ch> References: <499381D2.9090709@cs.wm.edu> <49939001.2020008@cs.wm.edu> <20090212083414.GD3781@brakk.ethz.ch> Message-ID: <49942B6D.6040901@cs.wm.edu> Jed Brown wrote: > On Wed 2009-02-11 22:35, Satish Balay wrote: > >> Don't know cmake. >> >> You'll have to make sure 'all' compiler options used to compile the >> PETSc example are also used in your build system. If you miss >> something - you'll have to go back - and add it in. >> >> So: >> >> - look at the make output of compiling a PETSc example >> - look at the make output from compiling your code. >> - look for whats missing - and add it to your cmake stuff.. >> > > Yixun, please have a look at my FindPETSc.cmake module at > > http://github.com/jedbrown/cmake-modules > > It should do the right thing with both shared and static libs. Let me > know if you have any trouble with it. > > Jed > Thanks. Satish's method works. I add X11 to CMakeList.txt and it is ok. I also want to try Jed's method to simplify the configuration. I download FindPetsc.cmake and I think I need add something like, FIND_PACKAGE (PETSC) into CMakeList. Right? Q1. Where should I put FindPetsc.cmake? Q2. in my application there are a lot of CMakeList.txt distributed in different directories. Which one should I use? From stm-direct_reply at pvv.org Thu Feb 12 08:28:27 2009 From: stm-direct_reply at pvv.org (Svend Tollak Munkejord) Date: Thu, 12 Feb 2009 15:28:27 +0100 Subject: How to use PETSc with sunf90? Message-ID: Hi, I am trying to use petsc-3.0.0-p3 with the Sunstudio 12 Fortran compiler. Everything worked until "make test". Then the linker complained about unknown options. Does anyone know how to make this work? Here's my configure command (all on one line): ./config/configure.py --with-cc=gcc --with-fc=sunf90 --with-petsc-arch=sunf90-optim --with-debugging=no --download-mpich=1 --download-f-blas-lapack=1 --download-hypre=1 "make all" worked fine, but "make test" said: --------------Error detected during compile or link!----------------------- [...] /home/vsl184/tmp/petsc/petsc-3.0.0-p3/sunf90-optim/bin/mpif90 -O -o ex5f ex5f.o -Wl,-rpath,/home/vsl184/tmp/petsc/petsc-3.0.0-p3/sunf90-optim/lib -L/home/vsl184/tmp/petsc/petsc-3.0.0-p3/sunf90-optim/lib -lpetscsnes -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetsc -lX11 -Wl,-rpath,/home/vsl184/tmp/petsc/petsc-3.0.0-p3/sunf90-optim/lib -L/home/vsl184/tmp/petsc/petsc-3.0.0-p3/sunf90-optim/lib -lHYPRE -lmpichcxx -lstdc++ -lflapack -lfblas -lnsl -laio -lrt -L/home/vsl184/tmp/petsc/petsc-3.0.0-p3/sunf90-optim/lib -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2 -L/usr/lib64 -L/lib64 -L/usr/x86_64-suse-linux/lib -ldl -lmpich -lpthread -lrt -lgcc_s -lmpichf90 -L/usr/local/linux/intel/fc_81_ia32/lib -L/usr/local/qwt/lib -L/home/vsl184/a/svendm/workdir/plot_on_runtime/lib -Wl,-rpath,/usr/local/sun/sunstudio12/lib/amd64:/opt/sun/sunstudio12/lib/amd64:/usr/local/sun/lib/rtlibs/amd64:/opt/sun/lib/rtlibs/amd64 -L/usr/local/sun/sunstudio12/lib/amd64 -L/usr/local/sun/sunstudio12/rtlibs/amd64 -L/usr/local/sun/sunstudio12/prod/lib/amd64 -lfui -lfai -lfsu -lmtsk -lm -Wl,-rpath,/usr/local/sun/sunstudio12/prod/lib/amd64 -lc_supp -lmpichcxx -lstdc++ -lmpichcxx -lstdc++ -ldl -lmpich -lpthread -lrt -lgcc_s -ldl sunf90: Warning: Option -Wl,-rpath,/home/vsl184/tmp/petsc/petsc-3.0.0-p3/sunf90-optim/lib passed to ld, if ld is invoked, ignored otherwise [...] /usr/bin/ld: unrecognized option '-Wl,-rpath,/home/vsl184/tmp/petsc/petsc-3.0.0-p3/sunf90-optim/lib' /usr/bin/ld: use the --help option for usage information This is on an Opteron machine running Opensuse 10.2. I get the same message on a Centrino laptop running Opensuse 11.1. I can use gfortran, but I would also like to try sunf90, because in some cases, sunf90 has produced faster-running code (i.e., when not using PETSc). Thanks, -- Svend Tollak Munkejord From balay at mcs.anl.gov Thu Feb 12 08:54:55 2009 From: balay at mcs.anl.gov (Satish Balay) Date: Thu, 12 Feb 2009 08:54:55 -0600 (CST) Subject: How to use PETSc with sunf90? In-Reply-To: References: Message-ID: For one -it looks like its just a warning - so it can be ignored. [or you can manually edit petsc-3.0.0-p3/sunf90-optim/conf/petscvariables - and remove the option causing this warning] But ideally - you should be using '--with-cc=suncc --wth-cxx=sunCC' with sunf90 [not gcc/g++]. Satish On Thu, 12 Feb 2009, Svend Tollak Munkejord wrote: > Hi, > > I am trying to use petsc-3.0.0-p3 with the Sunstudio 12 Fortran > compiler. Everything worked until "make test". Then the linker > complained about unknown options. Does anyone know how to make this > work? > > Here's my configure command (all on one line): > > ./config/configure.py --with-cc=gcc --with-fc=sunf90 --with-petsc-arch=sunf90-optim --with-debugging=no --download-mpich=1 --download-f-blas-lapack=1 --download-hypre=1 > > "make all" worked fine, but "make test" said: > > --------------Error detected during compile or link!----------------------- > [...] > > /home/vsl184/tmp/petsc/petsc-3.0.0-p3/sunf90-optim/bin/mpif90 -O -o ex5f ex5f.o -Wl,-rpath,/home/vsl184/tmp/petsc/petsc-3.0.0-p3/sunf90-optim/lib -L/home/vsl184/tmp/petsc/petsc-3.0.0-p3/sunf90-optim/lib -lpetscsnes -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetsc -lX11 -Wl,-rpath,/home/vsl184/tmp/petsc/petsc-3.0.0-p3/sunf90-optim/lib -L/home/vsl184/tmp/petsc/petsc-3.0.0-p3/sunf90-optim/lib -lHYPRE -lmpichcxx -lstdc++ -lflapack -lfblas -lnsl -laio -lrt -L/home/vsl184/tmp/petsc/petsc-3.0.0-p3/sunf90-optim/lib -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2 -L/usr/lib64 -L/lib64 -L/usr/x86_64-suse-linux/lib -ldl -lmpich -lpthread -lrt -lgcc_s -lmpichf90 -L/usr/local/linux/intel/fc_81_ia32/lib -L/usr/local/qwt/lib -L/home/vsl184/a/svendm/workdir/plot_on_runtime/lib -Wl,-rpath,/usr/local/sun/sunstudio12/lib/amd64:/opt/sun/sunstudio12/lib/amd64:/usr/local/sun/lib/rtlibs/amd64:/opt/sun/lib/rtlibs/amd64 -L/usr/local/sun/sunstudio12/lib/amd64 -L/usr/local/sun/sunstudio12/rtlibs/amd64 -L/usr/local/sun/sunstudio12/prod/lib/amd64 -lfui -lfai -lfsu -lmtsk -lm -Wl,-rpath,/usr/local/sun/sunstudio12/prod/lib/amd64 -lc_supp -lmpichcxx -lstdc++ -lmpichcxx -lstdc++ -ldl -lmpich -lpthread -lrt -lgcc_s -ldl > sunf90: Warning: Option -Wl,-rpath,/home/vsl184/tmp/petsc/petsc-3.0.0-p3/sunf90-optim/lib passed to ld, if ld is invoked, ignored otherwise > > [...] > > /usr/bin/ld: unrecognized option '-Wl,-rpath,/home/vsl184/tmp/petsc/petsc-3.0.0-p3/sunf90-optim/lib' > /usr/bin/ld: use the --help option for usage information > > This is on an Opteron machine running Opensuse 10.2. I get the same > message on a Centrino laptop running Opensuse 11.1. > > I can use gfortran, but I would also like to try sunf90, because in > some cases, sunf90 has produced faster-running code (i.e., when not > using PETSc). > > Thanks, > From stm-direct_reply at pvv.org Thu Feb 12 09:41:32 2009 From: stm-direct_reply at pvv.org (Svend Tollak Munkejord) Date: Thu, 12 Feb 2009 16:41:32 +0100 Subject: How to use PETSc with sunf90? In-Reply-To: (Satish Balay's message of "Thu, 12 Feb 2009 08:54:55 -0600 (CST)") References: Message-ID: Hi, Thanks for the quick answer On 2009-02-12, Satish Balay wrote: > For one -it looks like its just a warning - so it can be ignored. The one from sunf90 is a warning, but I think the one from ld is an error (even if it doesn't say "errror"); my program isn't linked. > [or > you can manually edit petsc-3.0.0-p3/sunf90-optim/conf/petscvariables > - and remove the option causing this warning] Ah, that worked. Thank you! > But ideally - you should be using '--with-cc=suncc --wth-cxx=sunCC' > with sunf90 [not gcc/g++]. I agree, but this gives: ********************************************************************************* UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for details): --------------------------------------------------------------------------------------- C++ compiler you provided with -with-cxx=sunCC does not work ********************************************************************************* configure.log contains things like Possible ERROR while running linker: /usr/lib64/libm.so: file not recognized: File format not recognized and I don't know how to fix it. I could send you the configure.log if you like. Thanks, -- Svend Tollak Munkejord From balay at mcs.anl.gov Thu Feb 12 09:53:15 2009 From: balay at mcs.anl.gov (Satish Balay) Date: Thu, 12 Feb 2009 09:53:15 -0600 (CST) Subject: How to use PETSc with sunf90? In-Reply-To: References: Message-ID: On Thu, 12 Feb 2009, Svend Tollak Munkejord wrote: > > > But ideally - you should be using '--with-cc=suncc --wth-cxx=sunCC' > > with sunf90 [not gcc/g++]. > > I agree, but this gives: > > ********************************************************************************* > UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for details): > --------------------------------------------------------------------------------------- > C++ compiler you provided with -with-cxx=sunCC does not work > ********************************************************************************* > > configure.log contains things like > > Possible ERROR while running linker: /usr/lib64/libm.so: file not recognized: File format not recognized > > and I don't know how to fix it. I could send you the configure.log if > you like. Hmm - sometimes sun compilers require the static libm - so the following additional option might work. '--LIBS=/usr/lib64/libm.a'. Otherwise - send us configure.log at petsc-maint at mcs.anl.gov Another note: we always recommend debug build of PETSc for development. One should worry about optimized/performance builds - only after developmenet is done and when performance numbers are captured [perhaps for publishing]. Satish From balay at mcs.anl.gov Thu Feb 12 10:03:27 2009 From: balay at mcs.anl.gov (Satish Balay) Date: Thu, 12 Feb 2009 10:03:27 -0600 (CST) Subject: About the bug problem In-Reply-To: <5ee7644a0902120738l3eef0508h29a3cce3da4b0585@mail.gmail.com> References: <5ee7644a0902120738l3eef0508h29a3cce3da4b0585@mail.gmail.com> Message-ID: >>>>> Configure Options: --configModules=PETSc.Configure --optionsModule=PETSc.compilerOptions --with-cc=gcc --with-fc=gfortran --with-cxx=g++ --with-mpi=0 --with-x=0 --with-clanguage=cxx --with-shared=1 --with-dynamic=1 PETSC_ARCH=x86_64_linux_node2 <<<<<< We don't won't to flood mailing lists with huge attachments - so emails with configure.log attachments will be blocked. [petsc-maint would be the correct place for such e-mails]. In your case - if the code runs fine in debugger - but not directly - it could mean some random memory corruption error. Sugest using valgrind to narrow down the problem. i.e valgrind --tool=memcheck -q binary Satish On Thu, 12 Feb 2009, Wei-Dong Lian wrote: > Hello everyone, > I am new for petsc. Thanks a lot for everyone working on petsc. It is really > powerful and stable. > I met a problem in using petsc. Below are the error information. But when I > run this program under gdb degbuger, it worked. and the results are OK. > I am attaching the configure.log and make.log of petsc. > Can anyone give me some suggestions, I will be appreciated. > Thanks a lot. > > [0]PETSC ERROR: > ------------------------------------------------------------------------ > [0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, > probably memory access out of range > [0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger > [0]PETSC ERROR: or see > http://www.mcs.anl.gov/petsc/petsc-as/documentation/troubleshooting.html#Signal[0]PETSCERROR: > or try > http://valgrind.org on linux or man libgmalloc on Apple to find memory > corruption errors > [0]PETSC ERROR: likely location of problem given in stack below > [0]PETSC ERROR: --------------------- Stack Frames > ------------------------------------ > [0]PETSC ERROR: Note: The EXACT line numbers in the stack are not available, > [0]PETSC ERROR: INSTEAD the line number of the start of the function > [0]PETSC ERROR: is given. > [0]PETSC ERROR: --------------------- Error Message > ------------------------------------ > [0]PETSC ERROR: Signal received! > [0]PETSC ERROR: > ------------------------------------------------------------------------ > [0]PETSC ERROR: Petsc Release Version 3.0.0, Patch 3, Fri Jan 30 17:55:56 > CST 2009 > [0]PETSC ERROR: See docs/changes/index.html for recent updates. > [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. > [0]PETSC ERROR: See docs/index.html for manual pages. > [0]PETSC ERROR: > ------------------------------------------------------------------------ > [0]PETSC ERROR: ./main on a x86_64_li named node2.alineos.net by lian Thu > Feb 12 16:23:38 2009 > [0]PETSC ERROR: Libraries linked from > /glouton/struct/lian/develop-64/Solver/petscSeq/x86_64_linux_node2/lib > [0]PETSC ERROR: Configure run at Thu Feb 12 11:20:04 2009 > [0]PETSC ERROR: Configure options --with-cc=gcc --with-fc=gfortran > --with-cxx=g++ --with-mpi=0 --with-x=0 --with-clanguage=cxx --with-shared=1 > --with-dynamic=1 PETSC_ARCH=x86_64_linux_node2 > [0]PETSC ERROR: > ------------------------------------------------------------------------ > [0]PETSC ERROR: User provided function() line 0 in unknown directory unknown > file > /bin/sh: line 1: 27527 Aborted ./main data/main.dat > From xy2102 at columbia.edu Thu Feb 12 11:44:33 2009 From: xy2102 at columbia.edu ((Rebecca) Xuefei YUAN) Date: Thu, 12 Feb 2009 12:44:33 -0500 Subject: DACreate2d() and DAGetMatrix() In-Reply-To: References: <7ff0ee010901060952x36351800n2320e1b07bfaa97e@mail.gmail.com> <7ff0ee010901061143r644dc28ave81735eceba6bfc8@mail.gmail.com> <7ff0ee010901061155n1eb38558y1a7813da6e95d00b@mail.gmail.com> <0B98A1F4-78E4-4A21-8535-F60BE994308B@mcs.anl.gov> <20090106174416.yz475c4ow0g04g8o@cubmail.cc.columbia.edu> <36CE42C4-4397-494F-9F3F-8833A96CD254@mcs.anl.gov> <20090106192826.u6ly4uajsokc8gck@cubmail.cc.columbia.edu> Message-ID: <20090212124433.di2ayi7r4408co88@cubmail.cc.columbia.edu> Hi, I use the following set of codes to create the jacobian matrix, however, the dimensions of jacobian becomes 3 (dim=3) although I use DACreate2d to create this da. I wanna know where is wrong? ierr = DMMGCreate(comm, 1, &appCtx, &dmmg);CHKERRQ(ierr); ierr = DACreate2d(comm,DA_XPERIODIC,DA_STENCIL_STAR, -5, -5, PETSC_DECIDE, PETSC_DECIDE, 4, 2, 0, 0, &da);CHKERRQ(ierr); ierr = DMMGSetDM(dmmg, (DM)da);CHKERRQ(ierr); ierr = DAGetMatrix(DMMGGetDA(dmmg), MATAIJ, &jacobian);CHKERRQ(ierr); Thanks very much! Rebecca From bsmith at mcs.anl.gov Thu Feb 12 11:52:04 2009 From: bsmith at mcs.anl.gov (Barry Smith) Date: Thu, 12 Feb 2009 11:52:04 -0600 Subject: DACreate2d() and DAGetMatrix() In-Reply-To: <20090212124433.di2ayi7r4408co88@cubmail.cc.columbia.edu> References: <7ff0ee010901060952x36351800n2320e1b07bfaa97e@mail.gmail.com> <7ff0ee010901061143r644dc28ave81735eceba6bfc8@mail.gmail.com> <7ff0ee010901061155n1eb38558y1a7813da6e95d00b@mail.gmail.com> <0B98A1F4-78E4-4A21-8535-F60BE994308B@mcs.anl.gov> <20090106174416.yz475c4ow0g04g8o@cubmail.cc.columbia.edu> <36CE42C4-4397-494F-9F3F-8833A96CD254@mcs.anl.gov> <20090106192826.u6ly4uajsokc8gck@cubmail.cc.columbia.edu> <20090212124433.di2ayi7r4408co88@cubmail.cc.columbia.edu> Message-ID: <5371BEBD-3CFA-405B-8B75-25B3F93EF8F7@mcs.anl.gov> The dof argument to DACreate2d() is greater than 1. Thus the "dimension" that is associated with the matrix is 3 dimensions. Is this causing a problem? Barry Note: the "dimension" of the matrix affects the MatSetValuesStencil() but not much else I can think of; On Feb 12, 2009, at 11:44 AM, (Rebecca) Xuefei YUAN wrote: > Hi, > > I use the following set of codes to create the jacobian matrix, > however, the dimensions of jacobian becomes 3 (dim=3) although I use > DACreate2d to create this da. I wanna know where is wrong? > > ierr = DMMGCreate(comm, 1, &appCtx, &dmmg);CHKERRQ(ierr); > ierr = DACreate2d(comm,DA_XPERIODIC,DA_STENCIL_STAR, -5, -5, > PETSC_DECIDE, PETSC_DECIDE, 4, 2, 0, 0, &da);CHKERRQ(ierr); > ierr = DMMGSetDM(dmmg, (DM)da);CHKERRQ(ierr); > ierr = DAGetMatrix(DMMGGetDA(dmmg), MATAIJ, &jacobian);CHKERRQ(ierr); > > Thanks very much! > > Rebecca From balay at mcs.anl.gov Thu Feb 12 11:57:08 2009 From: balay at mcs.anl.gov (Satish Balay) Date: Thu, 12 Feb 2009 11:57:08 -0600 (CST) Subject: How to use PETSc with sunf90? In-Reply-To: References: Message-ID: On Thu, 12 Feb 2009, Satish Balay wrote: > On Thu, 12 Feb 2009, Svend Tollak Munkejord wrote: > > > > > > But ideally - you should be using '--with-cc=suncc --wth-cxx=sunCC' > > > with sunf90 [not gcc/g++]. > > > > I agree, but this gives: > > > > ********************************************************************************* > > UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for details): > > --------------------------------------------------------------------------------------- > > C++ compiler you provided with -with-cxx=sunCC does not work > > ********************************************************************************* > > > > configure.log contains things like > > > > Possible ERROR while running linker: /usr/lib64/libm.so: file not recognized: File format not recognized Looks like sunCC is broken. [it can't compile a simple test code]. This c++ dependency is from hypre.. Satish From fredrik.bengzon at math.umu.se Thu Feb 12 11:57:32 2009 From: fredrik.bengzon at math.umu.se (Fredrik Bengzon) Date: Thu, 12 Feb 2009 18:57:32 +0100 Subject: A question about VecSet Message-ID: <4994630C.3000703@math.umu.se> Hi, I would like to know if I need to call VecGhostUpdateBegin\End on a vector with ghost nodes after a call to VecSet on the same vector, i.e., // Declare vector v with VecCreateGhost etc. VecSet(v, 0.0); // Does this set also ghosted entries to zero ? VecGhostUpdateBegin(v, INSERT_VALUES, SCATTER_FORWARD); // Is this necessary ? VecGhostUpdateEnd (v, INSERT_VALUES, SCATTER_FORWARD); Sincerely, Fredrik Bengzon From bsmith at mcs.anl.gov Thu Feb 12 12:06:50 2009 From: bsmith at mcs.anl.gov (Barry Smith) Date: Thu, 12 Feb 2009 12:06:50 -0600 Subject: A question about VecSet In-Reply-To: <4994630C.3000703@math.umu.se> References: <4994630C.3000703@math.umu.se> Message-ID: <7A08CD6E-8D25-4047-8B92-0E0181DD3733@mcs.anl.gov> On Feb 12, 2009, at 11:57 AM, Fredrik Bengzon wrote: > Hi, > I would like to know if I need to call VecGhostUpdateBegin\End on a > vector with ghost nodes after a call to VecSet on the same vector, > i.e., > > // Declare vector v with VecCreateGhost etc. > > VecSet(v, 0.0); // Does this set also ghosted entries to zero ? VecSet() zeros the VECTOR it is passed in. So if v is obtained from VecCreateGhost() then the "extra" ghost values are NOT zeroed (since those are not part of the global vector). If v was obtained with VecGhostGetLocalForm() then it has the "extra" ghost values and everything is zeroed. If you want to monkey with the ghost locations then you should use the local form. > > > VecGhostUpdateBegin(v, INSERT_VALUES, SCATTER_FORWARD); // Is this > necessary ? > VecGhostUpdateEnd (v, INSERT_VALUES, SCATTER_FORWARD); You would not want to to do this (requires extra communication). You instead would call VecSet() on the local form. Barry > > > Sincerely, > > Fredrik Bengzon From xy2102 at columbia.edu Thu Feb 12 14:53:13 2009 From: xy2102 at columbia.edu ((Rebecca) Xuefei YUAN) Date: Thu, 12 Feb 2009 15:53:13 -0500 Subject: DACreate2d() and DAGetMatrix() In-Reply-To: <20090212141613.fp2pstthmsccw4gc@cubmail.cc.columbia.edu> References: <7ff0ee010901060952x36351800n2320e1b07bfaa97e@mail.gmail.com> <7ff0ee010901061143r644dc28ave81735eceba6bfc8@mail.gmail.com> <7ff0ee010901061155n1eb38558y1a7813da6e95d00b@mail.gmail.com> <0B98A1F4-78E4-4A21-8535-F60BE994308B@mcs.anl.gov> <20090106174416.yz475c4ow0g04g8o@cubmail.cc.columbia.edu> <36CE42C4-4397-494F-9F3F-8833A96CD254@mcs.anl.gov> <20090106192826.u6ly4uajsokc8gck@cubmail.cc.columbia.edu> <20090212124433.di2ayi7r4408co88@cubmail.cc.columbia.edu> <5371BEBD-3CFA-405B-8B75-25B3F93EF8F7@mcs.anl.gov> <20090212140830.dr5xpk4sk08k8k4g@cubmail.cc.columbia.edu> <20090212141613.fp2pstthmsccw4gc@cubmail.cc.columbia.edu> Message-ID: <20090212155313.ij1sbn83k4g0cskk@cubmail.cc.columbia.edu> I check the matrix.c and find that the x,y,z direction has been reversed as in line 1249-1252 in MatSetStencil(), can I get to know why we do this? Thanks. 1249: for (i=0; istencil.dims[i] = dims[dim-i-1]; /* copy the values in backwards */ 1251: mat->stencil.starts[i] = starts[dim-i-1]; 1252: } Quoting "(Rebecca) Xuefei YUAN" : > I think the dims should be {9,5,4,0} if it is Xperiodic, and should be > {5,9,4,0} if it is Yperiodic. Am I right? > > Thanks, > > Rebecca > > > Quoting "(Rebecca) Xuefei YUAN" : > >> If I have -da_grid_x 5 -da_grid_y 5 -dmmg_nlevels 1 and the DA and >> jacobian like: >>>> ierr = DMMGCreate(comm, 1, &appCtx, &dmmg);CHKERRQ(ierr); >>>> ierr = DACreate2d(comm,DA_XPERIODIC,DA_STENCIL_STAR, -5, -5, >>>> PETSC_DECIDE, PETSC_DECIDE, 4, 2, 0, 0, &da);CHKERRQ(ierr); >>>> ierr = DMMGSetDM(dmmg, (DM)da);CHKERRQ(ierr); >>>> ierr = DAGetMatrix(DMMGGetDA(dmmg), MATAIJ, &jacobian);CHKERRQ(ierr); >> >> will that be right if I have jacobian->stencil.dims ={5, 9, 4, 0}? >> >> Thanks, >> >> Rebecca >> >> >> >> Quoting Barry Smith : >> >>> >>> The dof argument to DACreate2d() is greater than 1. Thus the >>> "dimension" that is associated with the matrix is 3 dimensions. Is >>> this causing a problem? >>> >>> >>> Barry >>> >>> Note: the "dimension" of the matrix affects the MatSetValuesStencil() >>> but not much else I can think of; >>> >>> >>> On Feb 12, 2009, at 11:44 AM, (Rebecca) Xuefei YUAN wrote: >>> >>>> Hi, >>>> >>>> I use the following set of codes to create the jacobian matrix, >>>> however, the dimensions of jacobian becomes 3 (dim=3) although I >>>> use DACreate2d to create this da. I wanna know where is wrong? >>>> >>>> ierr = DMMGCreate(comm, 1, &appCtx, &dmmg);CHKERRQ(ierr); >>>> ierr = DACreate2d(comm,DA_XPERIODIC,DA_STENCIL_STAR, -5, -5, >>>> PETSC_DECIDE, PETSC_DECIDE, 4, 2, 0, 0, &da);CHKERRQ(ierr); >>>> ierr = DMMGSetDM(dmmg, (DM)da);CHKERRQ(ierr); >>>> ierr = DAGetMatrix(DMMGGetDA(dmmg), MATAIJ, &jacobian);CHKERRQ(ierr); >>>> >>>> Thanks very much! >>>> >>>> Rebecca >> >> >> >> -- >> (Rebecca) Xuefei YUAN >> Department of Applied Physics and Applied Mathematics >> Columbia University >> Tel:917-399-8032 >> www.columbia.edu/~xy2102 > > > > -- > (Rebecca) Xuefei YUAN > Department of Applied Physics and Applied Mathematics > Columbia University > Tel:917-399-8032 > www.columbia.edu/~xy2102 -- (Rebecca) Xuefei YUAN Department of Applied Physics and Applied Mathematics Columbia University Tel:917-399-8032 www.columbia.edu/~xy2102 From xy2102 at columbia.edu Thu Feb 12 16:08:51 2009 From: xy2102 at columbia.edu ((Rebecca) Xuefei YUAN) Date: Thu, 12 Feb 2009 17:08:51 -0500 Subject: PetscValidIntPointer() Re: DACreate2d() and DAGetMatrix() In-Reply-To: <20090212155313.ij1sbn83k4g0cskk@cubmail.cc.columbia.edu> References: <7ff0ee010901060952x36351800n2320e1b07bfaa97e@mail.gmail.com> <7ff0ee010901061143r644dc28ave81735eceba6bfc8@mail.gmail.com> <7ff0ee010901061155n1eb38558y1a7813da6e95d00b@mail.gmail.com> <0B98A1F4-78E4-4A21-8535-F60BE994308B@mcs.anl.gov> <20090106174416.yz475c4ow0g04g8o@cubmail.cc.columbia.edu> <36CE42C4-4397-494F-9F3F-8833A96CD254@mcs.anl.gov> <20090106192826.u6ly4uajsokc8gck@cubmail.cc.columbia.edu> <20090212124433.di2ayi7r4408co88@cubmail.cc.columbia.edu> <5371BEBD-3CFA-405B-8B75-25B3F93EF8F7@mcs.anl.gov> <20090212140830.dr5xpk4sk08k8k4g@cubmail.cc.columbia.edu> <20090212141613.fp2pstthmsccw4gc@cubmail.cc.columbia.edu> <20090212155313.ij1sbn83k4g0cskk@cubmail.cc.columbia.edu> Message-ID: <20090212170851.gtfhq0rboc8sss4o@cubmail.cc.columbia.edu> Hi,all, Where could I see the source code of PetscValidIntPointer()? Thanks, Rebecca Quoting "(Rebecca) Xuefei YUAN" : > I check the matrix.c and find that the x,y,z direction has been > reversed as in line 1249-1252 in MatSetStencil(), can I get to know why > we do this? > > Thanks. > > > 1249: for (i=0; i 1250: mat->stencil.dims[i] = dims[dim-i-1]; /* copy the > values in backwards */ > 1251: mat->stencil.starts[i] = starts[dim-i-1]; > 1252: } > > Quoting "(Rebecca) Xuefei YUAN" : > >> I think the dims should be {9,5,4,0} if it is Xperiodic, and should be >> {5,9,4,0} if it is Yperiodic. Am I right? >> >> Thanks, >> >> Rebecca >> >> >> Quoting "(Rebecca) Xuefei YUAN" : >> >>> If I have -da_grid_x 5 -da_grid_y 5 -dmmg_nlevels 1 and the DA and >>> jacobian like: >>>>> ierr = DMMGCreate(comm, 1, &appCtx, &dmmg);CHKERRQ(ierr); >>>>> ierr = DACreate2d(comm,DA_XPERIODIC,DA_STENCIL_STAR, -5, -5, >>>>> PETSC_DECIDE, PETSC_DECIDE, 4, 2, 0, 0, &da);CHKERRQ(ierr); >>>>> ierr = DMMGSetDM(dmmg, (DM)da);CHKERRQ(ierr); >>>>> ierr = DAGetMatrix(DMMGGetDA(dmmg), MATAIJ, &jacobian);CHKERRQ(ierr); >>> >>> will that be right if I have jacobian->stencil.dims ={5, 9, 4, 0}? >>> >>> Thanks, >>> >>> Rebecca >>> >>> >>> >>> Quoting Barry Smith : >>> >>>> >>>> The dof argument to DACreate2d() is greater than 1. Thus the >>>> "dimension" that is associated with the matrix is 3 dimensions. Is >>>> this causing a problem? >>>> >>>> >>>> Barry >>>> >>>> Note: the "dimension" of the matrix affects the MatSetValuesStencil() >>>> but not much else I can think of; >>>> >>>> >>>> On Feb 12, 2009, at 11:44 AM, (Rebecca) Xuefei YUAN wrote: >>>> >>>>> Hi, >>>>> >>>>> I use the following set of codes to create the jacobian matrix, >>>>> however, the dimensions of jacobian becomes 3 (dim=3) >>>>> although I use DACreate2d to create this da. I wanna know >>>>> where is wrong? >>>>> >>>>> ierr = DMMGCreate(comm, 1, &appCtx, &dmmg);CHKERRQ(ierr); >>>>> ierr = DACreate2d(comm,DA_XPERIODIC,DA_STENCIL_STAR, -5, -5, >>>>> PETSC_DECIDE, PETSC_DECIDE, 4, 2, 0, 0, &da);CHKERRQ(ierr); >>>>> ierr = DMMGSetDM(dmmg, (DM)da);CHKERRQ(ierr); >>>>> ierr = DAGetMatrix(DMMGGetDA(dmmg), MATAIJ, &jacobian);CHKERRQ(ierr); >>>>> >>>>> Thanks very much! >>>>> >>>>> Rebecca >>> >>> >>> >>> -- >>> (Rebecca) Xuefei YUAN >>> Department of Applied Physics and Applied Mathematics >>> Columbia University >>> Tel:917-399-8032 >>> www.columbia.edu/~xy2102 >> >> >> >> -- >> (Rebecca) Xuefei YUAN >> Department of Applied Physics and Applied Mathematics >> Columbia University >> Tel:917-399-8032 >> www.columbia.edu/~xy2102 > > > > -- > (Rebecca) Xuefei YUAN > Department of Applied Physics and Applied Mathematics > Columbia University > Tel:917-399-8032 > www.columbia.edu/~xy2102 -- (Rebecca) Xuefei YUAN Department of Applied Physics and Applied Mathematics Columbia University Tel:917-399-8032 www.columbia.edu/~xy2102 From knepley at gmail.com Thu Feb 12 16:19:19 2009 From: knepley at gmail.com (Matthew Knepley) Date: Thu, 12 Feb 2009 16:19:19 -0600 Subject: PetscValidIntPointer() Re: DACreate2d() and DAGetMatrix() In-Reply-To: <20090212170851.gtfhq0rboc8sss4o@cubmail.cc.columbia.edu> References: <7ff0ee010901060952x36351800n2320e1b07bfaa97e@mail.gmail.com> <36CE42C4-4397-494F-9F3F-8833A96CD254@mcs.anl.gov> <20090106192826.u6ly4uajsokc8gck@cubmail.cc.columbia.edu> <20090212124433.di2ayi7r4408co88@cubmail.cc.columbia.edu> <5371BEBD-3CFA-405B-8B75-25B3F93EF8F7@mcs.anl.gov> <20090212140830.dr5xpk4sk08k8k4g@cubmail.cc.columbia.edu> <20090212141613.fp2pstthmsccw4gc@cubmail.cc.columbia.edu> <20090212155313.ij1sbn83k4g0cskk@cubmail.cc.columbia.edu> <20090212170851.gtfhq0rboc8sss4o@cubmail.cc.columbia.edu> Message-ID: On Thu, Feb 12, 2009 at 4:08 PM, (Rebecca) Xuefei YUAN wrote: > Hi,all, > > Where could I see the source code of PetscValidIntPointer()? include/private/petscimpl.h Matt > > Thanks, > > Rebecca > > > Quoting "(Rebecca) Xuefei YUAN" : > > I check the matrix.c and find that the x,y,z direction has been >> reversed as in line 1249-1252 in MatSetStencil(), can I get to know why >> we do this? >> >> Thanks. >> >> >> 1249: for (i=0; i> 1250: mat->stencil.dims[i] = dims[dim-i-1]; /* copy the >> values in backwards */ >> 1251: mat->stencil.starts[i] = starts[dim-i-1]; >> 1252: } >> >> Quoting "(Rebecca) Xuefei YUAN" : >> >> I think the dims should be {9,5,4,0} if it is Xperiodic, and should be >>> {5,9,4,0} if it is Yperiodic. Am I right? >>> >>> Thanks, >>> >>> Rebecca >>> >>> >>> Quoting "(Rebecca) Xuefei YUAN" : >>> >>> If I have -da_grid_x 5 -da_grid_y 5 -dmmg_nlevels 1 and the DA and >>>> jacobian like: >>>> >>>>> ierr = DMMGCreate(comm, 1, &appCtx, &dmmg);CHKERRQ(ierr); >>>>>> ierr = DACreate2d(comm,DA_XPERIODIC,DA_STENCIL_STAR, -5, -5, >>>>>> PETSC_DECIDE, PETSC_DECIDE, 4, 2, 0, 0, &da);CHKERRQ(ierr); >>>>>> ierr = DMMGSetDM(dmmg, (DM)da);CHKERRQ(ierr); >>>>>> ierr = DAGetMatrix(DMMGGetDA(dmmg), MATAIJ, &jacobian);CHKERRQ(ierr); >>>>>> >>>>> >>>> will that be right if I have jacobian->stencil.dims ={5, 9, 4, 0}? >>>> >>>> Thanks, >>>> >>>> Rebecca >>>> >>>> >>>> >>>> Quoting Barry Smith : >>>> >>>> >>>>> The dof argument to DACreate2d() is greater than 1. Thus the >>>>> "dimension" that is associated with the matrix is 3 dimensions. Is >>>>> this causing a problem? >>>>> >>>>> >>>>> Barry >>>>> >>>>> Note: the "dimension" of the matrix affects the MatSetValuesStencil() >>>>> but not much else I can think of; >>>>> >>>>> >>>>> On Feb 12, 2009, at 11:44 AM, (Rebecca) Xuefei YUAN wrote: >>>>> >>>>> Hi, >>>>>> >>>>>> I use the following set of codes to create the jacobian matrix, >>>>>> however, the dimensions of jacobian becomes 3 (dim=3) although I use >>>>>> DACreate2d to create this da. I wanna know where is wrong? >>>>>> >>>>>> ierr = DMMGCreate(comm, 1, &appCtx, &dmmg);CHKERRQ(ierr); >>>>>> ierr = DACreate2d(comm,DA_XPERIODIC,DA_STENCIL_STAR, -5, -5, >>>>>> PETSC_DECIDE, PETSC_DECIDE, 4, 2, 0, 0, &da);CHKERRQ(ierr); >>>>>> ierr = DMMGSetDM(dmmg, (DM)da);CHKERRQ(ierr); >>>>>> ierr = DAGetMatrix(DMMGGetDA(dmmg), MATAIJ, &jacobian);CHKERRQ(ierr); >>>>>> >>>>>> Thanks very much! >>>>>> >>>>>> Rebecca >>>>>> >>>>> >>>> >>>> >>>> -- >>>> (Rebecca) Xuefei YUAN >>>> Department of Applied Physics and Applied Mathematics >>>> Columbia University >>>> Tel:917-399-8032 >>>> www.columbia.edu/~xy2102 >>>> >>> >>> >>> >>> -- >>> (Rebecca) Xuefei YUAN >>> Department of Applied Physics and Applied Mathematics >>> Columbia University >>> Tel:917-399-8032 >>> www.columbia.edu/~xy2102 >>> >> >> >> >> -- >> (Rebecca) Xuefei YUAN >> Department of Applied Physics and Applied Mathematics >> Columbia University >> Tel:917-399-8032 >> www.columbia.edu/~xy2102 >> > > > > -- > (Rebecca) Xuefei YUAN > Department of Applied Physics and Applied Mathematics > Columbia University > Tel:917-399-8032 > www.columbia.edu/~xy2102 > > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From jed at 59A2.org Fri Feb 13 01:07:56 2009 From: jed at 59A2.org (Jed Brown) Date: Fri, 13 Feb 2009 08:07:56 +0100 Subject: link error In-Reply-To: <49942B6D.6040901@cs.wm.edu> References: <499381D2.9090709@cs.wm.edu> <49939001.2020008@cs.wm.edu> <20090212083414.GD3781@brakk.ethz.ch> <49942B6D.6040901@cs.wm.edu> Message-ID: <20090213070756.GE3781@brakk.ethz.ch> On Thu 2009-02-12 09:00, Yixun Liu wrote: > Thanks. Satish's method works. I add X11 to CMakeList.txt and it is ok. > I also want to try Jed's method to simplify the configuration. I > download FindPetsc.cmake and I think I need add something like, > > FIND_PACKAGE (PETSC) > > into CMakeList. Right? You normally distribute any nonstandard Find* modules with your software, for instance $MYPROJECT/CMake/FindPETSc.cmake. The start of $MYPROJECT/CMakeLists.txt should look something like: project (MyProject) cmake_minimum_required (VERSION 2.6.2) list (APPEND CMAKE_MODULE_PATH "${MyProject_SOURCE_DIR}/CMake") find_package (PETSc REQUIRED) include_directories (${PETSC_INCLUDES}) add_definitions (${PETSC_DEFINITIONS}) and link with target_link_libraries (myexecutable ${PETSC_LIBRARIES}) This is all the same as with other Find* modules. Jed -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: not available URL: From stm-direct_reply at pvv.org Fri Feb 13 01:31:05 2009 From: stm-direct_reply at pvv.org (Svend Tollak Munkejord) Date: Fri, 13 Feb 2009 08:31:05 +0100 Subject: How to use PETSc with sunf90? In-Reply-To: (Satish Balay's message of "Thu, 12 Feb 2009 09:53:15 -0600 (CST)") References: Message-ID: Hi, On 2009-02-12, Satish Balay wrote: > On Thu, 12 Feb 2009, Svend Tollak Munkejord wrote: > >> >> > But ideally - you should be using '--with-cc=suncc --wth-cxx=sunCC' >> > with sunf90 [not gcc/g++]. >> >> I agree, but this gives: >> >> ********************************************************************************* >> UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for details): >> --------------------------------------------------------------------------------------- >> C++ compiler you provided with -with-cxx=sunCC does not work >> ********************************************************************************* >> >> configure.log contains things like >> >> Possible ERROR while running linker: /usr/lib64/libm.so: file not recognized: File format not recognized >> >> and I don't know how to fix it. I could send you the configure.log if >> you like. > > Hmm - sometimes sun compilers require the static libm - so the > following additional option might > work. '--LIBS=/usr/lib64/libm.a'. As an option to ./config/configure.py ? It made no difference. > Otherwise - send us configure.log at > petsc-maint at mcs.anl.gov Based on your next e-mail (below), this now seems futile? > Another note: we always recommend debug build of PETSc for > development. One should worry about optimized/performance builds - > only after developmenet is done and when performance numbers are > captured [perhaps for publishing]. OK. I tried --with-debugging=yes, and it gave the same error message. On 2009-02-12, Satish Balay wrote: >> > Possible ERROR while running linker: /usr/lib64/libm.so: file not recognized: File format not recognized > > Looks like sunCC is broken. [it can't compile a simple test > code]. This is strange. I tried this on my 32-bit computer, and there sunCC didn't seem to cause any trouble. > This c++ dependency is from hypre.. Yes, the BoomerAMG solver works very well for my problems. Regards, -- Svend Tollak Munkejord From knepley at gmail.com Fri Feb 13 06:35:06 2009 From: knepley at gmail.com (Matthew Knepley) Date: Fri, 13 Feb 2009 06:35:06 -0600 Subject: How to use PETSc with sunf90? In-Reply-To: References: Message-ID: 1) This belongs in petsc-maint at mcs.anl.gov 2) We always always need configure.log and make*.log to diagnose problems with build Matt On Fri, Feb 13, 2009 at 1:31 AM, Svend Tollak Munkejord < stm-direct_reply at pvv.org> wrote: > Hi, > > On 2009-02-12, Satish Balay wrote: > > > On Thu, 12 Feb 2009, Svend Tollak Munkejord wrote: > > > >> > >> > But ideally - you should be using '--with-cc=suncc --wth-cxx=sunCC' > >> > with sunf90 [not gcc/g++]. > >> > >> I agree, but this gives: > >> > >> > ********************************************************************************* > >> UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log > for details): > >> > --------------------------------------------------------------------------------------- > >> C++ compiler you provided with -with-cxx=sunCC does not work > >> > ********************************************************************************* > >> > >> configure.log contains things like > >> > >> Possible ERROR while running linker: /usr/lib64/libm.so: file not > recognized: File format not recognized > >> > >> and I don't know how to fix it. I could send you the configure.log if > >> you like. > > > > Hmm - sometimes sun compilers require the static libm - so the > > following additional option might > > work. '--LIBS=/usr/lib64/libm.a'. > > As an option to ./config/configure.py ? > It made no difference. > > > Otherwise - send us configure.log at > > petsc-maint at mcs.anl.gov > > Based on your next e-mail (below), this now seems futile? > > > Another note: we always recommend debug build of PETSc for > > development. One should worry about optimized/performance builds - > > only after developmenet is done and when performance numbers are > > captured [perhaps for publishing]. > > OK. I tried --with-debugging=yes, and it gave the same error message. > > > On 2009-02-12, Satish Balay wrote: > > >> > Possible ERROR while running linker: /usr/lib64/libm.so: file not > recognized: File format not recognized > > > > Looks like sunCC is broken. [it can't compile a simple test > > code]. > > This is strange. I tried this on my 32-bit computer, and there sunCC > didn't seem to cause any trouble. > > > This c++ dependency is from hypre.. > > Yes, the BoomerAMG solver works very well for my problems. > > Regards, > -- > Svend Tollak Munkejord > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From enjoywm at cs.wm.edu Fri Feb 13 07:39:49 2009 From: enjoywm at cs.wm.edu (Yixun Liu) Date: Fri, 13 Feb 2009 08:39:49 -0500 Subject: link error In-Reply-To: <20090213070756.GE3781@brakk.ethz.ch> References: <499381D2.9090709@cs.wm.edu> <49939001.2020008@cs.wm.edu> <20090212083414.GD3781@brakk.ethz.ch> <49942B6D.6040901@cs.wm.edu> <20090213070756.GE3781@brakk.ethz.ch> Message-ID: <49957825.4010408@cs.wm.edu> Jed Brown wrote: > On Thu 2009-02-12 09:00, Yixun Liu wrote: > >> Thanks. Satish's method works. I add X11 to CMakeList.txt and it is ok. >> I also want to try Jed's method to simplify the configuration. I >> download FindPetsc.cmake and I think I need add something like, >> >> FIND_PACKAGE (PETSC) >> >> into CMakeList. Right? >> > > You normally distribute any nonstandard Find* modules with your > software, for instance $MYPROJECT/CMake/FindPETSc.cmake. The start of > $MYPROJECT/CMakeLists.txt should look something like: > > project (MyProject) > cmake_minimum_required (VERSION 2.6.2) > > list (APPEND CMAKE_MODULE_PATH "${MyProject_SOURCE_DIR}/CMake") > > find_package (PETSc REQUIRED) > > include_directories (${PETSC_INCLUDES}) > add_definitions (${PETSC_DEFINITIONS}) > > and link with > > target_link_libraries (myexecutable ${PETSC_LIBRARIES}) > > This is all the same as with other Find* modules. > > > Jed > Do I need to add link_directories(${PETSC_LIB_DIR})? From jed at 59A2.org Fri Feb 13 08:10:49 2009 From: jed at 59A2.org (Jed Brown) Date: Fri, 13 Feb 2009 15:10:49 +0100 Subject: link error In-Reply-To: <49957825.4010408@cs.wm.edu> References: <499381D2.9090709@cs.wm.edu> <49939001.2020008@cs.wm.edu> <20090212083414.GD3781@brakk.ethz.ch> <49942B6D.6040901@cs.wm.edu> <20090213070756.GE3781@brakk.ethz.ch> <49957825.4010408@cs.wm.edu> Message-ID: <20090213141049.GB12782@brakk.ethz.ch> On Fri 2009-02-13 08:39, Yixun Liu wrote: > Do I need to add link_directories(${PETSC_LIB_DIR})? No, as with other Find* modules, ${PETSC_LIBRARIES} contains full paths. CMake's link_directories command is not commonly used. Jed -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: not available URL: From balay at mcs.anl.gov Fri Feb 13 08:48:43 2009 From: balay at mcs.anl.gov (Satish Balay) Date: Fri, 13 Feb 2009 08:48:43 -0600 (CST) Subject: How to use PETSc with sunf90? In-Reply-To: References: Message-ID: On Fri, 13 Feb 2009, Svend Tollak Munkejord wrote: > Based on your next e-mail (below), this now seems futile? Yes - since sunCC is broken - looks like there is no way to work arround this.. > > Another note: we always recommend debug build of PETSc for > > development. One should worry about optimized/performance builds - > > only after developmenet is done and when performance numbers are > > captured [perhaps for publishing]. > > OK. I tried --with-debugging=yes, and it gave the same error message. I guess I was indicating that generally gcc/g++/gfortran can be used for developemnt. [Or you can continue to use the current hack for gcc/g++/sunf90] > On 2009-02-12, Satish Balay wrote: > > >> > Possible ERROR while running linker: /usr/lib64/libm.so: file not recognized: File format not recognized > > > > Looks like sunCC is broken. [it can't compile a simple test > > code]. > > This is strange. I tried this on my 32-bit computer, and there sunCC > didn't seem to cause any trouble. I guess it works fine on 32bit linux - but not 64bit linux. [Your PETSc install attempt was on 64bit linux - on this it breaks when compling a simple code.] Satish From recrusader at gmail.com Fri Feb 13 11:29:34 2009 From: recrusader at gmail.com (Yujie) Date: Fri, 13 Feb 2009 09:29:34 -0800 Subject: how to get the MPIAIJ matrix information? Message-ID: <7ff0ee010902130929j65503d1do4b82bb975f4936ff@mail.gmail.com> Hi, In MatCreateMPIAIJ() function, it needs d_nz, d_nnz[], o_nz, o_nnz[]. If one has a MATAIJ matrix, how to obtian this information? thanks a lot. PetscErrorCode PETSCMAT_DLLEXPORT MatCreateMPIAIJ(MPI_Comm comm,PetscInt m,PetscInt n,PetscInt M,PetscInt N,PetscInt d_nz,const PetscInt d_nnz[],PetscInt o_nz,const PetscInt o_nnz[],Mat *A) Regards, Yujie -------------- next part -------------- An HTML attachment was scrubbed... URL: From rlmackie862 at gmail.com Fri Feb 13 11:37:46 2009 From: rlmackie862 at gmail.com (Randall Mackie) Date: Fri, 13 Feb 2009 09:37:46 -0800 Subject: how to get the MPIAIJ matrix information? In-Reply-To: <7ff0ee010902130929j65503d1do4b82bb975f4936ff@mail.gmail.com> References: <7ff0ee010902130929j65503d1do4b82bb975f4936ff@mail.gmail.com> Message-ID: <4995AFEA.8090404@gmail.com> Yujie, This is explained in the manual on page 59, under Preallocation of Memory for Parallel AIJ Sparse Matrices. Randy Yujie wrote: > Hi, > > In MatCreateMPIAIJ() function, it needs d_nz, d_nnz[], o_nz, o_nnz[]. If > one has a MATAIJ matrix, how to obtian this information? thanks a lot. > > PetscErrorCode PETSCMAT_DLLEXPORT MatCreateMPIAIJ(MPI_Comm comm,PetscInt > m,PetscInt n,PetscInt M,PetscInt N,PetscInt d_nz,const PetscInt > d_nnz[],PetscInt o_nz,const PetscInt o_nnz[],Mat *A) > > Regards, > > Yujie > From recrusader at gmail.com Fri Feb 13 11:57:54 2009 From: recrusader at gmail.com (Yujie) Date: Fri, 13 Feb 2009 09:57:54 -0800 Subject: how to get the MPIAIJ matrix information? In-Reply-To: <4995AFEA.8090404@gmail.com> References: <7ff0ee010902130929j65503d1do4b82bb975f4936ff@mail.gmail.com> <4995AFEA.8090404@gmail.com> Message-ID: <7ff0ee010902130957s6446f130n448c6bb1a6a1646d@mail.gmail.com> thank you for your reply. Randy. Actually, I have read the manual. In the manual, it just demonstrate how to obtain this information from finite difference and finite element methods. However, if I only have a MPIAIJ matrix, how to obtain this information? one method is to use MatGetInfo() to my knolwedge, however, "info"'s structure is as follows: 476: typedef struct { 477: PetscLogDouble block_size; /* block size */ 478: PetscLogDouble nz_allocated,nz_used,nz_unneeded; /* number of nonzeros */ 479: PetscLogDouble memory; /* memory allocated */ 480: PetscLogDouble assemblies; /* number of matrix assemblies called */ 481: PetscLogDouble mallocs; /* number of mallocs during MatSetValues() */ 482: PetscLogDouble fill_ratio_given,fill_ratio_needed; /* fill ratio for LU/ILU */ 483: PetscLogDouble factor_mallocs; /* number of mallocs during factorization */ 484: } MatInfo; I am wondering what type PetscLogDouble is, double or int? Regards, Yujie On Fri, Feb 13, 2009 at 9:37 AM, Randall Mackie wrote: > Yujie, > > This is explained in the manual on page 59, under Preallocation of Memory > for Parallel AIJ Sparse Matrices. > > Randy > > > Yujie wrote: > >> Hi, >> >> In MatCreateMPIAIJ() function, it needs d_nz, d_nnz[], o_nz, o_nnz[]. If >> one has a MATAIJ matrix, how to obtian this information? thanks a lot. >> >> PetscErrorCode PETSCMAT_DLLEXPORT MatCreateMPIAIJ(MPI_Comm comm,PetscInt >> m,PetscInt n,PetscInt M,PetscInt N,PetscInt d_nz,const PetscInt >> d_nnz[],PetscInt o_nz,const PetscInt o_nnz[],Mat *A) >> >> Regards, >> >> Yujie >> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From recrusader at gmail.com Fri Feb 13 12:00:56 2009 From: recrusader at gmail.com (Yujie) Date: Fri, 13 Feb 2009 10:00:56 -0800 Subject: how to get the MPIAIJ matrix information? In-Reply-To: <4995AFEA.8090404@gmail.com> References: <7ff0ee010902130929j65503d1do4b82bb975f4936ff@mail.gmail.com> <4995AFEA.8090404@gmail.com> Message-ID: <7ff0ee010902131000k24794531v3d058172756f6454@mail.gmail.com> even if you can use the information from MatGetInfo(). However, you don't know d_nnz and o_nnz, right? Thanks. Yujie On Fri, Feb 13, 2009 at 9:37 AM, Randall Mackie wrote: > Yujie, > > This is explained in the manual on page 59, under Preallocation of Memory > for Parallel AIJ Sparse Matrices. > > Randy > > > Yujie wrote: > >> Hi, >> >> In MatCreateMPIAIJ() function, it needs d_nz, d_nnz[], o_nz, o_nnz[]. If >> one has a MATAIJ matrix, how to obtian this information? thanks a lot. >> >> PetscErrorCode PETSCMAT_DLLEXPORT MatCreateMPIAIJ(MPI_Comm comm,PetscInt >> m,PetscInt n,PetscInt M,PetscInt N,PetscInt d_nz,const PetscInt >> d_nnz[],PetscInt o_nz,const PetscInt o_nnz[],Mat *A) >> >> Regards, >> >> Yujie >> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From balay at mcs.anl.gov Fri Feb 13 12:09:35 2009 From: balay at mcs.anl.gov (Satish Balay) Date: Fri, 13 Feb 2009 12:09:35 -0600 (CST) Subject: how to get the MPIAIJ matrix information? In-Reply-To: <7ff0ee010902130929j65503d1do4b82bb975f4936ff@mail.gmail.com> References: <7ff0ee010902130929j65503d1do4b82bb975f4936ff@mail.gmail.com> Message-ID: MatAIJ is either MatSeqAIJ or MatMPIAIJ [depeding upon no of procs in the run]. So if you already have MatAIJ [which mostlikely is MatMPIAIJ for you] - why do you need to recreate it as MatMPIAIJ? Satish On Fri, 13 Feb 2009, Yujie wrote: > Hi, > > In MatCreateMPIAIJ() function, it needs d_nz, d_nnz[], o_nz, o_nnz[]. If one > has a MATAIJ matrix, how to obtian this information? thanks a lot. > > PetscErrorCode PETSCMAT_DLLEXPORT MatCreateMPIAIJ(MPI_Comm comm,PetscInt > m,PetscInt n,PetscInt M,PetscInt N,PetscInt d_nz,const PetscInt > d_nnz[],PetscInt o_nz,const PetscInt o_nnz[],Mat *A) > > Regards, > > Yujie > From bsmith at mcs.anl.gov Fri Feb 13 12:10:01 2009 From: bsmith at mcs.anl.gov (Barry Smith) Date: Fri, 13 Feb 2009 12:10:01 -0600 Subject: how to get the MPIAIJ matrix information? In-Reply-To: <7ff0ee010902130957s6446f130n448c6bb1a6a1646d@mail.gmail.com> References: <7ff0ee010902130929j65503d1do4b82bb975f4936ff@mail.gmail.com> <4995AFEA.8090404@gmail.com> <7ff0ee010902130957s6446f130n448c6bb1a6a1646d@mail.gmail.com> Message-ID: If you have a MPIAIJ matrix and want another with the same preallocation information you can simply use MatDuplicate(). Sometimes you just need to use the internal data structures of a matrix type if you are doing something very specific with the data in a matrix that is not common to most solvers. Barry On Feb 13, 2009, at 11:57 AM, Yujie wrote: > thank you for your reply. Randy. > > Actually, I have read the manual. In the manual, it just demonstrate > how to obtain this information from finite difference and finite > element methods. However, if I only have a MPIAIJ matrix, how to > obtain this information? one method is to use MatGetInfo() to my > knolwedge, however, "info"'s structure is as follows: > > 476: typedef struct { > 477: PetscLogDouble block_size; /* block size */ > 478: PetscLogDouble nz_allocated,nz_used,nz_unneeded; /* number of > nonzeros */ > 479: PetscLogDouble memory; /* memory allocated */ > 480: PetscLogDouble assemblies; /* number of matrix assemblies > called */ > 481: PetscLogDouble mallocs; /* number of mallocs during > MatSetValues() */ > 482: PetscLogDouble fill_ratio_given,fill_ratio_needed; /* fill > ratio for LU/ILU */ > 483: PetscLogDouble factor_mallocs; /* number of mallocs during > factorization */ > 484: } MatInfo; > > I am wondering what type PetscLogDouble is, double or int? > > Regards, > > Yujie > > On Fri, Feb 13, 2009 at 9:37 AM, Randall Mackie > wrote: > Yujie, > > This is explained in the manual on page 59, under Preallocation of > Memory > for Parallel AIJ Sparse Matrices. > > Randy > > > > Yujie wrote: > Hi, > > In MatCreateMPIAIJ() function, it needs d_nz, d_nnz[], o_nz, > o_nnz[]. If one has a MATAIJ matrix, how to obtian this information? > thanks a lot. > > PetscErrorCode PETSCMAT_DLLEXPORT MatCreateMPIAIJ(MPI_Comm > comm,PetscInt m,PetscInt n,PetscInt M,PetscInt N,PetscInt d_nz,const > PetscInt d_nnz[],PetscInt o_nz,const PetscInt o_nnz[],Mat *A) > > Regards, > > Yujie > > From schuang at ats.ucla.edu Fri Feb 13 15:01:15 2009 From: schuang at ats.ucla.edu (Shao-Ching Huang) Date: Fri, 13 Feb 2009 13:01:15 -0800 Subject: inverting independent, small dense matrices Message-ID: <4995DF9B.4090300@ats.ucla.edu> Hi I need to invert a bunch of independent, dense 4x4 matrices on each MPI process. (This is separate from the main computation, a parallel Ax=b solve.) I am thinking of using LAPACK's DGESV to invert these 4x4 matrices. In my code, is it necessary to call LAPACK directly? Or does PETSc already have a convenient interface to LAPACK? The size 4x4 may be increased to 8x8 or so later, so I am not trying to use the closed-form inversion formula. Thanks, Shao-Ching From knepley at gmail.com Fri Feb 13 15:11:24 2009 From: knepley at gmail.com (Matthew Knepley) Date: Fri, 13 Feb 2009 15:11:24 -0600 Subject: inverting independent, small dense matrices In-Reply-To: <4995DF9B.4090300@ats.ucla.edu> References: <4995DF9B.4090300@ats.ucla.edu> Message-ID: I think the easiest thing to do is use a BAIJ matrix with blocksize 4 to store all the matrices. Then factorization will handle LAPACK for you. Matt On Fri, Feb 13, 2009 at 3:01 PM, Shao-Ching Huang wrote: > Hi > > I need to invert a bunch of independent, dense 4x4 matrices on each > MPI process. (This is separate from the main computation, a parallel > Ax=b solve.) I am thinking of using LAPACK's DGESV to invert these 4x4 > matrices. > > In my code, is it necessary to call LAPACK directly? Or does PETSc > already have a convenient interface to LAPACK? > > The size 4x4 may be increased to 8x8 or so later, so I am not trying > to use the closed-form inversion formula. > > Thanks, > > Shao-Ching > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From bsmith at mcs.anl.gov Fri Feb 13 15:17:04 2009 From: bsmith at mcs.anl.gov (Barry Smith) Date: Fri, 13 Feb 2009 15:17:04 -0600 Subject: inverting independent, small dense matrices In-Reply-To: <4995DF9B.4090300@ats.ucla.edu> References: <4995DF9B.4090300@ats.ucla.edu> Message-ID: <825A037D-E926-4A32-A293-08C162E51B75@mcs.anl.gov> On Feb 13, 2009, at 3:01 PM, Shao-Ching Huang wrote: > Hi > > I need to invert a bunch of independent, dense 4x4 matrices on each > MPI process. (This is separate from the main computation, a parallel > Ax=b solve.) I am thinking of using LAPACK's DGESV to invert these 4x4 > matrices. > You would not want to use LAPACK's solvers for such tiny matrices. LAPACK is optimized for large dense matrices; the overhead is high for small matrices so that actual performance will be very slow calling LAPACK. > In my code, is it necessary to call LAPACK directly? Or does PETSc > already have a convenient interface to LAPACK? > For PETSc's own internal use we have written custom inverters for small matrices (these are used by the factorization routines for BAIJ matrices). They are called Kernel_A_gets_inverse_A_* where * is the block size. The prototypes for the functions are in src/inline/ilu.h and the actual source code in files in src/mat/impls/baij/seq/dgef*.c Barry > The size 4x4 may be increased to 8x8 or so later, so I am not trying > to use the closed-form inversion formula. > > Thanks, > > Shao-Ching From bsmith at mcs.anl.gov Fri Feb 13 15:49:05 2009 From: bsmith at mcs.anl.gov (Barry Smith) Date: Fri, 13 Feb 2009 15:49:05 -0600 Subject: DACreate2d() and DAGetMatrix() In-Reply-To: <20090212155313.ij1sbn83k4g0cskk@cubmail.cc.columbia.edu> References: <7ff0ee010901060952x36351800n2320e1b07bfaa97e@mail.gmail.com> <7ff0ee010901061143r644dc28ave81735eceba6bfc8@mail.gmail.com> <7ff0ee010901061155n1eb38558y1a7813da6e95d00b@mail.gmail.com> <0B98A1F4-78E4-4A21-8535-F60BE994308B@mcs.anl.gov> <20090106174416.yz475c4ow0g04g8o@cubmail.cc.columbia.edu> <36CE42C4-4397-494F-9F3F-8833A96CD254@mcs.anl.gov> <20090106192826.u6ly4uajsokc8gck@cubmail.cc.columbia.edu> <20090212124433.di2ayi7r4408co88@cubmail.cc.columbia.edu> <5371BEBD-3CFA-405B-8B75-25B3F93EF8F7@mcs.anl.gov> <20090212140830.dr5xpk4sk08k8k4g@cubmail.cc.columbia.edu> <20090212141613.fp2pstthmsccw4gc@cubmail.cc.columbia.edu> <20090212155313.ij1sbn83k4g0cskk@cubmail.cc.columbia.edu> Message-ID: <90D895FD-7E88-4539-A606-4E50236475FD@mcs.anl.gov> On Feb 12, 2009, at 2:53 PM, (Rebecca) Xuefei YUAN wrote: > I check the matrix.c and find that the x,y,z direction has been > reversed as in line 1249-1252 in MatSetStencil(), can I get to know > why we do this? This is to match the code in MatSetValuesStencil() where the code has else tmp = tmp*dims[j] + *(dxm-1) - starts[j+1]; ^ ^^^^^^ I am pretty sure the code is correct (if slightly cryptic). Barry > > > Thanks. > > > 1249: for (i=0; i 1250: mat->stencil.dims[i] = dims[dim-i-1]; /* copy the > values in backwards */ > 1251: mat->stencil.starts[i] = starts[dim-i-1]; > 1252: } > > Quoting "(Rebecca) Xuefei YUAN" : > >> I think the dims should be {9,5,4,0} if it is Xperiodic, and should >> be >> {5,9,4,0} if it is Yperiodic. Am I right? >> >> Thanks, >> >> Rebecca >> >> >> Quoting "(Rebecca) Xuefei YUAN" : >> >>> If I have -da_grid_x 5 -da_grid_y 5 -dmmg_nlevels 1 and the DA and >>> jacobian like: >>>>> ierr = DMMGCreate(comm, 1, &appCtx, &dmmg);CHKERRQ(ierr); >>>>> ierr = DACreate2d(comm,DA_XPERIODIC,DA_STENCIL_STAR, -5, -5, >>>>> PETSC_DECIDE, PETSC_DECIDE, 4, 2, 0, 0, &da);CHKERRQ(ierr); >>>>> ierr = DMMGSetDM(dmmg, (DM)da);CHKERRQ(ierr); >>>>> ierr = DAGetMatrix(DMMGGetDA(dmmg), MATAIJ, >>>>> &jacobian);CHKERRQ(ierr); >>> >>> will that be right if I have jacobian->stencil.dims ={5, 9, 4, 0}? >>> >>> Thanks, >>> >>> Rebecca >>> >>> >>> >>> Quoting Barry Smith : >>> >>>> >>>> The dof argument to DACreate2d() is greater than 1. Thus the >>>> "dimension" that is associated with the matrix is 3 dimensions. Is >>>> this causing a problem? >>>> >>>> >>>> Barry >>>> >>>> Note: the "dimension" of the matrix affects the >>>> MatSetValuesStencil() >>>> but not much else I can think of; >>>> >>>> >>>> On Feb 12, 2009, at 11:44 AM, (Rebecca) Xuefei YUAN wrote: >>>> >>>>> Hi, >>>>> >>>>> I use the following set of codes to create the jacobian >>>>> matrix, however, the dimensions of jacobian becomes 3 (dim=3) >>>>> although I use DACreate2d to create this da. I wanna know >>>>> where is wrong? >>>>> >>>>> ierr = DMMGCreate(comm, 1, &appCtx, &dmmg);CHKERRQ(ierr); >>>>> ierr = DACreate2d(comm,DA_XPERIODIC,DA_STENCIL_STAR, -5, -5, >>>>> PETSC_DECIDE, PETSC_DECIDE, 4, 2, 0, 0, &da);CHKERRQ(ierr); >>>>> ierr = DMMGSetDM(dmmg, (DM)da);CHKERRQ(ierr); >>>>> ierr = DAGetMatrix(DMMGGetDA(dmmg), MATAIJ, >>>>> &jacobian);CHKERRQ(ierr); >>>>> >>>>> Thanks very much! >>>>> >>>>> Rebecca >>> >>> >>> >>> -- >>> (Rebecca) Xuefei YUAN >>> Department of Applied Physics and Applied Mathematics >>> Columbia University >>> Tel:917-399-8032 >>> www.columbia.edu/~xy2102 >> >> >> >> -- >> (Rebecca) Xuefei YUAN >> Department of Applied Physics and Applied Mathematics >> Columbia University >> Tel:917-399-8032 >> www.columbia.edu/~xy2102 > > > > -- > (Rebecca) Xuefei YUAN > Department of Applied Physics and Applied Mathematics > Columbia University > Tel:917-399-8032 > www.columbia.edu/~xy2102 > From schuang at ats.ucla.edu Fri Feb 13 15:49:50 2009 From: schuang at ats.ucla.edu (Shao-Ching Huang) Date: Fri, 13 Feb 2009 13:49:50 -0800 Subject: inverting independent, small dense matrices In-Reply-To: <825A037D-E926-4A32-A293-08C162E51B75@mcs.anl.gov> References: <4995DF9B.4090300@ats.ucla.edu> <825A037D-E926-4A32-A293-08C162E51B75@mcs.anl.gov> Message-ID: <4995EAFE.60001@ats.ucla.edu> > For PETSc's own internal use we have written custom inverters for > small matrices (these are used by > the factorization routines for BAIJ matrices). They are called > Kernel_A_gets_inverse_A_* where * is the block size. > The prototypes for the functions are in src/inline/ilu.h and the actual > source code in files in src/mat/impls/baij/seq/dgef*.c > Beautiful! I will try it out. Thank you. Shao-Ching From enjoywm at cs.wm.edu Fri Feb 13 16:37:56 2009 From: enjoywm at cs.wm.edu (Yixun Liu) Date: Fri, 13 Feb 2009 17:37:56 -0500 Subject: KSP solver efficiency Message-ID: <4995F644.4040803@cs.wm.edu> Hi, Assume Ku=F is a linear system assembled from element stiffness matrix. I want to use KSP to solve Ku=F. Assume the size of K is 100x100 and the number of processors is 4. The question is does the efficiency of KSP depend on the structure of K? For example if each process owns 25 rows does the efficiency of the solver depend on the structure of K? Thanks. Yixun From knepley at gmail.com Fri Feb 13 16:56:16 2009 From: knepley at gmail.com (Matthew Knepley) Date: Fri, 13 Feb 2009 16:56:16 -0600 Subject: KSP solver efficiency In-Reply-To: <4995F644.4040803@cs.wm.edu> References: <4995F644.4040803@cs.wm.edu> Message-ID: On Fri, Feb 13, 2009 at 4:37 PM, Yixun Liu wrote: > Hi, > Assume Ku=F is a linear system assembled from element stiffness > matrix. I want to use KSP to solve Ku=F. Assume the size of K is 100x100 > and the number of processors is 4. > The question is does the efficiency of KSP depend on the structure of K? > For example if each process owns 25 rows does the efficiency of the > solver depend on the structure of K? 1) Strictly, yes it does. 2) Practically, not very much. You want to have at least a decent partition, but after that the communication load is small since its a PDE, and scales well. 3) Everything depends on the type of PDE. Krylov solvers will not work well for everything, but for elliptic things they are good. Matt > > Thanks. > > Yixun > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From schuang at ats.ucla.edu Fri Feb 13 17:29:08 2009 From: schuang at ats.ucla.edu (Shao-Ching Huang) Date: Fri, 13 Feb 2009 15:29:08 -0800 Subject: inverting independent, small dense matrices In-Reply-To: <825A037D-E926-4A32-A293-08C162E51B75@mcs.anl.gov> References: <4995DF9B.4090300@ats.ucla.edu> <825A037D-E926-4A32-A293-08C162E51B75@mcs.anl.gov> Message-ID: <49960244.6090502@ats.ucla.edu> Barry: How do I determine the "shift" value, to be passed into Kernel_A_gets_inverse_A_4(MatScalar *a,PetscReal shift) ? I know that my 4x4 matrices are non-singular for sure. Thanks. Shao-Ching Barry Smith wrote: > > On Feb 13, 2009, at 3:01 PM, Shao-Ching Huang wrote: > >> Hi >> >> I need to invert a bunch of independent, dense 4x4 matrices on each >> MPI process. (This is separate from the main computation, a parallel >> Ax=b solve.) I am thinking of using LAPACK's DGESV to invert these 4x4 >> matrices. >> > > You would not want to use LAPACK's solvers for such tiny matrices. > LAPACK is optimized > for large dense matrices; the overhead is high for small matrices so > that actual performance will > be very slow calling LAPACK. > >> In my code, is it necessary to call LAPACK directly? Or does PETSc >> already have a convenient interface to LAPACK? >> > For PETSc's own internal use we have written custom inverters for > small matrices (these are used by > the factorization routines for BAIJ matrices). They are called > Kernel_A_gets_inverse_A_* where * is the block size. > The prototypes for the functions are in src/inline/ilu.h and the actual > source code in files in src/mat/impls/baij/seq/dgef*.c > > Barry > > >> The size 4x4 may be increased to 8x8 or so later, so I am not trying >> to use the closed-form inversion formula. >> >> Thanks, >> >> Shao-Ching > From knepley at gmail.com Fri Feb 13 17:35:17 2009 From: knepley at gmail.com (Matthew Knepley) Date: Fri, 13 Feb 2009 17:35:17 -0600 Subject: inverting independent, small dense matrices In-Reply-To: <49960244.6090502@ats.ucla.edu> References: <4995DF9B.4090300@ats.ucla.edu> <825A037D-E926-4A32-A293-08C162E51B75@mcs.anl.gov> <49960244.6090502@ats.ucla.edu> Message-ID: On Fri, Feb 13, 2009 at 5:29 PM, Shao-Ching Huang wrote: > Barry: > > How do I determine the "shift" value, to be passed into > > Kernel_A_gets_inverse_A_4(MatScalar *a,PetscReal shift) > > ? > > I know that my 4x4 matrices are non-singular for sure. Then you use 0.0; Matt > > Thanks. > > Shao-Ching > > > Barry Smith wrote: > >> >> On Feb 13, 2009, at 3:01 PM, Shao-Ching Huang wrote: >> >> Hi >>> >>> I need to invert a bunch of independent, dense 4x4 matrices on each >>> MPI process. (This is separate from the main computation, a parallel >>> Ax=b solve.) I am thinking of using LAPACK's DGESV to invert these 4x4 >>> matrices. >>> >>> >> You would not want to use LAPACK's solvers for such tiny matrices. >> LAPACK is optimized >> for large dense matrices; the overhead is high for small matrices so that >> actual performance will >> be very slow calling LAPACK. >> >> In my code, is it necessary to call LAPACK directly? Or does PETSc >>> already have a convenient interface to LAPACK? >>> >>> For PETSc's own internal use we have written custom inverters for >> small matrices (these are used by >> the factorization routines for BAIJ matrices). They are called >> Kernel_A_gets_inverse_A_* where * is the block size. >> The prototypes for the functions are in src/inline/ilu.h and the actual >> source code in files in src/mat/impls/baij/seq/dgef*.c >> >> Barry >> >> >> The size 4x4 may be increased to 8x8 or so later, so I am not trying >>> to use the closed-form inversion formula. >>> >>> Thanks, >>> >>> Shao-Ching >>> >> >> -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From enjoywm at cs.wm.edu Fri Feb 13 21:22:24 2009 From: enjoywm at cs.wm.edu (Yixun Liu) Date: Fri, 13 Feb 2009 22:22:24 -0500 Subject: KSP solver efficiency In-Reply-To: References: <4995F644.4040803@cs.wm.edu> Message-ID: <499638F0.5050607@cs.wm.edu> Matthew Knepley wrote: > On Fri, Feb 13, 2009 at 4:37 PM, Yixun Liu > wrote: > > Hi, > Assume Ku=F is a linear system assembled from element stiffness > matrix. I want to use KSP to solve Ku=F. Assume the size of K is > 100x100 > and the number of processors is 4. > The question is does the efficiency of KSP depend on the structure > of K? > For example if each process owns 25 rows does the efficiency of the > solver depend on the structure of K? > > > 1) Strictly, yes it does. > > 2) Practically, not very much. You want to have at least a decent > partition, but > after that the communication load is small since its a PDE, and > scales well. > > 3) Everything depends on the type of PDE. Krylov solvers will not work > well for > everything, but for elliptic things they are good. > > Matt > > > > Thanks. > > Yixun > > -- > What most experimenters take for granted before they begin their > experiments is infinitely more interesting than any results to which > their experiments lead. > -- Norbert Wiener If in practice we assume the efficiency of KSP doesn't rely on the structure of K, do we need to partition? From bsmith at mcs.anl.gov Fri Feb 13 21:31:58 2009 From: bsmith at mcs.anl.gov (Barry Smith) Date: Fri, 13 Feb 2009 21:31:58 -0600 Subject: KSP solver efficiency In-Reply-To: <499638F0.5050607@cs.wm.edu> References: <4995F644.4040803@cs.wm.edu> <499638F0.5050607@cs.wm.edu> Message-ID: <9E801F0C-E392-4AC6-B027-C829A91120E7@mcs.anl.gov> In general you want to partition the rows of K to reduce the amount of communication needed in matrix vector products. Now for PDEs, the recommend approach is to partition the underlying grid (that defines your discretization) to minimize cut edges between subdomains. Then generate the matrix in parallel with each process generating the part associated with its subdomain; this way there is no "partitioning" of matrices. The matrix partitioning just comes automatically from the grid partitioning. If you are not solving a PDE on a grid then there likely is still some underlying "thing" that can be partitioned whose partition defines the matrix partitioning. If you are reading some matrix from a file and solving some linear system with it then you are just playing with finger paint in preschool and likely should stick to Matlab. Barry On Feb 13, 2009, at 9:22 PM, Yixun Liu wrote: > Matthew Knepley wrote: >> On Fri, Feb 13, 2009 at 4:37 PM, Yixun Liu > > wrote: >> >> Hi, >> Assume Ku=F is a linear system assembled from element stiffness >> matrix. I want to use KSP to solve Ku=F. Assume the size of K is >> 100x100 >> and the number of processors is 4. >> The question is does the efficiency of KSP depend on the structure >> of K? >> For example if each process owns 25 rows does the efficiency of >> the >> solver depend on the structure of K? >> >> >> 1) Strictly, yes it does. >> >> 2) Practically, not very much. You want to have at least a decent >> partition, but >> after that the communication load is small since its a PDE, and >> scales well. >> >> 3) Everything depends on the type of PDE. Krylov solvers will not >> work >> well for >> everything, but for elliptic things they are good. >> >> Matt >> >> >> >> Thanks. >> >> Yixun >> >> -- >> What most experimenters take for granted before they begin their >> experiments is infinitely more interesting than any results to which >> their experiments lead. >> -- Norbert Wiener > If in practice we assume the efficiency of KSP doesn't rely on the > structure of K, do we need to partition? From enjoywm at cs.wm.edu Sat Feb 14 16:55:41 2009 From: enjoywm at cs.wm.edu (Yixun Liu) Date: Sat, 14 Feb 2009 17:55:41 -0500 Subject: link error In-Reply-To: References: <499381D2.9090709@cs.wm.edu> <49939001.2020008@cs.wm.edu> Message-ID: <49974BED.2070408@cs.wm.edu> Satish Balay wrote: > Don't know cmake. > > You'll have to make sure 'all' compiler options used to compile the > PETSc example are also used in your build system. If you miss > something - you'll have to go back - and add it in. > > So: > > - look at the make output of compiling a PETSc example > - look at the make output from compiling your code. > - look for whats missing - and add it to your cmake stuff.. > > [most likely you are missing "-lX11" at link time.] > > Satish > > On Wed, 11 Feb 2009, Yixun Liu wrote: > > >> I can successfully compile the example with PETSC >> makefile. However, I need integrate PETSC into an existing >> application, which use CMake to generate makefile. I add the >> following into CMakelist.txt and use CMake to generate makefile and >> then make. >> > > >> #---------- >> # PETSc >> #---------- >> SET(PETSC_DIR /home/scratch/yixun/petsc-3.0.0-p3) >> SET(PETSC_ARCH /linux-gnu-c-debug) >> SET(X11_DIR /usr/X11R6) >> SET(PETSC_INCLUDE_DIR ${PETSC_DIR}/include >> ${PETSC_DIR}/${PETSC_ARCH}/include) >> SET(PETSC_LIB_DIR ${PETSC_DIR}/${PETSC_ARCH}/lib ${X11_DIR}/lib64 >> ${X11_DIR}/lib/X11) >> When I add the following in my application, there are many link errors. Vec x,b,u; Mat K; KSP ksp; PetscMPIInt size, rank; MPI_Comm_size(PETSC_COMM_WORLD,&size); MPI_Comm_rank(PETSC_COMM_WORLD,&rank); VecCreate(PETSC_COMM_WORLD,&u) Errors: /home/scratch/yixun/petsc-3.0.0-p3/linux-gnu-c-debug/lib/libpetscvec.a(dlregisvec.o): In function `VecInitializePackage': /home/scratch/yixun/petsc-3.0.0-p3/src/vec/vec/interface/dlregisvec.c:183: undefined reference to `PetscObjectComposedDataRegister' /home/scratch/yixun/petsc-3.0.0-p3/linux-gnu-c-debug/lib/libpetscvec.a(pmap.o): In function `PetscMapSetUp': /home/scratch/yixun/petsc-3.0.0-p3/src/vec/vec/impls/mpi/pmap.c:136: undefined reference to `PetscSplitOwnership' /home/scratch/yixun/petsc-3.0.0-p3/linux-gnu-c-debug/lib/libpetscvec.a(index.o): In function `ISSetPermutation': /home/scratch/yixun/petsc-3.0.0-p3/src/vec/is/interface/index.c:140: undefined reference to `PetscSortInt' /home/scratch/yixun/petsc-3.0.0-p3/linux-gnu-c-debug/lib/libpetscvec.a(isltog.o): In function `ISLocalToGlobalMappingGetInfo': /home/scratch/yixun/petsc-3.0.0-p3/src/vec/is/utils/isltog.c:864: undefined reference to `PetscSortIntWithArray' ... I can make ex2 using command make ex2. The link command is like following, mpicc -Wall -Wwrite-strings -Wno-strict-aliasing -g3 -o ex2 ex2.o -Wl,-rpath,/home/scratch/yixun/petsc-3.0.0-p3/linux-gnu-c-debug/lib -L/home/scratch/yixun/petsc-3.0.0-p3/linux-gnu-c-debug/lib -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetsc -lX11 -llapack -lblas -lm -L/usr/lib64 -L/usr/lib64/gcc/x86_64-suse-linux/4.2.1 -L/lib64 -L/usr/x86_64-suse-linux/lib -ldl -llammpio -llamf77mpi -lmpi -llam -lutil -lgcc_s -lpthread -lgfortranbegin -lgfortran -lm -lm -ldl -llammpio -llamf77mpi -lmpi -llam -lutil -lgcc_s -lpthread -ldl The command I use to link my application is like, /usr/bin/mpiCC -DWITHOUT_MTL -D_YAV_ -D_LINUX_ -ansi -Wall -fsigned-char -fsigned-bitfields -Wno-deprecated -ftemplate-depth-50 -Wall -fPIC CMakeFiles/PETScSolver.dir/PETScSolver.o CMakeFiles/PETScSolver.dir/PETScRegistrationMesh.o CMakeFiles/PETScSolver.dir/BlockList.o CMakeFiles/PETScSolver.dir/Point.o -o ../../../bin/PETScSolver -rdynamic -L/home/scratch/yixun/Biofemir/trunk/build/lib -L/home/scratch/yixun/VTK-mpicc/Build/bin -L/home/scratch/yixun/ITK-mpicc/Build/bin -L/lib/LINUX -L/home/scratch/yixun/petsc-3.0.0-p3/linux-gnu-c-debug/lib -L/usr/X11R6/lib64 -L/usr/X11R6/lib/X11 ../../../lib/libTetrahedrisationNG.a ../../../lib/libTetraImageNG.a ../../../lib/libImageDataNG.a -lITKCommon -lITKIO -lvtkIO -lpetsc -lpetscksp -lpetscmat -lpetscvec -lpetsccontrib -lpetscdm -lpetscsnes -lpetscts -lX11 -llapack -lblas -llam -lutil -lm -llammpio -lmpi -lgcc_s -lpthread -lgfortranbegin -ldl ../../../lib/libTetrahedrisationNG.a ../../../lib/libGraphics2DNG.a ../../../lib/libGraphics3DNG.a ../../../lib/libInrimageNG.a ../../../lib/libBasics.a ../../../lib/libmipsZ.a -lITKNrrdIO -litkgdcm -litkjpeg12 -litkjpeg16 -litkopenjpeg -luuid -litkpng -litktiff -litkjpeg8 -lITKSpatialObject -lITKCommon -litkvnl_inst -litkvnl_algo -litkvnl -litkv3p_netlib -litkvcl -lITKMetaIO -litksys -lITKDICOMParser -lITKEXPAT -lITKniftiio -lITKznz -litkzlib -lvtkFiltering -lvtkCommon -lpthread -lm -lvtkDICOMParser -lvtkNetCDF -lvtkmetaio -lvtksqlite -lvtkpng -lvtktiff -lvtkzlib -lvtkjpeg -lvtkexpat -lvtksys -lm -ldl -Wl,-rpath,/home/scratch/yixun/Biofemir/trunk/build/lib:/home/scratch/yixun/VTK-mpicc/Build/bin:/home/scratch/yixun/ITK-mpicc/Build/bin:/lib/LINUX:/home/scratch/yixun/petsc-3.0.0-p3/linux-gnu-c-debug/lib:/usr/X11R6/lib64:/usr/X11R6/lib/X11 I cannot see the difference, but why it doesn't work? Thanks. Yixun From keita at cray.com Sat Feb 14 17:52:08 2009 From: keita at cray.com (Keita Teranishi) Date: Sat, 14 Feb 2009 17:52:08 -0600 Subject: link error In-Reply-To: <49974BED.2070408@cs.wm.edu> References: <499381D2.9090709@cs.wm.edu> <49939001.2020008@cs.wm.edu> <49974BED.2070408@cs.wm.edu> Message-ID: <925346A443D4E340BEB20248BAFCDBDF099E1658@CFEVS1-IP.americas.cray.com> Yixun, In order to link PETSc library (it applies any linking operations for most platforms), you must place all .a files in the order of dependency. For example, -lpetscksp is placed before -lpetscmat and -lpetscvec, and these two are placed before -lpetsc. If you follow PETSc's makefile format (see PETSc manual), these .a files are substituted by ${PETSC_XXX_LIB} variables and all .a files are placed in the correct order. If you still want to write makefile on your own, you need place them something like "-lpetscsnes -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetsc". Thanks, ================================ ?Keita Teranishi ?Scientific Library Group ?Cray, Inc. ?keita at cray.com ================================ -----Original Message----- From: petsc-users-bounces at mcs.anl.gov [mailto:petsc-users-bounces at mcs.anl.gov] On Behalf Of Yixun Liu Sent: Saturday, February 14, 2009 4:56 PM To: PETSc users list Subject: Re: link error Satish Balay wrote: > Don't know cmake. > > You'll have to make sure 'all' compiler options used to compile the > PETSc example are also used in your build system. If you miss > something - you'll have to go back - and add it in. > > So: > > - look at the make output of compiling a PETSc example > - look at the make output from compiling your code. > - look for whats missing - and add it to your cmake stuff.. > > [most likely you are missing "-lX11" at link time.] > > Satish > > On Wed, 11 Feb 2009, Yixun Liu wrote: > > >> I can successfully compile the example with PETSC >> makefile. However, I need integrate PETSC into an existing >> application, which use CMake to generate makefile. I add the >> following into CMakelist.txt and use CMake to generate makefile and >> then make. >> > > >> #---------- >> # PETSc >> #---------- >> SET(PETSC_DIR /home/scratch/yixun/petsc-3.0.0-p3) >> SET(PETSC_ARCH /linux-gnu-c-debug) >> SET(X11_DIR /usr/X11R6) >> SET(PETSC_INCLUDE_DIR ${PETSC_DIR}/include >> ${PETSC_DIR}/${PETSC_ARCH}/include) >> SET(PETSC_LIB_DIR ${PETSC_DIR}/${PETSC_ARCH}/lib ${X11_DIR}/lib64 >> ${X11_DIR}/lib/X11) >> When I add the following in my application, there are many link errors. Vec x,b,u; Mat K; KSP ksp; PetscMPIInt size, rank; MPI_Comm_size(PETSC_COMM_WORLD,&size); MPI_Comm_rank(PETSC_COMM_WORLD,&rank); VecCreate(PETSC_COMM_WORLD,&u) Errors: /home/scratch/yixun/petsc-3.0.0-p3/linux-gnu-c-debug/lib/libpetscvec.a(dlregisvec.o): In function `VecInitializePackage': /home/scratch/yixun/petsc-3.0.0-p3/src/vec/vec/interface/dlregisvec.c:183: undefined reference to `PetscObjectComposedDataRegister' /home/scratch/yixun/petsc-3.0.0-p3/linux-gnu-c-debug/lib/libpetscvec.a(pmap.o): In function `PetscMapSetUp': /home/scratch/yixun/petsc-3.0.0-p3/src/vec/vec/impls/mpi/pmap.c:136: undefined reference to `PetscSplitOwnership' /home/scratch/yixun/petsc-3.0.0-p3/linux-gnu-c-debug/lib/libpetscvec.a(index.o): In function `ISSetPermutation': /home/scratch/yixun/petsc-3.0.0-p3/src/vec/is/interface/index.c:140: undefined reference to `PetscSortInt' /home/scratch/yixun/petsc-3.0.0-p3/linux-gnu-c-debug/lib/libpetscvec.a(isltog.o): In function `ISLocalToGlobalMappingGetInfo': /home/scratch/yixun/petsc-3.0.0-p3/src/vec/is/utils/isltog.c:864: undefined reference to `PetscSortIntWithArray' ... I can make ex2 using command make ex2. The link command is like following, mpicc -Wall -Wwrite-strings -Wno-strict-aliasing -g3 -o ex2 ex2.o -Wl,-rpath,/home/scratch/yixun/petsc-3.0.0-p3/linux-gnu-c-debug/lib -L/home/scratch/yixun/petsc-3.0.0-p3/linux-gnu-c-debug/lib -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetsc -lX11 -llapack -lblas -lm -L/usr/lib64 -L/usr/lib64/gcc/x86_64-suse-linux/4.2.1 -L/lib64 -L/usr/x86_64-suse-linux/lib -ldl -llammpio -llamf77mpi -lmpi -llam -lutil -lgcc_s -lpthread -lgfortranbegin -lgfortran -lm -lm -ldl -llammpio -llamf77mpi -lmpi -llam -lutil -lgcc_s -lpthread -ldl The command I use to link my application is like, /usr/bin/mpiCC -DWITHOUT_MTL -D_YAV_ -D_LINUX_ -ansi -Wall -fsigned-char -fsigned-bitfields -Wno-deprecated -ftemplate-depth-50 -Wall -fPIC CMakeFiles/PETScSolver.dir/PETScSolver.o CMakeFiles/PETScSolver.dir/PETScRegistrationMesh.o CMakeFiles/PETScSolver.dir/BlockList.o CMakeFiles/PETScSolver.dir/Point.o -o ../../../bin/PETScSolver -rdynamic -L/home/scratch/yixun/Biofemir/trunk/build/lib -L/home/scratch/yixun/VTK-mpicc/Build/bin -L/home/scratch/yixun/ITK-mpicc/Build/bin -L/lib/LINUX -L/home/scratch/yixun/petsc-3.0.0-p3/linux-gnu-c-debug/lib -L/usr/X11R6/lib64 -L/usr/X11R6/lib/X11 ../../../lib/libTetrahedrisationNG.a ../../../lib/libTetraImageNG.a ../../../lib/libImageDataNG.a -lITKCommon -lITKIO -lvtkIO -lpetsc -lpetscksp -lpetscmat -lpetscvec -lpetsccontrib -lpetscdm -lpetscsnes -lpetscts -lX11 -llapack -lblas -llam -lutil -lm -llammpio -lmpi -lgcc_s -lpthread -lgfortranbegin -ldl ../../../lib/libTetrahedrisationNG.a ../../../lib/libGraphics2DNG.a ../../../lib/libGraphics3DNG.a ../../../lib/libInrimageNG.a ../../../lib/libBasics.a ../../../lib/libmipsZ.a -lITKNrrdIO -litkgdcm -litkjpeg12 -litkjpeg16 -litkopenjpeg -luuid -litkpng -litktiff -litkjpeg8 -lITKSpatialObject -lITKCommon -litkvnl_inst -litkvnl_algo -litkvnl -litkv3p_netlib -litkvcl -lITKMetaIO -litksys -lITKDICOMParser -lITKEXPAT -lITKniftiio -lITKznz -litkzlib -lvtkFiltering -lvtkCommon -lpthread -lm -lvtkDICOMParser -lvtkNetCDF -lvtkmetaio -lvtksqlite -lvtkpng -lvtktiff -lvtkzlib -lvtkjpeg -lvtkexpat -lvtksys -lm -ldl -Wl,-rpath,/home/scratch/yixun/Biofemir/trunk/build/lib:/home/scratch/yixun/VTK-mpicc/Build/bin:/home/scratch/yixun/ITK-mpicc/Build/bin:/lib/LINUX:/home/scratch/yixun/petsc-3.0.0-p3/linux-gnu-c-debug/lib:/usr/X11R6/lib64:/usr/X11R6/lib/X11 I cannot see the difference, but why it doesn't work? Thanks. Yixun From enjoywm at cs.wm.edu Sun Feb 15 17:07:05 2009 From: enjoywm at cs.wm.edu (Yixun Liu) Date: Sun, 15 Feb 2009 18:07:05 -0500 Subject: distribution of matrix and vector Message-ID: <4998A019.4010103@cs.wm.edu> Hi, VecSetSizes(vec, PETSC_DECIDE, n); MatSetSizes(mat, PETSC_DECIDE, PETSC_DECIDE, n,n); If the matrix is square can I conclude that the vec and mat have the same distribution. Thanks Yixun From bsmith at mcs.anl.gov Sun Feb 15 17:13:51 2009 From: bsmith at mcs.anl.gov (Barry Smith) Date: Sun, 15 Feb 2009 17:13:51 -0600 Subject: distribution of matrix and vector In-Reply-To: <4998A019.4010103@cs.wm.edu> References: <4998A019.4010103@cs.wm.edu> Message-ID: <11F9998E-BF75-4844-95AC-E9CBCF919298@mcs.anl.gov> Yes. When you do not provide the local sizes then PetscSplitOwnership() is used to chose a value, thus it matches for different vectors and matrices. Barry On Feb 15, 2009, at 5:07 PM, Yixun Liu wrote: > Hi, > VecSetSizes(vec, PETSC_DECIDE, n); > MatSetSizes(mat, PETSC_DECIDE, PETSC_DECIDE, n,n); > > If the matrix is square can I conclude that the vec and mat have the > same distribution. > > Thanks > Yixun > From enjoywm at cs.wm.edu Sun Feb 15 18:20:32 2009 From: enjoywm at cs.wm.edu (Yixun Liu) Date: Sun, 15 Feb 2009 19:20:32 -0500 Subject: distribution of matrix and vector In-Reply-To: <11F9998E-BF75-4844-95AC-E9CBCF919298@mcs.anl.gov> References: <4998A019.4010103@cs.wm.edu> <11F9998E-BF75-4844-95AC-E9CBCF919298@mcs.anl.gov> Message-ID: <4998B150.3020509@cs.wm.edu> Barry Smith wrote: > > Yes. When you do not provide the local sizes then > PetscSplitOwnership() is used to chose a value, thus it matches for > different vectors and matrices. > > Barry > > On Feb 15, 2009, at 5:07 PM, Yixun Liu wrote: > >> Hi, >> VecSetSizes(vec, PETSC_DECIDE, n); >> MatSetSizes(mat, PETSC_DECIDE, PETSC_DECIDE, n,n); >> >> If the matrix is square can I conclude that the vec and mat have the >> same distribution. >> >> Thanks >> Yixun >> > If the matrix is not square, the distribution should be different. Right? From Andreas.Grassl at student.uibk.ac.at Mon Feb 16 07:55:13 2009 From: Andreas.Grassl at student.uibk.ac.at (Andreas Grassl) Date: Mon, 16 Feb 2009 14:55:13 +0100 Subject: config-options Message-ID: <49997041.3000900@student.uibk.ac.at> Hi, I played around with some configure options and adapted the python scripts from $PETSC_DIR/config/examples, but I didn't find an option to save the current standard options to such a script-file. Is there a possibility to get all the configure options? cheers ando -- /"\ Grassl Andreas \ / ASCII Ribbon Campaign Uni Innsbruck Institut f. Mathematik X against HTML email Technikerstr. 13 Zi 709 / \ +43 (0)512 507 6091 From balay at mcs.anl.gov Mon Feb 16 08:25:03 2009 From: balay at mcs.anl.gov (Satish Balay) Date: Mon, 16 Feb 2009 08:25:03 -0600 (CST) Subject: config-options In-Reply-To: <49997041.3000900@student.uibk.ac.at> References: <49997041.3000900@student.uibk.ac.at> Message-ID: On Mon, 16 Feb 2009, Andreas Grassl wrote: > Hi, > > I played around with some configure options and adapted the python > scripts from $PETSC_DIR/config/examples, but I didn't find an option to > save the current standard options to such a script-file. Not sure I understand the question. When you run configure with any set of options - and the run is successful - you get a $PETSC_ARCH/conf/reconfigure-$PETSC_ARCH.py file - with all these options listed in it. > > Is there a possibility to get all the configure options? Hmm - you can run configure with '--help' option - and it will list all the options configure accepts. Satish From hzhang at mcs.anl.gov Mon Feb 16 09:16:17 2009 From: hzhang at mcs.anl.gov (Hong Zhang) Date: Mon, 16 Feb 2009 09:16:17 -0600 (CST) Subject: distribution of matrix and vector In-Reply-To: <4998B150.3020509@cs.wm.edu> References: <4998A019.4010103@cs.wm.edu> <11F9998E-BF75-4844-95AC-E9CBCF919298@mcs.anl.gov> <4998B150.3020509@cs.wm.edu> Message-ID: On Sun, 15 Feb 2009, Yixun Liu wrote: > Barry Smith wrote: >> >> Yes. When you do not provide the local sizes then >> PetscSplitOwnership() is used to chose a value, thus it matches for >> different vectors and matrices. >> >> Barry >> >> On Feb 15, 2009, at 5:07 PM, Yixun Liu wrote: >> >>> Hi, >>> VecSetSizes(vec, PETSC_DECIDE, n); >>> MatSetSizes(mat, PETSC_DECIDE, PETSC_DECIDE, n,n); >>> >>> If the matrix is square can I conclude that the vec and mat have the >>> same distribution. >>> >>> Thanks >>> Yixun >>> >> > If the matrix is not square, the distribution should be different. Right? It might be different. The better way is to specify local size for vectors and matrices, and set PETSC_DECIDE for global sizes. Hong > From balay at mcs.anl.gov Mon Feb 16 10:44:38 2009 From: balay at mcs.anl.gov (Satish Balay) Date: Mon, 16 Feb 2009 10:44:38 -0600 (CST) Subject: distribution of matrix and vector In-Reply-To: References: <4998A019.4010103@cs.wm.edu> <11F9998E-BF75-4844-95AC-E9CBCF919298@mcs.anl.gov> <4998B150.3020509@cs.wm.edu> Message-ID: On Mon, 16 Feb 2009, Hong Zhang wrote: > > If the matrix is not square, the distribution should be different. Right? > > It might be different. The better way is to specify > local size for vectors and matrices, and set > PETSC_DECIDE for global sizes. It will be different - but will still match [if you use the correct sized vectors with the matrix]. For eg: MatSetSizes(A, PETSC_DECIDE, PETSC_DECIDE, m,n); VecSetSizes(x, PETSC_DECIDE, n); VecSetSizes(b, PETSC_DECIDE, m); /* b = Ax */ MatMult(A,x,b); Satish From Andreas.Grassl at student.uibk.ac.at Mon Feb 16 16:08:32 2009 From: Andreas.Grassl at student.uibk.ac.at (Andreas Grassl) Date: Mon, 16 Feb 2009 23:08:32 +0100 Subject: config-options In-Reply-To: References: <49997041.3000900@student.uibk.ac.at> Message-ID: <4999E3E0.7000009@student.uibk.ac.at> Satish Balay schrieb: > On Mon, 16 Feb 2009, Andreas Grassl wrote: > >> Hi, >> >> I played around with some configure options and adapted the python >> scripts from $PETSC_DIR/config/examples, but I didn't find an option to >> save the current standard options to such a script-file. > > Not sure I understand the question. > > When you run configure with any set of options - and the run is > successful - you get a $PETSC_ARCH/conf/reconfigure-$PETSC_ARCH.py > file - with all these options listed in it. Ok, I start from a script like this and wanted to have the default options, which were not set explicitly to appear in a script as well. > >> Is there a possibility to get all the configure options? > > Hmm - you can run configure with '--help' option - and it will list > all the options configure accepts. do I have to parse them out manually? cheers ando -- /"\ \ / ASCII Ribbon X against HTML email / \ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 315 bytes Desc: OpenPGP digital signature URL: From balay at mcs.anl.gov Mon Feb 16 16:14:09 2009 From: balay at mcs.anl.gov (Satish Balay) Date: Mon, 16 Feb 2009 16:14:09 -0600 (CST) Subject: config-options In-Reply-To: <4999E3E0.7000009@student.uibk.ac.at> References: <49997041.3000900@student.uibk.ac.at> <4999E3E0.7000009@student.uibk.ac.at> Message-ID: On Mon, 16 Feb 2009, Andreas Grassl wrote: > Satish Balay schrieb: > > On Mon, 16 Feb 2009, Andreas Grassl wrote: > > > >> Hi, > >> > >> I played around with some configure options and adapted the python > >> scripts from $PETSC_DIR/config/examples, but I didn't find an option to > >> save the current standard options to such a script-file. > > > > Not sure I understand the question. > > > > When you run configure with any set of options - and the run is > > successful - you get a $PETSC_ARCH/conf/reconfigure-$PETSC_ARCH.py > > file - with all these options listed in it. > > Ok, I start from a script like this and wanted to have the default options, > which were not set explicitly to appear in a script as well. Why? > > > > >> Is there a possibility to get all the configure options? > > > > Hmm - you can run configure with '--help' option - and it will list > > all the options configure accepts. > > do I have to parse them out manually? I guess so.. We don't have a way to format and dump this. Satish From bsmith at mcs.anl.gov Mon Feb 16 16:16:03 2009 From: bsmith at mcs.anl.gov (Barry Smith) Date: Mon, 16 Feb 2009 16:16:03 -0600 Subject: config-options In-Reply-To: <4999E3E0.7000009@student.uibk.ac.at> References: <49997041.3000900@student.uibk.ac.at> <4999E3E0.7000009@student.uibk.ac.at> Message-ID: On Feb 16, 2009, at 4:08 PM, Andreas Grassl wrote: > Satish Balay schrieb: >> On Mon, 16 Feb 2009, Andreas Grassl wrote: >> >>> Hi, >>> >>> I played around with some configure options and adapted the python >>> scripts from $PETSC_DIR/config/examples, but I didn't find an >>> option to >>> save the current standard options to such a script-file. >> >> Not sure I understand the question. >> >> When you run configure with any set of options - and the run is >> successful - you get a $PETSC_ARCH/conf/reconfigure-$PETSC_ARCH.py >> file - with all these options listed in it. > > Ok, I start from a script like this and wanted to have the default > options, > which were not set explicitly to appear in a script as well. There are probably several hundred default options (of various types) and they grow weekly. This is probably why we never thought of providing a way to have them all printed into the reconfigure-* file. Barry > > >> >>> Is there a possibility to get all the configure options? >> >> Hmm - you can run configure with '--help' option - and it will list >> all the options configure accepts. > > do I have to parse them out manually? > > cheers > > ando > > -- > /"\ > \ / ASCII Ribbon > X against HTML email > / \ > > From Andreas.Grassl at student.uibk.ac.at Mon Feb 16 16:20:37 2009 From: Andreas.Grassl at student.uibk.ac.at (Andreas Grassl) Date: Mon, 16 Feb 2009 23:20:37 +0100 Subject: config-options In-Reply-To: References: <49997041.3000900@student.uibk.ac.at> <4999E3E0.7000009@student.uibk.ac.at> Message-ID: <4999E6B5.9040706@student.uibk.ac.at> Satish Balay schrieb: > On Mon, 16 Feb 2009, Andreas Grassl wrote: > >> Satish Balay schrieb: >>> On Mon, 16 Feb 2009, Andreas Grassl wrote: >>> >>>> Hi, >>>> >>>> I played around with some configure options and adapted the python >>>> scripts from $PETSC_DIR/config/examples, but I didn't find an option to >>>> save the current standard options to such a script-file. >>> Not sure I understand the question. >>> >>> When you run configure with any set of options - and the run is >>> successful - you get a $PETSC_ARCH/conf/reconfigure-$PETSC_ARCH.py >>> file - with all these options listed in it. >> Ok, I start from a script like this and wanted to have the default options, >> which were not set explicitly to appear in a script as well. > > Why? To have an overview of the settings and to get the full control over the default-options, but maybe I'm thinking too paranoid and I don't have to change any default-options. cheers ando -- /"\ \ / ASCII Ribbon X against HTML email / \ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 315 bytes Desc: OpenPGP digital signature URL: From bsmith at mcs.anl.gov Mon Feb 16 16:28:01 2009 From: bsmith at mcs.anl.gov (Barry Smith) Date: Mon, 16 Feb 2009 16:28:01 -0600 Subject: config-options In-Reply-To: <4999E6B5.9040706@student.uibk.ac.at> References: <49997041.3000900@student.uibk.ac.at> <4999E3E0.7000009@student.uibk.ac.at> <4999E6B5.9040706@student.uibk.ac.at> Message-ID: <2C33E154-1A87-4D1C-A2F0-89EEA85589E8@mcs.anl.gov> The thing with PETSc config/configure.py options (and even more so with the PETSc runtime options) is that they are NOT centralized and they depend on each other. We don't even know how many there are and all their possible combinations. The only access to ALL of them is via the -help option where the current possibilities are listed. When someone adds a new component to PETSc (or to its config) its options go with that component (not in some central file). I guess we could add some runtime option like -defaults that would present all of them in a machine parsible way, it might be kind of messy. How important is this? Barry On Feb 16, 2009, at 4:20 PM, Andreas Grassl wrote: > Satish Balay schrieb: >> On Mon, 16 Feb 2009, Andreas Grassl wrote: >> >>> Satish Balay schrieb: >>>> On Mon, 16 Feb 2009, Andreas Grassl wrote: >>>> >>>>> Hi, >>>>> >>>>> I played around with some configure options and adapted the python >>>>> scripts from $PETSC_DIR/config/examples, but I didn't find an >>>>> option to >>>>> save the current standard options to such a script-file. >>>> Not sure I understand the question. >>>> >>>> When you run configure with any set of options - and the run is >>>> successful - you get a $PETSC_ARCH/conf/reconfigure-$PETSC_ARCH.py >>>> file - with all these options listed in it. >>> Ok, I start from a script like this and wanted to have the default >>> options, >>> which were not set explicitly to appear in a script as well. >> >> Why? > > To have an overview of the settings and to get the full control over > the > default-options, but maybe I'm thinking too paranoid and I don't > have to change > any default-options. > > cheers > > ando > > > -- > /"\ > \ / ASCII Ribbon > X against HTML email > / \ > > From balay at mcs.anl.gov Mon Feb 16 16:50:01 2009 From: balay at mcs.anl.gov (Satish Balay) Date: Mon, 16 Feb 2009 16:50:01 -0600 (CST) Subject: config-options In-Reply-To: <4999E6B5.9040706@student.uibk.ac.at> References: <49997041.3000900@student.uibk.ac.at> <4999E3E0.7000009@student.uibk.ac.at> <4999E6B5.9040706@student.uibk.ac.at> Message-ID: On Mon, 16 Feb 2009, Andreas Grassl wrote: > >>> > >>> When you run configure with any set of options - and the run is > >>> successful - you get a $PETSC_ARCH/conf/reconfigure-$PETSC_ARCH.py > >>> file - with all these options listed in it. > >> Ok, I start from a script like this and wanted to have the default options, > >> which were not set explicitly to appear in a script as well. > > > > Why? > > To have an overview of the settings and to get the full control over the > default-options, but maybe I'm thinking too paranoid and I don't have to change > any default-options. I think you are trying to fix a problem that doesn't exit [or insignificant]. Anyway your model will not achieve what you want. PETSc configure behaves differently based on some options. For eg: if '--with-cc' is specified - it uses it. But if not specified - it guesses it [and tries a bunch of things]. So there is no way to dump a default 'value' for such things for reuse. [The default in this case - is the absence of this option on the configure command line] Satish From Andreas.Grassl at student.uibk.ac.at Mon Feb 16 16:50:04 2009 From: Andreas.Grassl at student.uibk.ac.at (Andreas Grassl) Date: Mon, 16 Feb 2009 23:50:04 +0100 Subject: config-options In-Reply-To: <2C33E154-1A87-4D1C-A2F0-89EEA85589E8@mcs.anl.gov> References: <49997041.3000900@student.uibk.ac.at> <4999E3E0.7000009@student.uibk.ac.at> <4999E6B5.9040706@student.uibk.ac.at> <2C33E154-1A87-4D1C-A2F0-89EEA85589E8@mcs.anl.gov> Message-ID: <4999ED9C.3050509@student.uibk.ac.at> Barry Smith schrieb: > > The thing with PETSc config/configure.py options (and even more so > with the PETSc runtime options) is that they > are NOT centralized and they depend on each other. We don't even know > how many there are and all their possible > combinations. The only access to ALL of them is via the -help option > where the current possibilities are listed. > When someone adds a new component to PETSc (or to its config) its > options go with that component (not in some central file). I understand > > I guess we could add some runtime option like -defaults that would > present all of them in a machine parsible way, it might > be kind of messy. How important is this? I guess, that as soon as I get more familiar with the framework I won't need it anymore, so it is not so important. And if troubles appear, I know where to ask ;-) cu soon cheers ando -- /"\ \ / ASCII Ribbon X against HTML email / \ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 315 bytes Desc: OpenPGP digital signature URL: From bsmith at mcs.anl.gov Mon Feb 16 17:10:25 2009 From: bsmith at mcs.anl.gov (Barry Smith) Date: Mon, 16 Feb 2009 17:10:25 -0600 Subject: config-options In-Reply-To: References: <49997041.3000900@student.uibk.ac.at> <4999E3E0.7000009@student.uibk.ac.at> <4999E6B5.9040706@student.uibk.ac.at> Message-ID: On Feb 16, 2009, at 4:50 PM, Satish Balay wrote: > On Mon, 16 Feb 2009, Andreas Grassl wrote: > >>>>> >>>>> When you run configure with any set of options - and the run is >>>>> successful - you get a $PETSC_ARCH/conf/reconfigure-$PETSC_ARCH.py >>>>> file - with all these options listed in it. >>>> Ok, I start from a script like this and wanted to have the >>>> default options, >>>> which were not set explicitly to appear in a script as well. >>> >>> Why? >> >> To have an overview of the settings and to get the full control >> over the >> default-options, but maybe I'm thinking too paranoid and I don't >> have to change >> any default-options. > > I think you are trying to fix a problem that doesn't exit [or > insignificant]. Anyway your model will not achieve what you want. > > PETSc configure behaves differently based on some options. > > For eg: if '--with-cc' is specified - it uses it. But if not specified > - it guesses it [and tries a bunch of things]. > > So there is no way to dump a default 'value' for such things for > reuse. [The default in this case - is the absence of this option on > the configure command line] Well actually, we could have it put in the result that it did find after all the evaluations. Yikes, I am not saying we will but that would be the reasonable thing to do. Barry > > > Satish > From enjoywm at cs.wm.edu Mon Feb 16 19:05:26 2009 From: enjoywm at cs.wm.edu (Yixun Liu) Date: Mon, 16 Feb 2009 20:05:26 -0500 Subject: output to matlab Message-ID: <499A0D56.2020209@cs.wm.edu> Hi, I want to output matrix and vector into matlab. // output a vector, PetscViewer bviewer; PetscViewerCreate(PETSC_COMM_WORLD, &bviewer); PetscViewerSetType(bviewer, PETSC_VIEWER_ASCII); PetscViewerSetFormat(bviewer, PETSC_VIEWER_ASCII_MATLAB); PetscViewerFileSetName(bviewer, bname); VecView(externalForcesVector, bviewer);//externalForcesVector is a parallel vector. However, the output file contains nothing. Thanks. Yixun From bsmith at mcs.anl.gov Mon Feb 16 19:17:32 2009 From: bsmith at mcs.anl.gov (Barry Smith) Date: Mon, 16 Feb 2009 19:17:32 -0600 Subject: output to matlab In-Reply-To: <499A0D56.2020209@cs.wm.edu> References: <499A0D56.2020209@cs.wm.edu> Message-ID: On Feb 16, 2009, at 7:05 PM, Yixun Liu wrote: > Hi, > I want to output matrix and vector into matlab. > // output a vector, > PetscViewer bviewer; > PetscViewerCreate(PETSC_COMM_WORLD, &bviewer); > PetscViewerSetType(bviewer, PETSC_VIEWER_ASCII); > PetscViewerSetFormat(bviewer, PETSC_VIEWER_ASCII_MATLAB); > PetscViewerFileSetName(bviewer, bname); > VecView(externalForcesVector, bviewer);//externalForcesVector > is a > parallel vector. > PetscViewerDestroy(bviewer); Run with -info to see what it says along the way. BTW: If the matrix is large then you do not want to use an ASCII viewer. You want to use a binary viewer and then use bin/matlab/PetscBinaryRead() to read the vector into Matlab. Barry > However, the output file contains nothing. > > Thanks. > > Yixun > > From knepley at gmail.com Tue Feb 17 08:26:16 2009 From: knepley at gmail.com (Matthew Knepley) Date: Tue, 17 Feb 2009 08:26:16 -0600 Subject: output to matlab In-Reply-To: <499A0D56.2020209@cs.wm.edu> References: <499A0D56.2020209@cs.wm.edu> Message-ID: Always always always check the return codes for each call (you can use the CHKERRQ macro). Otherwise, you have no idea whether an error occurred during the call. Matt On Mon, Feb 16, 2009 at 7:05 PM, Yixun Liu wrote: > Hi, > I want to output matrix and vector into matlab. > // output a vector, > PetscViewer bviewer; > PetscViewerCreate(PETSC_COMM_WORLD, &bviewer); > PetscViewerSetType(bviewer, PETSC_VIEWER_ASCII); > PetscViewerSetFormat(bviewer, PETSC_VIEWER_ASCII_MATLAB); > PetscViewerFileSetName(bviewer, bname); > VecView(externalForcesVector, bviewer);//externalForcesVector is a > parallel vector. > > However, the output file contains nothing. > > Thanks. > > Yixun > > > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyoung at ippt.gov.pl Tue Feb 17 09:06:41 2009 From: tyoung at ippt.gov.pl (Toby D. Young) Date: Tue, 17 Feb 2009 16:06:41 +0100 Subject: petsc 3.0.0 test woes In-Reply-To: <499A0D56.2020209@cs.wm.edu> References: <499A0D56.2020209@cs.wm.edu> Message-ID: <20090217160641.1cde2981@rav.ippt.gov.pl> Hi, I am trying to migrate to petsc-2.0.0-p3 on an amd64 linux box. I have encountered two (unrealted?) problems. ** install problem 1 After exporting PETSC_DIR and PETSC_ARCH I use: $ ./config/configure.py --with-blas-lib=libblas.so --with-lapack-lib=liblapack.so --with-dynamic=1 --with-shared=1 --with-mpi=0 and then: $make all ...and all looks ok libraries are build. Then $make test complains thus: Running test examples to verify correct installation Possible error running C/C++ src/snes/examples/tutorials/ex19 with 1 MPI process See http://www.mcs.anl.gov/petsc/petsc-as/documentation/troubleshooting.html ././ex19: symbol lookup error: ././ex19: undefined symbol: petsc_tmp_flops Possible error running Graphics examples src/snes/examples/tutorials/ex19 1 MPI process See http://www.mcs.anl.gov/petsc/petsc-as/documentation/troubleshooting.html ././ex19: symbol lookup error: ././ex19: undefined symbol: petsc_tmp_flops Error running Fortran example src/snes/examples/tutorials/ex5f with 1 MPI process See http://www.mcs.anl.gov/petsc/petsc-as/documentation/troubleshooting.html ././ex5f: symbol lookup error: ././ex5f: undefined symbol: dmgetlocalvector_ Completed test examples I am unsure how to track down this error, or what it is I am doing wrong. This procedure works for sure for petsc-2.3.3-p6 Any ideas please? ** install problem 2 Sadly (for me), it seems that the petsc directory structure has changed from 2.3.3-p6; this is bringing development of other packages (deal.ii and slepc) to a screaming halt. So I'll try and fix this without complaining :-) I have noticed this change: petsc-2.3.3-p6/lib --> petsc-3.0.0-p6/$(PETSC_ARCH)/lib Can someone kindly point me of other directory structure changes I should look out for, or is there a page on the PETSc website which documents these changes I can look at. Many thanks. Best, Toby -- Toby D. Young Adiunkt (Assistant Professor) Philosopher-Physicist Department of Computational Science Institute of Fundamental Technological Research Polish Academy of Sciences Room 206, ul. Swietokrzyska 21 00-049 Warszawa, Polska +48 22 826 12 81 ext. 184 http://rav.ippt.gov.pl/~tyoung From bsmith at mcs.anl.gov Tue Feb 17 09:27:55 2009 From: bsmith at mcs.anl.gov (Barry Smith) Date: Tue, 17 Feb 2009 09:27:55 -0600 Subject: petsc 3.0.0 test woes In-Reply-To: <20090217160641.1cde2981@rav.ippt.gov.pl> References: <499A0D56.2020209@cs.wm.edu> <20090217160641.1cde2981@rav.ippt.gov.pl> Message-ID: <8A4ED101-E81F-4BED-8CF4-ECF929B1441D@mcs.anl.gov> Please send configure.log and make.log to petsc-maint at mcs.anl.gov For some reason the shared/dynamic libraries are giving you a problem. If you don't need them just run config/configure.py without --with-dynamic=1 and --with-shared=1 The changes from previous release are listed at http://www.mcs.anl.gov/petsc/petsc-as/documentation/changes/300.html Look at the bullet config/configure.py for changes in directory structure. Barry On Feb 17, 2009, at 9:06 AM, Toby D. Young wrote: > > > Hi, > > I am trying to migrate to petsc-2.0.0-p3 on an amd64 linux box. I have > encountered two (unrealted?) problems. > > ** install problem 1 > > After exporting PETSC_DIR and PETSC_ARCH > I use: > $ ./config/configure.py --with-blas-lib=libblas.so > --with-lapack-lib=liblapack.so --with-dynamic=1 --with-shared=1 > --with-mpi=0 > and then: > $make all > ...and all looks ok libraries are build. Then > $make test > complains thus: > > Running test examples to verify correct installation > Possible error running C/C++ src/snes/examples/tutorials/ex19 with 1 > MPI process See > http://www.mcs.anl.gov/petsc/petsc-as/documentation/troubleshooting.html > ././ex19: > symbol lookup error: ././ex19: undefined symbol: petsc_tmp_flops > Possible error running Graphics examples > src/snes/examples/tutorials/ex19 1 MPI process See > http://www.mcs.anl.gov/petsc/petsc-as/documentation/troubleshooting.html > ././ex19: > symbol lookup error: ././ex19: undefined symbol: petsc_tmp_flops Error > running Fortran example src/snes/examples/tutorials/ex5f with 1 MPI > process See > http://www.mcs.anl.gov/petsc/petsc-as/documentation/troubleshooting.html > ././ex5f: > symbol lookup error: ././ex5f: undefined symbol: dmgetlocalvector_ > Completed test examples > > I am unsure how to track down this error, or what it is I am doing > wrong. This procedure works for sure for petsc-2.3.3-p6 Any ideas > please? > > ** install problem 2 > > Sadly (for me), it seems that the petsc directory structure has > changed > from 2.3.3-p6; this is bringing development of other packages (deal.ii > and slepc) to a screaming halt. So I'll try and fix this without > complaining :-) > > I have noticed this change: > petsc-2.3.3-p6/lib --> petsc-3.0.0-p6/$(PETSC_ARCH)/lib > > Can someone kindly point me of other directory structure changes I > should look out for, or is there a page on the PETSc website which > documents these changes I can look at. > > Many thanks. > Best, > Toby > > > -- > > Toby D. Young > Adiunkt (Assistant Professor) > Philosopher-Physicist > Department of Computational Science > Institute of Fundamental Technological Research > Polish Academy of Sciences > Room 206, ul. Swietokrzyska 21 > 00-049 Warszawa, Polska > > +48 22 826 12 81 ext. 184 > http://rav.ippt.gov.pl/~tyoung From knepley at gmail.com Tue Feb 17 09:29:12 2009 From: knepley at gmail.com (Matthew Knepley) Date: Tue, 17 Feb 2009 09:29:12 -0600 Subject: petsc 3.0.0 test woes In-Reply-To: <20090217160641.1cde2981@rav.ippt.gov.pl> References: <499A0D56.2020209@cs.wm.edu> <20090217160641.1cde2981@rav.ippt.gov.pl> Message-ID: On Tue, Feb 17, 2009 at 9:06 AM, Toby D. Young wrote: > Hi, > > I am trying to migrate to petsc-2.0.0-p3 on an amd64 linux box. I have > encountered two (unrealted?) problems. Please always send logs with these kinds of questions. And when sending logs, petsc-maint at mcs.anl.gov is more appropriate. > > ** install problem 1 > > After exporting PETSC_DIR and PETSC_ARCH > I use: > $ ./config/configure.py --with-blas-lib=libblas.so > --with-lapack-lib=liblapack.so --with-dynamic=1 --with-shared=1 > --with-mpi=0 > and then: > $make all > ...and all looks ok libraries are build. Then Are you positive. Please check again that plog.c built. > > $make test > complains thus: > > Running test examples to verify correct installation > Possible error running C/C++ src/snes/examples/tutorials/ex19 with 1 > MPI process See > http://www.mcs.anl.gov/petsc/petsc-as/documentation/troubleshooting.html././ex19: > symbol lookup error: ././ex19: undefined symbol: petsc_tmp_flops > Possible error running Graphics examples > src/snes/examples/tutorials/ex19 1 MPI process See > http://www.mcs.anl.gov/petsc/petsc-as/documentation/troubleshooting.html././ex19: > symbol lookup error: ././ex19: undefined symbol: petsc_tmp_flops Error > running Fortran example src/snes/examples/tutorials/ex5f with 1 MPI > process See > http://www.mcs.anl.gov/petsc/petsc-as/documentation/troubleshooting.html././ex5f: > symbol lookup error: ././ex5f: undefined symbol: dmgetlocalvector_ > Completed test examples > > I am unsure how to track down this error, or what it is I am doing > wrong. This procedure works for sure for petsc-2.3.3-p6 Any ideas > please? The symbol petsc_tmp_flops is defined in plog.c, which is in libpetsc.a. You can check for that symbol with nm. > > ** install problem 2 > > Sadly (for me), it seems that the petsc directory structure has changed > from 2.3.3-p6; this is bringing development of other packages (deal.ii > and slepc) to a screaming halt. So I'll try and fix this without > complaining :-) > > I have noticed this change: > petsc-2.3.3-p6/lib --> petsc-3.0.0-p6/$(PETSC_ARCH)/lib > > Can someone kindly point me of other directory structure changes I > should look out for, or is there a page on the PETSc website which > documents these changes I can look at. We now conform to the Linux install model. All 3rd party packages and petsc includes/libraries are installed under $PETSC_ARCH, or in the install location you specify. Matt > > Many thanks. > Best, > Toby > > > -- > > Toby D. Young > Adiunkt (Assistant Professor) > Philosopher-Physicist > Department of Computational Science > Institute of Fundamental Technological Research > Polish Academy of Sciences > Room 206, ul. Swietokrzyska 21 > 00-049 Warszawa, Polska > > +48 22 826 12 81 ext. 184 > http://rav.ippt.gov.pl/~tyoung > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From tribur at vision.ee.ethz.ch Thu Feb 19 14:58:18 2009 From: tribur at vision.ee.ethz.ch (tribur at vision.ee.ethz.ch) Date: Thu, 19 Feb 2009 21:58:18 +0100 Subject: rtol + initial guess nonzero Message-ID: <20090219215818.ehh0tafmhws8skk4@email-bak.ee.ethz.ch> Dear petsc-people, can it be possible that the initial residuum norm used in rtol is always calculated by inserting zero, even if the initial guess is nonzero (using KSPSetInitialGuessNonzero)? From bsmith at mcs.anl.gov Thu Feb 19 15:18:41 2009 From: bsmith at mcs.anl.gov (Barry Smith) Date: Thu, 19 Feb 2009 15:18:41 -0600 Subject: rtol + initial guess nonzero In-Reply-To: <20090219215818.ehh0tafmhws8skk4@email-bak.ee.ethz.ch> References: <20090219215818.ehh0tafmhws8skk4@email-bak.ee.ethz.ch> Message-ID: <1DC0CAE0-D9CD-453A-900D-2BB555298E33@mcs.anl.gov> Yes, in fact it can be pretty complicated. The default convergence test is KSPDefaultConverged() in src/ksp/ksp/interface/iterativ.c In the manual page for KSPDefaultConverged() you'll find the cryptic When initial guess is non-zero you can call KSPDefaultConvergedSetUIRNorm() to use the norm of (b - A*(initial guess)) as the starting point for relative norm convergence testing. In the manual page for that function you'll see the option - ksp_converged_use_initial_residual_norm you'll also see mention of the manual page for KSPDefaultConvergedSetUMIRNorm() and that manual page mentions the option -ksp_converged_use_min_initial_residual_norm Thus there are basically three choices to use for the initial residual norm. Barry On Feb 19, 2009, at 2:58 PM, tribur at vision.ee.ethz.ch wrote: > Dear petsc-people, > > can it be possible that the initial residuum norm used in rtol is > always calculated by inserting zero, even if the initial guess is > nonzero (using KSPSetInitialGuessNonzero)? > From rlmackie862 at gmail.com Thu Feb 19 15:22:15 2009 From: rlmackie862 at gmail.com (Randall Mackie) Date: Thu, 19 Feb 2009 13:22:15 -0800 Subject: Question on using DMMG Message-ID: <499DCD87.2020805@gmail.com> I'm trying to modify my code to use the DMMG routines to solve my system by multi-grid, instead of the usual krylov solver. In my previous code, I would set up a DA for my finite difference grid, set the matrix preallocation using MATCreateMPIAIJ, then fill the matrix, etc. In the code I've modified to use DMMG, here is my sequence of routines so far: call DMMGCreate(...) call DACreate3D(....) ! to set the DA on the finest level call DMMGSetDM(...) call DMMGSETKSP(...) Questions: 1) I want to set the DA on the finest level and use Galerkin to get the coarser matrices. So, is the DACreate above the way to do this? 2) How do I set the matrix preallocation here for use in the DMMG routines? Would I use the same MATCreateMPIAIJ as before, and if so, where do I put that? In the routine that fills the Jacobian, or in the main program someplace? Thanks, Randy From knepley at gmail.com Thu Feb 19 15:36:35 2009 From: knepley at gmail.com (Matthew Knepley) Date: Thu, 19 Feb 2009 15:36:35 -0600 Subject: Question on using DMMG In-Reply-To: <499DCD87.2020805@gmail.com> References: <499DCD87.2020805@gmail.com> Message-ID: On Thu, Feb 19, 2009 at 3:22 PM, Randall Mackie wrote: > I'm trying to modify my code to use the DMMG routines to solve my system > by multi-grid, instead of the usual krylov solver. In my previous code, > I would set up a DA for my finite difference grid, set the matrix > preallocation using MATCreateMPIAIJ, then fill the matrix, etc. > > In the code I've modified to use DMMG, here is my sequence of routines > so far: > > call DMMGCreate(...) > call DACreate3D(....) ! to set the DA on the finest level > call DMMGSetDM(...) > > > call DMMGSETKSP(...) > > > Questions: > > 1) I want to set the DA on the finest level and use Galerkin to get > the coarser matrices. So, is the DACreate above the way to do this? Unfortunately, the DA has no way to do this right now since it does not know how to coarsen. You tell it the coarse grid and it refines. > > 2) How do I set the matrix preallocation here for use in the DMMG routines? > Would I use the same MATCreateMPIAIJ as before, and if so, where do I > put that? In the routine that fills the Jacobian, or in the main program > someplace? The DA will doe the preallocation by default. Use DAGetMatrix(). Matt > > Thanks, Randy > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From bsmith at mcs.anl.gov Thu Feb 19 15:41:09 2009 From: bsmith at mcs.anl.gov (Barry Smith) Date: Thu, 19 Feb 2009 15:41:09 -0600 Subject: Question on using DMMG In-Reply-To: <499DCD87.2020805@gmail.com> References: <499DCD87.2020805@gmail.com> Message-ID: <83475117-D946-42E8-92E9-7F04C9C541A8@mcs.anl.gov> On Feb 19, 2009, at 3:22 PM, Randall Mackie wrote: > I'm trying to modify my code to use the DMMG routines to solve my > system > by multi-grid, instead of the usual krylov solver. In my previous > code, > I would set up a DA for my finite difference grid, set the matrix > preallocation using MATCreateMPIAIJ, then fill the matrix, etc. > > In the code I've modified to use DMMG, here is my sequence of routines > so far: > > call DMMGCreate(...) > call DACreate3D(....) ! to set the DA on the finest level > call DMMGSetDM(...) > > > call DMMGSETKSP(...) > > > Questions: > > 1) I want to set the DA on the finest level and use Galerkin to get > the coarser matrices. So, is the DACreate above the way to do this? The current design always has you setting the coarsest DA; DMMG generates all the finer ones automatically. This is independent of using Galerkin coarse grids or not. To have DMMG use Galerkin to generate the coarser matrices call DMMGSetUseGalerkinCoarse() after you se the number of levels or use the option -dmmg_galerkin > > > 2) How do I set the matrix preallocation here for use in the DMMG > routines? > Would I use the same MATCreateMPIAIJ as before, and if so, where do I > put that? In the routine that fills the Jacobian, or in the main > program > someplace? DMMG manages all this for you; it creates the empty matrices (based on the DA stencil) and gives them the right nonzero structure. See, for example, src/ksp/ksp/examples/tutorials/ex34.c Barry > > > > Thanks, Randy From rlmackie862 at gmail.com Thu Feb 19 15:48:32 2009 From: rlmackie862 at gmail.com (Randall Mackie) Date: Thu, 19 Feb 2009 13:48:32 -0800 Subject: Question on using DMMG In-Reply-To: <83475117-D946-42E8-92E9-7F04C9C541A8@mcs.anl.gov> References: <499DCD87.2020805@gmail.com> <83475117-D946-42E8-92E9-7F04C9C541A8@mcs.anl.gov> Message-ID: <499DD3B0.2040203@gmail.com> Barry, I'm a little confused then, by how you set the size of the coarse grid in relation to the fine grid. What if my fine grid is 283x107x113? Can I just use a coarse grid of 3x3x3 and then the finer ones are generated until it gets to my fine grid? I've been trying to follow ex22f.F, where you set the coarse grid, and number of levels, but I can't figure out the relation between the grid size on each level and how you specify the grid size at the finest level. In ex22f.F, when I run it, I see the first level is 27x27 (since the 3D grid is 3x3x3). Then at the next level it goes to 125x125 or 5x5x5. Then the final level is 729x729, or 9x9x9. Thanks, Randy Barry Smith wrote: > > On Feb 19, 2009, at 3:22 PM, Randall Mackie wrote: > >> I'm trying to modify my code to use the DMMG routines to solve my system >> by multi-grid, instead of the usual krylov solver. In my previous code, >> I would set up a DA for my finite difference grid, set the matrix >> preallocation using MATCreateMPIAIJ, then fill the matrix, etc. >> >> In the code I've modified to use DMMG, here is my sequence of routines >> so far: >> >> call DMMGCreate(...) >> call DACreate3D(....) ! to set the DA on the finest level >> call DMMGSetDM(...) >> >> >> call DMMGSETKSP(...) >> >> >> Questions: >> >> 1) I want to set the DA on the finest level and use Galerkin to get >> the coarser matrices. So, is the DACreate above the way to do this? > > The current design always has you setting the coarsest DA; DMMG > generates all the finer ones > automatically. This is independent of using Galerkin coarse grids or not. > > To have DMMG use Galerkin to generate the coarser matrices call > DMMGSetUseGalerkinCoarse() > after you se the number of levels or use the option -dmmg_galerkin > >> >> >> 2) How do I set the matrix preallocation here for use in the DMMG >> routines? >> Would I use the same MATCreateMPIAIJ as before, and if so, where do I >> put that? In the routine that fills the Jacobian, or in the main program >> someplace? > > DMMG manages all this for you; it creates the empty matrices (based > on the DA stencil) and gives them > the right nonzero structure. > > See, for example, src/ksp/ksp/examples/tutorials/ex34.c > > Barry > >> >> >> >> Thanks, Randy > From knepley at gmail.com Thu Feb 19 15:50:31 2009 From: knepley at gmail.com (Matthew Knepley) Date: Thu, 19 Feb 2009 15:50:31 -0600 Subject: Question on using DMMG In-Reply-To: <499DD3B0.2040203@gmail.com> References: <499DCD87.2020805@gmail.com> <83475117-D946-42E8-92E9-7F04C9C541A8@mcs.anl.gov> <499DD3B0.2040203@gmail.com> Message-ID: On Thu, Feb 19, 2009 at 3:48 PM, Randall Mackie wrote: > Barry, > > I'm a little confused then, by how you set the size of the coarse grid > in relation to the fine grid. What if my fine grid is 283x107x113? Can > I just use a coarse grid of 3x3x3 and then the finer ones are generated > until it gets to my fine grid? I've been trying to follow ex22f.F, where > you set the coarse grid, and number of levels, but I can't figure out > the relation between the grid size on each level and how you specify > the grid size at the finest level. This is exactly why we only let the user set the coarse grid. Not all grids are possible with this simple scheme. If you truly need that particular grid, then you cannot use DMMG as is, as it is too simple. You can, however, provide your own grids and restriction or interpolation matrices to DMMG, and it will handle the solution process. Matt > > In ex22f.F, when I run it, I see the first level is 27x27 (since the > 3D grid is 3x3x3). Then at the next level it goes to 125x125 or 5x5x5. > Then the final level is 729x729, or 9x9x9. > > Thanks, Randy > > Barry Smith wrote: > >> >> On Feb 19, 2009, at 3:22 PM, Randall Mackie wrote: >> >> I'm trying to modify my code to use the DMMG routines to solve my system >>> by multi-grid, instead of the usual krylov solver. In my previous code, >>> I would set up a DA for my finite difference grid, set the matrix >>> preallocation using MATCreateMPIAIJ, then fill the matrix, etc. >>> >>> In the code I've modified to use DMMG, here is my sequence of routines >>> so far: >>> >>> call DMMGCreate(...) >>> call DACreate3D(....) ! to set the DA on the finest level >>> call DMMGSetDM(...) >>> >>> >>> call DMMGSETKSP(...) >>> >>> >>> Questions: >>> >>> 1) I want to set the DA on the finest level and use Galerkin to get >>> the coarser matrices. So, is the DACreate above the way to do this? >>> >> >> The current design always has you setting the coarsest DA; DMMG >> generates all the finer ones >> automatically. This is independent of using Galerkin coarse grids or not. >> >> To have DMMG use Galerkin to generate the coarser matrices call >> DMMGSetUseGalerkinCoarse() >> after you se the number of levels or use the option -dmmg_galerkin >> >> >>> >>> 2) How do I set the matrix preallocation here for use in the DMMG >>> routines? >>> Would I use the same MATCreateMPIAIJ as before, and if so, where do I >>> put that? In the routine that fills the Jacobian, or in the main program >>> someplace? >>> >> >> DMMG manages all this for you; it creates the empty matrices (based on >> the DA stencil) and gives them >> the right nonzero structure. >> >> See, for example, src/ksp/ksp/examples/tutorials/ex34.c >> >> Barry >> >> >>> >>> >>> Thanks, Randy >>> >> >> -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From bsmith at mcs.anl.gov Thu Feb 19 16:02:38 2009 From: bsmith at mcs.anl.gov (Barry Smith) Date: Thu, 19 Feb 2009 16:02:38 -0600 Subject: Question on using DMMG In-Reply-To: <499DD3B0.2040203@gmail.com> References: <499DCD87.2020805@gmail.com> <83475117-D946-42E8-92E9-7F04C9C541A8@mcs.anl.gov> <499DD3B0.2040203@gmail.com> Message-ID: <2942B08E-B49E-4E44-84AB-C43C4A956331@mcs.anl.gov> On Feb 19, 2009, at 3:48 PM, Randall Mackie wrote: > Barry, > > I'm a little confused then, by how you set the size of the coarse grid > in relation to the fine grid. What if my fine grid is 283x107x113? Can > I just use a coarse grid of 3x3x3 and then the finer ones are > generated > until it gets to my fine grid? I've been trying to follow ex22f.F, > where > you set the coarse grid, and number of levels, but I can't figure out > the relation between the grid size on each level and how you specify ^ ^^^^^^^^^^^^^^^ > > the grid size at the finest level. We don't specify the grid size at the finest level; it just comes out from the coarse grid size and the number of levels. > > > In ex22f.F, when I run it, I see the first level is 27x27 (since the > 3D grid is 3x3x3). Then at the next level it goes to 125x125 or 5x5x5. > Then the final level is 729x729, or 9x9x9. By default, with nonperiodic domains the grid spacing (distance between grid points) is cut in half with each refinement. So, for one dimension this looks like * * * + + + + + x x x x x x x x x that's 3 points, then 5, then 9. To get the 113 with three levels then make it 29 on the coarsest, then it becomes 57 then it becomes 113. For four levels start with 15. You can refine by other factors like 3 using DASetRefinementFactor() call this after DACreate but before DMMGSetDA() You can also control this via the options database see the manual page. Barry > > > Thanks, Randy > > Barry Smith wrote: >> On Feb 19, 2009, at 3:22 PM, Randall Mackie wrote: >>> I'm trying to modify my code to use the DMMG routines to solve my >>> system >>> by multi-grid, instead of the usual krylov solver. In my previous >>> code, >>> I would set up a DA for my finite difference grid, set the matrix >>> preallocation using MATCreateMPIAIJ, then fill the matrix, etc. >>> >>> In the code I've modified to use DMMG, here is my sequence of >>> routines >>> so far: >>> >>> call DMMGCreate(...) >>> call DACreate3D(....) ! to set the DA on the finest level >>> call DMMGSetDM(...) >>> >>> >>> call DMMGSETKSP(...) >>> >>> >>> Questions: >>> >>> 1) I want to set the DA on the finest level and use Galerkin to get >>> the coarser matrices. So, is the DACreate above the way to do this? >> The current design always has you setting the coarsest DA; DMMG >> generates all the finer ones >> automatically. This is independent of using Galerkin coarse grids >> or not. >> To have DMMG use Galerkin to generate the coarser matrices call >> DMMGSetUseGalerkinCoarse() >> after you se the number of levels or use the option -dmmg_galerkin >>> >>> >>> 2) How do I set the matrix preallocation here for use in the DMMG >>> routines? >>> Would I use the same MATCreateMPIAIJ as before, and if so, where >>> do I >>> put that? In the routine that fills the Jacobian, or in the main >>> program >>> someplace? >> DMMG manages all this for you; it creates the empty matrices >> (based on the DA stencil) and gives them >> the right nonzero structure. >> See, for example, src/ksp/ksp/examples/tutorials/ex34.c >> Barry >>> >>> >>> >>> Thanks, Randy From bsmith at mcs.anl.gov Thu Feb 19 16:12:12 2009 From: bsmith at mcs.anl.gov (Barry Smith) Date: Thu, 19 Feb 2009 16:12:12 -0600 Subject: request for cool PETSc generated images Message-ID: <16F881FD-687D-462D-A776-CD78785DEC16@mcs.anl.gov> PETSc users, We have decided to apply PETSc for a 2008 R and D 100 award (getting these type awards is always useful to keep funding flowing). In order to get make a good first impression we have been advised that some really nice graphics based on some PETSc computations would be useful. If any one is able to contribute some (high resolution) that represent something of interest to the industrial, commercial or the governmental world we'd really appreciate it. We'd, of course, include cite you and your work with the images. Send them along to petsc-maint at mcs.anl.gov Thanks Barry From irfan.khan at gatech.edu Fri Feb 20 10:51:07 2009 From: irfan.khan at gatech.edu (Khan, Irfan) Date: Fri, 20 Feb 2009 11:51:07 -0500 (EST) Subject: reading matlab binary files In-Reply-To: <590752070.989171235148387468.JavaMail.root@mail4.gatech.edu> Message-ID: <587833249.990391235148667370.JavaMail.root@mail4.gatech.edu> Hi In an earlier email to the group Barry mentioned that if the matrix sizes are large, the output should be done in binary format and bin/matlab/PetscBinaryRead.m should be used to read the matrix into matlab. I have output the matrix in the following manner. ierr = PetscViewerBinaryOpen(PETSC_COMM_WORLD, fname, FILE_MODE_WRITE, &viewer); ierr = PetscObjectSetName((PetscObject)obj.Amat,"Stiffness_matrix"); ierr = MatView(obj.Amat,viewer); I don't get any error messages during execution. However, when I have not been successful reading the matrix into matlab. Presently I get the following error messages. ??? Error using ==> fread Invalid file identifier. Use fopen to generate a valid file identifier. Error in ==> PetscOpenFile.read at 5 d = fread(freader.fd,count,datatype); Error in ==> PetscBinaryRead at 49 header = read(fd,1,'int32'); Any suggestions to solve the problem? Thanks Irfan From bsmith at mcs.anl.gov Fri Feb 20 11:27:18 2009 From: bsmith at mcs.anl.gov (Barry Smith) Date: Fri, 20 Feb 2009 11:27:18 -0600 Subject: reading matlab binary files In-Reply-To: <587833249.990391235148667370.JavaMail.root@mail4.gatech.edu> References: <587833249.990391235148667370.JavaMail.root@mail4.gatech.edu> Message-ID: <299D201A-36E7-4AF3-8F8A-79C2886BCDEB@mcs.anl.gov> Irfan, Make sure you use the absolutely latest PETSc patches version. There were some problems that we just recently fixed. If that does not solve the problem send the binary file to petsc-maint at mcs.anl.gov Barry On Feb 20, 2009, at 10:51 AM, Khan, Irfan wrote: > Hi > > In an earlier email to the group Barry mentioned that if the matrix > sizes are large, the output should be done in binary format and bin/ > matlab/PetscBinaryRead.m should be used to read the matrix into > matlab. > > I have output the matrix in the following manner. > > ierr = PetscViewerBinaryOpen(PETSC_COMM_WORLD, fname, > FILE_MODE_WRITE, &viewer); > ierr = > PetscObjectSetName((PetscObject)obj.Amat,"Stiffness_matrix"); > ierr = MatView(obj.Amat,viewer); > > I don't get any error messages during execution. However, when I > have not been successful reading the matrix into matlab. Presently I > get the following error messages. > > > > ??? Error using ==> fread > Invalid file identifier. Use fopen to generate a valid file > identifier. > > Error in ==> PetscOpenFile.read at 5 > d = fread(freader.fd,count,datatype); > > Error in ==> PetscBinaryRead at 49 > header = read(fd,1,'int32'); > > > Any suggestions to solve the problem? > > Thanks > Irfan From bruno.zerbo at gmail.com Fri Feb 20 11:28:20 2009 From: bruno.zerbo at gmail.com (Bruno Zerbo) Date: Fri, 20 Feb 2009 18:28:20 +0100 Subject: problem with the mail list Message-ID: <4fd5fadd0902200928g79cc4141t98edf29ba73fce42@mail.gmail.com> Hi, sorry but i can't remove my mail address from the mail list. I tried but I had not success, and i still receive your mail. Can you help me? From balay at mcs.anl.gov Fri Feb 20 11:41:16 2009 From: balay at mcs.anl.gov (Satish Balay) Date: Fri, 20 Feb 2009 11:41:16 -0600 (CST) Subject: problem with the mail list In-Reply-To: <4fd5fadd0902200928g79cc4141t98edf29ba73fce42@mail.gmail.com> References: <4fd5fadd0902200928g79cc4141t98edf29ba73fce42@mail.gmail.com> Message-ID: I'll remove your e-mail from the subscription list. However - we had migrated from majordomo to mailmail for all our lists - and one should be able to unsubscribe from the links mentioned at: http://www.mcs.anl.gov/petsc/petsc-as/miscellaneous/mailing-lists.html Satish On Fri, 20 Feb 2009, Bruno Zerbo wrote: > Hi, sorry but i can't remove my mail address from the mail list. I > tried but I had not success, and i still receive your mail. > Can you help me? > From enjoywm at cs.wm.edu Fri Feb 20 12:25:54 2009 From: enjoywm at cs.wm.edu (Yixun Liu) Date: Fri, 20 Feb 2009 13:25:54 -0500 Subject: se2(partitioning) Message-ID: <499EF5B2.9050209@cs.wm.edu> Hi, In ex2, the following codes Change the element vertex information to the PETSc numbering. 705:AOCreateBasic (PETSC_COMM_WORLD ,gdata->nlocal,gdata->localvert,PETSC_NULL ,&ao); 710:AOApplicationToPetsc (ao,3*gdata->mlocal_ele,gdata->ele); However, I cannot find the codes which are used to create an array or vector, which stores the coordinates according to the PETSc numbering. Without this array how we get the coordinate of the vertex of an element? Thanks. From rlmackie862 at gmail.com Fri Feb 20 12:34:21 2009 From: rlmackie862 at gmail.com (Randall Mackie) Date: Fri, 20 Feb 2009 10:34:21 -0800 Subject: Question on using DMMG In-Reply-To: <2942B08E-B49E-4E44-84AB-C43C4A956331@mcs.anl.gov> References: <499DCD87.2020805@gmail.com> <83475117-D946-42E8-92E9-7F04C9C541A8@mcs.anl.gov> <499DD3B0.2040203@gmail.com> <2942B08E-B49E-4E44-84AB-C43C4A956331@mcs.anl.gov> Message-ID: <499EF7AD.5020304@gmail.com> Thanks Barry, this was useful and I now understand how to set the levels and the grid size at the coarsest level. I'm trying to run a simple test problem, and it seems to be taking *forever* in the routine setting the Jacobian. In my old code, where I use MATCreateMPIAIJ to set up the matrix with the correct pre-allocation, it takes no time to fill this matrix. Here's a sketch of my ComputeJacobian routine: call DMMGGetDA Call DAGetGlobalIndices Loop through model: v(ic)=fact col(ic)=ltog(idltog +.....) etc call MatSetValues(...) I suspect this is a problem of the default stencil that is set up, with many more entries than I'm using. Any way to just use MATMPIAIJSetPreallocation, or do I need to use DASetBlockFills? Thanks, Randy Barry Smith wrote: > > On Feb 19, 2009, at 3:48 PM, Randall Mackie wrote: > >> Barry, >> >> I'm a little confused then, by how you set the size of the coarse grid >> in relation to the fine grid. What if my fine grid is 283x107x113? Can >> I just use a coarse grid of 3x3x3 and then the finer ones are generated >> until it gets to my fine grid? I've been trying to follow ex22f.F, where >> you set the coarse grid, and number of levels, but I can't figure out >> the relation between the grid size on each level and how you specify > > ^^^^^^^^^^^^^^^^ >> >> the grid size at the finest level. > > We don't specify the grid size at the finest level; it just comes > out from the coarse > grid size and the number of levels. >> >> >> In ex22f.F, when I run it, I see the first level is 27x27 (since the >> 3D grid is 3x3x3). Then at the next level it goes to 125x125 or 5x5x5. >> Then the final level is 729x729, or 9x9x9. > > By default, with nonperiodic domains the grid spacing (distance > between grid points) > is cut in half with each refinement. So, for one dimension this looks like > > * * * > + + + + + > x x x x x x x x x > > that's 3 points, then 5, then 9. > > To get the 113 with three levels then make it 29 on the coarsest, > then it becomes 57 then it > becomes 113. For four levels start with 15. > > You can refine by other factors like 3 using DASetRefinementFactor() > call this after > DACreate but before DMMGSetDA() You can also control this via the > options database > see the manual page. > > Barry > > >> >> >> Thanks, Randy >> >> Barry Smith wrote: >>> On Feb 19, 2009, at 3:22 PM, Randall Mackie wrote: >>>> I'm trying to modify my code to use the DMMG routines to solve my >>>> system >>>> by multi-grid, instead of the usual krylov solver. In my previous code, >>>> I would set up a DA for my finite difference grid, set the matrix >>>> preallocation using MATCreateMPIAIJ, then fill the matrix, etc. >>>> >>>> In the code I've modified to use DMMG, here is my sequence of routines >>>> so far: >>>> >>>> call DMMGCreate(...) >>>> call DACreate3D(....) ! to set the DA on the finest level >>>> call DMMGSetDM(...) >>>> >>>> >>>> call DMMGSETKSP(...) >>>> >>>> >>>> Questions: >>>> >>>> 1) I want to set the DA on the finest level and use Galerkin to get >>>> the coarser matrices. So, is the DACreate above the way to do this? >>> The current design always has you setting the coarsest DA; DMMG >>> generates all the finer ones >>> automatically. This is independent of using Galerkin coarse grids or >>> not. >>> To have DMMG use Galerkin to generate the coarser matrices call >>> DMMGSetUseGalerkinCoarse() >>> after you se the number of levels or use the option -dmmg_galerkin >>>> >>>> >>>> 2) How do I set the matrix preallocation here for use in the DMMG >>>> routines? >>>> Would I use the same MATCreateMPIAIJ as before, and if so, where do I >>>> put that? In the routine that fills the Jacobian, or in the main >>>> program >>>> someplace? >>> DMMG manages all this for you; it creates the empty matrices >>> (based on the DA stencil) and gives them >>> the right nonzero structure. >>> See, for example, src/ksp/ksp/examples/tutorials/ex34.c >>> Barry >>>> >>>> >>>> >>>> Thanks, Randy > From knepley at gmail.com Fri Feb 20 12:44:31 2009 From: knepley at gmail.com (Matthew Knepley) Date: Fri, 20 Feb 2009 12:44:31 -0600 Subject: Question on using DMMG In-Reply-To: <499EF7AD.5020304@gmail.com> References: <499DCD87.2020805@gmail.com> <83475117-D946-42E8-92E9-7F04C9C541A8@mcs.anl.gov> <499DD3B0.2040203@gmail.com> <2942B08E-B49E-4E44-84AB-C43C4A956331@mcs.anl.gov> <499EF7AD.5020304@gmail.com> Message-ID: On Fri, Feb 20, 2009 at 12:34 PM, Randall Mackie wrote: > Thanks Barry, this was useful and I now understand how to set the levels > and > the grid size at the coarsest level. > > I'm trying to run a simple test problem, and it seems to be taking > *forever* > in the routine setting the Jacobian. In my old code, where I use > MATCreateMPIAIJ > to set up the matrix with the correct pre-allocation, it takes no time to > fill > this matrix. > > Here's a sketch of my ComputeJacobian routine: > > call DMMGGetDA > Call DAGetGlobalIndices > > Loop through model: > > v(ic)=fact > col(ic)=ltog(idltog +.....) > > etc > > call MatSetValues(...) > > > > I suspect this is a problem of the default stencil that is set up, with > many more entries than I'm using. Any way to just use > MATMPIAIJSetPreallocation, > or do I need to use DASetBlockFills? 1) More entires would not cause a slowdown, but fewer would. 2) I believe that DA matrices are flagged to generate an error when a malloc is generated. You can run with -log to check this. Matt > > Thanks, Randy > > > Barry Smith wrote: > >> >> On Feb 19, 2009, at 3:48 PM, Randall Mackie wrote: >> >> Barry, >>> >>> I'm a little confused then, by how you set the size of the coarse grid >>> in relation to the fine grid. What if my fine grid is 283x107x113? Can >>> I just use a coarse grid of 3x3x3 and then the finer ones are generated >>> until it gets to my fine grid? I've been trying to follow ex22f.F, where >>> you set the coarse grid, and number of levels, but I can't figure out >>> the relation between the grid size on each level and how you specify >>> >> >> ^^^^^^^^^^^^^^^^ >> >>> >>> the grid size at the finest level. >>> >> >> We don't specify the grid size at the finest level; it just comes out >> from the coarse >> grid size and the number of levels. >> >>> >>> >>> In ex22f.F, when I run it, I see the first level is 27x27 (since the >>> 3D grid is 3x3x3). Then at the next level it goes to 125x125 or 5x5x5. >>> Then the final level is 729x729, or 9x9x9. >>> >> >> By default, with nonperiodic domains the grid spacing (distance between >> grid points) >> is cut in half with each refinement. So, for one dimension this looks like >> >> * * * >> + + + + + >> x x x x x x x x x >> >> that's 3 points, then 5, then 9. >> >> To get the 113 with three levels then make it 29 on the coarsest, then >> it becomes 57 then it >> becomes 113. For four levels start with 15. >> >> You can refine by other factors like 3 using DASetRefinementFactor() >> call this after >> DACreate but before DMMGSetDA() You can also control this via the options >> database >> see the manual page. >> >> Barry >> >> >> >>> >>> Thanks, Randy >>> >>> Barry Smith wrote: >>> >>>> On Feb 19, 2009, at 3:22 PM, Randall Mackie wrote: >>>> >>>>> I'm trying to modify my code to use the DMMG routines to solve my >>>>> system >>>>> by multi-grid, instead of the usual krylov solver. In my previous code, >>>>> I would set up a DA for my finite difference grid, set the matrix >>>>> preallocation using MATCreateMPIAIJ, then fill the matrix, etc. >>>>> >>>>> In the code I've modified to use DMMG, here is my sequence of routines >>>>> so far: >>>>> >>>>> call DMMGCreate(...) >>>>> call DACreate3D(....) ! to set the DA on the finest level >>>>> call DMMGSetDM(...) >>>>> >>>>> >>>>> call DMMGSETKSP(...) >>>>> >>>>> >>>>> Questions: >>>>> >>>>> 1) I want to set the DA on the finest level and use Galerkin to get >>>>> the coarser matrices. So, is the DACreate above the way to do this? >>>>> >>>> The current design always has you setting the coarsest DA; DMMG >>>> generates all the finer ones >>>> automatically. This is independent of using Galerkin coarse grids or >>>> not. >>>> To have DMMG use Galerkin to generate the coarser matrices call >>>> DMMGSetUseGalerkinCoarse() >>>> after you se the number of levels or use the option -dmmg_galerkin >>>> >>>>> >>>>> >>>>> 2) How do I set the matrix preallocation here for use in the DMMG >>>>> routines? >>>>> Would I use the same MATCreateMPIAIJ as before, and if so, where do I >>>>> put that? In the routine that fills the Jacobian, or in the main >>>>> program >>>>> someplace? >>>>> >>>> DMMG manages all this for you; it creates the empty matrices (based on >>>> the DA stencil) and gives them >>>> the right nonzero structure. >>>> See, for example, src/ksp/ksp/examples/tutorials/ex34.c >>>> Barry >>>> >>>>> >>>>> >>>>> >>>>> Thanks, Randy >>>>> >>>> >> -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Fri Feb 20 12:46:18 2009 From: knepley at gmail.com (Matthew Knepley) Date: Fri, 20 Feb 2009 12:46:18 -0600 Subject: se2(partitioning) In-Reply-To: <499EF5B2.9050209@cs.wm.edu> References: <499EF5B2.9050209@cs.wm.edu> Message-ID: The coordinates are stored according to the PETSc numbering. You get them using http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/DA/DAGetCoordinates.html Matt On Fri, Feb 20, 2009 at 12:25 PM, Yixun Liu wrote: > Hi, > In ex2, the following codes Change the element vertex information to the > PETSc numbering. > > 705:AOCreateBasic < > http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-3.0.0/docs/manualpages/AO/AOCreateBasic.html#AOCreateBasic>(PETSC_COMM_WORLD > < > http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-3.0.0/docs/manualpages/Sys/PETSC_COMM_WORLD.html#PETSC_COMM_WORLD>,gdata->nlocal,gdata->localvert,PETSC_NULL > < > http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-3.0.0/docs/manualpages/Sys/PETSC_NULL.html#PETSC_NULL > >,&ao); > < > http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-3.0.0/docs/manualpages/AO/AOCreateBasic.html#AOCreateBasic>710:AOApplicationToPetsc > < > http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-3.0.0/docs/manualpages/AO/AOApplicationToPetsc.html#AOApplicationToPetsc > >(ao,3*gdata->mlocal_ele,gdata->ele); > > However, I cannot find the codes which are used to create an array or > vector, which stores the coordinates according to the PETSc numbering. > Without this array how we get the coordinate of the vertex of an element? > > Thanks. > > > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From enjoywm at cs.wm.edu Fri Feb 20 13:05:50 2009 From: enjoywm at cs.wm.edu (Yixun Liu) Date: Fri, 20 Feb 2009 14:05:50 -0500 Subject: se2(partitioning) In-Reply-To: References: <499EF5B2.9050209@cs.wm.edu> Message-ID: <499EFF0E.7010107@cs.wm.edu> Matthew Knepley wrote: > The coordinates are stored according to the PETSc numbering. You get > them using > > > http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/DA/DAGetCoordinates.html > > Matt > > On Fri, Feb 20, 2009 at 12:25 PM, Yixun Liu > wrote: > > Hi, > In ex2, the following codes Change the element vertex information > to the > PETSc numbering. > > 705:AOCreateBasic > (PETSC_COMM_WORLD > ,gdata->nlocal,gdata->localvert,PETSC_NULL > ,&ao); > 710:AOApplicationToPetsc > (ao,3*gdata->mlocal_ele,gdata->ele); > > However, I cannot find the codes which are used to create an array > or vector, which stores the coordinates according to the PETSc > numbering. Without this array how we get the coordinate of the > vertex of an element? > > Thanks. > > > > > > -- > What most experimenters take for granted before they begin their > experiments is infinitely more interesting than any results to which > their experiments lead. > -- Norbert Wiener Can I use VecCreateMPIWithArray(PETSC_COMM_WORLD, 2*gdata->mlocal_vert, PETSC_DECIDE, gdata->vert, &vert) to get Vec vert, which stores the coordinates according to PETSc order? Yixun From knepley at gmail.com Fri Feb 20 13:08:18 2009 From: knepley at gmail.com (Matthew Knepley) Date: Fri, 20 Feb 2009 13:08:18 -0600 Subject: se2(partitioning) In-Reply-To: <499EFF0E.7010107@cs.wm.edu> References: <499EF5B2.9050209@cs.wm.edu> <499EFF0E.7010107@cs.wm.edu> Message-ID: On Fri, Feb 20, 2009 at 1:05 PM, Yixun Liu wrote: > Can I use VecCreateMPIWithArray(PETSC_COMM_WORLD, 2*gdata->mlocal_vert, > PETSC_DECIDE, gdata->vert, &vert) to get Vec vert, which stores the > coordinates according to PETSc order? I do not understand what you are asking. Just creating a vector will not put the coordinates in it. Why not just use the Vec from the function given in the last message? Matt > > Yixun > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From bsmith at mcs.anl.gov Fri Feb 20 13:41:59 2009 From: bsmith at mcs.anl.gov (Barry Smith) Date: Fri, 20 Feb 2009 13:41:59 -0600 Subject: Question on using DMMG In-Reply-To: <499EF7AD.5020304@gmail.com> References: <499DCD87.2020805@gmail.com> <83475117-D946-42E8-92E9-7F04C9C541A8@mcs.anl.gov> <499DD3B0.2040203@gmail.com> <2942B08E-B49E-4E44-84AB-C43C4A956331@mcs.anl.gov> <499EF7AD.5020304@gmail.com> Message-ID: <5606143F-8125-488A-8283-D86EBA4A007A@mcs.anl.gov> On Feb 20, 2009, at 12:34 PM, Randall Mackie wrote: > Thanks Barry, this was useful and I now understand how to set the > levels and > the grid size at the coarsest level. > > I'm trying to run a simple test problem, and it seems to be taking > *forever* > in the routine setting the Jacobian. In my old code, where I use > MATCreateMPIAIJ > to set up the matrix with the correct pre-allocation, it takes no > time to fill > this matrix. > First we need to see WHAT is taking so long (in my experience the only thing that takes "forever" is not have enough preallocation; perhaps you do not have the correct DA stencil width or type or you are zeroing the matrix or something before setting the values (thus throwing away the correct preallocation). Questions: 1) run with -info and send the result to petsc-maint at mcs.anl.gov 2) what happens if you do not compute the Jacobian and just let PETSc do it. That is run with -dmmg_jacobian_fd Barry > Here's a sketch of my ComputeJacobian routine: > > call DMMGGetDA > Call DAGetGlobalIndices > > Loop through model: > > v(ic)=fact > col(ic)=ltog(idltog +.....) > > etc > > call MatSetValues(...) > > > > I suspect this is a problem of the default stencil that is set up, > with > many more entries than I'm using. Any way to just use > MATMPIAIJSetPreallocation, > or do I need to use DASetBlockFills? > > > Thanks, Randy > > > Barry Smith wrote: >> On Feb 19, 2009, at 3:48 PM, Randall Mackie wrote: >>> Barry, >>> >>> I'm a little confused then, by how you set the size of the coarse >>> grid >>> in relation to the fine grid. What if my fine grid is 283x107x113? >>> Can >>> I just use a coarse grid of 3x3x3 and then the finer ones are >>> generated >>> until it gets to my fine grid? I've been trying to follow ex22f.F, >>> where >>> you set the coarse grid, and number of levels, but I can't figure >>> out >>> the relation between the grid size on each level and how you specify >> ^ >> ^^^^^^^^^^^^^^^ >>> >>> the grid size at the finest level. >> We don't specify the grid size at the finest level; it just >> comes out from the coarse >> grid size and the number of levels. >>> >>> >>> In ex22f.F, when I run it, I see the first level is 27x27 (since the >>> 3D grid is 3x3x3). Then at the next level it goes to 125x125 or >>> 5x5x5. >>> Then the final level is 729x729, or 9x9x9. >> By default, with nonperiodic domains the grid spacing (distance >> between grid points) >> is cut in half with each refinement. So, for one dimension this >> looks like >> * >> * * >> + + + + + >> x x x x x x x x x >> that's 3 points, then 5, then 9. >> To get the 113 with three levels then make it 29 on the coarsest, >> then it becomes 57 then it >> becomes 113. For four levels start with 15. >> You can refine by other factors like 3 using >> DASetRefinementFactor() call this after >> DACreate but before DMMGSetDA() You can also control this via the >> options database >> see the manual page. >> Barry >>> >>> >>> Thanks, Randy >>> >>> Barry Smith wrote: >>>> On Feb 19, 2009, at 3:22 PM, Randall Mackie wrote: >>>>> I'm trying to modify my code to use the DMMG routines to solve >>>>> my system >>>>> by multi-grid, instead of the usual krylov solver. In my >>>>> previous code, >>>>> I would set up a DA for my finite difference grid, set the matrix >>>>> preallocation using MATCreateMPIAIJ, then fill the matrix, etc. >>>>> >>>>> In the code I've modified to use DMMG, here is my sequence of >>>>> routines >>>>> so far: >>>>> >>>>> call DMMGCreate(...) >>>>> call DACreate3D(....) ! to set the DA on the finest level >>>>> call DMMGSetDM(...) >>>>> >>>>> >>>>> call DMMGSETKSP(...) >>>>> >>>>> >>>>> Questions: >>>>> >>>>> 1) I want to set the DA on the finest level and use Galerkin to >>>>> get >>>>> the coarser matrices. So, is the DACreate above the way to do >>>>> this? >>>> The current design always has you setting the coarsest DA; DMMG >>>> generates all the finer ones >>>> automatically. This is independent of using Galerkin coarse grids >>>> or not. >>>> To have DMMG use Galerkin to generate the coarser matrices call >>>> DMMGSetUseGalerkinCoarse() >>>> after you se the number of levels or use the option -dmmg_galerkin >>>>> >>>>> >>>>> 2) How do I set the matrix preallocation here for use in the >>>>> DMMG routines? >>>>> Would I use the same MATCreateMPIAIJ as before, and if so, where >>>>> do I >>>>> put that? In the routine that fills the Jacobian, or in the main >>>>> program >>>>> someplace? >>>> DMMG manages all this for you; it creates the empty matrices >>>> (based on the DA stencil) and gives them >>>> the right nonzero structure. >>>> See, for example, src/ksp/ksp/examples/tutorials/ex34.c >>>> Barry >>>>> >>>>> >>>>> >>>>> Thanks, Randy From enjoywm at cs.wm.edu Fri Feb 20 14:37:45 2009 From: enjoywm at cs.wm.edu (Yixun Liu) Date: Fri, 20 Feb 2009 15:37:45 -0500 Subject: how to map the node number from global to local Message-ID: <499F1499.2070608@cs.wm.edu> Hi, I partitioned a mesh into 4 parts. Each parts use global numbering. Now I want to map the global numbering to local numbering for each part. Does PETSc provide some methods to facilitate it? Thanks. Yixun From bsmith at mcs.anl.gov Fri Feb 20 14:49:27 2009 From: bsmith at mcs.anl.gov (Barry Smith) Date: Fri, 20 Feb 2009 14:49:27 -0600 Subject: how to map the node number from global to local In-Reply-To: <499F1499.2070608@cs.wm.edu> References: <499F1499.2070608@cs.wm.edu> Message-ID: ISLocalToGlobalMappingCreate() and its friends like ISGlobalToLocalMappingApply() Barry On Feb 20, 2009, at 2:37 PM, Yixun Liu wrote: > Hi, > I partitioned a mesh into 4 parts. Each parts use global numbering. > Now > I want to map the global numbering to local numbering for each part. > Does PETSc provide some methods to facilitate it? > > Thanks. > > Yixun From enjoywm at cs.wm.edu Fri Feb 20 17:07:48 2009 From: enjoywm at cs.wm.edu (Yixun Liu) Date: Fri, 20 Feb 2009 18:07:48 -0500 Subject: AOCreateBasic Message-ID: <499F37C4.3000302@cs.wm.edu> Hi, PetscErrorCode PETSCDM_DLLEXPORT AOCreateBasic(MPI_Comm comm,PetscInt napp,const PetscInt myapp[],const PetscInt mypetsc[],AO *aoout) When mypetsc is PETSC_NULL, it uses natural ordering. Does the natural ordering mean each processor has a contiguous set of indices and process with rank 0 begins with indice 0? Yixun From bsmith at mcs.anl.gov Fri Feb 20 17:09:52 2009 From: bsmith at mcs.anl.gov (Barry Smith) Date: Fri, 20 Feb 2009 17:09:52 -0600 Subject: AOCreateBasic In-Reply-To: <499F37C4.3000302@cs.wm.edu> References: <499F37C4.3000302@cs.wm.edu> Message-ID: Yes On Feb 20, 2009, at 5:07 PM, Yixun Liu wrote: > Hi, > > PetscErrorCode PETSCDM_DLLEXPORT AOCreateBasic(MPI_Comm > comm,PetscInt napp,const PetscInt myapp[],const PetscInt > mypetsc[],AO *aoout) > > When mypetsc is PETSC_NULL, it uses natural ordering. Does the > natural ordering mean each processor has a contiguous set of indices > and process with rank 0 begins with indice 0? > > Yixun > > From enjoywm at cs.wm.edu Sat Feb 21 08:40:37 2009 From: enjoywm at cs.wm.edu (Yixun Liu) Date: Sat, 21 Feb 2009 09:40:37 -0500 Subject: partitioning Message-ID: <49A01265.70103@cs.wm.edu> Hi, ex2 give an example on how to partition using ParMETIS by inputing element graph and mesh. ParMETIS also provides function for partitioning without inputing graph. Does PETSc provide some interface for this? Thanks. Yixun From bsmith at mcs.anl.gov Sat Feb 21 08:56:02 2009 From: bsmith at mcs.anl.gov (Barry Smith) Date: Sat, 21 Feb 2009 08:56:02 -0600 Subject: partitioning In-Reply-To: <49A01265.70103@cs.wm.edu> References: <49A01265.70103@cs.wm.edu> Message-ID: On Feb 21, 2009, at 8:40 AM, Yixun Liu wrote: > Hi, > ex2 give an example on how to partition using ParMETIS by inputing > element graph and mesh. ParMETIS also provides function for > partitioning > without inputing graph. Does PETSc provide some interface for this? I doubt it. How can one partition a graph without providing the graph? Barry > > > Thanks. > > Yixun From enjoywm at cs.wm.edu Sat Feb 21 09:30:03 2009 From: enjoywm at cs.wm.edu (Yixun Liu) Date: Sat, 21 Feb 2009 10:30:03 -0500 Subject: partitioning In-Reply-To: References: <49A01265.70103@cs.wm.edu> Message-ID: <49A01DFB.6070404@cs.wm.edu> Barry Smith wrote: > > On Feb 21, 2009, at 8:40 AM, Yixun Liu wrote: > >> Hi, >> ex2 give an example on how to partition using ParMETIS by inputing >> element graph and mesh. ParMETIS also provides function for partitioning >> without inputing graph. Does PETSc provide some interface for this? > > I doubt it. How can one partition a graph without providing the graph? > > Barry > >> >> >> Thanks. >> >> Yixun > Mesh can produce graph by taking into account the fact two neighboring elements share same edge or surface, so we can let ParMETIS do it just providing mesh as input. ParMETIS provides a function named as ParMETIS_V3_PartMeshKway, which only takes a mesh as input. Internally, this function use a mesh-to-graph routine(section 3.2 ParMETIS manual). From bsmith at mcs.anl.gov Sat Feb 21 10:09:18 2009 From: bsmith at mcs.anl.gov (Barry Smith) Date: Sat, 21 Feb 2009 10:09:18 -0600 Subject: partitioning In-Reply-To: <49A01DFB.6070404@cs.wm.edu> References: <49A01265.70103@cs.wm.edu> <49A01DFB.6070404@cs.wm.edu> Message-ID: <3BFBBBD8-A9BF-48DE-B657-9D6FAEC56FEC@mcs.anl.gov> PETSc currently only provides an interface using graphs. Note that since PETSc is just a library there is nothing stopping someone from calingl ParMetis or any other library anyway they want in the same code that uses PETSc. Barry On Feb 21, 2009, at 9:30 AM, Yixun Liu wrote: > Barry Smith wrote: >> >> On Feb 21, 2009, at 8:40 AM, Yixun Liu wrote: >> >>> Hi, >>> ex2 give an example on how to partition using ParMETIS by inputing >>> element graph and mesh. ParMETIS also provides function for >>> partitioning >>> without inputing graph. Does PETSc provide some interface for this? >> >> I doubt it. How can one partition a graph without providing the >> graph? >> >> Barry >> >>> >>> >>> Thanks. >>> >>> Yixun >> > Mesh can produce graph by taking into account the fact two neighboring > elements share same edge or surface, so we can let ParMETIS do it just > providing mesh as input. ParMETIS provides a function named as > ParMETIS_V3_PartMeshKway, which only takes a mesh as input. > Internally, > this function use a mesh-to-graph routine(section 3.2 ParMETIS > manual). From enjoywm at cs.wm.edu Sat Feb 21 10:24:26 2009 From: enjoywm at cs.wm.edu (Yixun Liu) Date: Sat, 21 Feb 2009 11:24:26 -0500 Subject: partitioning In-Reply-To: <3BFBBBD8-A9BF-48DE-B657-9D6FAEC56FEC@mcs.anl.gov> References: <49A01265.70103@cs.wm.edu> <49A01DFB.6070404@cs.wm.edu> <3BFBBBD8-A9BF-48DE-B657-9D6FAEC56FEC@mcs.anl.gov> Message-ID: <49A02ABA.2090205@cs.wm.edu> Barry Smith wrote: > > PETSc currently only provides an interface using graphs. Note > that since PETSc is just a library there is nothing stopping someone > from calingl ParMetis or any other library anyway they want in the same > code that uses PETSc. > > Barry > > On Feb 21, 2009, at 9:30 AM, Yixun Liu wrote: > >> Barry Smith wrote: >>> >>> On Feb 21, 2009, at 8:40 AM, Yixun Liu wrote: >>> >>>> Hi, >>>> ex2 give an example on how to partition using ParMETIS by inputing >>>> element graph and mesh. ParMETIS also provides function for >>>> partitioning >>>> without inputing graph. Does PETSc provide some interface for this? >>> >>> I doubt it. How can one partition a graph without providing the graph? >>> >>> Barry >>> >>>> >>>> >>>> Thanks. >>>> >>>> Yixun >>> >> Mesh can produce graph by taking into account the fact two neighboring >> elements share same edge or surface, so we can let ParMETIS do it just >> providing mesh as input. ParMETIS provides a function named as >> ParMETIS_V3_PartMeshKway, which only takes a mesh as input. Internally, >> this function use a mesh-to-graph routine(section 3.2 ParMETIS manual). > Thanks. Another question is once I have partitioned the mesh into two parts and each part uses local numbering. Now I need to assemble the matrix. Can I do like this, For local indices generate a 2x2 matrix (triangle) and then map each local row into global row? Is it a better way? From bsmith at mcs.anl.gov Sat Feb 21 13:19:55 2009 From: bsmith at mcs.anl.gov (Barry Smith) Date: Sat, 21 Feb 2009 13:19:55 -0600 Subject: [PETSC #19080] Re: reading matlab binary files In-Reply-To: <2024616173.1045531235158437909.JavaMail.root@mail4.gatech.edu> References: <2024616173.1045531235158437909.JavaMail.root@mail4.gatech.edu> Message-ID: OK, I just downloaded petsc-3.0.0-p3 from the web: barry-smiths-macbook-pro:~/Datafiles/Matrices] barrysmith% setenv MATLABPATH /Users/barrysmith/Src/petsc-3.0.0-p3/bin/matlab [barry-smiths-macbook-pro:~/Datafiles/Matrices] barrysmith% matlab - nojvm -nodisplay < M A T L A B (R) > Copyright 1984-2008 The MathWorks, Inc. Version 7.7.0.471 (R2008b) September 17, 2008 To get started, type one of these: helpwin, helpdesk, or demo. For product information, visit www.mathworks.com. >> a = PetscBinaryRead('matrix.m'); >> I think you do not have the correct PETSc installed. Please DELETE any PETSc you have installed and get petsc-3.0.0-p3 then do what I have done above to load the matrix. You do NOT have to first run config and make on PETSc to try the load. Make sure your MATLABPATH doesn't have some old PETSc in its path. Barry I On Feb 20, 2009, at 1:33 PM, Khan, Irfan wrote: > I installed the latest petsc code and tried binary matlab output and > read again. It did not work, I get the same error message. I have > attached the binary file with this email. The .info files were empty > and as I mentioned I did not get any error messages. > The matlab version I am using is 7.4.0.287 (R2007a). > > Thanks for the help > Regards > Irfan > > > ----- Original Message ----- > From: "Barry Smith" > To: "PETSc users list" > Sent: Friday, February 20, 2009 12:27:18 PM GMT -05:00 US/Canada > Eastern > Subject: Re: reading matlab binary files > > > Irfan, > > Make sure you use the absolutely latest PETSc patches version. > There were some problems that we just recently fixed. > If that does not solve the problem send the binary file to petsc-maint at mcs.anl.gov > > Barry > > On Feb 20, 2009, at 10:51 AM, Khan, Irfan wrote: > >> Hi >> >> In an earlier email to the group Barry mentioned that if the matrix >> sizes are large, the output should be done in binary format and bin/ >> matlab/PetscBinaryRead.m should be used to read the matrix into >> matlab. >> >> I have output the matrix in the following manner. >> >> ierr = PetscViewerBinaryOpen(PETSC_COMM_WORLD, fname, >> FILE_MODE_WRITE, &viewer); >> ierr = >> PetscObjectSetName((PetscObject)obj.Amat,"Stiffness_matrix"); >> ierr = MatView(obj.Amat,viewer); >> >> I don't get any error messages during execution. However, when I >> have not been successful reading the matrix into matlab. Presently I >> get the following error messages. >> >> >> >> ??? Error using ==> fread >> Invalid file identifier. Use fopen to generate a valid file >> identifier. >> >> Error in ==> PetscOpenFile.read at 5 >> d = fread(freader.fd,count,datatype); >> >> Error in ==> PetscBinaryRead at 49 >> header = read(fd,1,'int32'); >> >> >> Any suggestions to solve the problem? >> >> Thanks >> Irfan > > From enjoywm at cs.wm.edu Sun Feb 22 08:25:55 2009 From: enjoywm at cs.wm.edu (Yixun Liu) Date: Sun, 22 Feb 2009 09:25:55 -0500 Subject: PetscBT Message-ID: <49A16073.9060204@cs.wm.edu> Hi, PetscBT mask; PetscBTCreate(n_vert,mask);CHKERRQ(ierr); mask is a sequential variable. right? Yixun From irfan.khan at gatech.edu Sun Feb 22 08:35:58 2009 From: irfan.khan at gatech.edu (Khan, Irfan) Date: Sun, 22 Feb 2009 09:35:58 -0500 (EST) Subject: [PETSC #19080] Re: reading matlab binary files In-Reply-To: <1961395977.129781235313080645.JavaMail.root@mail4.gatech.edu> Message-ID: <1793014030.130061235313358444.JavaMail.root@mail4.gatech.edu> Thanks Barry, I have been able to load the matrix. The comments in the PetscBinaryRead.m may be misleading. I have pasted them below. % % [varargout] = PetscBinaryRead(inarg[,comp[,cnt]]) % % Reads in PETSc binary file matrices or vectors % emits as Matlab sparse matrice or vectors. % % Argument may be file name (string), socket number (integer) % or any Matlab class that provides the read() and close() methods % [We provide PetscOpenFile() and PetscOpenSocket() for binary files and sockets] % % comp = 'complex' means the input file is complex % comp = 'cell' means return a Matlab cell array % if cnt is given then cnt PETSc objects are read otherwise % all objects are read in % Regards Irfan ----- Original Message ----- From: "Barry Smith" To: "Irfan Khan" Cc: "PETSc users list" , petsc-maint at mcs.anl.gov Sent: Saturday, February 21, 2009 2:19:55 PM GMT -05:00 US/Canada Eastern Subject: Re: [PETSC #19080] Re: reading matlab binary files OK, I just downloaded petsc-3.0.0-p3 from the web: barry-smiths-macbook-pro:~/Datafiles/Matrices] barrysmith% setenv MATLABPATH /Users/barrysmith/Src/petsc-3.0.0-p3/bin/matlab [barry-smiths-macbook-pro:~/Datafiles/Matrices] barrysmith% matlab - nojvm -nodisplay < M A T L A B (R) > Copyright 1984-2008 The MathWorks, Inc. Version 7.7.0.471 (R2008b) September 17, 2008 To get started, type one of these: helpwin, helpdesk, or demo. For product information, visit www.mathworks.com. >> a = PetscBinaryRead('matrix.m'); >> I think you do not have the correct PETSc installed. Please DELETE any PETSc you have installed and get petsc-3.0.0-p3 then do what I have done above to load the matrix. You do NOT have to first run config and make on PETSc to try the load. Make sure your MATLABPATH doesn't have some old PETSc in its path. Barry I On Feb 20, 2009, at 1:33 PM, Khan, Irfan wrote: > I installed the latest petsc code and tried binary matlab output and > read again. It did not work, I get the same error message. I have > attached the binary file with this email. The .info files were empty > and as I mentioned I did not get any error messages. > The matlab version I am using is 7.4.0.287 (R2007a). > > Thanks for the help > Regards > Irfan > > > ----- Original Message ----- > From: "Barry Smith" > To: "PETSc users list" > Sent: Friday, February 20, 2009 12:27:18 PM GMT -05:00 US/Canada > Eastern > Subject: Re: reading matlab binary files > > > Irfan, > > Make sure you use the absolutely latest PETSc patches version. > There were some problems that we just recently fixed. > If that does not solve the problem send the binary file to petsc-maint at mcs.anl.gov > > Barry > > On Feb 20, 2009, at 10:51 AM, Khan, Irfan wrote: > >> Hi >> >> In an earlier email to the group Barry mentioned that if the matrix >> sizes are large, the output should be done in binary format and bin/ >> matlab/PetscBinaryRead.m should be used to read the matrix into >> matlab. >> >> I have output the matrix in the following manner. >> >> ierr = PetscViewerBinaryOpen(PETSC_COMM_WORLD, fname, >> FILE_MODE_WRITE, &viewer); >> ierr = >> PetscObjectSetName((PetscObject)obj.Amat,"Stiffness_matrix"); >> ierr = MatView(obj.Amat,viewer); >> >> I don't get any error messages during execution. However, when I >> have not been successful reading the matrix into matlab. Presently I >> get the following error messages. >> >> >> >> ??? Error using ==> fread >> Invalid file identifier. Use fopen to generate a valid file >> identifier. >> >> Error in ==> PetscOpenFile.read at 5 >> d = fread(freader.fd,count,datatype); >> >> Error in ==> PetscBinaryRead at 49 >> header = read(fd,1,'int32'); >> >> >> Any suggestions to solve the problem? >> >> Thanks >> Irfan > > From knepley at gmail.com Sun Feb 22 09:52:01 2009 From: knepley at gmail.com (Matthew Knepley) Date: Sun, 22 Feb 2009 09:52:01 -0600 Subject: PetscBT In-Reply-To: <49A16073.9060204@cs.wm.edu> References: <49A16073.9060204@cs.wm.edu> Message-ID: Local to a process? Yes. Matt On Sun, Feb 22, 2009 at 8:25 AM, Yixun Liu wrote: > Hi, > PetscBT mask; > PetscBTCreate(n_vert,mask);CHKERRQ(ierr); > > mask is a sequential variable. right? > > Yixun > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From bsmith at mcs.anl.gov Sun Feb 22 11:17:05 2009 From: bsmith at mcs.anl.gov (Barry Smith) Date: Sun, 22 Feb 2009 11:17:05 -0600 Subject: [PETSC #19080] Re: reading matlab binary files In-Reply-To: <1793014030.130061235313358444.JavaMail.root@mail4.gatech.edu> References: <1793014030.130061235313358444.JavaMail.root@mail4.gatech.edu> Message-ID: What did you find confusing about the comments? They seem pretty straightforward to us; how can we improve them. Barry On Feb 22, 2009, at 8:35 AM, Khan, Irfan wrote: > Thanks Barry, I have been able to load the matrix. The comments in > the PetscBinaryRead.m may be misleading. I have pasted them below. > > > > % > % [varargout] = PetscBinaryRead(inarg[,comp[,cnt]]) > % > % Reads in PETSc binary file matrices or vectors > % emits as Matlab sparse matrice or vectors. > % > % Argument may be file name (string), socket number (integer) > % or any Matlab class that provides the read() and close() methods > % [We provide PetscOpenFile() and PetscOpenSocket() for binary > files and sockets] > % > % comp = 'complex' means the input file is complex > % comp = 'cell' means return a Matlab cell array > % if cnt is given then cnt PETSc objects are read otherwise > % all objects are read in > % > > Regards > Irfan > > > > > > > > > > > ----- Original Message ----- > From: "Barry Smith" > To: "Irfan Khan" > Cc: "PETSc users list" , petsc-maint at mcs.anl.gov > Sent: Saturday, February 21, 2009 2:19:55 PM GMT -05:00 US/Canada > Eastern > Subject: Re: [PETSC #19080] Re: reading matlab binary files > > > OK, I just downloaded petsc-3.0.0-p3 from the web: > > barry-smiths-macbook-pro:~/Datafiles/Matrices] barrysmith% setenv > MATLABPATH /Users/barrysmith/Src/petsc-3.0.0-p3/bin/matlab > [barry-smiths-macbook-pro:~/Datafiles/Matrices] barrysmith% matlab - > nojvm -nodisplay > < M A T L A B (R) > > Copyright 1984-2008 The > MathWorks, Inc. > Version 7.7.0.471 > (R2008b) > September 17, 2008 > > > To get started, type one of these: helpwin, helpdesk, or demo. > For product information, visit www.mathworks.com. > >>> a = PetscBinaryRead('matrix.m'); >>> > > I think you do not have the correct PETSc installed. Please DELETE any > PETSc you have installed and get petsc-3.0.0-p3 then do what I have > done above > to load the matrix. You do NOT have to first run config and make on > PETSc to try the load. > > Make sure your MATLABPATH doesn't have some old PETSc in its path. > > > Barry > > > I On Feb 20, 2009, at 1:33 PM, Khan, Irfan wrote: > >> I installed the latest petsc code and tried binary matlab output and >> read again. It did not work, I get the same error message. I have >> attached the binary file with this email. The .info files were empty >> and as I mentioned I did not get any error messages. >> The matlab version I am using is 7.4.0.287 (R2007a). >> >> Thanks for the help >> Regards >> Irfan >> >> >> ----- Original Message ----- >> From: "Barry Smith" >> To: "PETSc users list" >> Sent: Friday, February 20, 2009 12:27:18 PM GMT -05:00 US/Canada >> Eastern >> Subject: Re: reading matlab binary files >> >> >> Irfan, >> >> Make sure you use the absolutely latest PETSc patches version. >> There were some problems that we just recently fixed. >> If that does not solve the problem send the binary file to petsc-maint at mcs.anl.gov >> >> Barry >> >> On Feb 20, 2009, at 10:51 AM, Khan, Irfan wrote: >> >>> Hi >>> >>> In an earlier email to the group Barry mentioned that if the matrix >>> sizes are large, the output should be done in binary format and bin/ >>> matlab/PetscBinaryRead.m should be used to read the matrix into >>> matlab. >>> >>> I have output the matrix in the following manner. >>> >>> ierr = PetscViewerBinaryOpen(PETSC_COMM_WORLD, fname, >>> FILE_MODE_WRITE, &viewer); >>> ierr = >>> PetscObjectSetName((PetscObject)obj.Amat,"Stiffness_matrix"); >>> ierr = MatView(obj.Amat,viewer); >>> >>> I don't get any error messages during execution. However, when I >>> have not been successful reading the matrix into matlab. Presently I >>> get the following error messages. >>> >>> >>> >>> ??? Error using ==> fread >>> Invalid file identifier. Use fopen to generate a valid file >>> identifier. >>> >>> Error in ==> PetscOpenFile.read at 5 >>> d = fread(freader.fd,count,datatype); >>> >>> Error in ==> PetscBinaryRead at 49 >>> header = read(fd,1,'int32'); >>> >>> >>> Any suggestions to solve the problem? >>> >>> Thanks >>> Irfan >> >> > From enjoywm at cs.wm.edu Sun Feb 22 14:52:19 2009 From: enjoywm at cs.wm.edu (enjoywm at cs.wm.edu) Date: Sun, 22 Feb 2009 15:52:19 -0500 (EST) Subject: external lib Message-ID: Hi, I have installed ParMetis and then use the following commands to install PETSc >./config/configure.py --with-ParMetis-dir=/home/ParMetis1.3/ >make all How do I know PETSc has been installed with ParMetis successfully ? Thanks. Yixun From enjoywm at cs.wm.edu Sun Feb 22 15:57:10 2009 From: enjoywm at cs.wm.edu (enjoywm at cs.wm.edu) Date: Sun, 22 Feb 2009 16:57:10 -0500 (EST) Subject: cannot config ParMetis Message-ID: <5ff4dcb8ba20bb35686454c4496bcdaf.squirrel@mail.cs.wm.edu> Hi, I have installed ParMetis and use the following commands, /petsc-3.0.0-p3>./config/configure.py --with-parmetis-dir=/home/scratch/ParMetis-3.1.1 The error is UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for details): --------------------------------------------------------------------------------------- --with-parmetis-dir=/home/scratch/yixun/ParMetis-3.1.1 did not work Thanks. From hzhang at mcs.anl.gov Sun Feb 22 16:24:41 2009 From: hzhang at mcs.anl.gov (Hong Zhang) Date: Sun, 22 Feb 2009 16:24:41 -0600 (CST) Subject: cannot config ParMetis In-Reply-To: <5ff4dcb8ba20bb35686454c4496bcdaf.squirrel@mail.cs.wm.edu> References: <5ff4dcb8ba20bb35686454c4496bcdaf.squirrel@mail.cs.wm.edu> Message-ID: Try replacing --with-parmetis-dir= ... with the option '--download-parmetis' Hong On Sun, 22 Feb 2009, enjoywm at cs.wm.edu wrote: > Hi, > I have installed ParMetis and use the following commands, > /petsc-3.0.0-p3>./config/configure.py > --with-parmetis-dir=/home/scratch/ParMetis-3.1.1 > The error is > UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for details): > --------------------------------------------------------------------------------------- > --with-parmetis-dir=/home/scratch/yixun/ParMetis-3.1.1 did not work > > > Thanks. > From hzhang at mcs.anl.gov Sun Feb 22 16:36:28 2009 From: hzhang at mcs.anl.gov (Hong Zhang) Date: Sun, 22 Feb 2009 16:36:28 -0600 (CST) Subject: external lib In-Reply-To: References: Message-ID: On Sun, 22 Feb 2009, enjoywm at cs.wm.edu wrote: > Hi, > I have installed ParMetis and then use the following commands to install > PETSc >> ./config/configure.py --with-ParMetis-dir=/home/ParMetis1.3/ >> make all > > How do I know PETSc has been installed with ParMetis successfully ? After successfully configure and build petsc library with parmetis, you may test petsc-release-3.0.0/src/ksp/ksp/examples/tests/ex31.c: mpiexec -n 2 ./ex31 -f -partition -mat_partitioning_view Hong From enjoywm at cs.wm.edu Sun Feb 22 18:17:31 2009 From: enjoywm at cs.wm.edu (enjoywm at cs.wm.edu) Date: Sun, 22 Feb 2009 19:17:31 -0500 (EST) Subject: cannot config ParMetis In-Reply-To: References: <5ff4dcb8ba20bb35686454c4496bcdaf.squirrel@mail.cs.wm.edu> Message-ID: <367318e961b9f28265ff1144653e1878.squirrel@mail.cs.wm.edu> > > Try replacing --with-parmetis-dir= ... with the option > '--download-parmetis' > > Hong > > On Sun, 22 Feb 2009, enjoywm at cs.wm.edu wrote: > >> Hi, >> I have installed ParMetis and use the following commands, >> /petsc-3.0.0-p3>./config/configure.py >> --with-parmetis-dir=/home/scratch/ParMetis-3.1.1 >> The error is >> UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for >> details): >> --------------------------------------------------------------------------------------- >> --with-parmetis-dir=/home/scratch/yixun/ParMetis-3.1.1 did not work >> >> >> Thanks. >> > I tried it and after make all I can find libparmetis.a and libmetis.a in petsc-3.0.0-p3/linux-gnu-c-debug/lib . However when I make test,computer stopped here and no any response. Thanks. From knepley at gmail.com Sun Feb 22 18:31:08 2009 From: knepley at gmail.com (Matthew Knepley) Date: Sun, 22 Feb 2009 18:31:08 -0600 Subject: cannot config ParMetis In-Reply-To: <367318e961b9f28265ff1144653e1878.squirrel@mail.cs.wm.edu> References: <5ff4dcb8ba20bb35686454c4496bcdaf.squirrel@mail.cs.wm.edu> <367318e961b9f28265ff1144653e1878.squirrel@mail.cs.wm.edu> Message-ID: On Sun, Feb 22, 2009 at 6:17 PM, wrote: > > > > Try replacing --with-parmetis-dir= ... with the option > > '--download-parmetis' > > > > Hong > > > > On Sun, 22 Feb 2009, enjoywm at cs.wm.edu wrote: > > > >> Hi, > >> I have installed ParMetis and use the following commands, > >> /petsc-3.0.0-p3>./config/configure.py > >> --with-parmetis-dir=/home/scratch/ParMetis-3.1.1 > >> The error is > >> UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for > >> details): > >> > --------------------------------------------------------------------------------------- > >> --with-parmetis-dir=/home/scratch/yixun/ParMetis-3.1.1 did not work > >> > >> > >> Thanks. > >> > > > I tried it and after make all I can find libparmetis.a and libmetis.a in > petsc-3.0.0-p3/linux-gnu-c-debug/lib . > However when I make test,computer stopped here and no any response. 1) With any configuration question, Always always always send configure.log and make_*.log. Without them, we have no idea what you did. 2) Since that is large, we recommend you use petsc-maint at mcs.anl.govinstead. 3) My guess is that you have an MPI run configuration problem. Can you run any examples? cd src/ksp/ksp/examples/tutorials make ex2 ./ex2 $PETSC_DIR/$PETSC_ARCH/bin/mpiexec -n 2 ./ex2 Matt > > Thanks. > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From bsmith at mcs.anl.gov Sun Feb 22 20:42:16 2009 From: bsmith at mcs.anl.gov (Barry Smith) Date: Sun, 22 Feb 2009 20:42:16 -0600 Subject: external lib In-Reply-To: References: Message-ID: <8D8E1076-DCBB-49A5-9F8F-A88876E1DD15@mcs.anl.gov> When config/configure.py finishes it will print the various libraries it is using. If successful ParMETIS will be listed. It is possible the capital letters in --with-ParMetis-dir you wrote may cause it to be ignored. If so use --with-parmetis-dir In general it is better to have PETSc install ParMetis for you by using --download-parmetis This will make sure the same compilers, compiler options and version of ParMETIS that PETSc needs are used. Barry On Feb 22, 2009, at 2:52 PM, enjoywm at cs.wm.edu wrote: > Hi, > I have installed ParMetis and then use the following commands to > install > PETSc >> ./config/configure.py --with-ParMetis-dir=/home/ParMetis1.3/ >> make all > > How do I know PETSc has been installed with ParMetis successfully ? > > Thanks. > > Yixun From shengli.xu.xu at gmail.com Sun Feb 22 21:30:12 2009 From: shengli.xu.xu at gmail.com (Shengli Xu) Date: Sun, 22 Feb 2009 22:30:12 -0500 Subject: How to get the matrix after ordering Message-ID: <5b3d4bb70902221930p7a415158n2b6c86c1dc69b43d@mail.gmail.com> Hi everyone, I want get the ordering matrix of a sparse matrix. I use MatGetOrdering(Mat matrix, MatOrderingType type, IS* rowperm, IS* colperm); to get rowperm and colperm. How to get the matrix after ordering? -- Shengli Xu -------------- next part -------------- An HTML attachment was scrubbed... URL: From enjoywm at cs.wm.edu Mon Feb 23 08:01:41 2009 From: enjoywm at cs.wm.edu (enjoywm at cs.wm.edu) Date: Mon, 23 Feb 2009 09:01:41 -0500 (EST) Subject: cannot config ParMetis In-Reply-To: References: <5ff4dcb8ba20bb35686454c4496bcdaf.squirrel@mail.cs.wm.edu> <367318e961b9f28265ff1144653e1878.squirrel@mail.cs.wm.edu> Message-ID: <065c2a30173f62d4e767a52d862b7a81.squirrel@mail.cs.wm.edu> > On Sun, Feb 22, 2009 at 6:17 PM, wrote: > >> > >> > Try replacing --with-parmetis-dir= ... with the option >> > '--download-parmetis' >> > >> > Hong >> > >> > On Sun, 22 Feb 2009, enjoywm at cs.wm.edu wrote: >> > >> >> Hi, >> >> I have installed ParMetis and use the following commands, >> >> /petsc-3.0.0-p3>./config/configure.py >> >> --with-parmetis-dir=/home/scratch/ParMetis-3.1.1 >> >> The error is >> >> UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for >> >> details): >> >> >> --------------------------------------------------------------------------------------- >> >> --with-parmetis-dir=/home/scratch/yixun/ParMetis-3.1.1 did not work >> >> >> >> >> >> Thanks. >> >> >> > >> I tried it and after make all I can find libparmetis.a and libmetis.a in >> petsc-3.0.0-p3/linux-gnu-c-debug/lib . >> However when I make test,computer stopped here and no any response. > > > 1) With any configuration question, Always always always send > configure.log > and make_*.log. Without them, we have no idea what you did. > > 2) Since that is large, we recommend you use > petsc-maint at mcs.anl.govinstead. > > 3) My guess is that you have an MPI run configuration problem. Can you run > any examples? > > cd src/ksp/ksp/examples/tutorials > make ex2 > ./ex2 > $PETSC_DIR/$PETSC_ARCH/bin/mpiexec -n 2 ./ex2 > > Matt > > >> >> Thanks. >> > -- > What most experimenters take for granted before they begin their > experiments > is infinitely more interesting than any results to which their experiments > lead. > -- Norbert Wiener > Thanks. After restart it works now. From knepley at gmail.com Mon Feb 23 08:35:15 2009 From: knepley at gmail.com (Matthew Knepley) Date: Mon, 23 Feb 2009 08:35:15 -0600 Subject: How to get the matrix after ordering In-Reply-To: <5b3d4bb70902221930p7a415158n2b6c86c1dc69b43d@mail.gmail.com> References: <5b3d4bb70902221930p7a415158n2b6c86c1dc69b43d@mail.gmail.com> Message-ID: On Sun, Feb 22, 2009 at 9:30 PM, Shengli Xu wrote: > > Hi everyone, > > I want get the ordering matrix of a sparse matrix. I use MatGetOrdering(Mat > matrix, MatOrderingType type, IS* rowperm, IS* colperm); to get rowperm and > colperm. > > How to get the matrix after ordering? I am not sure what you mean. A MatOrdering is exactly those permutation vectors. We do not change the matrix. If you want to change the matrix, you must use something like MatPermute(). Matt > > -- > Shengli Xu > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.e.calvert at us.army.mil Mon Feb 23 13:33:12 2009 From: mark.e.calvert at us.army.mil (Calvert, Mark E AMRDEC) Date: Mon, 23 Feb 2009 13:33:12 -0600 Subject: DAVecGetArray, DAVecRestoreArray and FORTRAN (UNCLASSIFIED) Message-ID: <28389D553BFB2B4BBC3AB3A9B5E94E2306C1F2F7@amr-ex2.ds.amrdec.army.mil> Classification: UNCLASSIFIED Caveats: NONE Hello, Can the routines DAVecGetArray and DAVecRestoreArray be used in FORTRAN programs? If so, what would the routine call statements look like for 2D and 3D distributed arrays? Thanks, Mark Calvert Mark.E.Calvert at us.army.mil U.S. Army Aviation and Missile Research, Development and Engineering Center Classification: UNCLASSIFIED Caveats: NONE -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Mon Feb 23 13:54:35 2009 From: knepley at gmail.com (Matthew Knepley) Date: Mon, 23 Feb 2009 13:54:35 -0600 Subject: DAVecGetArray, DAVecRestoreArray and FORTRAN (UNCLASSIFIED) In-Reply-To: <28389D553BFB2B4BBC3AB3A9B5E94E2306C1F2F7@amr-ex2.ds.amrdec.army.mil> References: <28389D553BFB2B4BBC3AB3A9B5E94E2306C1F2F7@amr-ex2.ds.amrdec.army.mil> Message-ID: On Mon, Feb 23, 2009 at 1:33 PM, Calvert, Mark E AMRDEC < mark.e.calvert at us.army.mil> wrote: > Classification: * UNCLASSIFIED*** > > Caveats: NONE > > Hello, > > Can the routines DAVecGetArray and DAVecRestoreArray be used in FORTRAN > programs? If so, what would the routine call statements look like for 2D > and 3D distributed arrays? > Right now, we only have F90 versions for 1D. It would just be some work to add 2D and 3D if people want them. There is currently a work around which you can see in SNES ex5f90. Thanks, Matt > Thanks, > > Mark Calvert > > Mark.E.Calvert at us.army.mil > > U.S. Army Aviation and Missile Research, Development and Engineering Center > > > > > Classification: *** UNCLASSIFIED*** > > Caveats: NONE > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From enjoywm at cs.wm.edu Mon Feb 23 20:24:34 2009 From: enjoywm at cs.wm.edu (Yixun Liu) Date: Mon, 23 Feb 2009 21:24:34 -0500 Subject: initial values of matrix and vector Message-ID: <49A35A62.6020009@cs.wm.edu> Hi, What's the initial value when I create a matrix or vector? Thanks. From bsmith at mcs.anl.gov Mon Feb 23 20:26:45 2009 From: bsmith at mcs.anl.gov (Barry Smith) Date: Mon, 23 Feb 2009 20:26:45 -0600 Subject: initial values of matrix and vector In-Reply-To: <49A35A62.6020009@cs.wm.edu> References: <49A35A62.6020009@cs.wm.edu> Message-ID: <91476420-4D99-4068-9B02-32EBA2E58C97@mcs.anl.gov> Vectors have all entries equal to zero. Dense matrices have all entries equal to zero. Sparse matrices have no entries (logically this is the same as entries equal to zero). Barry On Feb 23, 2009, at 8:24 PM, Yixun Liu wrote: > Hi, > What's the initial value when I create a matrix or vector? > > Thanks. From knepley at gmail.com Tue Feb 24 06:53:58 2009 From: knepley at gmail.com (Matthew Knepley) Date: Tue, 24 Feb 2009 06:53:58 -0600 Subject: initial values of matrix and vector In-Reply-To: <91476420-4D99-4068-9B02-32EBA2E58C97@mcs.anl.gov> References: <49A35A62.6020009@cs.wm.edu> <91476420-4D99-4068-9B02-32EBA2E58C97@mcs.anl.gov> Message-ID: On Mon, Feb 23, 2009 at 8:26 PM, Barry Smith wrote: > > Vectors have all entries equal to zero. Dense matrices have all entries > equal to zero. Sparse matrices have no entries (logically this is the same > as entries equal to zero). We do not automatically zero the entires upon allocation. You have to call VecZeroEntries() or VecSet() to initialize the vector. Matt > > Barry > > > On Feb 23, 2009, at 8:24 PM, Yixun Liu wrote: > > Hi, >> What's the initial value when I create a matrix or vector? >> >> Thanks. >> > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From jed at 59A2.org Tue Feb 24 10:57:17 2009 From: jed at 59A2.org (Jed Brown) Date: Tue, 24 Feb 2009 17:57:17 +0100 Subject: initial values of matrix and vector In-Reply-To: References: <49A35A62.6020009@cs.wm.edu> <91476420-4D99-4068-9B02-32EBA2E58C97@mcs.anl.gov> Message-ID: <20090224165717.GA4377@brakk.ethz.ch> On Tue 2009-02-24 06:53, Matthew Knepley wrote: > On Mon, Feb 23, 2009 at 8:26 PM, Barry Smith wrote: > > > Vectors have all entries equal to zero. Dense matrices have all entries > equal to zero. Sparse matrices have no entries (logically this is the same > as entries equal to zero). > > > We do not automatically zero the entires upon allocation. You have to call > VecZeroEntries() or VecSet() > to initialize the vector. That's what I would have expected, but Barry is correct, at least for the usual types. See, for instance PetscErrorCode PETSCVEC_DLLEXPORT VecCreate_Seq(Vec V) { Vec_Seq *s; PetscScalar *array; PetscErrorCode ierr; PetscInt n = PetscMax(V->map->n,V->map->N); PetscMPIInt size; PetscFunctionBegin; ierr = MPI_Comm_size(((PetscObject)V)->comm,&size);CHKERRQ(ierr); if (size > 1) { SETERRQ(PETSC_ERR_ARG_WRONG,"Cannot create VECSEQ on more than one process"); } ierr = PetscMalloc(n*sizeof(PetscScalar),&array);CHKERRQ(ierr); ierr = PetscLogObjectMemory(V, n*sizeof(PetscScalar));CHKERRQ(ierr); ierr = PetscMemzero(array,n*sizeof(PetscScalar));CHKERRQ(ierr); ierr = VecCreate_Seq_Private(V,array);CHKERRQ(ierr); s = (Vec_Seq*)V->data; s->array_allocated = array; PetscFunctionReturn(0); } In well-structured code, the cost of zeroing the vector is tiny and the effort to track down uninitialized bugs is significant enough that this seems like a sane default. Jed -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: not available URL: From tchouanm at msn.com Tue Feb 24 11:05:38 2009 From: tchouanm at msn.com (STEPHANE TCHOUANMO) Date: Tue, 24 Feb 2009 18:05:38 +0100 Subject: =?windows-1256?Q?Petsc_slow?= =?windows-1256?Q?ness_on_a_?= =?windows-1256?Q?single_pro?= =?windows-1256?Q?cessor_mac?= =?windows-1256?Q?hine=FE?= In-Reply-To: References: Message-ID: Dear all, I use petsc to solve a nonlinear convection-diffusion type equation in porous media. The built linear system's size is 30000 and its resolution lasts about a hour on a single processor machine (my laptop...). I run for that a hundred time steps and have in average 4 Newton iterations per time step. So a hour seems huge to me with the optimized version of Petsc. I tryed to profile my code with the options "-log_summary" and "-info". What i get out of it is that the first time step lasts about 15min representing 25% of the total time and i think its not normal. The thing is, these 15min happen at the second call of the petsc routine "VecScatterCreate()" right after the first Newton residual. Any idea? Thanks. Stephane _________________________________________________________________ Show them the way! Add maps and directions to your party invites. http://www.microsoft.com/windows/windowslive/products/events.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Tue Feb 24 11:22:18 2009 From: knepley at gmail.com (Matthew Knepley) Date: Tue, 24 Feb 2009 11:22:18 -0600 Subject: =?windows-1256?Q?Re=3A_Petsc_slowness_on_a_single_processor_machine=FE?= In-Reply-To: References: Message-ID: 2009/2/24 STEPHANE TCHOUANMO > Dear all, > > I use petsc to solve a nonlinear convection-diffusion type equation in > porous media. > The built linear system's size is 30000 and its resolution lasts about a > hour on a single processor machine (my laptop...). > I run for that a hundred time steps and have in average 4 Newton iterations > per time step. So a hour seems huge to me with the optimized version of > Petsc. > I tryed to profile my code with the options "-log_summary" and "-info". > What i get out of it is that the first time step lasts about 15min > representing 25% of the total time and i think its not normal. > The thing is, these 15min happen at the second call of the petsc routine > "VecScatterCreate()" right after the first Newton residual. > We can't say anything without seeing the entire output of -log_summary. Matt > > Any idea? > Thanks. > > Stephane > > > > ------------------------------ > See all the ways you can stay connected to friends and family > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From tchouanm at msn.com Tue Feb 24 12:17:27 2009 From: tchouanm at msn.com (STEPHANE TCHOUANMO) Date: Tue, 24 Feb 2009 19:17:27 +0100 Subject: petsc-users Digest, Vol 2, Issue 32 In-Reply-To: References: Message-ID: Here is my -log_summary: Something looks a bit strange to me; its the MPI Reductions below. Other than that, i dont see anything relevant. What do you think? Thanks ---------------------------------------------- PETSc Performance Summary: ---------------------------------------------- ./diff-conv-opt on a linux-gnu named linux-stchouan with 1 processor, by stephane Tue Feb 24 13:54:35 2009 Using Petsc Release Version 2.3.3, Patch 13, Thu May 15 17:29:26 CDT 2008 HG revision: 4466c6289a0922df26e20626fd4a0b4dd03c8124 Max Max/Min Avg Total Time (sec): 2.937e+03 1.00000 2.937e+03 Objects: 3.420e+03 1.00000 3.420e+03 Flops: 2.690e+09 1.00000 2.690e+09 2.690e+09 Flops/sec: 9.161e+05 1.00000 9.161e+05 9.161e+05 MPI Messages: 0.000e+00 0.00000 0.000e+00 0.000e+00 MPI Message Lengths: 0.000e+00 0.00000 0.000e+00 0.000e+00 MPI Reductions: 1.189e+05 1.00000 Flop counting convention: 1 flop = 1 real number operation of type (multiply/divide/add/subtract) e.g., VecAXPY() for real vectors of length N --> 2N flops and VecAXPY() for complex vectors of length N --> 8N flops Summary of Stages: ----- Time ------ ----- Flops ----- --- Messages --- -- Message Lengths -- -- Reductions -- Avg %Total Avg %Total counts %Total Avg %Total counts %Total 0: Main Stage: 2.9367e+03 100.0% 2.6905e+09 100.0% 0.000e+00 0.0% 0.000e+00 0.0% 1.106e+03 0.9% ------------------------------------------------------------------------------------------------------------------------ See the 'Profiling' chapter of the users' manual for details on interpreting output. Phase summary info: Count: number of times phase was executed Time and Flops/sec: Max - maximum over all processors Ratio - ratio of maximum to minimum over all processors Mess: number of messages sent Avg. len: average message length Reduct: number of global reductions Global: entire computation Stage: stages of a computation. Set stages with PetscLogStagePush() and PetscLogStagePop(). %T - percent time in this phase %F - percent flops in this phase %M - percent messages in this phase %L - percent message lengths in this phase %R - percent reductions in this phase Total Mflop/s: 10e-6 * (sum of flops over all processors)/(max time over all processors) ------------------------------------------------------------------------------------------------------------------------ Event Count Time (sec) Flops/sec --- Global --- --- Stage --- Total Max Ratio Max Ratio Max Ratio Mess Avg len Reduct %T %F %M %L %R %T %F %M %L %R Mflop/s ------------------------------------------------------------------------------------------------------------------------ --- Event Stage 0: Main Stage VecDot 202 1.0 3.0360e-02 1.0 3.96e+08 1.0 0.0e+00 0.0e+00 0.0e+00 0 0 0 0 0 0 0 0 0 0 396 VecMDot 202 1.0 3.0552e-02 1.0 3.94e+08 1.0 0.0e+00 0.0e+00 0.0e+00 0 0 0 0 0 0 0 0 0 0 394 VecNorm 1110 1.0 1.2257e+00 1.0 5.40e+07 1.0 0.0e+00 0.0e+00 0.0e+00 0 2 0 0 0 0 2 0 0 0 54 VecScale 404 1.0 3.5342e-02 1.0 3.41e+08 1.0 0.0e+00 0.0e+00 0.0e+00 0 0 0 0 0 0 0 0 0 0 341 VecCopy 507 1.0 8.4626e-02 1.0 0.00e+00 0.0 0.0e+00 0.0e+00 0.0e+00 0 0 0 0 0 0 0 0 0 0 0 VecSet 1408 1.0 1.1664e-01 1.0 0.00e+00 0.0 0.0e+00 0.0e+00 0.0e+00 0 0 0 0 0 0 0 0 0 0 0 VecAXPY 202 1.0 2.6221e-02 1.0 4.59e+08 1.0 0.0e+00 0.0e+00 0.0e+00 0 0 0 0 0 0 0 0 0 0 459 VecWAXPY 202 1.0 4.4239e-02 1.0 1.36e+08 1.0 0.0e+00 0.0e+00 0.0e+00 0 0 0 0 0 0 0 0 0 0 136 VecMAXPY 404 1.0 7.3515e-02 1.0 3.27e+08 1.0 0.0e+00 0.0e+00 0.0e+00 0 1 0 0 0 0 1 0 0 0 327 VecAssemblyBegin 302 1.0 9.2960e-04 1.0 0.00e+00 0.0 0.0e+00 0.0e+00 0.0e+00 0 0 0 0 0 0 0 0 0 0 0 VecAssemblyEnd 302 1.0 5.5790e-04 1.0 0.00e+00 0.0 0.0e+00 0.0e+00 0.0e+00 0 0 0 0 0 0 0 0 0 0 0 VecScatterBegin 603 1.0 1.9933e-01 1.0 0.00e+00 0.0 0.0e+00 0.0e+00 0.0e+00 0 0 0 0 0 0 0 0 0 0 0 VecNormalize 404 1.0 5.5408e-01 1.0 6.52e+07 1.0 0.0e+00 0.0e+00 0.0e+00 0 1 0 0 0 0 1 0 0 0 65 MatMult 404 1.0 2.6457e+00 1.0 2.26e+08 1.0 0.0e+00 0.0e+00 0.0e+00 0 22 0 0 0 0 22 0 0 0 226 MatSolve 404 1.0 4.6454e+00 1.0 1.28e+08 1.0 0.0e+00 0.0e+00 0.0e+00 0 22 0 0 0 0 22 0 0 0 128 MatLUFactorNum 202 1.0 1.5211e+01 1.0 8.85e+07 1.0 0.0e+00 0.0e+00 0.0e+00 1 50 0 0 0 1 50 0 0 0 89 MatILUFactorSym 100 1.0 1.9993e+00 1.0 0.00e+00 0.0 0.0e+00 0.0e+00 1.0e+02 0 0 0 0 0 0 0 0 0 9 0 MatAssemblyBegin 404 1.0 9.6217e-04 1.0 0.00e+00 0.0 0.0e+00 0.0e+00 0.0e+00 0 0 0 0 0 0 0 0 0 0 0 MatAssemblyEnd 404 1.0 1.4601e+00 1.0 0.00e+00 0.0 0.0e+00 0.0e+00 0.0e+00 0 0 0 0 0 0 0 0 0 0 0 MatGetRowIJ 100 1.0 2.4641e-04 1.0 0.00e+00 0.0 0.0e+00 0.0e+00 0.0e+00 0 0 0 0 0 0 0 0 0 0 0 MatGetOrdering 100 1.0 7.6755e-02 1.0 0.00e+00 0.0 0.0e+00 0.0e+00 2.0e+02 0 0 0 0 0 0 0 0 0 18 0 MatZeroEntries 99 1.0 3.6160e-01 1.0 0.00e+00 0.0 0.0e+00 0.0e+00 0.0e+00 0 0 0 0 0 0 0 0 0 0 0 SNESSolve 100 1.0 2.9339e+03 1.0 9.17e+05 1.0 0.0e+00 0.0e+00 1.0e+03100100 0 0 1 100100 0 0 91 1 SNESLineSearch 202 1.0 7.9707e+02 1.0 4.35e+05 1.0 0.0e+00 0.0e+00 4.0e+02 27 13 0 0 0 27 13 0 0 37 0 SNESFunctionEval 302 1.0 1.1836e+03 1.0 0.00e+00 0.0 0.0e+00 0.0e+00 3.0e+02 40 0 0 0 0 40 0 0 0 27 0 SNESJacobianEval 202 1.0 1.7238e+03 1.0 0.00e+00 0.0 0.0e+00 0.0e+00 2.0e+02 59 0 0 0 0 59 0 0 0 18 0 KSPGMRESOrthog 202 1.0 7.0303e-02 1.0 3.42e+08 1.0 0.0e+00 0.0e+00 0.0e+00 0 1 0 0 0 0 1 0 0 0 342 KSPSetup 202 1.0 4.6391e-02 1.0 0.00e+00 0.0 0.0e+00 0.0e+00 0.0e+00 0 0 0 0 0 0 0 0 0 0 0 KSPSolve 202 1.0 2.4101e+01 1.0 9.65e+07 1.0 0.0e+00 0.0e+00 3.0e+02 1 86 0 0 0 1 86 0 0 27 97 PCSetUp 202 1.0 1.7296e+01 1.0 7.78e+07 1.0 0.0e+00 0.0e+00 3.0e+02 1 50 0 0 0 1 50 0 0 27 78 PCApply 404 1.0 4.6487e+00 1.0 1.28e+08 1.0 0.0e+00 0.0e+00 0.0e+00 0 22 0 0 0 0 22 0 0 0 128 ------------------------------------------------------------------------------------------------------------------------ Memory usage is given in bytes: Object Type Creations Destructions Memory Descendants' Mem. --- Event Stage 0: Main Stage Index Set 904 901 107564984 0 Vec 1511 1497 357441684 0 Vec Scatter 604 604 0 0 Matrix 101 99 942432084 0 SNES 100 99 12276 0 Krylov Solver 100 99 1671120 0 Preconditioner 100 99 14256 0 ======================================================================================================================== Average time to get PetscTime(): 1.49164e-06 OptionTable: -snes_converged_reason OptionTable: -snes_max_it 20 OptionTable: -snes_rtol 0.0000001 OptionTable: -snes_stol 0.001 Compiled without FORTRAN kernels Compiled with full precision matrices (default) sizeof(short) 2 sizeof(int) 4 sizeof(long) 4 sizeof(void*) 4 sizeof(PetscScalar) 8 Configure run at: Mon Feb 23 23:01:43 2009 Configure options: --with-debugging=no -with-shared --download-mpich=1 ----------------------------------------- > > Message: 7 > Date: Tue, 24 Feb 2009 18:05:38 +0100 > From: STEPHANE TCHOUANMO > Subject: Petsc slowness on a single processor machine? > To: > Message-ID: > Content-Type: text/plain; charset="windows-1256" > > > Dear all, > > I use petsc to solve a nonlinear convection-diffusion type equation in porous media. > The built linear system's size is 30000 and its resolution lasts about a hour on a single processor machine (my laptop...). > I > run for that a hundred time steps and have in average 4 Newton > iterations per time step. So a hour seems huge to me with the optimized > version of Petsc. > I tryed to profile my code with the options > "-log_summary" and "-info". What i get out of it is that the first time > step lasts about 15min representing 25% of the total time and i think > its not normal. > The thing is, these 15min happen at the second call > of the petsc routine "VecScatterCreate()" right after the first Newton residual. > > Any idea? > Thanks. > > Stephane > > > > _________________________________________________________________ > Show them the way! Add maps and directions to your party invites. > http://www.microsoft.com/windows/windowslive/products/events.aspx > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 8 > Date: Tue, 24 Feb 2009 11:22:18 -0600 > From: Matthew Knepley > Subject: Re: Petsc slowness on a single processor machine? > To: PETSc users list > Message-ID: > > Content-Type: text/plain; charset="iso-8859-1" > > 2009/2/24 STEPHANE TCHOUANMO > > > Dear all, > > > > I use petsc to solve a nonlinear convection-diffusion type equation in > > porous media. > > The built linear system's size is 30000 and its resolution lasts about a > > hour on a single processor machine (my laptop...). > > I run for that a hundred time steps and have in average 4 Newton iterations > > per time step. So a hour seems huge to me with the optimized version of > > Petsc. > > I tryed to profile my code with the options "-log_summary" and "-info". > > What i get out of it is that the first time step lasts about 15min > > representing 25% of the total time and i think its not normal. > > The thing is, these 15min happen at the second call of the petsc routine > > "VecScatterCreate()" right after the first Newton residual. > > > > We can't say anything without seeing the entire output of -log_summary. > > Matt > > > > > > Any idea? > > Thanks. > > > > Stephane > > > > > > > > ------------------------------ > > See all the ways you can stay connected to friends and family > > > > > > -- > What most experimenters take for granted before they begin their experiments > is infinitely more interesting than any results to which their experiments > lead. > -- Norbert Wiener > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > _______________________________________________ > petsc-users mailing list > petsc-users at mcs.anl.gov > https://lists.mcs.anl.gov/mailman/listinfo/petsc-users > > > End of petsc-users Digest, Vol 2, Issue 32 > ****************************************** _________________________________________________________________ News, entertainment and everything you care about at Live.com. Get it now! http://www.live.com/getstarted.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From bsmith at mcs.anl.gov Tue Feb 24 12:25:44 2009 From: bsmith at mcs.anl.gov (Barry Smith) Date: Tue, 24 Feb 2009 12:25:44 -0600 Subject: petsc-users Digest, Vol 2, Issue 32 In-Reply-To: References: Message-ID: <014621DE-584C-4574-8F95-9E491F8858D9@mcs.anl.gov> SNESSolve 100 1.0 2.9339e+03 1.0 9.17e+05 1.0 0.0e+00 0.0e +00 1.0e+03100100 0 0 1 100 SNESLineSearch 202 1.0 7.9707e+02 1.0 4.35e+05 1.0 0.0e+00 0.0e +00 4.0e+02 27 13 0 0 0 27 SNESFunctionEval 302 1.0 1.1836e+03 1.0 0.00e+00 0.0 0.0e+00 0.0e +00 3.0e+02 40 0 0 0 0 40 SNESJacobianEval 202 1.0 1.7238e+03 1.0 0.00e+00 0.0 0.0e+00 0.0e +00 2.0e+02 59 0 0 0 0 59 The final column above (I have removed the later ones for clarity) is the problem. Your function evaluation is taking 40% of the time and the Jacobian 59% The PETSc linear solver is taking 1% so something is seriously bad about your function evaluation and Jacobian evaluation code. Barry On Feb 24, 2009, at 12:17 PM, STEPHANE TCHOUANMO wrote: > Here is my -log_summary: > Something looks a bit strange to me; its the MPI Reductions below. > Other than that, i dont see anything relevant. > What do you think? > Thanks > > > > ---------------------------------------------- PETSc Performance > Summary: ---------------------------------------------- > > ./diff-conv-opt on a linux-gnu named linux-stchouan with 1 > processor, by stephane Tue Feb 24 13:54:35 2009 > Using Petsc Release Version 2.3.3, Patch 13, Thu May 15 17:29:26 CDT > 2008 HG revision: 4466c6289a0922df26e20626fd4a0b4dd03c8124 > > Max Max/ > Min Avg Total > Time (sec): 2.937e+03 1.00000 2.937e+03 > Objects: 3.420e+03 1.00000 3.420e > +03 > Flops: 2.690e+09 1.00000 > 2.690e+09 2.690e+09 > Flops/sec: 9.161e+05 1.00000 9.161e > +05 9.161e+05 > MPI Messages: 0.000e+00 0.00000 0.000e+00 > 0.000e+00 > MPI Message Lengths: 0.000e+00 0.00000 0.000e+00 0.000e+00 > MPI Reductions: 1.189e+05 1.00000 > > Flop counting convention: 1 flop = 1 real number operation of type > (multiply/divide/add/subtract) > e.g., VecAXPY() for real vectors of > length N --> 2N flops > and VecAXPY() for complex vectors of > length N --> 8N flops > > Summary of Stages: ----- Time ------ ----- Flops ----- --- > Messages --- -- Message Lengths -- -- Reductions -- > Avg %Total Avg %Total counts > %Total Avg %Total counts %Total > 0: Main Stage: 2.9367e+03 100.0% 2.6905e+09 100.0% 0.000e > +00 0.0% 0.000e+00 0.0% 1.106e+03 0.9% > > ------------------------------------------------------------------------------------------------------------------------ > See the 'Profiling' chapter of the users' manual for details on > interpreting output. > Phase summary info: > Count: number of times phase was executed > Time and Flops/sec: Max - maximum over all processors > Ratio - ratio of maximum to minimum over all > processors > Mess: number of messages sent > Avg. len: average message length > Reduct: number of global reductions > Global: entire computation > Stage: stages of a computation. Set stages with > PetscLogStagePush() and PetscLogStagePop(). > %T - percent time in this phase %F - percent flops in > this phase > %M - percent messages in this phase %L - percent message > lengths in this phase > %R - percent reductions in this phase > Total Mflop/s: 10e-6 * (sum of flops over all processors)/(max > time over all processors) > ------------------------------------------------------------------------------------------------------------------------ > > Event Count Time (sec) Flops/ > sec --- Global --- --- Stage --- Total > Max Ratio Max Ratio Max Ratio Mess Avg > len Reduct %T %F %M %L %R %T %F %M %L %R Mflop/s > ------------------------------------------------------------------------------------------------------------------------ > > --- Event Stage 0: Main Stage > > VecDot 202 1.0 3.0360e-02 1.0 3.96e+08 1.0 0.0e+00 0.0e > +00 0.0e+00 0 0 0 0 0 0 0 0 0 0 396 > VecMDot 202 1.0 3.0552e-02 1.0 3.94e+08 1.0 0.0e+00 0.0e > +00 0.0e+00 0 0 0 0 0 0 0 0 0 0 394 > VecNorm 1110 1.0 1.2257e+00 1.0 5.40e+07 1.0 0.0e+00 0.0e > +00 0.0e+00 0 2 0 0 0 0 2 0 0 0 54 > VecScale 404 1.0 3.5342e-02 1.0 3.41e+08 1.0 0.0e+00 0.0e > +00 0.0e+00 0 0 0 0 0 0 0 0 0 0 341 > VecCopy 507 1.0 8.4626e-02 1.0 0.00e+00 0.0 0.0e+00 0.0e > +00 0.0e+00 0 0 0 0 0 0 0 0 0 0 0 > VecSet 1408 1.0 1.1664e-01 1.0 0.00e+00 0.0 0.0e+00 0.0e > +00 0.0e+00 0 0 0 0 0 0 0 0 0 0 0 > VecAXPY 202 1.0 2.6221e-02 1.0 4.59e+08 1.0 0.0e+00 0.0e > +00 0.0e+00 0 0 0 0 0 0 0 0 0 0 459 > VecWAXPY 202 1.0 4.4239e-02 1.0 1.36e+08 1.0 0.0e+00 0.0e > +00 0.0e+00 0 0 0 0 0 0 0 0 0 0 136 > VecMAXPY 404 1.0 7.3515e-02 1.0 3.27e+08 1.0 0.0e+00 0.0e > +00 0.0e+00 0 1 0 0 0 0 1 0 0 0 327 > VecAssemblyBegin 302 1.0 9.2960e-04 1.0 0.00e+00 0.0 0.0e+00 0.0e > +00 0.0e+00 0 0 0 0 0 0 0 0 0 0 0 > VecAssemblyEnd 302 1.0 5.5790e-04 1.0 0.00e+00 0.0 0.0e+00 0.0e > +00 0.0e+00 0 0 0 0 0 0 0 0 0 0 0 > VecScatterBegin 603 1.0 1.9933e-01 1.0 0.00e+00 0.0 0.0e+00 0.0e > +00 0.0e+00 0 0 0 0 0 0 0 0 0 0 0 > VecNormalize 404 1.0 5.5408e-01 1.0 6.52e+07 1.0 0.0e+00 0.0e > +00 0.0e+00 0 1 0 0 0 0 1 0 0 0 65 > MatMult 404 1.0 2.6457e+00 1.0 2.26e+08 1.0 0.0e+00 0.0e > +00 0.0e+00 0 22 0 0 0 0 22 0 0 0 226 > MatSolve 404 1.0 4.6454e+00 1.0 1.28e+08 1.0 0.0e+00 0.0e > +00 0.0e+00 0 22 0 0 0 0 22 0 0 0 128 > MatLUFactorNum 202 1.0 1.5211e+01 1.0 8.85e+07 1.0 0.0e+00 0.0e > +00 0.0e+00 1 50 0 0 0 1 50 0 0 0 89 > MatILUFactorSym 100 1.0 1.9993e+00 1.0 0.00e+00 0.0 0.0e+00 0.0e > +00 1.0e+02 0 0 0 0 0 0 0 0 0 9 0 > MatAssemblyBegin 404 1.0 9.6217e-04 1.0 0.00e+00 0.0 0.0e+00 0.0e > +00 0.0e+00 0 0 0 0 0 0 0 0 0 0 0 > MatAssemblyEnd 404 1.0 1.4601e+00 1.0 0.00e+00 0.0 0.0e+00 0.0e > +00 0.0e+00 0 0 0 0 0 0 0 0 0 0 0 > MatGetRowIJ 100 1.0 2.4641e-04 1.0 0.00e+00 0.0 0.0e+00 0.0e > +00 0.0e+00 0 0 0 0 0 0 0 0 0 0 0 > MatGetOrdering 100 1.0 7.6755e-02 1.0 0.00e+00 0.0 0.0e+00 0.0e > +00 2.0e+02 0 0 0 0 0 0 0 0 0 18 0 > MatZeroEntries 99 1.0 3.6160e-01 1.0 0.00e+00 0.0 0.0e+00 0.0e > +00 0.0e+00 0 0 0 0 0 0 0 0 0 0 0 > SNESSolve 100 1.0 2.9339e+03 1.0 9.17e+05 1.0 0.0e+00 0.0e > +00 1.0e+03100100 0 0 1 100100 0 0 91 1 > SNESLineSearch 202 1.0 7.9707e+02 1.0 4.35e+05 1.0 0.0e+00 0.0e > +00 4.0e+02 27 13 0 0 0 27 13 0 0 37 0 > SNESFunctionEval 302 1.0 1.1836e+03 1.0 0.00e+00 0.0 0.0e+00 0.0e > +00 3.0e+02 40 0 0 0 0 40 0 0 0 27 0 > SNESJacobianEval 202 1.0 1.7238e+03 1.0 0.00e+00 0.0 0.0e+00 0.0e > +00 2.0e+02 59 0 0 0 0 59 0 0 0 18 0 > KSPGMRESOrthog 202 1.0 7.0303e-02 1.0 3.42e+08 1.0 0.0e+00 0.0e > +00 0.0e+00 0 1 0 0 0 0 1 0 0 0 342 > KSPSetup 202 1.0 4.6391e-02 1.0 0.00e+00 0.0 0.0e+00 0.0e > +00 0.0e+00 0 0 0 0 0 0 0 0 0 0 0 > KSPSolve 202 1.0 2.4101e+01 1.0 9.65e+07 1.0 0.0e+00 0.0e > +00 3.0e+02 1 86 0 0 0 1 86 0 0 27 97 > PCSetUp 202 1.0 1.7296e+01 1.0 7.78e+07 1.0 0.0e+00 0.0e > +00 3.0e+02 1 50 0 0 0 1 50 0 0 27 78 > PCApply 404 1.0 4.6487e+00 1.0 1.28e+08 1.0 0.0e+00 0.0e > +00 0.0e+00 0 22 0 0 0 0 22 0 0 0 128 > ------------------------------------------------------------------------------------------------------------------------ > > Memory usage is given in bytes: > > Object Type Creations Destructions Memory Descendants' > Mem. > > --- Event Stage 0: Main Stage > > Index Set 904 901 107564984 0 > Vec 1511 1497 357441684 0 > Vec Scatter 604 604 0 0 > Matrix 101 99 942432084 0 > SNES 100 99 12276 0 > Krylov Solver 100 99 1671120 0 > Preconditioner 100 99 14256 0 > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > ====================================================================== > Average time to get PetscTime(): 1.49164e-06 > OptionTable: -snes_converged_reason > OptionTable: -snes_max_it 20 > OptionTable: -snes_rtol 0.0000001 > OptionTable: -snes_stol 0.001 > Compiled without FORTRAN kernels > Compiled with full precision matrices (default) > sizeof(short) 2 sizeof(int) 4 sizeof(long) 4 sizeof(void*) 4 > sizeof(PetscScalar) 8 > Configure run at: Mon Feb 23 23:01:43 2009 > Configure options: --with-debugging=no -with-shared --download-mpich=1 > ----------------------------------------- > > > > > > > > Message: 7 > > Date: Tue, 24 Feb 2009 18:05:38 +0100 > > From: STEPHANE TCHOUANMO > > Subject: Petsc slowness on a single processor machine? > > To: > > Message-ID: > > Content-Type: text/plain; charset="windows-1256" > > > > > > Dear all, > > > > I use petsc to solve a nonlinear convection-diffusion type > equation in porous media. > > The built linear system's size is 30000 and its resolution lasts > about a hour on a single processor machine (my laptop...). > > I > > run for that a hundred time steps and have in average 4 Newton > > iterations per time step. So a hour seems huge to me with the > optimized > > version of Petsc. > > I tryed to profile my code with the options > > "-log_summary" and "-info". What i get out of it is that the first > time > > step lasts about 15min representing 25% of the total time and i > think > > its not normal. > > The thing is, these 15min happen at the second call > > of the petsc routine "VecScatterCreate()" right after the first > Newton residual. > > > > Any idea? > > Thanks. > > > > Stephane > > > > > > > > _________________________________________________________________ > > Show them the way! Add maps and directions to your party invites. > > http://www.microsoft.com/windows/windowslive/products/events.aspx > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: > > > > > ------------------------------ > > > > Message: 8 > > Date: Tue, 24 Feb 2009 11:22:18 -0600 > > From: Matthew Knepley > > Subject: Re: Petsc slowness on a single processor machine? > > To: PETSc users list > > Message-ID: > > > > Content-Type: text/plain; charset="iso-8859-1" > > > > 2009/2/24 STEPHANE TCHOUANMO > > > > > Dear all, > > > > > > I use petsc to solve a nonlinear convection-diffusion type > equation in > > > porous media. > > > The built linear system's size is 30000 and its resolution lasts > about a > > > hour on a single processor machine (my laptop...). > > > I run for that a hundred time steps and have in average 4 Newton > iterations > > > per time step. So a hour seems huge to me with the optimized > version of > > > Petsc. > > > I tryed to profile my code with the options "-log_summary" and "- > info". > > > What i get out of it is that the first time step lasts about 15min > > > representing 25% of the total time and i think its not normal. > > > The thing is, these 15min happen at the second call of the petsc > routine > > > "VecScatterCreate()" right after the first Newton residual. > > > > > > > We can't say anything without seeing the entire output of - > log_summary. > > > > Matt > > > > > > > > > > Any idea? > > > Thanks. > > > > > > Stephane > > > > > > > > > > > > ------------------------------ > > > See all the ways you can stay connected to friends and family > > > > > > > > > > > > -- > > What most experimenters take for granted before they begin their > experiments > > is infinitely more interesting than any results to which their > experiments > > lead. > > -- Norbert Wiener > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: > > > > > ------------------------------ > > > > _______________________________________________ > > petsc-users mailing list > > petsc-users at mcs.anl.gov > > https://lists.mcs.anl.gov/mailman/listinfo/petsc-users > > > > > > End of petsc-users Digest, Vol 2, Issue 32 > > ****************************************** > > Get news, entertainment and everything you care about at Live.com. > Check it out! From enjoywm at cs.wm.edu Tue Feb 24 13:57:42 2009 From: enjoywm at cs.wm.edu (Yixun Liu) Date: Tue, 24 Feb 2009 14:57:42 -0500 Subject: output to matlab readable format Message-ID: <49A45136.3010403@cs.wm.edu> Hi, I use the following code to output matrix into file which can be read by matlab, PetscViewer aviewer; PetscViewerCreate(PETSC_COMM_WORLD, &aviewer); PetscViewerSetType(aviewer, PETSC_VIEWER_ASCII); //PetscObjectSetName((PetscObject)sparseMechanicalStiffnessMatrix, aname); PetscViewerSetFormat(aviewer, PETSC_VIEWER_ASCII_MATLAB); PetscViewerFileSetName(aviewer, aname); MatView(sparseMechanicalStiffnessMatrix, aviewer); PetscViewerDestroy(aviewer); The error is ASCII format file doesn't allow the matrix exceeds 512 rows. So I change PETSC_VIEWER_ASCII to PETSC_VIEWER_BINARY, but it seem that PETSc outputs to screen. Thanks. From irfan.khan at gatech.edu Tue Feb 24 14:07:32 2009 From: irfan.khan at gatech.edu (Khan, Irfan) Date: Tue, 24 Feb 2009 15:07:32 -0500 (EST) Subject: output to matlab readable format In-Reply-To: <49A45136.3010403@cs.wm.edu> Message-ID: <853349545.921871235506052550.JavaMail.root@mail4.gatech.edu> You will need to open a binary file to output the data. Try the following. PetscViewer viewer; ierr = PetscViewerBinaryOpen(PETSC_COMM_WORLD, "matrix", FILE_MODE_WRITE, &viewer); ierr = MatView(Amat,viewer); PetscViewerDestroy(viewer); In order to load the file into matlab do the following % $PETSC_DIR/bin/matlab/PetscBinaryRead("") Irfan Hi, I use the following code to output matrix into file which can be read by matlab, PetscViewer aviewer; PetscViewerCreate(PETSC_COMM_WORLD, &aviewer); PetscViewerSetType(aviewer, PETSC_VIEWER_ASCII); //PetscObjectSetName((PetscObject)sparseMechanicalStiffnessMatrix, aname); PetscViewerSetFormat(aviewer, PETSC_VIEWER_ASCII_MATLAB); PetscViewerFileSetName(aviewer, aname); MatView(sparseMechanicalStiffnessMatrix, aviewer); PetscViewerDestroy(aviewer); The error is ASCII format file doesn't allow the matrix exceeds 512 rows. So I change PETSC_VIEWER_ASCII to PETSC_VIEWER_BINARY, but it seem that PETSc outputs to screen. Thanks. From enjoywm at cs.wm.edu Tue Feb 24 14:39:51 2009 From: enjoywm at cs.wm.edu (Yixun Liu) Date: Tue, 24 Feb 2009 15:39:51 -0500 Subject: output to matlab readable format In-Reply-To: <853349545.921871235506052550.JavaMail.root@mail4.gatech.edu> References: <853349545.921871235506052550.JavaMail.root@mail4.gatech.edu> Message-ID: <49A45B17.7070605@cs.wm.edu> Thanks! Can I save matrix into (row, column, value) format? Khan, Irfan wrote: > You will need to open a binary file to output the data. Try the following. > > > PetscViewer viewer; > ierr = PetscViewerBinaryOpen(PETSC_COMM_WORLD, "matrix", FILE_MODE_WRITE, &viewer); > ierr = MatView(Amat,viewer); > PetscViewerDestroy(viewer); > > In order to load the file into matlab do the following > > % $PETSC_DIR/bin/matlab/PetscBinaryRead("") > > Irfan > > > > > > > > > > Hi, > I use the following code to output matrix into file which can be read by > matlab, > > PetscViewer aviewer; > PetscViewerCreate(PETSC_COMM_WORLD, &aviewer); > PetscViewerSetType(aviewer, PETSC_VIEWER_ASCII); > //PetscObjectSetName((PetscObject)sparseMechanicalStiffnessMatrix, > aname); > PetscViewerSetFormat(aviewer, PETSC_VIEWER_ASCII_MATLAB); > PetscViewerFileSetName(aviewer, aname); > MatView(sparseMechanicalStiffnessMatrix, aviewer); > PetscViewerDestroy(aviewer); > > > > The error is ASCII format file doesn't allow the matrix exceeds 512 > rows. So I change PETSC_VIEWER_ASCII to PETSC_VIEWER_BINARY, but it seem > that PETSc outputs to screen. > > Thanks. > From irfan.khan at gatech.edu Tue Feb 24 14:49:28 2009 From: irfan.khan at gatech.edu (Khan, Irfan) Date: Tue, 24 Feb 2009 15:49:28 -0500 (EST) Subject: output to matlab readable format In-Reply-To: <1675970570.937481235508512131.JavaMail.root@mail4.gatech.edu> Message-ID: <213952444.938091235508568472.JavaMail.root@mail4.gatech.edu> I don't think so. Petsc has its own way to output matrix information in binary format that is platform independent. However, I found that after loading into matlab, you can save or output the matrix in a format that you want. Irfan ----- Original Message ----- From: "Yixun Liu" To: "PETSc users list" Sent: Tuesday, February 24, 2009 3:39:51 PM GMT -05:00 US/Canada Eastern Subject: Re: output to matlab readable format Thanks! Can I save matrix into (row, column, value) format? Khan, Irfan wrote: > You will need to open a binary file to output the data. Try the following. > > > PetscViewer viewer; > ierr = PetscViewerBinaryOpen(PETSC_COMM_WORLD, "matrix", FILE_MODE_WRITE, &viewer); > ierr = MatView(Amat,viewer); > PetscViewerDestroy(viewer); > > In order to load the file into matlab do the following > > % $PETSC_DIR/bin/matlab/PetscBinaryRead("") > > Irfan > > > > > > > > > > Hi, > I use the following code to output matrix into file which can be read by > matlab, > > PetscViewer aviewer; > PetscViewerCreate(PETSC_COMM_WORLD, &aviewer); > PetscViewerSetType(aviewer, PETSC_VIEWER_ASCII); > //PetscObjectSetName((PetscObject)sparseMechanicalStiffnessMatrix, > aname); > PetscViewerSetFormat(aviewer, PETSC_VIEWER_ASCII_MATLAB); > PetscViewerFileSetName(aviewer, aname); > MatView(sparseMechanicalStiffnessMatrix, aviewer); > PetscViewerDestroy(aviewer); > > > > The error is ASCII format file doesn't allow the matrix exceeds 512 > rows. So I change PETSC_VIEWER_ASCII to PETSC_VIEWER_BINARY, but it seem > that PETSc outputs to screen. > > Thanks. > From enjoywm at cs.wm.edu Tue Feb 24 14:55:52 2009 From: enjoywm at cs.wm.edu (Yixun Liu) Date: Tue, 24 Feb 2009 15:55:52 -0500 Subject: output to matlab readable format In-Reply-To: <213952444.938091235508568472.JavaMail.root@mail4.gatech.edu> References: <213952444.938091235508568472.JavaMail.root@mail4.gatech.edu> Message-ID: <49A45ED8.6050909@cs.wm.edu> You mean PETSc has no option to only output non-zero values with the format (row, column, value)? Khan, Irfan wrote: > I don't think so. Petsc has its own way to output matrix information in binary format that is platform independent. > However, I found that after loading into matlab, you can save or output the matrix in a format that you want. > > Irfan > > ----- Original Message ----- > From: "Yixun Liu" > To: "PETSc users list" > Sent: Tuesday, February 24, 2009 3:39:51 PM GMT -05:00 US/Canada Eastern > Subject: Re: output to matlab readable format > > Thanks! > > Can I save matrix into (row, column, value) format? > > > Khan, Irfan wrote: > >> You will need to open a binary file to output the data. Try the following. >> >> >> PetscViewer viewer; >> ierr = PetscViewerBinaryOpen(PETSC_COMM_WORLD, "matrix", FILE_MODE_WRITE, &viewer); >> ierr = MatView(Amat,viewer); >> PetscViewerDestroy(viewer); >> >> In order to load the file into matlab do the following >> >> % $PETSC_DIR/bin/matlab/PetscBinaryRead("") >> >> Irfan >> >> >> >> >> >> >> >> >> >> Hi, >> I use the following code to output matrix into file which can be read by >> matlab, >> >> PetscViewer aviewer; >> PetscViewerCreate(PETSC_COMM_WORLD, &aviewer); >> PetscViewerSetType(aviewer, PETSC_VIEWER_ASCII); >> //PetscObjectSetName((PetscObject)sparseMechanicalStiffnessMatrix, >> aname); >> PetscViewerSetFormat(aviewer, PETSC_VIEWER_ASCII_MATLAB); >> PetscViewerFileSetName(aviewer, aname); >> MatView(sparseMechanicalStiffnessMatrix, aviewer); >> PetscViewerDestroy(aviewer); >> >> >> >> The error is ASCII format file doesn't allow the matrix exceeds 512 >> rows. So I change PETSC_VIEWER_ASCII to PETSC_VIEWER_BINARY, but it seem >> that PETSc outputs to screen. >> >> Thanks. >> >> From bsmith at mcs.anl.gov Tue Feb 24 15:35:53 2009 From: bsmith at mcs.anl.gov (Barry Smith) Date: Tue, 24 Feb 2009 15:35:53 -0600 Subject: initial values of matrix and vector In-Reply-To: <20090224165717.GA4377@brakk.ethz.ch> References: <49A35A62.6020009@cs.wm.edu> <91476420-4D99-4068-9B02-32EBA2E58C97@mcs.anl.gov> <20090224165717.GA4377@brakk.ethz.ch> Message-ID: <3F6F208A-A8DD-455B-9CB3-7259B896D840@mcs.anl.gov> Jed is right. Our intention is to have the vector initialized to zero at creation time IF we allocate the array space. Tracking down a not properly initialized vector is the type of bug that takes forever to find; plus I wanted consistency between vectors and matrix. Users SHOULD NOT call a MatZeroEntries() initially on matrices (since it screws up preallocation) so we should not have them do it on vectors either for consistency. Barry On Feb 24, 2009, at 10:57 AM, Jed Brown wrote: > On Tue 2009-02-24 06:53, Matthew Knepley wrote: >> On Mon, Feb 23, 2009 at 8:26 PM, Barry Smith >> wrote: >> >> >> Vectors have all entries equal to zero. Dense matrices have >> all entries >> equal to zero. Sparse matrices have no entries (logically this >> is the same >> as entries equal to zero). >> >> >> We do not automatically zero the entires upon allocation. You have >> to call >> VecZeroEntries() or VecSet() >> to initialize the vector. > > That's what I would have expected, but Barry is correct, at least for > the usual types. See, for instance > > PetscErrorCode PETSCVEC_DLLEXPORT VecCreate_Seq(Vec V) > { > Vec_Seq *s; > PetscScalar *array; > PetscErrorCode ierr; > PetscInt n = PetscMax(V->map->n,V->map->N); > PetscMPIInt size; > > PetscFunctionBegin; > ierr = MPI_Comm_size(((PetscObject)V)->comm,&size);CHKERRQ(ierr); > if (size > 1) { > SETERRQ(PETSC_ERR_ARG_WRONG,"Cannot create VECSEQ on more than > one process"); > } > ierr = PetscMalloc(n*sizeof(PetscScalar),&array);CHKERRQ(ierr); > ierr = PetscLogObjectMemory(V, n*sizeof(PetscScalar));CHKERRQ(ierr); > ierr = PetscMemzero(array,n*sizeof(PetscScalar));CHKERRQ(ierr); > ierr = VecCreate_Seq_Private(V,array);CHKERRQ(ierr); > s = (Vec_Seq*)V->data; > s->array_allocated = array; > PetscFunctionReturn(0); > } > > > > In well-structured code, the cost of zeroing the vector is tiny and > the > effort to track down uninitialized bugs is significant enough that > this > seems like a sane default. > > Jed From knepley at gmail.com Tue Feb 24 15:40:20 2009 From: knepley at gmail.com (Matthew Knepley) Date: Tue, 24 Feb 2009 15:40:20 -0600 Subject: output to matlab readable format In-Reply-To: <49A45ED8.6050909@cs.wm.edu> References: <213952444.938091235508568472.JavaMail.root@mail4.gatech.edu> <49A45ED8.6050909@cs.wm.edu> Message-ID: That is the default ASCII format. Matt On Tue, Feb 24, 2009 at 2:55 PM, Yixun Liu wrote: > You mean PETSc has no option to only output non-zero values with the > format (row, column, value)? > > Khan, Irfan wrote: > > I don't think so. Petsc has its own way to output matrix information in > binary format that is platform independent. > > However, I found that after loading into matlab, you can save or output > the matrix in a format that you want. > > > > Irfan > > > > ----- Original Message ----- > > From: "Yixun Liu" > > To: "PETSc users list" > > Sent: Tuesday, February 24, 2009 3:39:51 PM GMT -05:00 US/Canada Eastern > > Subject: Re: output to matlab readable format > > > > Thanks! > > > > Can I save matrix into (row, column, value) format? > > > > > > Khan, Irfan wrote: > > > >> You will need to open a binary file to output the data. Try the > following. > >> > >> > >> PetscViewer viewer; > >> ierr = PetscViewerBinaryOpen(PETSC_COMM_WORLD, "matrix", > FILE_MODE_WRITE, &viewer); > >> ierr = MatView(Amat,viewer); > >> PetscViewerDestroy(viewer); > >> > >> In order to load the file into matlab do the following > >> > >> % $PETSC_DIR/bin/matlab/PetscBinaryRead("") > >> > >> Irfan > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> Hi, > >> I use the following code to output matrix into file which can be read by > >> matlab, > >> > >> PetscViewer aviewer; > >> PetscViewerCreate(PETSC_COMM_WORLD, &aviewer); > >> PetscViewerSetType(aviewer, PETSC_VIEWER_ASCII); > >> //PetscObjectSetName((PetscObject)sparseMechanicalStiffnessMatrix, > >> aname); > >> PetscViewerSetFormat(aviewer, PETSC_VIEWER_ASCII_MATLAB); > >> PetscViewerFileSetName(aviewer, aname); > >> MatView(sparseMechanicalStiffnessMatrix, aviewer); > >> PetscViewerDestroy(aviewer); > >> > >> > >> > >> The error is ASCII format file doesn't allow the matrix exceeds 512 > >> rows. So I change PETSC_VIEWER_ASCII to PETSC_VIEWER_BINARY, but it seem > >> that PETSc outputs to screen. > >> > >> Thanks. > >> > >> > > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From bsmith at mcs.anl.gov Tue Feb 24 15:45:05 2009 From: bsmith at mcs.anl.gov (Barry Smith) Date: Tue, 24 Feb 2009 15:45:05 -0600 Subject: output to matlab readable format In-Reply-To: References: <213952444.938091235508568472.JavaMail.root@mail4.gatech.edu> <49A45ED8.6050909@cs.wm.edu> Message-ID: No it is not. The (row, column, value) format is a silly relic from the 1980s; it is completely unscalable and slow to parse. For SEQAIJ matrices you can use the matrix format PETSC_VIEWER_ASCII_MATRIXMARKET to print the matrix. But it is not supported for other matrices types (though could be easily added). I don't know which is sadder, that other formats don't support it or that someone actually added it for SeqAIJ :-( Barry On Feb 24, 2009, at 3:40 PM, Matthew Knepley wrote: > That is the default ASCII format. > > Matt > > On Tue, Feb 24, 2009 at 2:55 PM, Yixun Liu wrote: > You mean PETSc has no option to only output non-zero values with the > format (row, column, value)? > > Khan, Irfan wrote: > > I don't think so. Petsc has its own way to output matrix > information in binary format that is platform independent. > > However, I found that after loading into matlab, you can save or > output the matrix in a format that you want. > > > > Irfan > > > > ----- Original Message ----- > > From: "Yixun Liu" > > To: "PETSc users list" > > Sent: Tuesday, February 24, 2009 3:39:51 PM GMT -05:00 US/Canada > Eastern > > Subject: Re: output to matlab readable format > > > > Thanks! > > > > Can I save matrix into (row, column, value) format? > > > > > > Khan, Irfan wrote: > > > >> You will need to open a binary file to output the data. Try the > following. > >> > >> > >> PetscViewer viewer; > >> ierr = PetscViewerBinaryOpen(PETSC_COMM_WORLD, > "matrix", FILE_MODE_WRITE, &viewer); > >> ierr = MatView(Amat,viewer); > >> PetscViewerDestroy(viewer); > >> > >> In order to load the file into matlab do the following > >> > >> % $PETSC_DIR/bin/matlab/PetscBinaryRead("") > >> > >> Irfan > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> Hi, > >> I use the following code to output matrix into file which can be > read by > >> matlab, > >> > >> PetscViewer aviewer; > >> PetscViewerCreate(PETSC_COMM_WORLD, &aviewer); > >> PetscViewerSetType(aviewer, PETSC_VIEWER_ASCII); > >> // > PetscObjectSetName((PetscObject)sparseMechanicalStiffnessMatrix, > >> aname); > >> PetscViewerSetFormat(aviewer, PETSC_VIEWER_ASCII_MATLAB); > >> PetscViewerFileSetName(aviewer, aname); > >> MatView(sparseMechanicalStiffnessMatrix, aviewer); > >> PetscViewerDestroy(aviewer); > >> > >> > >> > >> The error is ASCII format file doesn't allow the matrix exceeds 512 > >> rows. So I change PETSC_VIEWER_ASCII to PETSC_VIEWER_BINARY, but > it seem > >> that PETSc outputs to screen. > >> > >> Thanks. > >> > >> > > > > > -- > What most experimenters take for granted before they begin their > experiments is infinitely more interesting than any results to which > their experiments lead. > -- Norbert Wiener From enjoywm at cs.wm.edu Tue Feb 24 15:47:20 2009 From: enjoywm at cs.wm.edu (Yixun Liu) Date: Tue, 24 Feb 2009 16:47:20 -0500 Subject: initial values of matrix and vector In-Reply-To: <3F6F208A-A8DD-455B-9CB3-7259B896D840@mcs.anl.gov> References: <49A35A62.6020009@cs.wm.edu> <91476420-4D99-4068-9B02-32EBA2E58C97@mcs.anl.gov> <20090224165717.GA4377@brakk.ethz.ch> <3F6F208A-A8DD-455B-9CB3-7259B896D840@mcs.anl.gov> Message-ID: <49A46AE8.4000304@cs.wm.edu> You mean I have no need to call VecSet(v, 0.0); and MatZeroEntries(mat); after I set the size for the vector or matrix? Barry Smith wrote: > > Jed is right. Our intention is to have the vector initialized to zero > at creation time IF we allocate the array space. > Tracking down a not properly initialized vector is the type of bug > that takes forever to find; plus I wanted consistency > between vectors and matrix. Users SHOULD NOT call a MatZeroEntries() > initially on matrices (since it screws up > preallocation) so we should not have them do it on vectors either for > consistency. > > Barry > > On Feb 24, 2009, at 10:57 AM, Jed Brown wrote: > >> On Tue 2009-02-24 06:53, Matthew Knepley wrote: >>> On Mon, Feb 23, 2009 at 8:26 PM, Barry Smith >>> wrote: >>> >>> >>> Vectors have all entries equal to zero. Dense matrices have all entries >>> equal to zero. Sparse matrices have no entries (logically this is >>> the same >>> as entries equal to zero). >>> >>> >>> We do not automatically zero the entires upon allocation. You have >>> to call >>> VecZeroEntries() or VecSet() >>> to initialize the vector. >> >> That's what I would have expected, but Barry is correct, at least for >> the usual types. See, for instance >> >> PetscErrorCode PETSCVEC_DLLEXPORT VecCreate_Seq(Vec V) >> { >> Vec_Seq *s; >> PetscScalar *array; >> PetscErrorCode ierr; >> PetscInt n = PetscMax(V->map->n,V->map->N); >> PetscMPIInt size; >> >> PetscFunctionBegin; >> ierr = MPI_Comm_size(((PetscObject)V)->comm,&size);CHKERRQ(ierr); >> if (size > 1) { >> SETERRQ(PETSC_ERR_ARG_WRONG,"Cannot create VECSEQ on more than one >> process"); >> } >> ierr = PetscMalloc(n*sizeof(PetscScalar),&array);CHKERRQ(ierr); >> ierr = PetscLogObjectMemory(V, n*sizeof(PetscScalar));CHKERRQ(ierr); >> ierr = PetscMemzero(array,n*sizeof(PetscScalar));CHKERRQ(ierr); >> ierr = VecCreate_Seq_Private(V,array);CHKERRQ(ierr); >> s = (Vec_Seq*)V->data; >> s->array_allocated = array; >> PetscFunctionReturn(0); >> } >> >> >> >> In well-structured code, the cost of zeroing the vector is tiny and the >> effort to track down uninitialized bugs is significant enough that this >> seems like a sane default. >> >> Jed > From knepley at gmail.com Tue Feb 24 15:56:57 2009 From: knepley at gmail.com (Matthew Knepley) Date: Tue, 24 Feb 2009 15:56:57 -0600 Subject: initial values of matrix and vector In-Reply-To: <49A46AE8.4000304@cs.wm.edu> References: <49A35A62.6020009@cs.wm.edu> <91476420-4D99-4068-9B02-32EBA2E58C97@mcs.anl.gov> <20090224165717.GA4377@brakk.ethz.ch> <3F6F208A-A8DD-455B-9CB3-7259B896D840@mcs.anl.gov> <49A46AE8.4000304@cs.wm.edu> Message-ID: On Tue, Feb 24, 2009 at 3:47 PM, Yixun Liu wrote You mean I have no need to call > VecSet(v, 0.0); and > MatZeroEntries(mat); > > after I set the size for the vector or matrix? > Yes, do not call them. Matt > Barry Smith wrote: > > > > Jed is right. Our intention is to have the vector initialized to zero > > at creation time IF we allocate the array space. > > Tracking down a not properly initialized vector is the type of bug > > that takes forever to find; plus I wanted consistency > > between vectors and matrix. Users SHOULD NOT call a MatZeroEntries() > > initially on matrices (since it screws up > > preallocation) so we should not have them do it on vectors either for > > consistency. > > > > Barry > > > > On Feb 24, 2009, at 10:57 AM, Jed Brown wrote: > > > >> On Tue 2009-02-24 06:53, Matthew Knepley wrote: > >>> On Mon, Feb 23, 2009 at 8:26 PM, Barry Smith > >>> wrote: > >>> > >>> > >>> Vectors have all entries equal to zero. Dense matrices have all entries > >>> equal to zero. Sparse matrices have no entries (logically this is > >>> the same > >>> as entries equal to zero). > >>> > >>> > >>> We do not automatically zero the entires upon allocation. You have > >>> to call > >>> VecZeroEntries() or VecSet() > >>> to initialize the vector. > >> > >> That's what I would have expected, but Barry is correct, at least for > >> the usual types. See, for instance > >> > >> PetscErrorCode PETSCVEC_DLLEXPORT VecCreate_Seq(Vec V) > >> { > >> Vec_Seq *s; > >> PetscScalar *array; > >> PetscErrorCode ierr; > >> PetscInt n = PetscMax(V->map->n,V->map->N); > >> PetscMPIInt size; > >> > >> PetscFunctionBegin; > >> ierr = MPI_Comm_size(((PetscObject)V)->comm,&size);CHKERRQ(ierr); > >> if (size > 1) { > >> SETERRQ(PETSC_ERR_ARG_WRONG,"Cannot create VECSEQ on more than one > >> process"); > >> } > >> ierr = PetscMalloc(n*sizeof(PetscScalar),&array);CHKERRQ(ierr); > >> ierr = PetscLogObjectMemory(V, n*sizeof(PetscScalar));CHKERRQ(ierr); > >> ierr = PetscMemzero(array,n*sizeof(PetscScalar));CHKERRQ(ierr); > >> ierr = VecCreate_Seq_Private(V,array);CHKERRQ(ierr); > >> s = (Vec_Seq*)V->data; > >> s->array_allocated = array; > >> PetscFunctionReturn(0); > >> } > >> > >> > >> > >> In well-structured code, the cost of zeroing the vector is tiny and the > >> effort to track down uninitialized bugs is significant enough that this > >> seems like a sane default. > >> > >> Jed > > > > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From enjoywm at cs.wm.edu Tue Feb 24 16:24:32 2009 From: enjoywm at cs.wm.edu (Yixun Liu) Date: Tue, 24 Feb 2009 17:24:32 -0500 Subject: initial values of matrix and vector In-Reply-To: References: <49A35A62.6020009@cs.wm.edu> <91476420-4D99-4068-9B02-32EBA2E58C97@mcs.anl.gov> <20090224165717.GA4377@brakk.ethz.ch> <3F6F208A-A8DD-455B-9CB3-7259B896D840@mcs.anl.gov> <49A46AE8.4000304@cs.wm.edu> Message-ID: <49A473A0.4040506@cs.wm.edu> How about Mat or Vec Duplicate? VecDuplicate(v1, &v2); v2 will be set to be zero automatically? Matthew Knepley wrote: > On Tue, Feb 24, 2009 at 3:47 PM, Yixun Liu > wrote > You mean I have no need to call > > VecSet(v, 0.0); and > MatZeroEntries(mat); > > after I set the size for the vector or matrix? > > > Yes, do not call them. > > Matt > > > Barry Smith wrote: > > > > Jed is right. Our intention is to have the vector initialized to > zero > > at creation time IF we allocate the array space. > > Tracking down a not properly initialized vector is the type of bug > > that takes forever to find; plus I wanted consistency > > between vectors and matrix. Users SHOULD NOT call a MatZeroEntries() > > initially on matrices (since it screws up > > preallocation) so we should not have them do it on vectors > either for > > consistency. > > > > Barry > > > > On Feb 24, 2009, at 10:57 AM, Jed Brown wrote: > > > >> On Tue 2009-02-24 06:53, Matthew Knepley wrote: > >>> On Mon, Feb 23, 2009 at 8:26 PM, Barry Smith > > > >>> wrote: > >>> > >>> > >>> Vectors have all entries equal to zero. Dense matrices have > all entries > >>> equal to zero. Sparse matrices have no entries (logically this is > >>> the same > >>> as entries equal to zero). > >>> > >>> > >>> We do not automatically zero the entires upon allocation. You have > >>> to call > >>> VecZeroEntries() or VecSet() > >>> to initialize the vector. > >> > >> That's what I would have expected, but Barry is correct, at > least for > >> the usual types. See, for instance > >> > >> PetscErrorCode PETSCVEC_DLLEXPORT VecCreate_Seq(Vec V) > >> { > >> Vec_Seq *s; > >> PetscScalar *array; > >> PetscErrorCode ierr; > >> PetscInt n = PetscMax(V->map->n,V->map->N); > >> PetscMPIInt size; > >> > >> PetscFunctionBegin; > >> ierr = MPI_Comm_size(((PetscObject)V)->comm,&size);CHKERRQ(ierr); > >> if (size > 1) { > >> SETERRQ(PETSC_ERR_ARG_WRONG,"Cannot create VECSEQ on more than one > >> process"); > >> } > >> ierr = PetscMalloc(n*sizeof(PetscScalar),&array);CHKERRQ(ierr); > >> ierr = PetscLogObjectMemory(V, > n*sizeof(PetscScalar));CHKERRQ(ierr); > >> ierr = PetscMemzero(array,n*sizeof(PetscScalar));CHKERRQ(ierr); > >> ierr = VecCreate_Seq_Private(V,array);CHKERRQ(ierr); > >> s = (Vec_Seq*)V->data; > >> s->array_allocated = array; > >> PetscFunctionReturn(0); > >> } > >> > >> > >> > >> In well-structured code, the cost of zeroing the vector is tiny > and the > >> effort to track down uninitialized bugs is significant enough > that this > >> seems like a sane default. > >> > >> Jed > > > > > > > -- > What most experimenters take for granted before they begin their > experiments is infinitely more interesting than any results to which > their experiments lead. > -- Norbert Wiener From knepley at gmail.com Tue Feb 24 16:27:54 2009 From: knepley at gmail.com (Matthew Knepley) Date: Tue, 24 Feb 2009 16:27:54 -0600 Subject: initial values of matrix and vector In-Reply-To: <49A473A0.4040506@cs.wm.edu> References: <49A35A62.6020009@cs.wm.edu> <91476420-4D99-4068-9B02-32EBA2E58C97@mcs.anl.gov> <20090224165717.GA4377@brakk.ethz.ch> <3F6F208A-A8DD-455B-9CB3-7259B896D840@mcs.anl.gov> <49A46AE8.4000304@cs.wm.edu> <49A473A0.4040506@cs.wm.edu> Message-ID: On Tue, Feb 24, 2009 at 4:24 PM, Yixun Liu wrote: > How about Mat or Vec Duplicate? > > VecDuplicate(v1, &v2); > > v2 will be set to be zero automatically? > Yes. Matt -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From xy2102 at columbia.edu Tue Feb 24 18:58:23 2009 From: xy2102 at columbia.edu ((Rebecca) Xuefei YUAN) Date: Tue, 24 Feb 2009 19:58:23 -0500 Subject: running option: with -snes_mf and without -snes_mf In-Reply-To: References: <49A35A62.6020009@cs.wm.edu> <91476420-4D99-4068-9B02-32EBA2E58C97@mcs.anl.gov> <20090224165717.GA4377@brakk.ethz.ch> <3F6F208A-A8DD-455B-9CB3-7259B896D840@mcs.anl.gov> <49A46AE8.4000304@cs.wm.edu> <49A473A0.4040506@cs.wm.edu> Message-ID: <20090224195823.3ngod591c0go40kw@cubmail.cc.columbia.edu> Hi, I was writing a FormJacobianLocal() as a part of my project, however, I found that the result from two sets of running options (one with -snes_mf and one without it) are not the same, and they are not even close to each other. (The running result could be seen at the bottom of this email.) I believe there is sth wrong with my jacobian matrix and I double checked with my lines and cannot find what's wrong, so I am starting to debug the code in gdb. The difference between two codes are happened at MatMult which is located at SNESSolve_LS -- SNES_KSPSolve -- KSPSolve_FGMRES -- FGMREScycle -- MatMult. With jacobian matrix given, it calls MatMult_Inode and with matrix free, it calls MatMult_MFFD. Any suggestions if I would like to track why and how those two give different results? Moreover, besides the reference "A Flexible Inner-Outer Preconditioned GMRES Algorithm" by Y. Saad 1993, is there any other references those codes(especially SNESSolve_LS) based on? Or is there an already written algorithm for SNESSolve_LS()? Thanks a lot! with -snes_mf: -------------------------------------------- ************************************************** 0 SNES Function norm 1.413389226096e+00 0 KSP Residual norm 1.413389226096e+00 1 KSP Residual norm 8.949990968008e-03 2 KSP Residual norm 1.701213729481e-11 1 SNES Function norm 2.550842882967e-09 Nonlinear solve converged due to CONVERGED_FNORM_RELATIVE ************************************************** time step = 1 time = 1.0000000000000000e+00 number of nonlinear iterations = 1 number of linear iterations = 2 function norm = 2.5508428829673858e-09 ----------------------------------------------- without -snes_mf************************************************** 0 SNES Function norm 1.413389226096e+00 0 KSP Residual norm 1.413389226096e+00 1 KSP Residual norm 1.417239245196e-03 2 KSP Residual norm 2.565960913946e-06 1 SNES Function norm 9.641118499860e-03 0 KSP Residual norm 9.641118499860e-03 1 KSP Residual norm 1.434927485205e-05 2 KSP Residual norm 2.360672583502e-09 2 SNES Function norm 1.310213342315e-04 0 KSP Residual norm 1.310213342315e-04 1 KSP Residual norm 1.466288489933e-07 2 KSP Residual norm 9.025797759583e-11 3 SNES Function norm 1.769344613096e-06 0 KSP Residual norm 1.769344613096e-06 1 KSP Residual norm 2.167360853642e-09 2 KSP Residual norm 5.034113683896e-13 4 SNES Function norm 2.351612245726e-08 Nonlinear solve converged due to CONVERGED_PNORM_RELATIVE ************************************************** time step = 1 time = 1.0000000000000000e+00 number of nonlinear iterations = 4 number of linear iterations = 8 function norm = 2.3516122457259199e-08 ************************************************** ----------------------------------------------- -R From bsmith at mcs.anl.gov Tue Feb 24 21:30:30 2009 From: bsmith at mcs.anl.gov (Barry Smith) Date: Tue, 24 Feb 2009 21:30:30 -0600 Subject: running option: with -snes_mf and without -snes_mf In-Reply-To: <20090224195823.3ngod591c0go40kw@cubmail.cc.columbia.edu> References: <49A35A62.6020009@cs.wm.edu> <91476420-4D99-4068-9B02-32EBA2E58C97@mcs.anl.gov> <20090224165717.GA4377@brakk.ethz.ch> <3F6F208A-A8DD-455B-9CB3-7259B896D840@mcs.anl.gov> <49A46AE8.4000304@cs.wm.edu> <49A473A0.4040506@cs.wm.edu> <20090224195823.3ngod591c0go40kw@cubmail.cc.columbia.edu> Message-ID: Your Jacobian is wrong. It is close to being correct but has some entries that are wrong. Run with -snes_type test -snes_test_display for a small problem (like 10 unknowns) and it will show the entries that are wrong. Barry On Feb 24, 2009, at 6:58 PM, (Rebecca) Xuefei YUAN wrote: > Hi, > > I was writing a FormJacobianLocal() as a part of my project, > however, I found that the result from two sets of running options > (one with -snes_mf and one without it) are not the same, and they > are not even close to each other. (The running result could be seen > at the bottom of this email.) > > I believe there is sth wrong with my jacobian matrix and I double > checked with my lines and cannot find what's wrong, so I am starting > to debug the code in gdb. > > The difference between two codes are happened at MatMult which is > located at SNESSolve_LS -- SNES_KSPSolve -- KSPSolve_FGMRES -- > FGMREScycle -- MatMult. > > With jacobian matrix given, it calls MatMult_Inode and with matrix > free, it calls MatMult_MFFD. > > Any suggestions if I would like to track why and how those two give > different results? > > Moreover, besides the reference "A Flexible Inner-Outer > Preconditioned GMRES Algorithm" by Y. Saad 1993, is there any other > references those codes(especially SNESSolve_LS) based on? > > Or is there an already written algorithm for SNESSolve_LS()? > > Thanks a lot! > > with -snes_mf: > -------------------------------------------- > ************************************************** > 0 SNES Function norm 1.413389226096e+00 > 0 KSP Residual norm 1.413389226096e+00 > 1 KSP Residual norm 8.949990968008e-03 > 2 KSP Residual norm 1.701213729481e-11 > 1 SNES Function norm 2.550842882967e-09 > Nonlinear solve converged due to CONVERGED_FNORM_RELATIVE > ************************************************** > time step = 1 > time = 1.0000000000000000e+00 > number of nonlinear iterations = 1 > number of linear iterations = 2 > function norm = 2.5508428829673858e-09 > ----------------------------------------------- > without -snes_mf************************************************** > 0 SNES Function norm 1.413389226096e+00 > 0 KSP Residual norm 1.413389226096e+00 > 1 KSP Residual norm 1.417239245196e-03 > 2 KSP Residual norm 2.565960913946e-06 > 1 SNES Function norm 9.641118499860e-03 > 0 KSP Residual norm 9.641118499860e-03 > 1 KSP Residual norm 1.434927485205e-05 > 2 KSP Residual norm 2.360672583502e-09 > 2 SNES Function norm 1.310213342315e-04 > 0 KSP Residual norm 1.310213342315e-04 > 1 KSP Residual norm 1.466288489933e-07 > 2 KSP Residual norm 9.025797759583e-11 > 3 SNES Function norm 1.769344613096e-06 > 0 KSP Residual norm 1.769344613096e-06 > 1 KSP Residual norm 2.167360853642e-09 > 2 KSP Residual norm 5.034113683896e-13 > 4 SNES Function norm 2.351612245726e-08 > Nonlinear solve converged due to CONVERGED_PNORM_RELATIVE > ************************************************** > time step = 1 > time = 1.0000000000000000e+00 > number of nonlinear iterations = 4 > number of linear iterations = 8 > function norm = 2.3516122457259199e-08 > ************************************************** > > ----------------------------------------------- > > > -R > From tim.kroeger at cevis.uni-bremen.de Wed Feb 25 04:19:10 2009 From: tim.kroeger at cevis.uni-bremen.de (Tim Kroeger) Date: Wed, 25 Feb 2009 11:19:10 +0100 (CET) Subject: VecCopy() for ghosted vectors Message-ID: Dear PETSc team, When using VecCopy(a,b) where both a and b have been created using VecCreateGhost(), it seems as if ghost components are not copied. Did I do something wrong? Best Regards, Tim -- Dr. Tim Kroeger tim.kroeger at mevis.fraunhofer.de Phone +49-421-218-7710 tim.kroeger at cevis.uni-bremen.de Fax +49-421-218-4236 Fraunhofer MEVIS, Institute for Medical Image Computing Universitaetsallee 29, 28359 Bremen, Germany From jed at 59A2.org Wed Feb 25 05:13:02 2009 From: jed at 59A2.org (Jed Brown) Date: Wed, 25 Feb 2009 12:13:02 +0100 Subject: VecCopy() for ghosted vectors In-Reply-To: References: Message-ID: <20090225111302.GE12295@brakk.ethz.ch> On Wed 2009-02-25 11:19, Tim Kroeger wrote: > When using VecCopy(a,b) where both a and b have been created using > VecCreateGhost(), it seems as if ghost components are not copied. Did I > do something wrong? The vector returned by VecCreateGhost will behave exactly like any other parallel vector for the usual vector operations. If you want access to the ghosted values, use VecGhostGetLocalForm which will give you a serial vector (which knows nothing about the other processes, or even that it came from a VecGhost). VecGhostUpdate{Begin,End} is the way to handle the relationship between these conceptually different objects. If you only work with one (the local form or the global form) at a time, the result should be the same as if they didn't share any memory and you used a VecScatter to move values between the two representations (as with DALocalToGlobal). Jed -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: not available URL: From ahuramazda10 at gmail.com Wed Feb 25 08:01:34 2009 From: ahuramazda10 at gmail.com (Santolo Felaco) Date: Wed, 25 Feb 2009 15:01:34 +0100 Subject: Parallel example Gradient Conjugatr Message-ID: <5f76eef60902250601v63a55675nc4f251351d045ef3@mail.gmail.com> Hi, where can I to find a Gradient Conjugat parallel example in C language? Thanks. Bye. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bsmith at mcs.anl.gov Wed Feb 25 08:23:55 2009 From: bsmith at mcs.anl.gov (Barry Smith) Date: Wed, 25 Feb 2009 08:23:55 -0600 Subject: VecCopy() for ghosted vectors In-Reply-To: <20090225111302.GE12295@brakk.ethz.ch> References: <20090225111302.GE12295@brakk.ethz.ch> Message-ID: If you do VecCopy() on the vectors obtained via VecGhostGetLocalForm() then the ghost values are copied (because the ghost values are OWNED by the local form, not the global vector (which does not own ghost values). Barry On Feb 25, 2009, at 5:13 AM, Jed Brown wrote: > On Wed 2009-02-25 11:19, Tim Kroeger wrote: >> When using VecCopy(a,b) where both a and b have been created using >> VecCreateGhost(), it seems as if ghost components are not copied. >> Did I >> do something wrong? > > The vector returned by VecCreateGhost will behave exactly like any > other > parallel vector for the usual vector operations. If you want access > to > the ghosted values, use VecGhostGetLocalForm which will give you a > serial vector (which knows nothing about the other processes, or even > that it came from a VecGhost). VecGhostUpdate{Begin,End} is the way > to > handle the relationship between these conceptually different objects. > If you only work with one (the local form or the global form) at a > time, > the result should be the same as if they didn't share any memory and > you > used a VecScatter to move values between the two representations (as > with DALocalToGlobal). > > Jed From F.Cruz at bristol.ac.uk Wed Feb 25 08:26:41 2009 From: F.Cruz at bristol.ac.uk (Felipe Cruz) Date: Wed, 25 Feb 2009 14:26:41 +0000 Subject: Parallel example Gradient Conjugatr In-Reply-To: <5f76eef60902250601v63a55675nc4f251351d045ef3@mail.gmail.com> References: <5f76eef60902250601v63a55675nc4f251351d045ef3@mail.gmail.com> Message-ID: <6A8E68EB-ED1D-48A2-BB01-71E587C2BFD2@bristol.ac.uk> If you want to solve linear system with Conjugate gradient, I think you can look here: http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/src/ksp/ksp/examples/tutorials/index.html Felipe On 25 Feb 2009, at 14:01, Santolo Felaco wrote: > Hi, > where can I to find a Gradient Conjugat parallel example in C > language? > Thanks. Bye. > > > ---------------------------------------------------- Felipe Cruz PhD student Applied Mathematics Department of Mathematics University of Bristol Bristol BS8 1TW, UK ---------------------------------------------------- From shengli.xu.xu at gmail.com Thu Feb 26 02:20:14 2009 From: shengli.xu.xu at gmail.com (Shengli Xu) Date: Thu, 26 Feb 2009 03:20:14 -0500 Subject: How to get the matrix after ordering In-Reply-To: References: <5b3d4bb70902221930p7a415158n2b6c86c1dc69b43d@mail.gmail.com> Message-ID: <5b3d4bb70902260020g2b89fcb3k86a21a3d8c7de34f@mail.gmail.com> 2009/2/23 Matthew Knepley > On Sun, Feb 22, 2009 at 9:30 PM, Shengli Xu wrote: > >> >> Hi everyone, >> >> I want get the ordering matrix of a sparse matrix. I use >> MatGetOrdering(Mat matrix, MatOrderingType type, IS* rowperm, IS* colperm); >> to get rowperm and colperm. >> >> How to get the matrix after ordering? > > > I am not sure what you mean. A MatOrdering is exactly those permutation > vectors. We do not > change the matrix. If you want to change the matrix, you must use something > like MatPermute(). > > Matt > > Thank you Matt, MatPermute() is what I want. Another question: Matrix A is known, there are some zero entries in A. For example A(2,3)=0.0 and A(4,5)=0.0. I want to get a new matrix B, which has the same nonzero structure as A but does not have the entries where are zero in A. For example no entries of B(2,3) and B(4,5). How to get Matrix B? I want to use MatGetSeqNonzeroStructure(), But I don't think clearly. thanks in advance. >> -- >> Shengli Xu >> > -- > What most experimenters take for granted before they begin their > experiments is infinitely more interesting than any results to which their > experiments lead. > -- Norbert Wiener > -- Shengli Xu -------------- next part -------------- An HTML attachment was scrubbed... URL: From bsmith at mcs.anl.gov Thu Feb 26 08:25:04 2009 From: bsmith at mcs.anl.gov (Barry Smith) Date: Thu, 26 Feb 2009 08:25:04 -0600 Subject: How to get the matrix after ordering In-Reply-To: <5b3d4bb70902260020g2b89fcb3k86a21a3d8c7de34f@mail.gmail.com> References: <5b3d4bb70902221930p7a415158n2b6c86c1dc69b43d@mail.gmail.com> <5b3d4bb70902260020g2b89fcb3k86a21a3d8c7de34f@mail.gmail.com> Message-ID: <49C40559-45CD-40FC-BD44-F5F135188D98@mcs.anl.gov> On Feb 26, 2009, at 2:20 AM, Shengli Xu wrote: > > > Another question: Matrix A is known, there are some zero entries in > A. For example A(2,3)=0.0 and A(4,5)=0.0. I want to get a new matrix > B, which has the same nonzero structure as A but does not have the > entries where are zero in A. For example no entries of B(2,3) and > B(4,5). How to get Matrix B? There isn't anything like this. It is also not a desirable operation since the matrix has to be copied into new memory so you really are not getting a memory savings. Just try to do the best you can with not having zero values and don't sweat having a few. MatOption(A, MAT_IGNORE_ZERO_ENTRIES) will cause any call of MatSetValues() with a zero value to be ignored and not introduce a "zero" "nonzero location" into the matrix. Barry > > > I want to use MatGetSeqNonzeroStructure(), But I don't think clearly. > > thanks in advance. > > > -- > Shengli Xu > -- > What most experimenters take for granted before they begin their > experiments is infinitely more interesting than any results to which > their experiments lead. > -- Norbert Wiener > > > > -- > Shengli Xu From ahuramazda10 at gmail.com Thu Feb 26 10:00:13 2009 From: ahuramazda10 at gmail.com (Santolo Felaco) Date: Thu, 26 Feb 2009 17:00:13 +0100 Subject: Error Handlers Function Message-ID: <5f76eef60902260800q6d54fac1of25b3bc23d9e869c@mail.gmail.com> Hi, I have setted a handler error function: ierr = MPI_Errhandler_create(errorHandler,&errhandler); CHKERRQ(ierr); ierr = MPI_Errhandler_set(PETSC_COMM_WORLD,errhandler); CHKERRQ(ierr); I have simulated a fault of processor 1: if (rank == 1)) exit(2); MPI_Barrier(PETSC_COMM_WORLD); The process remains blocked and the functions errorHandler is not called. If I use return; instead of exit(2); the process don't remains blocked, I read the error of Petsc but errorHandler is not called. Help me please. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Andreas.Grassl at student.uibk.ac.at Thu Feb 26 10:12:44 2009 From: Andreas.Grassl at student.uibk.ac.at (Andreas Grassl) Date: Thu, 26 Feb 2009 17:12:44 +0100 Subject: PCNN preconditioner Message-ID: <49A6BF7C.1030503@student.uibk.ac.at> Hello, I'm working with a FE-Software where I get out the element stiffness matrices and the element-node correspondency to setup the stiffness matrix for solving with PETSc. Currently this is working fine for the seqaij matrix type and connected solvers. Now I want to Implement the PCNN preconditioner. Does anybody have any simple examples with this preconditioner? Thank you in advance ando -- /"\ Grassl Andreas \ / ASCII Ribbon Campaign Uni Innsbruck Institut f. Mathematik X against HTML email Technikerstr. 13 Zi 709 / \ +43 (0)512 507 6091 From knepley at gmail.com Thu Feb 26 11:37:22 2009 From: knepley at gmail.com (Matthew Knepley) Date: Thu, 26 Feb 2009 11:37:22 -0600 Subject: Error Handlers Function In-Reply-To: <5f76eef60902260800q6d54fac1of25b3bc23d9e869c@mail.gmail.com> References: <5f76eef60902260800q6d54fac1of25b3bc23d9e869c@mail.gmail.com> Message-ID: exit(2) does not trigger a PETSc error. SETERRQ does. Matt On Thu, Feb 26, 2009 at 10:00 AM, Santolo Felaco wrote: > Hi, > I have setted a handler error function: > ierr = MPI_Errhandler_create(errorHandler,&errhandler); CHKERRQ(ierr); > ierr = MPI_Errhandler_set(PETSC_COMM_WORLD,errhandler); CHKERRQ(ierr); > > I have simulated a fault of processor 1: > > if (rank == 1)) exit(2); > MPI_Barrier(PETSC_COMM_WORLD); > > The process remains blocked and the functions errorHandler is not called. > If I use return; instead of exit(2); the process don't remains blocked, I > read the error of Petsc but errorHandler is not called. > > Help me please. > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From bsmith at mcs.anl.gov Thu Feb 26 11:51:03 2009 From: bsmith at mcs.anl.gov (Barry Smith) Date: Thu, 26 Feb 2009 11:51:03 -0600 Subject: Error Handlers Function In-Reply-To: <5f76eef60902260800q6d54fac1of25b3bc23d9e869c@mail.gmail.com> References: <5f76eef60902260800q6d54fac1of25b3bc23d9e869c@mail.gmail.com> Message-ID: <854AF864-E105-4E33-9E41-BACC696B0B05@mcs.anl.gov> This is an MPI question and has nothing to do with PETSc. Perhaps there are some MPI mailing lists out there for this type of question. Note: I don't think exit() is something that all MPI implementations can catch and distribute to the other MPI nodes, but this is something MPI folks would know. Barry On Feb 26, 2009, at 10:00 AM, Santolo Felaco wrote: > Hi, > I have setted a handler error function: > ierr = MPI_Errhandler_create(errorHandler,&errhandler); CHKERRQ(ierr); > ierr = MPI_Errhandler_set(PETSC_COMM_WORLD,errhandler); CHKERRQ(ierr); > > I have simulated a fault of processor 1: > > if (rank == 1)) exit(2); > MPI_Barrier(PETSC_COMM_WORLD); > > The process remains blocked and the functions errorHandler is not > called. > If I use return; instead of exit(2); the process don't remains > blocked, I read the error of Petsc but errorHandler is not called. > > Help me please. From bsmith at mcs.anl.gov Thu Feb 26 12:04:24 2009 From: bsmith at mcs.anl.gov (Barry Smith) Date: Thu, 26 Feb 2009 12:04:24 -0600 Subject: PCNN preconditioner In-Reply-To: <49A6BF7C.1030503@student.uibk.ac.at> References: <49A6BF7C.1030503@student.uibk.ac.at> Message-ID: I'm sorry there is no example of the use of PCNN. Here is what you need to do. Use MatCreateIS() to create the matrix. Use MatSetValuesLocal() to put the values in the matrix then use PCSetType(pc,PCNN); to set the preconditioner to NN. Barry Note: You cannot just use MatCreateMPIAIJ() to create the matrix because it needs the unassembled per processor parts to build the preconditioner. You cannot use MatSetValues() because then it could not have the unassembled matrix. On Feb 26, 2009, at 10:12 AM, Andreas Grassl wrote: > Hello, > > I'm working with a FE-Software where I get out the element stiffness > matrices and the element-node correspondency to setup the stiffness > matrix for solving with PETSc. > > Currently this is working fine for the seqaij matrix type and > connected > solvers. Now I want to Implement the PCNN preconditioner. > > Does anybody have any simple examples with this preconditioner? > > Thank you in advance > > ando > > -- > /"\ Grassl Andreas > \ / ASCII Ribbon Campaign Uni Innsbruck Institut f. Mathematik > X against HTML email Technikerstr. 13 Zi 709 > / \ +43 (0)512 507 6091 From Andreas.Grassl at student.uibk.ac.at Thu Feb 26 12:26:20 2009 From: Andreas.Grassl at student.uibk.ac.at (Andreas Grassl) Date: Thu, 26 Feb 2009 19:26:20 +0100 Subject: PCNN preconditioner In-Reply-To: References: <49A6BF7C.1030503@student.uibk.ac.at> Message-ID: <49A6DECC.1080009@student.uibk.ac.at> Ok, this would be easy. I didn't try it, because I was thinking, that I have to mess around with more ISLocalToGlobal-stuff. I'll try out and give a feedback. cheers ando Barry Smith schrieb: > > I'm sorry there is no example of the use of PCNN. Here is what you > need to do. > Use MatCreateIS() to create the matrix. Use MatSetValuesLocal() to put > the values in the matrix > then use PCSetType(pc,PCNN); to set the preconditioner to NN. > > Barry > > Note: You cannot just use MatCreateMPIAIJ() to create the matrix because > it needs the unassembled per processor parts to build the preconditioner. > You cannot use MatSetValues() because then it could not have the > unassembled matrix. > > > On Feb 26, 2009, at 10:12 AM, Andreas Grassl wrote: > >> Hello, >> >> I'm working with a FE-Software where I get out the element stiffness >> matrices and the element-node correspondency to setup the stiffness >> matrix for solving with PETSc. >> >> Currently this is working fine for the seqaij matrix type and connected >> solvers. Now I want to Implement the PCNN preconditioner. >> >> Does anybody have any simple examples with this preconditioner? >> >> Thank you in advance >> >> ando >> >> -- >> /"\ Grassl Andreas >> \ / ASCII Ribbon Campaign Uni Innsbruck Institut f. Mathematik >> X against HTML email Technikerstr. 13 Zi 709 >> / \ +43 (0)512 507 6091 > -- /"\ \ / ASCII Ribbon X against HTML email / \ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 315 bytes Desc: OpenPGP digital signature URL: From ahuramazda10 at gmail.com Thu Feb 26 13:12:00 2009 From: ahuramazda10 at gmail.com (Santolo Felaco) Date: Thu, 26 Feb 2009 20:12:00 +0100 Subject: Error Handlers Function In-Reply-To: References: <5f76eef60902260800q6d54fac1of25b3bc23d9e869c@mail.gmail.com> Message-ID: <5f76eef60902261112g40f2d955kebf76de3720758c6@mail.gmail.com> Hi, also with return; the handler function isn't called. 2009/2/26 Matthew Knepley > exit(2) does not trigger a PETSc error. SETERRQ does. > > Matt > > > On Thu, Feb 26, 2009 at 10:00 AM, Santolo Felaco wrote: > >> Hi, >> I have setted a handler error function: >> ierr = MPI_Errhandler_create(errorHandler,&errhandler); CHKERRQ(ierr); >> ierr = MPI_Errhandler_set(PETSC_COMM_WORLD,errhandler); CHKERRQ(ierr); >> >> I have simulated a fault of processor 1: >> >> if (rank == 1)) exit(2); >> MPI_Barrier(PETSC_COMM_WORLD); >> >> The process remains blocked and the functions errorHandler is not called. >> If I use return; instead of exit(2); the process don't remains blocked, I >> read the error of Petsc but errorHandler is not called. >> >> Help me please. >> > > > > -- > What most experimenters take for granted before they begin their > experiments is infinitely more interesting than any results to which their > experiments lead. > -- Norbert Wiener > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ahuramazda10 at gmail.com Thu Feb 26 13:27:56 2009 From: ahuramazda10 at gmail.com (Santolo Felaco) Date: Thu, 26 Feb 2009 20:27:56 +0100 Subject: Error Handlers Function In-Reply-To: <854AF864-E105-4E33-9E41-BACC696B0B05@mcs.anl.gov> References: <5f76eef60902260800q6d54fac1of25b3bc23d9e869c@mail.gmail.com> <854AF864-E105-4E33-9E41-BACC696B0B05@mcs.anl.gov> Message-ID: <5f76eef60902261127l54920612ncaad1b30b84b1f4f@mail.gmail.com> Hi, I am using mpich conteined in Petsc. If use return instead exit(2) the handler function is not called. Thanks. 2009/2/26 Barry Smith > > This is an MPI question and has nothing to do with PETSc. Perhaps there > are some MPI mailing lists out there for this type of question. > Note: I don't think exit() is something that all MPI implementations can > catch and distribute to the other MPI nodes, but this is something MPI folks > would know. > > Barry > > > On Feb 26, 2009, at 10:00 AM, Santolo Felaco wrote: > > Hi, >> I have setted a handler error function: >> ierr = MPI_Errhandler_create(errorHandler,&errhandler); CHKERRQ(ierr); >> ierr = MPI_Errhandler_set(PETSC_COMM_WORLD,errhandler); CHKERRQ(ierr); >> >> I have simulated a fault of processor 1: >> >> if (rank == 1)) exit(2); >> MPI_Barrier(PETSC_COMM_WORLD); >> >> The process remains blocked and the functions errorHandler is not called. >> If I use return; instead of exit(2); the process don't remains blocked, I >> read the error of Petsc but errorHandler is not called. >> >> Help me please. >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Thu Feb 26 13:36:35 2009 From: knepley at gmail.com (Matthew Knepley) Date: Thu, 26 Feb 2009 13:36:35 -0600 Subject: Error Handlers Function In-Reply-To: <5f76eef60902261112g40f2d955kebf76de3720758c6@mail.gmail.com> References: <5f76eef60902260800q6d54fac1of25b3bc23d9e869c@mail.gmail.com> <5f76eef60902261112g40f2d955kebf76de3720758c6@mail.gmail.com> Message-ID: On Thu, Feb 26, 2009 at 1:12 PM, Santolo Felaco wrote: > Hi, also with return; the handler function isn't called. 1) I missed that you are setting the MPI err handler instead of the PETSc error handler. Sorry. 2) This post belongs on the MPI list. It has nothing to do with PETSc. Matt > > 2009/2/26 Matthew Knepley > >> exit(2) does not trigger a PETSc error. SETERRQ does. >> >> Matt >> >> >> On Thu, Feb 26, 2009 at 10:00 AM, Santolo Felaco wrote: >> >>> Hi, >>> I have setted a handler error function: >>> ierr = MPI_Errhandler_create(errorHandler,&errhandler); CHKERRQ(ierr); >>> ierr = MPI_Errhandler_set(PETSC_COMM_WORLD,errhandler); CHKERRQ(ierr); >>> >>> I have simulated a fault of processor 1: >>> >>> if (rank == 1)) exit(2); >>> MPI_Barrier(PETSC_COMM_WORLD); >>> >>> The process remains blocked and the functions errorHandler is not called. >>> If I use return; instead of exit(2); the process don't remains blocked, I >>> read the error of Petsc but errorHandler is not called. >>> >>> Help me please. >>> >> >> >> >> -- >> What most experimenters take for granted before they begin their >> experiments is infinitely more interesting than any results to which their >> experiments lead. >> -- Norbert Wiener >> > > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From ahuramazda10 at gmail.com Thu Feb 26 13:47:16 2009 From: ahuramazda10 at gmail.com (Santolo Felaco) Date: Thu, 26 Feb 2009 20:47:16 +0100 Subject: Error Handlers Function In-Reply-To: References: <5f76eef60902260800q6d54fac1of25b3bc23d9e869c@mail.gmail.com> <5f76eef60902261112g40f2d955kebf76de3720758c6@mail.gmail.com> Message-ID: <5f76eef60902261147s68b99dbbo64978dcd43f854e8@mail.gmail.com> Ok, Thanks. I will try with Petsc error handler. Bye. 2009/2/26 Matthew Knepley > On Thu, Feb 26, 2009 at 1:12 PM, Santolo Felaco wrote: > >> Hi, also with return; the handler function isn't called. > > > 1) I missed that you are setting the MPI err handler instead of the PETSc > error handler. Sorry. > > 2) This post belongs on the MPI list. It has nothing to do with PETSc. > > Matt > > >> >> 2009/2/26 Matthew Knepley >> >>> exit(2) does not trigger a PETSc error. SETERRQ does. >>> >>> Matt >>> >>> >>> On Thu, Feb 26, 2009 at 10:00 AM, Santolo Felaco >> > wrote: >>> >>>> Hi, >>>> I have setted a handler error function: >>>> ierr = MPI_Errhandler_create(errorHandler,&errhandler); CHKERRQ(ierr); >>>> ierr = MPI_Errhandler_set(PETSC_COMM_WORLD,errhandler); CHKERRQ(ierr); >>>> >>>> I have simulated a fault of processor 1: >>>> >>>> if (rank == 1)) exit(2); >>>> MPI_Barrier(PETSC_COMM_WORLD); >>>> >>>> The process remains blocked and the functions errorHandler is not >>>> called. >>>> If I use return; instead of exit(2); the process don't remains blocked, >>>> I read the error of Petsc but errorHandler is not called. >>>> >>>> Help me please. >>>> >>> >>> >>> >>> -- >>> What most experimenters take for granted before they begin their >>> experiments is infinitely more interesting than any results to which their >>> experiments lead. >>> -- Norbert Wiener >>> >> >> > > > -- > What most experimenters take for granted before they begin their > experiments is infinitely more interesting than any results to which their > experiments lead. > -- Norbert Wiener > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Andreas.Grassl at student.uibk.ac.at Fri Feb 27 03:20:00 2009 From: Andreas.Grassl at student.uibk.ac.at (Andreas Grassl) Date: Fri, 27 Feb 2009 10:20:00 +0100 Subject: PCNN preconditioner In-Reply-To: References: <49A6BF7C.1030503@student.uibk.ac.at> Message-ID: <49A7B040.9050309@student.uibk.ac.at> Barry Smith schrieb: > Use MatCreateIS() to create the matrix. Use MatSetValuesLocal() to put > the values in the matrix > then use PCSetType(pc,PCNN); to set the preconditioner to NN. > I followed your advice, but still run into problems. my sourcecode: ierr = KSPCreate(comm,&solver);CHKERRQ(ierr); ierr = KSPSetOperators(solver,A,A,DIFFERENT_NONZERO_PATTERN);CHKERRQ(ierr); ierr = KSPSetInitialGuessNonzero(solver,PETSC_TRUE);CHKERRQ(ierr); ierr = KSPGetPC(solver,&prec);CHKERRQ(ierr); ierr = PCSetType(prec,PCNN);CHKERRQ(ierr); //ierr = PCFactorSetShiftPd(prec,PETSC_TRUE);CHKERRQ(ierr); ierr = KSPSetUp(solver);CHKERRQ(ierr); ierr = KSPSolve(solver,B,X);CHKERRQ(ierr); and the error message: [0]PETSC ERROR: --------------------- Error Message ------------------------------------ [0]PETSC ERROR: Detected zero pivot in LU factorization see http://www.mcs.anl.gov/petsc/petsc-as/documentation/troubleshooting.html#ZeroPivot! [0]PETSC ERROR: Zero pivot row 801 value 2.78624e-13 tolerance 4.28598e-12 * rowsum 4.28598! [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: Petsc Release Version 3.0.0, Patch 3, Fri Jan 30 17:55:56 CST 2009 [0]PETSC ERROR: See docs/changes/index.html for recent updates. [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. [0]PETSC ERROR: See docs/index.html for manual pages. [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: Unknown Name on a linux64-g named mat1.uibk.ac.at by csae1801 Fri Feb 27 10:12:34 2009 [0]PETSC ERROR: Libraries linked from /home/lux/csae1801/petsc/petsc-3.0.0-p3/linux64-gnu-c-debug/lib [0]PETSC ERROR: Configure run at Wed Feb 18 10:30:58 2009 [0]PETSC ERROR: Configure options --with-64-bit-indices --with-scalar-type=real --with-precision=double --with-cc=icc --with-fc=ifort --with-cxx=icpc --with-shared=0 --with-mpi=1 --download-mpich=ifneeded --with-scalapack=1 --download-scalapack=ifneeded --download-f-blas-lapack=yes --with-blacs=1 --download-blacs=yes PETSC_ARCH=linux64-gnu-c-debug [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: MatLUFactorNumeric_Inode() line 1335 in src/mat/impls/aij/seq/inode.c [0]PETSC ERROR: MatLUFactorNumeric() line 2338 in src/mat/interface/matrix.c [0]PETSC ERROR: PCSetUp_LU() line 222 in src/ksp/pc/impls/factor/lu/lu.c [0]PETSC ERROR: PCSetUp() line 794 in src/ksp/pc/interface/precon.c [0]PETSC ERROR: KSPSetUp() line 237 in src/ksp/ksp/interface/itfunc.c [0]PETSC ERROR: PCISSetUp() line 137 in src/ksp/pc/impls/is/pcis.c [0]PETSC ERROR: PCSetUp_NN() line 28 in src/ksp/pc/impls/is/nn/nn.c [0]PETSC ERROR: PCSetUp() line 794 in src/ksp/pc/interface/precon.c [0]PETSC ERROR: KSPSetUp() line 237 in src/ksp/ksp/interface/itfunc.c [0]PETSC ERROR: User provided function() line 1274 in petscsolver.c Running PCFactorSetShift doesn't affect the output. any ideas? cheers ando -- /"\ Grassl Andreas \ / ASCII Ribbon Campaign Uni Innsbruck Institut f. Mathematik X against HTML email Technikerstr. 13 Zi 709 / \ +43 (0)512 507 6091 From ahuramazda10 at gmail.com Fri Feb 27 03:55:13 2009 From: ahuramazda10 at gmail.com (Santolo Felaco) Date: Fri, 27 Feb 2009 10:55:13 +0100 Subject: Error Handlers Function In-Reply-To: <5f76eef60902261147s68b99dbbo64978dcd43f854e8@mail.gmail.com> References: <5f76eef60902260800q6d54fac1of25b3bc23d9e869c@mail.gmail.com> <5f76eef60902261112g40f2d955kebf76de3720758c6@mail.gmail.com> <5f76eef60902261147s68b99dbbo64978dcd43f854e8@mail.gmail.com> Message-ID: <5f76eef60902270155u652a430axb6beea4803245df8@mail.gmail.com> Hi, I have used PetscPushErrorHandler, the handler function is called only I send CTRL+C signal. Thanks. Bye. 2009/2/26 Santolo Felaco > Ok, Thanks. I will try with Petsc error handler. > Bye. > > > 2009/2/26 Matthew Knepley > >> On Thu, Feb 26, 2009 at 1:12 PM, Santolo Felaco wrote: >> >>> Hi, also with return; the handler function isn't called. >> >> >> 1) I missed that you are setting the MPI err handler instead of the PETSc >> error handler. Sorry. >> >> 2) This post belongs on the MPI list. It has nothing to do with PETSc. >> >> Matt >> >> >>> >>> 2009/2/26 Matthew Knepley >>> >>>> exit(2) does not trigger a PETSc error. SETERRQ does. >>>> >>>> Matt >>>> >>>> >>>> On Thu, Feb 26, 2009 at 10:00 AM, Santolo Felaco < >>>> ahuramazda10 at gmail.com> wrote: >>>> >>>>> Hi, >>>>> I have setted a handler error function: >>>>> ierr = MPI_Errhandler_create(errorHandler,&errhandler); CHKERRQ(ierr); >>>>> ierr = MPI_Errhandler_set(PETSC_COMM_WORLD,errhandler); CHKERRQ(ierr); >>>>> >>>>> I have simulated a fault of processor 1: >>>>> >>>>> if (rank == 1)) exit(2); >>>>> MPI_Barrier(PETSC_COMM_WORLD); >>>>> >>>>> The process remains blocked and the functions errorHandler is not >>>>> called. >>>>> If I use return; instead of exit(2); the process don't remains blocked, >>>>> I read the error of Petsc but errorHandler is not called. >>>>> >>>>> Help me please. >>>>> >>>> >>>> >>>> >>>> -- >>>> What most experimenters take for granted before they begin their >>>> experiments is infinitely more interesting than any results to which their >>>> experiments lead. >>>> -- Norbert Wiener >>>> >>> >>> >> >> >> -- >> What most experimenters take for granted before they begin their >> experiments is infinitely more interesting than any results to which their >> experiments lead. >> -- Norbert Wiener >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Fri Feb 27 09:02:13 2009 From: knepley at gmail.com (Matthew Knepley) Date: Fri, 27 Feb 2009 09:02:13 -0600 Subject: Error Handlers Function In-Reply-To: <5f76eef60902270155u652a430axb6beea4803245df8@mail.gmail.com> References: <5f76eef60902260800q6d54fac1of25b3bc23d9e869c@mail.gmail.com> <5f76eef60902261112g40f2d955kebf76de3720758c6@mail.gmail.com> <5f76eef60902261147s68b99dbbo64978dcd43f854e8@mail.gmail.com> <5f76eef60902270155u652a430axb6beea4803245df8@mail.gmail.com> Message-ID: On Fri, Feb 27, 2009 at 3:55 AM, Santolo Felaco wrote: > Hi, I have used PetscPushErrorHandler, the handler function is called only > I send CTRL+C signal. 1) What do you want to do? 2) PetscPushSignalHandler() will handle signals like SIGINT from Ctrl+C 3) PetscPushErrHandler() will handle errors caught by CHKERRQ Matt > > Thanks. Bye. > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From enjoywm at cs.wm.edu Fri Feb 27 09:22:02 2009 From: enjoywm at cs.wm.edu (Yixun Liu) Date: Fri, 27 Feb 2009 10:22:02 -0500 Subject: number of processors Message-ID: <49A8051A.6090301@cs.wm.edu> Hi, The program can run faster and finish with 1,3 and 4 processors , but if I use 2 processors, the program seems stop and no response. What's the possible reason? Thanks. Yixun From knepley at gmail.com Fri Feb 27 09:27:14 2009 From: knepley at gmail.com (Matthew Knepley) Date: Fri, 27 Feb 2009 09:27:14 -0600 Subject: number of processors In-Reply-To: <49A8051A.6090301@cs.wm.edu> References: <49A8051A.6090301@cs.wm.edu> Message-ID: Deadlock. Matt On Fri, Feb 27, 2009 at 9:22 AM, Yixun Liu wrote: > Hi, > The program can run faster and finish with 1,3 and 4 processors , but if > I use 2 processors, the program seems stop and no response. > What's the possible reason? > > Thanks. > > Yixun > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From ahuramazda10 at gmail.com Fri Feb 27 11:01:28 2009 From: ahuramazda10 at gmail.com (Santolo Felaco) Date: Fri, 27 Feb 2009 18:01:28 +0100 Subject: Error Handlers Function In-Reply-To: References: <5f76eef60902260800q6d54fac1of25b3bc23d9e869c@mail.gmail.com> <5f76eef60902261112g40f2d955kebf76de3720758c6@mail.gmail.com> <5f76eef60902261147s68b99dbbo64978dcd43f854e8@mail.gmail.com> <5f76eef60902270155u652a430axb6beea4803245df8@mail.gmail.com> Message-ID: <5f76eef60902270901u12f1390fuea3ebdbd6776f654@mail.gmail.com> Ok. Thanks. Bye. 2009/2/27 Matthew Knepley > On Fri, Feb 27, 2009 at 3:55 AM, Santolo Felaco wrote: > >> Hi, I have used PetscPushErrorHandler, the handler function is called >> only I send CTRL+C signal. > > > 1) What do you want to do? > > 2) PetscPushSignalHandler() will handle signals like SIGINT from Ctrl+C > > 3) PetscPushErrHandler() will handle errors caught by CHKERRQ > > Matt > > >> >> Thanks. Bye. >> > -- > What most experimenters take for granted before they begin their > experiments is infinitely more interesting than any results to which their > experiments lead. > -- Norbert Wiener > -------------- next part -------------- An HTML attachment was scrubbed... URL: From enjoywm at cs.wm.edu Fri Feb 27 14:07:22 2009 From: enjoywm at cs.wm.edu (Yixun Liu) Date: Fri, 27 Feb 2009 15:07:22 -0500 Subject: multiple processor read one file Message-ID: <49A847FA.4010605@cs.wm.edu> Hi, Is it a problem to let each processor to read the same file? Thanks. From knepley at gmail.com Fri Feb 27 15:41:02 2009 From: knepley at gmail.com (Matthew Knepley) Date: Fri, 27 Feb 2009 15:41:02 -0600 Subject: multiple processor read one file In-Reply-To: <49A847FA.4010605@cs.wm.edu> References: <49A847FA.4010605@cs.wm.edu> Message-ID: On Fri, Feb 27, 2009 at 2:07 PM, Yixun Liu wrote: > Hi, > Is it a problem to let each processor to read the same file? This is a filesystem question that depends upon the parallel machine on which you run. Matt > > Thanks. > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From bsmith at mcs.anl.gov Fri Feb 27 17:05:53 2009 From: bsmith at mcs.anl.gov (Barry Smith) Date: Fri, 27 Feb 2009 17:05:53 -0600 Subject: multiple processor read one file In-Reply-To: <49A847FA.4010605@cs.wm.edu> References: <49A847FA.4010605@cs.wm.edu> Message-ID: <69C46E24-2474-48C2-AADF-646703F538B3@mcs.anl.gov> For a tiny number of processors it is harmless; for larger number of processors it is hopeless. On Feb 27, 2009, at 2:07 PM, Yixun Liu wrote: > Hi, > Is it a problem to let each processor to read the same file? > > Thanks. > From enjoywm at cs.wm.edu Fri Feb 27 18:45:29 2009 From: enjoywm at cs.wm.edu (Yixun Liu) Date: Fri, 27 Feb 2009 19:45:29 -0500 Subject: VecSetValue Message-ID: <49A88929.6090905@cs.wm.edu> Hi, VecCreate(PETSC_COMM_WORLD,&solutionDisplacementVector); VecSetSizes(solutionDisplacementVector, 3*numOfVerticesOfOneProcessor, systemSize); //in this case 3*numOfVerticesOfOneProcessor==systemSize VecSetFromOptions(solutionDisplacementVector); VecDuplicate(solutionDisplacementVector, &weightedDisplacementVector); for(i = 0; i < systemSize; i++) { output weightedRealDisplacement[i] to file//with this code the values in weightedDisplacementVector are correct. ... VecSetValue(weightedDisplacementVector, i, weightedRealDisplacement[i], ADD_VALUES); ... } VecAssemblyBegin(weightedDisplacementVector); VecAssemblyEnd(weightedDisplacementVector); output weightedDisplacementVector to file to see its values For simplicity I only use one processor. As I examine the values in weightedDisplacementVector and I found if I add the output code in the for loop the values in weightedDisplacementVector are correct. Without it there is error. Thanks. Yixun From enjoywm at cs.wm.edu Fri Feb 27 20:00:43 2009 From: enjoywm at cs.wm.edu (Yixun Liu) Date: Fri, 27 Feb 2009 21:00:43 -0500 Subject: VecSetValue(ignore last one) Message-ID: <49A89ACB.6010401@cs.wm.edu> Hi, I made a mistake in previous email. Please ignore the last one. VecCreate(PETSC_COMM_WORLD,&solutionDisplacementVector); VecSetSizes(solutionDisplacementVector, 3*numOfVerticesOfOneProcessor, systemSize); //in this case 3*numOfVerticesOfOneProcessor==systemSize VecSetFromOptions(solutionDisplacementVector); VecDuplicate(solutionDisplacementVector, &weightedDisplacementVector); for(k=0; k References: <49A847FA.4010605@cs.wm.edu> <69C46E24-2474-48C2-AADF-646703F538B3@mcs.anl.gov> Message-ID: Hi I have a question, when the communicator has more than one processors, MatLoad routine would read the same binary file at the same time for each processors. But "large number of processors is hopeless", how can we deal with this issue? I know maybe we can use one processor to read the file and assembly to others. However, when large "size" of binary file( out of memory of one processor), is any suggestion about this situation? Thanks! On Sat, Feb 28, 2009 at 7:05 AM, Barry Smith wrote: > For a tiny number of processors it is harmless; for larger number of > processors it is hopeless. > > > > On Feb 27, 2009, at 2:07 PM, Yixun Liu wrote: > >> Hi, >> Is it a problem to let each processor to read the same file? >> >> Thanks. >> > -- Zi-Hao Wei Department of Mathematics National Central University, Taiwan Rodney Dangerfield - "When I was a kid my parents moved a lot, but I always found them." From neckel at in.tum.de Sat Feb 28 10:58:17 2009 From: neckel at in.tum.de (Tobias Neckel) Date: Sat, 28 Feb 2009 17:58:17 +0100 Subject: Question on adding matrix rows and columns Message-ID: <49A96D29.9090002@in.tum.de> Hello, I need to weight and add a certain number of rows and columns from one matrix (A) into another one (B) where I just know the corresponding row and column indices, but not the indices of the entries inside one row or one column. For the rows, I managed to do so by calling MatGetRow() (and MatRestoreRow()) on A, getting the corresponding column indices and values to work with and add into B. For the columns, however, I just found MatGetColumnIJ() and MatGetColumnVector() in the online manual. The first seems to give access to columns and corresponding indices, but I am not sure if n corresponds to the total number of columns or just all non-zero columns. The latter (besides the warning of possibly being slow) seems to return the complete vector of values, but no indices. Is my interpretation correct so far? A bit weired workaround would be to transpose A each time a column needs to be accessed and use MatGetRow() etc. again and retranspose afterwards. Or copying the transpose of A into another matrix meaning twice the amount of data in the RAM which I would like to avoid. What would you suggest to do? Thanks and best regards Tobias -- Dipl.-Tech. Math. Tobias Neckel Institut f?r Informatik V, TU M?nchen Boltzmannstr. 3, 85748 Garching Tel.: 089/289-18602 Email: neckel at in.tum.de URL: http://www5.in.tum.de/persons/neckel.html From bsmith at mcs.anl.gov Sat Feb 28 12:36:24 2009 From: bsmith at mcs.anl.gov (Barry Smith) Date: Sat, 28 Feb 2009 12:36:24 -0600 Subject: multiple processor read one file In-Reply-To: References: <49A847FA.4010605@cs.wm.edu> <69C46E24-2474-48C2-AADF-646703F538B3@mcs.anl.gov> Message-ID: <8275DC14-8922-4481-8377-4F9491BD7A6F@mcs.anl.gov> On Feb 27, 2009, at 9:04 PM, Zi-Hao Wei wrote: > Hi > > I have a question, when the communicator has more than one processors, > MatLoad routine would read the same binary file at the same time for > each processors. MatLoad() does NOT "read the same binary file at the same time for each processors". We assumed you were talking about your own IO code that was having each process open a file and read from it at the same time. For that, performance would stink. MatLoad() and VecLoad() scale fine up to a few thousand processors. They also can use MPI (with an option) and that, in theory, can scale to any size. So just use MatLoad() and VecLoad() and if they start to dominate the time (which they never will) then we'll see why and improve them. Barry > > But "large number of processors is hopeless", how can we deal with > this issue? > I know maybe we can use one processor to read the file and assembly > to others. > However, when large "size" of binary file( out of memory of one > processor), is any suggestion about this situation? > > Thanks! > > On Sat, Feb 28, 2009 at 7:05 AM, Barry Smith > wrote: >> For a tiny number of processors it is harmless; for larger number of >> processors it is hopeless. >> >> >> >> On Feb 27, 2009, at 2:07 PM, Yixun Liu wrote: >> >>> Hi, >>> Is it a problem to let each processor to read the same file? >>> >>> Thanks. >>> >> > > > > -- > Zi-Hao Wei > Department of Mathematics > National Central University, Taiwan > Rodney Dangerfield - "When I was a kid my parents moved a lot, but I > always found them." From bsmith at mcs.anl.gov Sat Feb 28 12:42:35 2009 From: bsmith at mcs.anl.gov (Barry Smith) Date: Sat, 28 Feb 2009 12:42:35 -0600 Subject: Question on adding matrix rows and columns In-Reply-To: <49A96D29.9090002@in.tum.de> References: <49A96D29.9090002@in.tum.de> Message-ID: <6EC3E14D-E224-490D-9B41-0FF87FE6A567@mcs.anl.gov> Because the default PETSc matrix formats AIJ, BAIJ, SBAIJ are row oriented accessing by row is easy (and reasonably efficient) but accessing by column is NOT. First think about the operation you need to perform at the highest level of abstraction (Hint that is not a set of MatGetRow() calls). Second you might just write the code that does whatever this is using the specific data structures of the sparse matrices, NOT through a bunch of calls to MatGetRows() etc. There is nothing that says you should never work directly with the matrix data structures. > A bit weired workaround would be to transpose A each time a column > needs to be accessed and use MatGetRow() etc. again and retranspose > afterwards. Or copying the transpose of A into another matrix > meaning twice the amount of data in the RAM which I would like to > avoid. This may not be totally weird. Some kind of processing of the data into another form that makes what you need to access easy is sometime the way to go. Barry On Feb 28, 2009, at 10:58 AM, Tobias Neckel wrote: > Hello, > > I need to weight and add a certain number of rows and columns from > one matrix (A) into another one (B) where I just know the > corresponding row and column indices, but not the indices of the > entries inside one row or one column. > > For the rows, I managed to do so by calling MatGetRow() (and > MatRestoreRow()) on A, getting the corresponding column indices and > values to work with and add into B. > > For the columns, however, I just found MatGetColumnIJ() and > MatGetColumnVector() in the online manual. > The first seems to give access to columns and corresponding indices, > but I am not sure if n corresponds to the total number of columns or > just all non-zero columns. > The latter (besides the warning of possibly being slow) seems to > return the complete vector of values, but no indices. Is my > interpretation correct so far? > > A bit weired workaround would be to transpose A each time a column > needs to be accessed and use MatGetRow() etc. again and retranspose > afterwards. Or copying the transpose of A into another matrix > meaning twice the amount of data in the RAM which I would like to > avoid. > > What would you suggest to do? > > Thanks and best regards > Tobias > > -- > Dipl.-Tech. Math. Tobias Neckel > > Institut f?r Informatik V, TU M?nchen > Boltzmannstr. 3, 85748 Garching > > Tel.: 089/289-18602 > Email: neckel at in.tum.de > URL: http://www5.in.tum.de/persons/neckel.html From socrates.wei at gmail.com Sat Feb 28 14:25:41 2009 From: socrates.wei at gmail.com (Zi-Hao Wei) Date: Sun, 1 Mar 2009 04:25:41 +0800 Subject: multiple processor read one file In-Reply-To: <8275DC14-8922-4481-8377-4F9491BD7A6F@mcs.anl.gov> References: <49A847FA.4010605@cs.wm.edu> <69C46E24-2474-48C2-AADF-646703F538B3@mcs.anl.gov> <8275DC14-8922-4481-8377-4F9491BD7A6F@mcs.anl.gov> Message-ID: hello: I think maybe I misunderstand the notes in MatLoad: "In parallel, each processor can load a subset of rows (or the entire matrix). This routine is especially useful when a large matrix is stored on disk and only part of it existsis desired on each processor." I thought each processor would read the same binary file at the same time in order to load a subset of rows. So, when I use MatLoad with PETSC_COMM_WORLD viewer to load matrices, PETSc will automatically deal with that. By the way, we don't need to care about whether the values on the right processor if we use MatLoad and matrix preallocate stuff, right? thanks! On Sun, Mar 1, 2009 at 2:36 AM, Barry Smith wrote: > > On Feb 27, 2009, at 9:04 PM, Zi-Hao Wei wrote: > >> Hi >> >> I have a question, when the communicator has more than one processors, >> MatLoad routine would read the same binary file at the same time for >> each processors. > > ? MatLoad() does NOT "read the same binary file at the same time for each > processors". > We assumed you were talking about your own IO code that was having each > process > open a file and read from it at the same time. For that, performance would > stink. > > ? MatLoad() and VecLoad() scale fine up to a few thousand processors. They > also can use > MPI (with an option) and that, in theory, can scale to any size. > > ? ?So just use MatLoad() and VecLoad() and if they start to dominate the > time (which they never > will) then we'll see why and improve them. > > ?Barry > >> >> But "large number of processors is hopeless", how can we deal with this >> issue? >> I know maybe we can use one processor to read the file and assembly to >> others. >> However, when large "size" of binary file( out of memory of one >> processor), is any suggestion about this situation? >> >> Thanks! >> >> On Sat, Feb 28, 2009 at 7:05 AM, Barry Smith wrote: >>> >>> For a tiny number of processors it is harmless; for larger number of >>> processors it is hopeless. >>> >>> >>> >>> On Feb 27, 2009, at 2:07 PM, Yixun Liu wrote: >>> >>>> Hi, >>>> Is it a problem to let each processor to read the same file? >>>> >>>> Thanks. >>>> >>> >> >> >> >> -- >> Zi-Hao Wei >> Department of Mathematics >> National Central University, Taiwan >> Rodney Dangerfield ?- "When I was a kid my parents moved a lot, but I >> always found them." > > -- Zi-Hao Wei Department of Mathematics National Central University, Taiwan Rodney Dangerfield - "When I was a kid my parents moved a lot, but I always found them." From bsmith at mcs.anl.gov Sat Feb 28 15:12:24 2009 From: bsmith at mcs.anl.gov (Barry Smith) Date: Sat, 28 Feb 2009 15:12:24 -0600 Subject: multiple processor read one file In-Reply-To: References: <49A847FA.4010605@cs.wm.edu> <69C46E24-2474-48C2-AADF-646703F538B3@mcs.anl.gov> <8275DC14-8922-4481-8377-4F9491BD7A6F@mcs.anl.gov> Message-ID: On Feb 28, 2009, at 2:25 PM, Zi-Hao Wei wrote: > hello: > > I think maybe I misunderstand the notes in MatLoad: > > "In parallel, each processor can load a subset of rows (or the entire > matrix). This routine is especially useful when a large matrix is > stored on disk and only part of it existsis desired on each > processor." > > I thought each processor would read the same binary file at the same > time in order to load a subset of rows. > So, when I use MatLoad with PETSC_COMM_WORLD viewer to load matrices, > PETSc will automatically deal with that. With MatLoad() not every process opens the file and reads from it; that is completely unscalable. > > > By the way, we don't need to care about whether the values on the > right processor if we use MatLoad and matrix preallocate stuff, right? MatLoad() handles its own preallocate "stuff" automatically. You do not do any preallocation for matrices used with MatLoad(). MatLoad() decides which rows o on each process. > > > thanks! > > On Sun, Mar 1, 2009 at 2:36 AM, Barry Smith > wrote: >> >> On Feb 27, 2009, at 9:04 PM, Zi-Hao Wei wrote: >> >>> Hi >>> >>> I have a question, when the communicator has more than one >>> processors, >>> MatLoad routine would read the same binary file at the same time for >>> each processors. >> >> MatLoad() does NOT "read the same binary file at the same time >> for each >> processors". >> We assumed you were talking about your own IO code that was having >> each >> process >> open a file and read from it at the same time. For that, >> performance would >> stink. >> >> MatLoad() and VecLoad() scale fine up to a few thousand >> processors. They >> also can use >> MPI (with an option) and that, in theory, can scale to any size. >> >> So just use MatLoad() and VecLoad() and if they start to >> dominate the >> time (which they never >> will) then we'll see why and improve them. >> >> Barry >> >>> >>> But "large number of processors is hopeless", how can we deal with >>> this >>> issue? >>> I know maybe we can use one processor to read the file and >>> assembly to >>> others. >>> However, when large "size" of binary file( out of memory of one >>> processor), is any suggestion about this situation? >>> >>> Thanks! >>> >>> On Sat, Feb 28, 2009 at 7:05 AM, Barry Smith >>> wrote: >>>> >>>> For a tiny number of processors it is harmless; for larger number >>>> of >>>> processors it is hopeless. >>>> >>>> >>>> >>>> On Feb 27, 2009, at 2:07 PM, Yixun Liu wrote: >>>> >>>>> Hi, >>>>> Is it a problem to let each processor to read the same file? >>>>> >>>>> Thanks. >>>>> >>>> >>> >>> >>> >>> -- >>> Zi-Hao Wei >>> Department of Mathematics >>> National Central University, Taiwan >>> Rodney Dangerfield - "When I was a kid my parents moved a lot, >>> but I >>> always found them." >> >> > > > > -- > Zi-Hao Wei > Department of Mathematics > National Central University, Taiwan > Rodney Dangerfield - "When I was a kid my parents moved a lot, but I > always found them." From knepley at gmail.com Sat Feb 28 17:18:45 2009 From: knepley at gmail.com (Matthew Knepley) Date: Sat, 28 Feb 2009 17:18:45 -0600 Subject: VecSetValue In-Reply-To: <49A88929.6090905@cs.wm.edu> References: <49A88929.6090905@cs.wm.edu> Message-ID: I cannot understand your question. Matt On Fri, Feb 27, 2009 at 6:45 PM, Yixun Liu wrote: > Hi, > > > VecCreate(PETSC_COMM_WORLD,&solutionDisplacementVector); > > VecSetSizes(solutionDisplacementVector, 3*numOfVerticesOfOneProcessor, > systemSize); //in this case 3*numOfVerticesOfOneProcessor==systemSize > VecSetFromOptions(solutionDisplacementVector); > > > VecDuplicate(solutionDisplacementVector, &weightedDisplacementVector); > > > for(i = 0; i < systemSize; i++) > { > output weightedRealDisplacement[i] to file//with this code the values in > weightedDisplacementVector are correct. > > ... > VecSetValue(weightedDisplacementVector, i, weightedRealDisplacement[i], > ADD_VALUES); > ... > > } > > VecAssemblyBegin(weightedDisplacementVector); > VecAssemblyEnd(weightedDisplacementVector); > > output weightedDisplacementVector to file to see its values > > > > For simplicity I only use one processor. As I examine the values in > weightedDisplacementVector and I found if I add the output code in the > for loop the values in weightedDisplacementVector are correct. Without > it there is error. > > > Thanks. > > Yixun > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: From enjoywm at cs.wm.edu Sat Feb 28 18:19:18 2009 From: enjoywm at cs.wm.edu (Yixun Liu) Date: Sat, 28 Feb 2009 19:19:18 -0500 Subject: VecSetValue In-Reply-To: References: <49A88929.6090905@cs.wm.edu> Message-ID: <49A9D486.4050801@cs.wm.edu> I use VecSetValue in a loop and if I add some codes such as IO before the VecSetValue the output of the vector is correct. However if I remove the IO the output is wrong. It seems that the values are cached and need some time to be set. Matthew Knepley wrote: > I cannot understand your question. > > Matt > > On Fri, Feb 27, 2009 at 6:45 PM, Yixun Liu > wrote: > > Hi, > > > VecCreate(PETSC_COMM_WORLD,&solutionDisplacementVector); > > VecSetSizes(solutionDisplacementVector, > 3*numOfVerticesOfOneProcessor, > systemSize); //in this case 3*numOfVerticesOfOneProcessor==systemSize > VecSetFromOptions(solutionDisplacementVector); > > > VecDuplicate(solutionDisplacementVector, > &weightedDisplacementVector); > > > for(i = 0; i < systemSize; i++) > { > output weightedRealDisplacement[i] to file//with this code the > values in > weightedDisplacementVector are correct. > > ... > VecSetValue(weightedDisplacementVector, i, > weightedRealDisplacement[i], > ADD_VALUES); > ... > > } > > VecAssemblyBegin(weightedDisplacementVector); > VecAssemblyEnd(weightedDisplacementVector); > > output weightedDisplacementVector to file to see its values > > > > For simplicity I only use one processor. As I examine the values in > weightedDisplacementVector and I found if I add the output code > in the > for loop the values in weightedDisplacementVector are correct. Without > it there is error. > > > Thanks. > > Yixun > > > > > -- > What most experimenters take for granted before they begin their > experiments is infinitely more interesting than any results to which > their experiments lead. > -- Norbert Wiener From knepley at gmail.com Sat Feb 28 18:23:24 2009 From: knepley at gmail.com (Matthew Knepley) Date: Sat, 28 Feb 2009 18:23:24 -0600 Subject: VecSetValue In-Reply-To: <49A9D486.4050801@cs.wm.edu> References: <49A88929.6090905@cs.wm.edu> <49A9D486.4050801@cs.wm.edu> Message-ID: On Sat, Feb 28, 2009 at 6:19 PM, Yixun Liu wrote: > I use VecSetValue in a loop and if I add some codes such as IO before > the VecSetValue the output of the vector is correct. However if I remove > the IO the output is wrong. It seems that the values are cached and need > some time to be set. > 1) It is unclear what the wrong behavior is. 2) This is also the a sign that memory might be corrupt somewhere else. It is not possible to see what is wrong from your description, but I assure you that nothing is wrong with that method. It is used millions of times every day. Send a sample code with known output and I will run it. Matt > Matthew Knepley wrote: > > I cannot understand your question. > > > > Matt > > > > On Fri, Feb 27, 2009 at 6:45 PM, Yixun Liu > > wrote: > > > > Hi, > > > > > > VecCreate(PETSC_COMM_WORLD,&solutionDisplacementVector); > > > > VecSetSizes(solutionDisplacementVector, > > 3*numOfVerticesOfOneProcessor, > > systemSize); //in this case 3*numOfVerticesOfOneProcessor==systemSize > > VecSetFromOptions(solutionDisplacementVector); > > > > > > VecDuplicate(solutionDisplacementVector, > > &weightedDisplacementVector); > > > > > > for(i = 0; i < systemSize; i++) > > { > > output weightedRealDisplacement[i] to file//with this code the > > values in > > weightedDisplacementVector are correct. > > > > ... > > VecSetValue(weightedDisplacementVector, i, > > weightedRealDisplacement[i], > > ADD_VALUES); > > ... > > > > } > > > > VecAssemblyBegin(weightedDisplacementVector); > > VecAssemblyEnd(weightedDisplacementVector); > > > > output weightedDisplacementVector to file to see its values > > > > > > > > For simplicity I only use one processor. As I examine the values in > > weightedDisplacementVector and I found if I add the output code > > in the > > for loop the values in weightedDisplacementVector are correct. > Without > > it there is error. > > > > > > Thanks. > > > > Yixun > > > > > > > > > > -- > > What most experimenters take for granted before they begin their > > experiments is infinitely more interesting than any results to which > > their experiments lead. > > -- Norbert Wiener > > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: