Re: [petsc-users] Can we force SNES solver to do at least Newton step?

2023-09-02 Thread Barry Smith
https://petsc.org/release/manualpages/SNES/SNESSetForceIteration/#snessetforceiteration > On Sep 2, 2023, at 3:04 PM, David Knezevic via petsc-users > wrote: > > Hi all, > > I'm using the SNES solver for a plasticity model, and the issue I've run into > is that in some time steps the

Re: [petsc-users] Error using GPU in Fortran code

2023-08-30 Thread Barry Smith
resid norm 6.221244366707e-16 true resid norm >> > 1.263339414861e-03 ||r(i)||/||b|| 3.348589631014e+01 I won't worry about the GPU behavior (it is just due to slightly different numerical computations on the GPU and not surprising.) You need to use a different preconditioner, e

Re: [petsc-users] Error using GPU in Fortran code

2023-08-30 Thread Barry Smith
What convergence do you get without the GPU matrix and vector operations? Can you try the GPU run with -ksp_type gmres -ksp_pc_side right ? For certain problems, ILU can produce catastrophically bad preconditioners. Barry > On Aug 30, 2023, at 4:41 PM, Ramoni Z. Sedano Azevedo

Re: [petsc-users] Orthogonalization of a (sparse) PETSc matrix

2023-08-29 Thread Barry Smith
er if someone would like to contribute a sparse QR to PETSc. It could > have a default implementation via Cholesky QR and the ability to call SPQR > from Suitesparse. > > Barry Smith writes: > >> Are the nonzero structures of all the rows related? If they are, one

Re: [petsc-users] Orthogonalization of a (sparse) PETSc matrix

2023-08-29 Thread Barry Smith
Are the nonzero structures of all the rows related? If they are, one could devise a routine to take advantage of this relationship, but if the nonzero structures of each row are "randomly" different from all the other rows, then it is difficult to see how one can take advantage of the

Re: [petsc-users] CUDA error trying to run a job with two mpi processes and 1 GPU

2023-08-24 Thread Barry Smith
elong to other modules upstream visible through USE. This does not seem > to be the case here. I agree, you had seemingly inconsistent results with your different tests; it could be bugs in the handling of modules by the Fortran system. > > Best, > Marcos > > > From:

Re: [petsc-users] CUDA error trying to run a job with two mpi processes and 1 GPU

2023-08-24 Thread Barry Smith
PETSc uses the non-MPI_F08 Fortran modules so I am guessing when you also use the MPI_F08 modules the compiler sees two sets of interfaces for the same functions hence the error. I am not sure if it portable to use PETSc with the F08 Fortran modules in the same program or routine. >

Re: [petsc-users] (Sub) KSP initial guess with PCREDISTRIBUTE

2023-08-22 Thread Barry Smith
aking > the solution to one a very bad initial guess to the other. > > Again, thank you for your support. > > Best regards, > Jonas Lundgren > > Från: Barry Smith mailto:bsm...@petsc.dev>> > Skickat: den 21 augusti 2023 22:04 > Till: Jonas Lundgren mailto:j

Re: [petsc-users] (Sub) KSP initial guess with PCREDISTRIBUTE

2023-08-21 Thread Barry Smith
same) > linear operator, so that they become almost the same problem. On the other > hand, the state and adjoint problems are not similar to each other, making > the solution to one a very bad initial guess to the other. > > Again, thank you for your support. > > Best regard

Re: [petsc-users] (Sub) KSP initial guess with PCREDISTRIBUTE

2023-08-21 Thread Barry Smith
erations. This means that the numbers provided above are on the > low side: most likely the savings can be even more in the end of the design > process. > > Best regards, > Jonas Lundgren > > Från: Barry Smith mailto:bsm...@petsc.dev>> > Skickat: den 21

Re: [petsc-users] (Sub) KSP initial guess with PCREDISTRIBUTE

2023-08-21 Thread Barry Smith via petsc-users
When you use 2 KSP so that you can use the previous "solution" as the initial guess for the next problem, how much savings do you get? In iterations inside PCREDISTRIBUTE and in time (relative to the entire linear solver time and relative to the entire application run)? You can get this

Re: [petsc-users] MetSetValues not found

2023-08-19 Thread Barry Smith
You are attempting to pass the entire aA array into each MatSetValues() call when you should pass one row with each call. Use PetscCallA(MatSetValues(A,1,i,4,j,aA(i+1,:),INSERT_VALUES,ierr)) > On Aug 19, 2023, at 4:47 PM, Sanjay Govindjee wrote: > > I recently got a copy of

Re: [petsc-users] Filling non-zero values of a Petsc matrix using numpy arrays with non-zero indices and values (petsc4py)

2023-08-19 Thread Barry Smith
The cost of the initial matrix creation to get the row starts and ends is trivial compared to the later computations, so is fine to retain. > On Aug 19, 2023, at 10:51 AM, Erik Kneller via petsc-users > wrote: > > Hi All, > > Thank you for the recommendations. The first option provided

Re: [petsc-users] PetscCall( ) in fortran

2023-08-17 Thread Barry Smith
> On Aug 17, 2023, at 7:44 PM, Sanjay Govindjee wrote: > > Two questions about the PetscCall( ) etc. functionality in fortran: > > (1) To use this functionality, is it required to use a .F90 naming > convention? or should I be able to use .F? This likely depends on the compiler. > >

Re: [petsc-users] Filling non-zero values of a Petsc matrix using numpy arrays with non-zero indices and values (petsc4py)

2023-08-17 Thread Barry Smith
It appears there are currently no Python bindings for > https://petsc.org/main/manualpages/Mat/MatSetPreallocationCOOLocal/ > https://petsc.org/main/manualpages/Mat/MatSetValuesCOO/ they should be fairly easy to add in a merge request. Barry > On Aug 17, 2023, at 5:57 PM, Matthew

Re: [petsc-users] error related to 'valgrind' when using MatView

2023-08-11 Thread Barry Smith
New error checking to prevent this confusion in the future: https://gitlab.com/petsc/petsc/-/merge_requests/6804 > On Aug 10, 2023, at 6:54 AM, Matthew Knepley wrote: > > On Thu, Aug 10, 2023 at 2:30 AM maitri ksh > wrote: >> I am unable to understand what

Re: [petsc-users] 32-bit vs 64-bit GPU support

2023-08-11 Thread Barry Smith
We do not currently have any code for using 64 bit integer sizes on the GPUs. Given the current memory available on GPUs is 64 bit integer support needed? I think even a single vector of length 2^31 will use up most of the GPU's memory? Are the practical, not synthetic, situations that

Re: [petsc-users] Using PETSc GPU backend

2023-08-09 Thread Barry Smith
, Ng, Cho-Kuen wrote: > > Barry and Matt, > > Thanks for your help. Now I can use petsc GPU backend on Perlmutter: 1 node, > 4 MPI tasks and 4 GPUs. However, I ran into problems with multiple nodes: 2 > nodes, 8 MPI tasks and 8 GPUs. The run hung on KSPSolve. How can I fix this?

Re: [petsc-users] Python PETSc performance vs scipy ZVODE

2023-08-09 Thread Barry Smith
Was PETSc built with debugging turned off; so ./configure --with-debugging=0 ? Can you run with the equivalent of -log_view to get information about the time spent in the various operations and send that information. The data generated is the best starting point for determining where the

Re: [petsc-users] IMPI with Hypre

2023-08-08 Thread Barry Smith
We get these reports regularly. Intel is selecting [GCC 4.8.2 20140120 (Red Hat 4.8.2-15)] as the base compiler, this ancient version does not provide the language support needed by hypre. You need a more recent GNU compiler available for the Intel compilers to base themselves on.

Re: [petsc-users] PCMG with PCREDISTRIBUTE

2023-07-29 Thread Barry Smith
cient and non-intrusive) > way to “get out of redistribute.c a mapping …”? > > /Carl-Johan > > > From: Carl-Johan Thore <mailto:carl-johan.th...@liu.se>> > Sent: Tuesday, July 25, 2023 4:49 PM > To: Barry Smith mailto:bsm...@petsc.dev>> > Subject:

Re: [petsc-users] [petsc-maint] Monolithic AMG with fieldsplit as smoother

2023-07-26 Thread Barry Smith
See the very end of the section https://petsc.org/release/manual/ksp/#multigrid-preconditioners on how to control the smoothers (and coarse grid solve) for multigrid in PETSc including for algebraic multigrid. So, for example, -mg_levels_pc_type fieldsplit would be the starting point.

Re: [petsc-users] Null Pointer Issue (Eigen-Value-Problem with user input Matrices)

2023-07-25 Thread Barry Smith
You never called MatCreate(comm, ); > On Jul 25, 2023, at 6:06 PM, maitri ksh wrote: > > I am using the following setup: > 1. petsc-3.19.3 (on wsl-ubuntu22.04 platform) > 2. MATLAB-R2022a > 3. slepc-3.19.1 > 4. configured using: './configure --with-cc=gcc --with-cxx=g++ >

Re: [petsc-users] (no subject)

2023-07-24 Thread Barry Smith
Perhaps you need > make PETSC_DIR=~/asd/petsc-3.19.3 PETSC_ARCH=arch-mswin-c-opt all > On Jul 24, 2023, at 1:11 PM, Константин via petsc-users > wrote: > > Good evening. After configuring petsc I had to write this comand on cygwin64. > $ make PETSC_DIR=/home/itugr/asd/petsc-3.19.3

Re: [petsc-users] Confusion/failures about the tests involved in including Hypre

2023-07-21 Thread Barry Smith
hout increasing this requirement - sure without access to the new > features provided by the new version] > > Having a single version dependency between pkgs makes the whole > ecosystem [where many pkgs with all their dependencies mixed in] > brittle.. > > Satish > > On Thu, 20 Jul

Re: [petsc-users] MPICH C++ compilers when using PETSC --with-cxx=0

2023-07-21 Thread Barry Smith
ote: > > Can I easily get the MPICH config PETSc uses? I’m poking through the repo and > not seeing anything related to config of downloaded packages. > Thanks, > Robert > > From: Barry Smith mailto:bsm...@petsc.dev>> > Sent: Friday, July 21, 2023 11:35 AM > To: Cr

Re: [petsc-users] MPICH C++ compilers when using PETSC --with-cxx=0

2023-07-21 Thread Barry Smith
No, you will need to build MPICH yourself, stand-alone and then direct PETSc's configure to use what you have built. Barry > On Jul 21, 2023, at 11:11 AM, Robert Crockett via petsc-users > wrote: > > Hello, > I built PETSc with –with-cxx=0 in order to get around a likely Intel C++ >

Re: [petsc-users] Confusion/failures about the tests involved in including Hypre

2023-07-20 Thread Barry Smith
main' > branch with 2.29.0 > > Satish > > On Thu, 20 Jul 2023, Barry Smith via petsc-users wrote: > >> >> You cannot use this version of PETSc, 3.19, with the version of hypre you >> installed. In hypre they recently changed hypre_Error from an integer to

Re: [petsc-users] Failing PETSc 3.19.2 compile using ICPC

2023-07-20 Thread Barry Smith
etric and unsymmetric problems, if --with-cxx=0 and suitesparse is not > downloaded? > Thanks, > Robert > > > Confidential – Limited Access and Use > -Original Message- > From: Satish Balay > Sent: Wednesday, July 19, 2023 5:07 PM > To: Barry Smith

Re: [petsc-users] Confusion/failures about the tests involved in including Hypre

2023-07-20 Thread Barry Smith via petsc-users
;> checking library functions will fail. >> >> Checking PETSc dll build: >> >> balay@ps5 ~/petsc/arch-ci-mswin-uni/lib >> $ nm -Ao libpetsc.lib |grep MatCreateSeqAIJWithArrays >> libpetsc.lib:libpetsc.dll: I __imp_MatCreateSeqAIJWithA

Re: [petsc-users] Failing PETSc 3.19.2 compile using ICPC

2023-07-19 Thread Barry Smith
Do you need C++, you can configure --with-cxx=0 if you do not need it. You can also try the main branch of PETSc or slightly different versions of the compiler. Barry > On Jul 19, 2023, at 4:31 PM, Robert Crockett via petsc-users > wrote: > > Hello, > I am attempting to build PETSc

Re: [petsc-users] Confusion/failures about the tests involved in including Hypre

2023-07-19 Thread Barry Smith
self.gitcommit = 'v'+self.version >> self.download = >> ['git://https://github.com/hypre-space/hypre','https://github.com/hypre-space/hypre/archive/'+self.gitcommit+'.tar.gz'] >> -self.functions = ['HYPRE_IJMatrixCreate'] >> +self.functions

Re: [petsc-users] PETSc Discord server

2023-07-19 Thread Barry Smith
Here is an update address to join the PETSc Discord space https://discord.gg/Fqm8r6Gcyb > On Jul 5, 2023, at 10:04 PM, Barry Smith wrote: > > > We are experimenting with using Discord as our PETSc chat space. PETSc > users are welcome to join us there https://disc

Re: [petsc-users] Confusion/failures about the tests involved in including Hypre

2023-07-19 Thread Barry Smith
You don't indicate what type of libraries you built hypre with; static or shared. My guess is you ended up with shared I think the answer to your difficulty is hidden in __cdecl (Satish will know much better than me). When you are looking for symbols in Windows shared libraries you have

Re: [petsc-users] periodic boundary conditions

2023-07-19 Thread Barry Smith
do it with an option (it is in the documentation). For AMG you need > to specify the coarse solver. I know this works with GAMG, you use > > -mg_coarse_pc_type svd > > Thanks, > > Matt > >> Kind regards, >> >> Karthik. >> >>

Re: [petsc-users] periodic boundary conditions

2023-07-18 Thread Barry Smith
I am trying to understand what is implemented in DMDA to > eliminate those extra nodes. > > Best, > Karthik. > > From: Barry Smith mailto:bsm...@petsc.dev>> > Date: Tuesday, 18 July 2023 at 16:58 > To: Chockalingam, Karthikeyan (STFC,DL,HC) > <mailt

Re: [petsc-users] periodic boundary conditions

2023-07-18 Thread Barry Smith
If you are using DMDA with periodic boundary conditions for example only one "copy" of such nodes exists in the global vector (the vector the solvers see) so one does not need to eliminate extra ones > On Jul 18, 2023, at 11:51 AM, Karthikeyan Chockalingam - STFC UKRI via > petsc-users

Re: [petsc-users] petscconf.h missing building cpp file with dolfinx?

2023-07-17 Thread Barry Smith
When configuring and making PETSc, PETSC_DIR can be empty or point to the directory with the PETSc source If you used --prefix to configure and install PETSc then When using PETSc to compile other source code and using a makefile that utilizes PETSC_DIR, then PETSC_DIR needs to

Re: [petsc-users] Parallel matrix multiplication

2023-07-17 Thread Barry Smith
https://petsc.org/release/manualpages/Mat/MatPtAP/ also note that PETSc has a large infrastructure for efficient ways to compute various matrix-matrix operations with a variety of algorithms that can be all accessed by starting with

Re: [petsc-users] Structured (DMDA) vs Unstructured (DMPlex) meshes

2023-07-17 Thread Barry Smith
The largest potential advantage of DMDA is likely the possibility of easily using geometric multigrid if it is appropriate for the problem (or subproblem of the problem) you are solving. The second advantage is, this depends on your PDE and discretization, the simplicity of your code, and

Re: [petsc-users] Using PETSc GPU backend

2023-07-17 Thread Barry Smith
104.c and ex300.c use MatXAIJSetPreallocation(). Are there > other tutorials available? > > Cho > From: Barry Smith mailto:bsm...@petsc.dev>> > Sent: Saturday, July 15, 2023 8:36 AM > To: Ng, Cho-Kuen mailto:c...@slac.stanford.edu>> > Cc: petsc-users@mcs.anl.gov <mailto:p

Re: [petsc-users] Problems in use of VecNest in Petsc?

2023-07-15 Thread Barry Smith
It is in the loop below that it errors due to an unassembled vector. T static PetscErrorCode VecCopy_Nest(Vec x, Vec y) { Vec_Nest *bx = (Vec_Nest *)x->data; Vec_Nest *by = (Vec_Nest *)y->data; PetscInt i; PetscFunctionBegin; VecNestCheckCompatible2(x, 1, y, 2); for (i = 0; i <

Re: [petsc-users] Using PETSc GPU backend

2023-07-15 Thread Barry Smith
overwrites the Mat you > created in steps 1 and 2. This is detailed in the manual. > > 2. You should replace MatCreateAIJ(), with MatSetSizes() before > MatSetFromOptions(). > > THanks, > > Matt > >> Thanks, >> Cho >> >> From: Ma

Re: [petsc-users] Verifying matching PetscFunctionBeginUser() and PetscFunctionReturn()

2023-07-12 Thread Barry Smith
missing > PetscFunctionReturn() in layer 1 are not detected. > > ./check_petscstack missing_both > Testing missing PetsFunctionBeginUser() in layer 0 and PetscFunctionReturn() > in layer 1... > Layer 0: Calling layer 1 > Layer 1: Noop > > _

Re: [petsc-users] Verifying matching PetscFunctionBeginUser() and PetscFunctionReturn()

2023-07-11 Thread Barry Smith
#define PetscStackPop_Private(stack__, func__) \ do { \ PetscCheckAbort(!stack__.check || stack__.currentsize > 0, PETSC_COMM_SELF, PETSC_ERR_PLIB, "Invalid stack size %d, pop %s %s:%d.\n", stack__.currentsize, func__, __FILE__, __LINE__); \ if (--stack__.currentsize <

Re: [petsc-users] Inquiry about the PetscScalar in Petsc.

2023-07-11 Thread Barry Smith
(); >>>> VecGetArray(veccords, );//it seems coords has to be defined by >>>> complex either. >>>> >>>> 2) Store the coordinates in coords with imaginary part equal to zero. >>>> I got the coordinates from above function VecGetArray, ther

Re: [petsc-users] Inquiry about the PetscScalar in Petsc.

2023-07-11 Thread Barry Smith
Not really. PetscScalar (and entries of vectors etc) are either real or complex, they cannot be mixed. What parts of PETSc are you using, DM? You can 1) store the coordinates in arrays and not use Vec for them. (of if you are not using DM) 2) sore them in Vec but with imaginary

Re: [petsc-users] User-defined updating function in SNES

2023-07-06 Thread Barry Smith
Could you provide more context on when and why "Some values in the solution vectors must be inserted to some different location." during the solution process. SNES provides two "hooks" already that allow some "changes" to the solution during the solve process. Maybe one of the hooks is

Re: [petsc-users] Nested solves and fgmres residual normalization

2023-07-06 Thread Barry Smith
You are referring to 8 KSP Residual norm 8.464122393957e-07 Residual norms for fieldsplit_p_lsc_ solve. 0 KSP Residual norm 1.e+00 1 KSP Residual norm 1.627170127450e-05 2 KSP Residual norm 1.448537328052e-05 3 KSP Residual norm 1.309526985856e-05 4

[petsc-users] PETSc Discord server

2023-07-05 Thread Barry Smith
We are experimenting with using Discord as our PETSc chat space. PETSc users are welcome to join us there https://discord.gg/TAmq3kvB Barry

Re: [petsc-users] Abort SNES Mid-iteration

2023-07-05 Thread Barry Smith
I assume you want to stop the SNES solve, but you do not want the program to end immediately? Instead, you want SNESSolve() to end immediately with a very useful message? This is done with https://petsc.org/release/manualpages/SNES/SNESSetFunctionDomainError/#snessetfunctiondomainerror

Re: [petsc-users] Running AMG libraries as standalone solvers

2023-07-05 Thread Barry Smith
ment > methods. Some clever tweaks may allow it (like having sub-structured meshes) > but not as of now. > > Best > Parv > > > > From: Barry Smith mailto:bsm...@petsc.dev>> > Sent: 05 July 2023 16:51 > To: Khurana, Parv <mailto:p.khuran...@imperial.

Re: [petsc-users] Running AMG libraries as standalone solvers

2023-07-05 Thread Barry Smith
-hypre-type-boomeramg-ksp-type-preonly-i-don-t-get-a-very-accurate-answer > > Best > Parv > > From: petsc-users <mailto:petsc-users-boun...@mcs.anl.gov>> On Behalf Of Khurana, Parv > Sent: 05 July 2023 17:09 > To: Barry Smith mailto:bsm...@petsc.dev>> > Cc: p

Re: [petsc-users] Running AMG libraries as standalone solvers

2023-07-05 Thread Barry Smith
to the extra Krylov solver overhead). Algebraic multigrid is usually run with a Krylov solver and running without a Krylov solver, as far as I am aware, generally performs poorly. > On Jul 5, 2023, at 11:46 AM, Barry Smith wrote: > > > -ksp_type richardson > > If you use -ksp

Re: [petsc-users] Running AMG libraries as standalone solvers

2023-07-05 Thread Barry Smith
-ksp_type richardson If you use -ksp_typre preonly you effectively get one V-cycle (or whatever cycle type you may have selected) which in general, will give you a more or less garbage answer > On Jul 5, 2023, at 11:28 AM, Khurana, Parv wrote: > > Hello PETSc users, > > I am fairly

Re: [petsc-users] Basic Inquiries about PETSc

2023-07-04 Thread Barry Smith
You might consider https://www.firedrakeproject.org/ it wraps PETSc in a higher-level environment for solving PDEs. > On Jul 4, 2023, at 2:24 PM, Ju Taur wrote: > > Hi, > Everyone. I am a new PETSc user and have little knowledge about it. So my > queries are as follows: > 1. Is PETSc only

Re: [petsc-users] Smaller assemble time with increasing processors

2023-07-03 Thread Barry Smith
): >>>> version\processors 4816 32 >>>> 64128 256 >>>> old 3145s 2554s 673s 329s >>>> 201s 142s 138s >>>> n

Re: [petsc-users] Smaller assemble time with increasing processors

2023-07-02 Thread Barry Smith
mbly > be affected? I mean, when processors receive the elements that should be > stored in their local by MPI, then will the new mallocs happen at this time > point? > 2. I can not give an accurate preallocation for the large cost, so is > there any better way to prealloca

Re: [petsc-users] Question about residue norm in PETSc

2023-07-02 Thread Barry Smith
Also look at https://petsc.org/release/manualpages/KSP/KSPSetPCSide/#kspsetpcside and https://petsc.org/release/manualpages/KSP/KSPSetNormType/#kspsetnormtype in PETSc different Krylov solvers have different default values for this. > On Jul 2, 2023, at 1:47 AM, 王赫萌 wrote: > > Dear

Re: [petsc-users] PCMG with PCREDISTRIBUTE

2023-07-02 Thread Barry Smith
e attached code snippet to see if I’m doing some obvious mistake? Kind regards,Carl-Johan From: Barry Smith <bsm...@petsc.dev> Sent: Friday, June 30, 2023 5:21 PMTo: Matthew Knepley <knep...@gmail.com>Cc: Carl-Johan Thore <carl-johan.th...@liu.se>; petsc-users@mcs.anl.govSub

Re: [petsc-users] Smaller assemble time with increasing processors

2023-07-01 Thread Barry Smith
3 3 10 0 1 3 3 0 > only setvalues 1 1.0 1.3717e+02 1.1 0.00e+00 0.0 0.0e+00 0.0e+00 0.0e+00 > 78 0 0 0 0 78 0 0 0 0 0 > Test both 1 1.0 1.5475e+02 1.0 0.00e+00 0.0 1.0e+05 2.3e+04 1.5e+01 > 91 0 1 3 4 91 0 1 3 4 0 > > > &

Re: [petsc-users] Smaller assemble time with increasing processors

2023-06-30 Thread Barry Smith
You cannot look just at the VecAssemblyEnd() time, that will very likely give the wrong impression of the total time it takes to put the values in. You need to register a new Event and put a PetscLogEvent() just before you start generating the vector entries and calling VecSetValues()

Re: [petsc-users] PCMG with PCREDISTRIBUTE

2023-06-30 Thread Barry Smith
a mapping for each kept dof to what MPI rank it is moved to and use that to move the entries in the reduced interpolation you have created. If you do succeed it would actually be useful code that we could add to PCREDISTRIBUTE for more general use by others. Barry > &

Re: [petsc-users] Using PETSc GPU backend

2023-06-30 Thread Barry Smith
Note that options like -mat_type aijcusparse -vec_type cuda only work if the program is set up to allow runtime swapping of matrix and vector types. If you have a call to MatCreateMPIAIJ() or other specific types then then these options do nothing but because Mark had you use -options_left

Re: [petsc-users] PCMG with PCREDISTRIBUTE

2023-06-30 Thread Barry Smith
the convergence on the full system. > On Jun 30, 2023, at 9:17 AM, Barry Smith wrote: > > >ex42.c provides directly the interpolation/restriction needed to move > between levels in the loop > > for (k = 1; k < nlevels; k++) { > PetscCall(DMCreateInterpolat

Re: [petsc-users] Fortran alternative for DMDAGetElements?

2023-06-30 Thread Barry Smith
da3d,ierr) >>>>> call DMDASetElementType(da3d,DMDA_ELEMENT_Q1,ierr) >>>>> call DMSetUp(da3d,ierr) >>>>> call DMGetLocalToGlobalMapping(da3d,map,ierr) >>>>> >>>>> call DMDAGetElements(da3d,nel,n

Re: [petsc-users] PCMG with PCREDISTRIBUTE

2023-06-30 Thread Barry Smith
ex42.c provides directly the interpolation/restriction needed to move between levels in the loop for (k = 1; k < nlevels; k++) { PetscCall(DMCreateInterpolation(da_list[k - 1], da_list[k], , NULL)); PetscCall(PCMGSetInterpolation(pc, k, R)); PetscCall(MatDestroy()); } The

Re: [petsc-users] Fortran alternative for DMDAGetElements?

2023-06-29 Thread Barry Smith
>> On 29 Jun 2023, at 18:38, Barry Smith wrote: >> >> >> I can provide the Fortran interface this afternoon. >> >> Barry >> >> >>> On Jun 29, 2023, at 10:48 AM, Ngoc Mai Monica Huynh >>> wrote: >>> >>> Hi

Re: [petsc-users] Fortran alternative for DMDAGetElements?

2023-06-29 Thread Barry Smith
I can provide the Fortran interface this afternoon. Barry > On Jun 29, 2023, at 10:48 AM, Ngoc Mai Monica Huynh > wrote: > > Hi everyone, > > I would need to use the routine DMDAGetElements() in our Fortran code. > However, as I read from the manual, there is no Fortran support for

Re: [petsc-users] Problem in some macro when using VS+intel cl

2023-06-27 Thread Barry Smith
The macros expand differently depending on the compiler being used. In this case #if defined(PETSC_HAVE_BUILTIN_EXPECT) #define PetscUnlikely(cond) __builtin_expect(!!(cond), 0) #define PetscLikely(cond) __builtin_expect(!!(cond), 1) #else #define PetscUnlikely(cond) (cond) #define

Re: [petsc-users] Problem in some macro when using VS+intel cl

2023-06-27 Thread Barry Smith
Regarding PetscCall(). It sounds like you are working with two different versions of PETSc with different compilers? This isn't practical since things do change (improve we hope) with newer versions of PETSc. You should just built the latest version of PETSc with all the compiler suites you

Re: [petsc-users] Using DMDA for a block-structured grid approach

2023-06-26 Thread Barry Smith
ave support for block structured (quad-tree) grids you might want to >> use. This is a common approach for block structured grids. >> >> Thanks, >> Mark >> >> >> >> On Mon, Jun 26, 2023 at 12:08 PM Barry Smith > <mailto:bsm...@petsc.d

Re: [petsc-users] Using DMDA for a block-structured grid approach

2023-06-26 Thread Barry Smith
> On Jun 26, 2023, at 11:44 AM, Srikanth Sathyanarayana > wrote: > > Dear PETSc developers, > > > I am currently working on a Gyrokinetic code where I essentially have to > implement a block structured grid approach in one of the subdomains of the > phase space coordinates. I have

Re: [petsc-users] Error while checking with ex19 after intallation

2023-06-25 Thread Barry Smith
Googling these messages find other people who have received similar messages while working Microsoft Windows and MPI but nothing particularly helpful I could find. I am guessing an incompatibility between the Microsoft MPI and cl compiler you are using. I suggest installing the very

Re: [petsc-users] Questions on CPR preconditioner

2023-06-25 Thread Barry Smith
your email. Thanks for pointing out my PetSC sillyness. I thin= k what happened is I played with matrices as well as with preconditioners s= o I initially implemented it as MATSHELL and at the end wrapped it in a PCS= HELL. :) =20 On Mon, Jan 23, 2017 at 2:26 AM, Barry Smith bsm...@mcs.anl.gov &

Re: [petsc-users] Questions on CPR preconditioner

2023-06-25 Thread Barry Smith
There is a thread https://lists.mcs.anl.gov/pipermail/petsc-dev/2019-March/023999.html here that contains some attached code (follow the links RL: ). > On Jun 25, 2023, at 9:36 AM, Edoardo

Re: [petsc-users] Petsc 3.19.2 to 3.18.0 error possibility.

2023-06-24 Thread Barry Smith
compatible to new petsc was not done in such > fundamentals details like vector acssembling. The programmer should mostly > change the names of variables and functions from old to new. > > Best regards > > Paul > > > > W dniu 24.06.2023 o 16:32, Barry Smith pisze:

Re: [petsc-users] Petsc 3.19.2 to 3.18.0 error possibility.

2023-06-24 Thread Barry Smith
iter at character 48 > in cmd > > > IN POLAND is midnight so I go sleep. Tommorow i will check --with-cflags='-g > -O0' --with-cxxflags='-g -O0' --with-fflags='-g -O0' > > Best Regards > > Paul Steblinski > > > > > > W dniu 23.06.2023 o 2

Re: [petsc-users] Petsc 3.19.2 to 3.18.0 error possibility.

2023-06-24 Thread Barry Smith
Option left: name:-condinp_t value: 1e-4 source: command > line > [6]PETSC ERROR: Option left: name:-countG value: 0 source: command line > [6]PETSC ERROR: Option left: name:-countN value: 0 source: file > [6]PETSC ERROR: Option lef[8]PETSC ERROR: - Erro

Re: [petsc-users] Petsc 3.19.2 to 3.18.0 error possibility.

2023-06-23 Thread Barry Smith
Could you send us the exact error output that occurs? Cut and paste the run command and the entire error message. Also send the configure options you used. Have you tried configuring the later PETSc versions with all optimization turned off; use --with-debugging=1 --with-cflags='-g -O0'

Re: [petsc-users] snes_type aspin without DA example

2023-06-23 Thread Barry Smith
ode but I miss an example using >> SNESNASMSetSubdomains. In fact I do not even find a single use of the >> function in PETSc. >> Could someone provide me with an example ? >> Thanks, >> Nicolas >> >> Le ven. 23 juin 2023 à 02:17, Barry Smith > <ma

Re: [petsc-users] snes_type aspin without DA example

2023-06-23 Thread Barry Smith
Could someone provide me with an example ? > Thanks, > Nicolas > > Le ven. 23 juin 2023 à 02:17, Barry Smith <mailto:bsm...@petsc.dev>> a écrit : >> >> A test would be great. >> >>> On Jun 22, 2023, at 3:20 PM, Karin >> <mailto:niko.ka...@gmail.co

Re: [petsc-users] snes_type aspin without DA example

2023-06-22 Thread Barry Smith
A test would be great. > On Jun 22, 2023, at 3:20 PM, Karin wrote: > > Thank you Barry. I will try this. > Should I provide a test in src/binding/petsc4py/test/test_snes.py ? > > Le jeu. 22 juin 2023 à 20:41, Barry Smith <mailto:bsm...@petsc.dev>> a écrit : &

Re: [petsc-users] snes_type aspin without DA example

2023-06-22 Thread Barry Smith
You are not missing anything. The petsc4py stub for SNESNASMSetSubdomains() has not been written. You could add it by adding to src/petsc4py/PETSc/SNES.pyx and src/petsc4py/PETSc/petscsnes.pxi and then make a merge request https://petsc.org/release/developers/contributing/ to get it into

Re: [petsc-users] How to efficiently fill in, in parallel, a PETSc matrix from a COO sparse matrix?

2023-06-20 Thread Barry Smith
Since you have 6 entries that needed to be added to the matrix you will need to call MatSetValues() six time for the six entries. > On Jun 20, 2023, at 11:06 AM, Matthew Knepley wrote: > > On Tue, Jun 20, 2023 at 10:55 AM Diego Magela Lemos via petsc-users >

Re: [petsc-users] Question about using MatCreateAIJ

2023-06-18 Thread Barry Smith
I am concerned this is not good advice being provided. Let's back up and look more closely at your use case. * What is the ratio of new nonzero locations added compared to the initial number of nonzeros for your code, for each of your iterations? * Is it possible for many iterations,

Re: [petsc-users] Start logging with -info after PetscInitialize()

2023-06-13 Thread Barry Smith
Jacob, Perhaps the cleanup can be done automatically so as to not require the user to know they need to call the Destroy first? The current API seems odd. > On Jun 13, 2023, at 10:25 AM, Jacob Faibussowitsch > wrote: > > Call PetscInfoDestroy() first. > >

Re: [petsc-users] Inquiry about the definitely lost memory

2023-06-09 Thread Barry Smith
(mpid_abort.c:67) > ==15547==by 0x9A22823: MPIR_Abort_impl (init_impl.c:270) > ==15547==by 0x97FFF02: internal_Abort (abort.c:65) > ==15547==by 0x98000C3: PMPI_Abort (abort.c:112) > ==15547==by 0x58FE116: PetscError (err.c:403) > ==15547==by 0x410CA3: main (ex1.c:764) //

Re: [petsc-users] Unconditional jump or move depends on uninitialised value(s)

2023-06-09 Thread Barry Smith
Yes they matter; they cannot be ignored. The most likely cause is that you did not fill in certain entries in the vector during the function evaluation routine you set with SNESSetFunction(). Another possibility is if you provided a right hand side vector to the SNES (uncommon) that not

Re: [petsc-users] Inquiry about the definitely lost memory

2023-06-09 Thread Barry Smith
This are MPI objects PETSc creates in PetscInitialize(), for successful runs they should all be removed in PETSc finalize, hence they should not appear as valgrind links. Are you sure PetscFinalize() is called and completes? We'll need the exact PETSc version you are using to know

Re: [petsc-users] IS natural numbering to global numbering

2023-06-09 Thread Barry Smith
You might be looking for https://petsc.org/release/manualpages/AO/AO/#ao > On Jun 9, 2023, at 11:02 AM, Mark Adams wrote: > > An IS is just an array of integers. We need your context. > Is this question for sparse matrices? If so look at the documentation on the > AIJ matrix construction

Re: [petsc-users] Petsc using VecDuplicate in solution process

2023-06-07 Thread Barry Smith
Can you please present the all output that callgrind is outputing to you that provides this indication. > On Jun 7, 2023, at 4:11 AM, Pichler, Franz wrote: > > Hello thanks for the reply, > > I created a working minimal example (as minimal as I can think of?) that I > include here, even

Re: [petsc-users] Failed to configure on Windows with latest Intel OneAPI

2023-06-01 Thread Barry Smith
t; When I try to open configure.log with Notepad, it says "the file cannot be > accessed by the system". > Besides, the file size is 0 bytes.  > > > Barry Smith mailto:bsm...@petsc.dev>> 于2023年6月2日周五 01:20写道: >> >> Please send configure

Re: [petsc-users] Failed to configure on Windows with latest Intel OneAPI

2023-06-01 Thread Barry Smith
Please send configure.log to petsc-ma...@mcs.anl.gov > On Jun 1, 2023, at 10:01 AM, Hawk Shaw wrote: > > Hi, > > I failed to configue PETSc on Windows with latest Intel OneAPI toolkit: > > ./configure --with-cc="win32fe cl" --with-cxx="win32fe cl"

Re: [petsc-users] Using SNESSHELL as a wrapper for a CFD solver.

2023-05-31 Thread Barry Smith
Sorry, I wrote to quickly in my last email. You will need to create a SNESSHELL its solve simply calls your solver (for its one iteration) SNESNRICHARSON handles the rest. > On May 31, 2023, at 4:16 PM, Kenneth C Hall wrote: > > Matt, > > Thanks for your quick reply. I think what you

Re: [petsc-users] Using SNESSHELL as a wrapper for a CFD solver.

2023-05-31 Thread Barry Smith
> On May 31, 2023, at 4:16 PM, Kenneth C Hall wrote: > > Matt, > > Thanks for your quick reply. I think what you say makes sense. > > You asked what my code does. The MySolver program performs one iteration of a > CFD iteration. The CFD scheme is an explicit scheme that uses multigrid,

Re: [petsc-users] ask for the ERROR MESSAGE

2023-05-31 Thread Barry Smith
This is an inconsistent error message. It prints > Error in query to SYEV Lapack routine 0 But the error check is on lierr != 0 so the error check should not have been triggered. I inspected the code and there is no obvious problem with mixing up different-size integers; the prototype for

Re: [petsc-users] petsc-users Digest, Vol 173, Issue 131

2023-05-29 Thread Barry Smith
@mcs.anl.gov <mailto:petsc-users-ow...@mcs.anl.gov> >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of petsc-users digest..." >> >> >> Today's Topics: >> >>1. MatGetValues() can't retur

Re: [petsc-users] MatGetValues() can't return the correct values

2023-05-29 Thread Barry Smith
Perhaps run a very small problem with 2 ranks and use MatView() to see the matrix before getting the values. Maybe use the debugger (-start_in_debugger) and step through the code as it gets values. I would say there is very little chance it is getting the "wrong values" and is more likely

Re: [petsc-users] Regarding Issue with Metis Double Precision

2023-05-28 Thread Barry Smith
***** > > On Sun, May 28, 2023 at 8:12 PM Barry Smith <mailto:bsm...@petsc.dev>> wrote: >> >> It looks you are calling Metis routines directly. In that case, you can do >> one of two things >> >> 1) use the ad

<    1   2   3   4   5   6   7   8   9   10   >