Re: [petsc-users] Using matrix-free with KSP

2022-09-06 Thread Barry Smith
> On Sep 6, 2022, at 11:00 PM, Tu, Jiannan wrote: > > I am using TS IMEX to solve a large DAE system. The DAE is obtained by > applying finite FV method to 3-D multi-specie ion/neutral fluids equations > with magnetic induction equation. The Jacobian for stiff part is formed by > using

Re: [petsc-users] PETSc with gcc/gfortran

2022-09-06 Thread Barry Smith
This happens when the module files were created with one Fortran compiler, say ifort`, but it is attempting to read them with a different Fortran compiler, say gfortran. (You can never mix to different Fortran compilers in the same executable/library/module system. You need to use a

Re: [petsc-users] Problem about optimized version

2022-08-31 Thread Barry Smith
Please send configure.log and make.log to petsc-ma...@mcs.anl.gov (too large for petsc-users) Did you use the exact same configure options for the optimized and debugger versions of PETSc except for the option --with-debugging=no ? The "is processed by

Re: [petsc-users] Question on PetscViewerFileSetMode

2022-08-30 Thread Barry Smith
You should only use PetscViewerFileSetMode to APPEND when you first create the viewer. You would only set it to APPEND if you destroy and recreate the viewer for each time-step. The append tells the viewer that when it opens the file it should move its pointer to the end of the file

Re: [petsc-users] Hint for compiling PETSC on Windows with non-english language settings

2022-08-28 Thread Barry Smith
Is there a way to automatically check the package language? If so, we will do that check right at the beginning of configure to limit the user's need to read the PETSc documentation before getting to work :-) > On Aug 28, 2022, at 2:09 PM, Andreas Hauffe > wrote: > > Hi, > > perhaps it

Re: [petsc-users] unable to build petsc with cuda / superlu-dist enabled

2022-08-26 Thread Barry Smith
-cxx-dialect=C++11 > and > --with-cuda-dialect=cxx11 > > and that got rid of those errors. I image there are cleaner / more elegant > ways of doing this but I'll settle for this for now. > > Thanks a lot for the help guys, much appreciated > > Best regards > Byr

Re: [petsc-users] unable to build petsc with cuda / superlu-dist enabled

2022-08-26 Thread Barry Smith
makes different -std=c++11 vs -std=c++14 choices as well. > > Main should hopefully *also* warn about this, but unless you really really > want -std=c++11 or -std=c++14, it is better to leave out this configure flag > (--with-cxx-dialect). > > If --with-cxx-dialect is unspeci

Re: [petsc-users] unable to build petsc with cuda / superlu-dist enabled

2022-08-25 Thread Barry Smith
ils.cu > On Aug 25, 2022, at 9:38 AM, byron wrote: > > Hi Barry > > There doesn't appear to be any reference to 'optimize' in the only copy of > superlu_gpu_utils.cu <http://superlu_gpu_utils.cu/> I could find, I've > attached a copy. > > Thanks >

Re: [petsc-users] unable to build petsc with cuda / superlu-dist enabled

2022-08-25 Thread Barry Smith
nvcc fatal : redefinition of argument 'optimize' make[2]: *** [SRC/CMakeFiles/superlu_dist.dir/build.make:499: SRC/CMakeFiles/superlu_dist.dir/superlu_gpu_utils.cu.o] Error 1 make[2]: *** Waiting for unfinished jobs nvcc fatal : redefinition of argument 'optimize' make[2]: ***

Re: [petsc-users] PETSc on fedora 36

2022-08-23 Thread Barry Smith
libevent_core-2.1.so.7 => /lib64/libevent_core-2.1.so.7 > (0x7f302fc07000) > libevent_pthreads-2.1.so.7 => /lib64/libevent_pthreads-2.1.so.7 > (0x7f302fc02000) > libXau.so.6 => /lib64/libXau.so.6 (0x7f302fbfc000) > > I think that it's cor

Re: [petsc-users] PETSc on fedora 36

2022-08-22 Thread Barry Smith
Are you sure the mpirun you are using matches the mpi that PETSc was built with? > On Aug 22, 2022, at 2:31 PM, Rafel Amer Ramon wrote: > > Hi, > > I have installed the following packages on fedora 36 > > ~# rpm -qa | grep petsc > petsc64-3.16.4-3.fc36.x86_64 > petsc-3.16.4-3.fc36.x86_64

Re: [petsc-users] Preallocating a matrix with the d_nnz and o_nnz arrays

2022-08-22 Thread Barry Smith
MatGetOwnershipRangeColumn() tells you the start and end+1 of the columns that are in the diagonal block. For square matrices they are the same as rstart and rend. Barry > On Aug 22, 2022, at 12:12 PM, Patrick Alken wrote: > > Thank you, I have read that document. I have changed my

Re: [petsc-users] Using VecGetType() and VecNest

2022-08-19 Thread Barry Smith
I am not sure why the code works this way creating these sequential work vectors. Since VecNest needs some information about the subvectors I don't think just setting these work vectors to nest vectors will work properly. I am cc:ing Stefano who wrote the code and can likely say

Re: [petsc-users] Using matrix-free with KSP

2022-08-19 Thread Barry Smith
nt *thematrixvariable to see the exact struct with all its fields If this doesn't tell you why the troublesome matrix is not assembled then cut and paste ALL of the output and email it Barry > > > > From: Barry Smith mailto:bsm...@petsc.dev>> > Sent: Thursda

Re: [petsc-users] Using matrix-free with KSP

2022-08-18 Thread Barry Smith
Y); > > //set values for actual matrix row by row > MatSetValues(B, 1, , 1, nCols, matCols, INSERT_VALUES); > > MatAssemblyBegin(B, MAT_FINAL_ASSEMBLY); > MatAssemblyEnd(B, MAT_FINAL_ASSEMBLY); > > KSPCreate(MPI_COMM_WORLD, ); > KSPSetOperators(ksp, A, B); &g

Re: [petsc-users] Using matrix-free with KSP

2022-08-18 Thread Barry Smith
> The code runs in parallel. Each process owns number of rows that equals to > number of unknowns (that is, xm in 1D DM) it owns. > > Jiannan > > From: Barry Smith mailto:bsm...@petsc.dev>> > Sent: Thursday, August 18, 2022 11:37 AM > To: Tu, Jiannan mailto:jian

Re: [petsc-users] Using matrix-free with KSP

2022-08-18 Thread Barry Smith
jiannantu/petsc-3.16.6/src/ksp/ksp/interface/itfunc.c:914 > [0]PETSC ERROR: #8 KSPSolve() at > /home/jiannantu/petsc-3.16.6/src/ksp/ksp/interface/itfunc.c:1086 > > From: Barry Smith mailto:bsm...@petsc.dev>> > Sent: Thursday, August 18, 2022 8:35 AM > To: Tu, Jiannan mailt

Re: [petsc-users] Using matrix-free with KSP

2022-08-18 Thread Barry Smith
atSetValues(B, 1, , nn, nCols, matCols, INSERT_VALUES); > > MatAssemblyBegin(B, MAT_FINAL_ASSEMBLY); > MatAssemblyEnd(B, MAT_FINAL_ASSEMBLY); > > Could you please tell me what I have done wrong? > > Thank you, > Jiannan > > From: Barry Smith mailto:bsm...@pet

Re: [petsc-users] Parallel assembly of a matrix problem

2022-08-16 Thread Barry Smith
MatMPIAIJSetPreallocation(A, 3, NULL, 0, NULL); The 0 indicates you expect that there will be no matrix entries in the columns of the matrix that represent degrees of freedom that are not stored on the given rank. In your case this means you expect the matrix to be block diagonal with one

Re: [petsc-users] Using matrix-free with KSP

2022-08-16 Thread Barry Smith
PCSHELL); > PCShellSetApply(pc,MatrixFreePreconditioner); > > Thank you, > Jiannan > > From: Barry Smith mailto:bsm...@petsc.dev>> > Sent: Tuesday, August 16, 2022 10:10 AM > To: Tu, Jiannan mailto:jiannan...@uml.edu>> > Cc: petsc-users@mcs.anl.gov &l

Re: [petsc-users] Using matrix-free with KSP

2022-08-16 Thread Barry Smith
routine and then Petsc handles applying the preconditioner > to matrix-vector product? I used PCSetType(pc, PCSHELL) and PCShellSetApply. > > Thank you and appreciate your help! > > Jiannan > From: Tu, Jiannan mailto:jiannan...@uml.edu>> > Sent: Wednesday, July 6, 2022 2:34

Re: [petsc-users] Solution vector in a component-wise order

2022-08-15 Thread Barry Smith
Not really. There are tools to make it easier to do computations on individual fields in the field-coupling order such as https://petsc.org/release/docs/manualpages/Vec/VecStrideGatherAll.html and its many friends and

Re: [petsc-users] Parallel assembly of a matrix problem

2022-08-15 Thread Barry Smith
There are two sets of tools for helping compute the preallocation in a "pre-compute" step that "count" what you will need later efficiently so that you don't need to "figure out" the preallocation information yourself. They are both slightly clumsy, unfortunately, but should work fine.

Re: [petsc-users] DMDA ghosted boundary

2022-08-15 Thread Barry Smith
Something like DMDASetComputeGhostBoundary(DM dm, s(DM,Vec,Vec,void*),d(void*)) where s(DM dm, Vec g, Vec l, void*ctx) { User code that fills in appropriate places in l. d(void* ctx) { Optional: Destroys optional user context when DM is destroyed. } and s() gets called inside of

Re: [petsc-users] MatView to file

2022-08-12 Thread Barry Smith
> On Aug 12, 2022, at 3:50 PM, Pierre Jolivet wrote: > > >> On 12 Aug 2022, at 9:47 PM, Alfredo Jaramillo > > wrote: >> >> Hello Mark, >> But why should this depend on the number of processes? > > Because with non-binary formats, the matrix is centralized

Re: [petsc-users] DMDA ghosted boundary

2022-08-12 Thread Barry Smith
> On Aug 12, 2022, at 9:27 AM, David Scott wrote: > > > > On 12/08/2022 11:26, Matthew Knepley wrote: >> This email was sent to you by someone outside the University. >> You should only click on links or attachments if you are certain that the >> email is genuine and the content is safe. >>

Re: [petsc-users] CPARDISO halt on petsc3.17

2022-08-11 Thread Barry Smith
022, at 1:57 PM, Gong Ding wrote: > > On 2022/8/12 01:41, Barry Smith wrote: >> >> -with-mpi-dir=/usr/local/mpich-3.4.2/ >> >> >>> #0 0x7fede65066b3 in MPIR_Barrier.part.0 () from >>> /usr/local/mpich/lib/libmpi.so.12 >>> #1 0x00

Re: [petsc-users] CPARDISO halt on petsc3.17

2022-08-11 Thread Barry Smith
f353b4caa46 in PCSetUp_LU () from > /usr/local/petsc-3.17.4/arch-linux2-c-opt/lib/libpetsc.so.3.17 > #8 0x7f353b59cd82 in PCSetUp () from > /usr/local/petsc-3.17.4/arch-linux2-c-opt/lib/libpetsc.so.3.17 > #9 0x7f353b5dee5a in KSPSetUp () from > /usr/local/petsc-3.17.4/arch-linux

Re: [petsc-users] CPARDISO halt on petsc3.17

2022-08-11 Thread Barry Smith
What do you mean halt? Does it hang, seemingly running forever with no output, does it crash and print an error message (please send the entire error message; cut and paste). Is the matrix something you can share so we can try to reproduce? Barry > On Aug 11, 2022, at 5:42 AM, Gong

Re: [petsc-users] problem linking to petsc

2022-08-05 Thread Barry Smith
The secret is in the > 000fd2ce T __petscsys_MOD_petscinitializenoarguments > 000fd313 T __petscsys_MOD_petscinitializenohelp > 000fd3e9 T __petscsys_MOD_petscinitializewithhelp it looks like the application code was last used with a much older version of PETSc that

Re: [petsc-users] Question about speed of MatMatSolveTranspose with MUMPS

2022-08-04 Thread Barry Smith
Yes, it appears no MUMPS matmatsolvetranspose is wired in. Does MUMPS provide such a function? If so it can be added with a few lines of code. Barry > On Aug 4, 2022, at 3:55 PM, Lucas Banting wrote: > > Hello, > > I am using MUMPS to solve a system with multiple right hand sides. > I

Re: [petsc-users] KSPAGMRES Question

2022-08-02 Thread Barry Smith
Ok, this is embarrassing, all the code is there and the documentation, but it is not wired up to be usable; I'm not sure how that happened. The code was contributed over two years ago, and I have no memory of why it would be there but not wired up. I wired it up and ran a simple test and got

Re: [petsc-users] On MatDestroy() in Fortran

2022-07-31 Thread Barry Smith
leaner to implement :) > > Is there any way to get the reference count of an object just to double check > it is not referenced anymore? > > Thank you > > Il Sab 30 Lug 2022, 21:59 Barry Smith <mailto:bsm...@petsc.dev>> ha scritto: > > Yes, as you describe below.

Re: [petsc-users] On MatDestroy() in Fortran

2022-07-30 Thread Barry Smith
Yes, as you describe below. > On Jul 30, 2022, at 4:31 PM, Edoardo alinovi > wrote: > > Hello Barry, > > I assume you are calling KSPSetOperators() before each new KSPSolve() so > that it knows to solve a new system? > > Yes, I do. > > This looks like a good trick: >

Re: [petsc-users] On MatDestroy() in Fortran

2022-07-30 Thread Barry Smith
I assume you are calling KSPSetOperators() before each new KSPSolve() so that it knows to solve a new system? If the above is true with your current code it should thus have two matrices in memory at the most since every new call to KSPSetOperators() will trigger freeing the previous.

Re: [petsc-users] On MatDestroy() in Fortran

2022-07-30 Thread Barry Smith
PETSc objects do use reference counting so if the reference count does not reach zero on a MatDestroy() the matrix is not actually freed, because somewhere else in the code there may be a reference for it that could cause it to be used. For example KSPSetOperators( A) MatDestroy(A)

Re: [petsc-users] MatPrealloctor

2022-07-29 Thread Barry Smith
.anl.gov/mailman/htdig/petsc-users/2022-May/046094.html> > > This works fine without the MatPreallocator routines. > > Randy > >> On Jul 29, 2022, at 2:23 PM, Barry Smith > <mailto:bsm...@petsc.dev>> wrote: >> >> >> I'm hoping

Re: [petsc-users] MatPrealloctor

2022-07-29 Thread Barry Smith
c:2012 > > > Any help to point me in the right direction is appreciated. > > Randy M. > > > >> On Jul 28, 2022, at 2:49 PM, Barry Smith > <mailto:bsm...@petsc.dev>> wrote: >> >> >> I am not sure what you are asking exactly but I th

Re: [petsc-users] Import Matlab matrix

2022-07-29 Thread Barry Smith
If you already have Matlab matrices that were saved with, for example, save example.mat A It may be possible to use MatLoad() directly on them using the PETSCVIEWERHDF5 viewer type (and not need to use the PetscBinaryWrite()). Please read the full manual page

Re: [petsc-users] MatPrealloctor

2022-07-28 Thread Barry Smith
I am not sure what you are asking exactly but I think so, so long have you have called MatSetLocalToGlobalMapping() and the "stencil" idea makes sense for your discretization. Barry > On Jul 28, 2022, at 5:41 PM, Randall Mackie wrote: > > Dear PETSc users: > > Can one use a

Re: [petsc-users] Make check 3.17.3

2022-07-21 Thread Barry Smith
export HWLOC_HIDE_ERRORS=2 seems to be the option to prevent these confusing and annoying messages. > On Jul 21, 2022, at 9:37 AM, san.tempo...@gmail.com wrote: > > I am compiling, installing and checking 3.17.3, as posted below, following > the usual instructions after each step. > I am

Re: [petsc-users] Reusing A00 block with Schur complement

2022-07-20 Thread Barry Smith
It is suppose to not rebuild the preconditioner for the A00 block if the matrix does not change; and automatically rebuild if it does change. > On Jul 20, 2022, at 4:14 PM, Mike Welland wrote: > > My A00 block in an SNES solve with a Schur complement preconditioner is > constant, and I'd

Re: [petsc-users] Possible to turn off unused option warning in debug mode?

2022-07-20 Thread Barry Smith
You can put these in a .petscrc file in your home directory, the current directory or in the environmental variable PETSC_OPTIONS (I do this) > On Jul 20, 2022, at 2:43 PM, Jacob Faibussowitsch wrote: > > Run with "-options_left 0" (also accepts no, and false) > > Best regards, > >

Re: [petsc-users] Error running src/snes/tutorials/ex19 on Nvidia Tesla K40m : CUDA ERROR (code = 101, invalid device ordinal)

2022-07-14 Thread Barry Smith
So the PETSc test all run, including the test that uses a GPU. The hypre test is failing. It is impossible to tell from the output why. You can run it manually, cd src/snes/tutorials make ex19 mpiexec -n 1 ./ex19 -dm_vec_type cuda -dm_mat_type aijcusparse -da_refine 3

Re: [petsc-users] DMPlex: a Mapping Array between Natural and Distributed Cell Index

2022-07-14 Thread Barry Smith
> On Jul 13, 2022, at 9:52 PM, Bora Jeong wrote: > > Dear petsc team, > > I am a user of DMPlex for a finite volume code and there is a necessity to > know global index of each cell. Here the global index means the indexing that > can be found from a mesh file itself without distribution

Re: [petsc-users] Strange strong scaling result

2022-07-12 Thread Barry Smith
The streams numbers 1 8291.4887 Rate (MB/s) 2 8739.3219 Rate (MB/s) 1.05401 3 24769.5868 Rate (MB/s) 2.98735 4 31962.0242 Rate (MB/s) 3.8548 5 39603.8828 Rate (MB/s) 4.77645 6 4.7385 Rate (MB/s) 5.76226 7 54557.5363 Rate (MB/s) 6.57994 8 62769.3910 Rate (MB/s)

Re: [petsc-users] [PCGAMG + AGG + GMRES] Non-Exact Dirichlet Boundary Conditions

2022-07-07 Thread Barry Smith
Elias, How are you zeroing the rows and columns of the matrix, are you using MatZeroRowsColumns()? If so, are you passing in the vectors b and x (with b set and the x locations associated with the Dirichlet rows set to the correct Dirichlet value)? If so, are you calling

Re: [petsc-users] Using matrix-free with KSP

2022-07-06 Thread Barry Smith
eading the manual and trying to understand how VecScatter and PetscSF > work. > > Jiannan > From: Jed Brown mailto:j...@jedbrown.org>> > Sent: Wednesday, July 6, 2022 10:09 AM > To: Tu, Jiannan mailto:jiannan...@uml.edu>>; Barry Smith > mailto:bsm...@petsc.dev>>

Re: [petsc-users] [EXTERNAL] Fail function evaluation with SNES

2022-06-27 Thread Barry Smith
s looking for. > > — > Jacob Merson > >> On Jun 27, 2022, at 6:17 AM, Barry Smith wrote: >> >>  >> You would call SNESSetFunctionDomainError() or SNESSetJacobianDomainError() >> from within your function or Jacobian evaluation and then return from the >>

Re: [petsc-users] Fail function evaluation with SNES

2022-06-27 Thread Barry Smith
You would call SNESSetFunctionDomainError() or SNESSetJacobianDomainError() from within your function or Jacobian evaluation and then return from the function. This notifies SNES that the step it attempted is not acceptable to your functions. SNES may not be able to recover from its bad

Re: [petsc-users] Pestc-matlab issue

2022-06-17 Thread Barry Smith
Please send configure.log and make.log to petsc-ma...@mcs.anl.gov > On Jun 17, 2022, at 1:52 PM, Yongxiang Lei wrote: > > Dear concerns, > > I met such issues when I confirm that my Matlab installation is finished. I > am also sure that the g++ version

Re: [petsc-users] Customizing NASM subsnes

2022-06-17 Thread Barry Smith
lename][:[format][:append]]]: Saves > object to a binary file (PetscOptionsGetViewer) > -sub_0_snes_view_solution draw[:[drawtype][:filename|format]] Draws object > (PetscOptionsGetViewer) > -sub_0_snes_view_solution socket[:port]: Pushes object to a Unix socket > (PetscOptions

Re: [petsc-users] Customizing NASM subsnes

2022-06-17 Thread Barry Smith
MPI_Comm_size(PETSC_COMM_WORLD,); MPI_Comm_rank(PETSC_COMM_WORLD,); > SNESNASMGetSNES(snes,0,); > char prefix[10]; > sprintf(prefix,"sub_%d_",rank); > SNESSetOptionsPrefix(subsnes,prefix); > On Jun 17, 2022, at 9:35 AM, Matthew Knepley wrote: > > On Fri, Jun 17, 2022 at 9:22 AM

Re: [petsc-users] Calling Pytorch and Python within PETSc C/C++ code

2022-06-13 Thread Barry Smith
Note that your Python main ptsc4py program can call C/C++ code for some of its computations, so if you have a lot of C/C++ code you do not need to change it all to Python. It is also possible to call Petsc4py (and hence PyTorch) from a C/C++ main but a bit more cumbersome so not recommended.

Re: [petsc-users] [EXTERNAL] Question about SuperLU

2022-06-11 Thread Barry Smith
> binary:BVmat:binary_matlab and checked the resulting matrix in Matlab. > For Matlab, this is a full rank matrix, and the LU factorization there was > carried out without any issues. > I also outputted the BV block directly from the Jacobian matrix. > Once again, according

Re: [petsc-users] Error with PetscMatlabEngineCreate

2022-06-10 Thread Barry Smith
Based on your report the issue is likely due to a MATLABPATH issue. The difference between using "master" and NULL is that when "master" is used, PETSc ssh's to "master" to startup the Matlab engine while with NULL it launches the Matlab engine directly from the current process in

Re: [petsc-users] Question about SuperLU

2022-06-10 Thread Barry Smith
It is difficult to tell exactly how the preconditioner is being formed with the information below it looks like in the first case: the original B diagonal block and V diagonal block of the matrix are being factored separately with SuperLU_DIST second case: the B block is factored with

Re: [petsc-users] How to ignore a one floating point exception and move to the next?

2022-06-07 Thread Barry Smith
PETSc uses the signal handler to catch floating point exceptions when run by default or with -fp_trap. These are hard to recover from and continue. You can run PETSc with -fp_trap off in the debugger but tell the debugger to catch the floating point exceptions. You may be able to continue

Re: [petsc-users] PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range

2022-06-07 Thread Barry Smith
That is an extremely old PETSc version. Unless you are using a package that only works with that version (and talk to the package's authors about upgrading) we recommend upgrading to the latest PETSc version. Usually, there is more information in the error message, is there more in the

Re: [petsc-users] Petsc with mingw64

2022-06-02 Thread Barry Smith
Configure should error with a very helpful message if --with-openblas or --with-openblas-dir are provided on the command line > On Jun 2, 2022, at 5:38 AM, hamid badi wrote: > > Hi, > > I want to compile petsc with openblas & mumps (sequential) under mingw64. To > do so, I compiled

Re: [petsc-users] Sparse linear system solving

2022-06-01 Thread Barry Smith
PETSc is an MPI library. It is not an OpenMP library. Only some external packages that PETSc uses can use OpenMP, things like GAMG will not utilize OpenMP pretty much at all. Barry > On Jun 1, 2022, at 1:37 PM, Lidia wrote: > > Dear Matt, > > Thank you for the rule of 10,000 variables

Re: [petsc-users] Mat created by DMStag cannot access ghost points

2022-06-01 Thread Barry Smith
This appears to be a bug in the DMStag/Mat preallocator code. If you add after the DMCreateMatrix() line in your code PetscCall(MatSetOption(A, MAT_NO_OFF_PROC_ENTRIES, PETSC_FALSE)); Your code will run correctly. Patrick and Matt, MatPreallocatorPreallocate_Preallocator() has

Re: [petsc-users] Using matrix-free with KSP

2022-05-30 Thread Barry Smith
hod still counts the total number of matrix elements > even though they are not stored. Any other ways around it? > > Thank you, > Jiannan > > From: Barry Smith mailto:bsm...@petsc.dev>> > Sent: Tuesday, May 24, 2022 2:13 PM > To: Tu, Jiannan mailto:jiannan...@uml.edu&g

Re: [petsc-users] Using matrix-free with KSP

2022-05-24 Thread Barry Smith
You can use MatCreateMFFD https://petsc.org/main/docs/manualpages/Mat/MatCreateMFFD/ MatMFFDSetFunction MatSetFromOptions MatMFFDSetBase and provide the matrix to KSP. Note you will need to use -pc_type none or provide your own

Re: [petsc-users] strumpack in ilu mode

2022-05-23 Thread Barry Smith
Randy, Please take a look at https://gitlab.com/petsc/petsc/-/merge_requests/4543/ and try its branch. It has more features and may provide more of what you need. Barry > On May 23, 2022, at 1:59 PM, Randall Mackie wrote: > >

Re: [petsc-users] A compilation error about VecGetValues

2022-05-23 Thread Barry Smith
Thanks again! > 从 Windows 版邮件 <https://go.microsoft.com/fwlink/?LinkId=550986>发送 > > 发件人: Barry Smith <mailto:bsm...@petsc.dev> > 发送时间: 2022年5月23日 0:44 > 收件人: wang yuqi <mailto:yu1299885...@outlook.com> > 抄送: petsc-users@mcs.anl.gov <mailto:petsc-users@

Re: [petsc-users] A compilation error about VecGetValues

2022-05-22 Thread Barry Smith
This should work for at least the last three versions of PETSc. Please upgrade to the latest PETSc version and let us know if you continue to get this error message. Yes, for some PETSc versions between 3.8 and 3.14 it may generate this error message with some Fortran compilers.

Re: [petsc-users] API cal to set mg_levels_pc_type

2022-05-20 Thread Barry Smith
quot;,"sor"); >> PetscOptionsSetValue(NULL,"-fieldsplit_0_mg_levels_pc_type","sor"); etc and any "extra" ones not appropriate for your particular case will just be ignored. > On May 20, 2022, at 3:25 PM, Jeremy Theler wrote: > > On Fri,

Re: [petsc-users] API cal to set mg_levels_pc_type

2022-05-20 Thread Barry Smith
> On May 20, 2022, at 2:39 PM, Jeremy Theler wrote: > > The default smoothing PC changed from sor to jacobi in 3.17. Note that this is only for GAMG, it is not for geometric multigrid (using PCMG directly). > The > Changelog says the old behavior can be recovered by using >

Re: [petsc-users] Very slow VecDot operations

2022-05-20 Thread Barry Smith
Ernesto, If you ran (or can run) with -log_view you could see the time "ratio" in the output that tells how much time the "fastest" rank spent on the dot product versus the "slowest". Based on the different counts per rank you report that ratio might be around 3. But based on the times

Re: [petsc-users] MatColoring

2022-05-11 Thread Barry Smith
parameter/trick we can try to further cut down the number of > function evaluations? And also how could we use MATCOLORINGMIS as this latter > does not appear in the MatColoringType options? > Many thanks. > > Zakariae > From: Tang, Qi mailto:tan...@msu.edu>> > Sent: Tuesday, Ma

Re: [petsc-users] MatColoring

2022-05-10 Thread Barry Smith
This depends to some degree on how you are accessing applying the Jacobian construction process. If you are using SNES or TS then the SNES object handles most of the work of organizing the PETSc objects needed to compute the Jacobian and you can control the choices via the options

Re: [petsc-users] Preconditioning Diagnostics

2022-05-03 Thread Barry Smith
A difficult question with no easy answers. First, do you have a restart system so you can save your state just before your "bad behavior" and run experiments easily at the bad point? You could try to use SLEPc to compute the first few eigenmodes (presumably associated with excessively

Re: [petsc-users] GMRES for outer solver

2022-05-02 Thread Barry Smith
> On May 2, 2022, at 8:12 AM, Matthew Knepley wrote: > > On Mon, May 2, 2022 at 12:23 AM Ramakrishnan Thirumalaisamy > mailto:rthirumalaisam1...@sdsu.edu>> wrote: > Thank you. I have a couple of questions. I am solving the low Mach > Navier-Stokes system using a projection preconditioner

Re: [petsc-users] Error: Invalid MIT-MAGIC-COOKIE-1

2022-04-24 Thread Barry Smith
Why is this message seemingly being produced for every PETSc executable run? PETSc, by default, should not be doing anything with X-Windows calls unless a specific option related to X windows is used even if PETSc is compiled and linked against X windows. These test runs are not using

Re: [petsc-users] Combining DMDA and DMStag

2022-04-22 Thread Barry Smith
We would need more details as to exactly what goes wrong to determine any kind of fix; my guess would be that the layout of the velocity vectors and temperature vectors is slightly different since the DMDA uses nelx+1 while the stag uses nelx and may split things up slightly differently in

Re: [petsc-users] How to use MAT_SCHUR_COMPLEMENT_AINV_BLOCK_DIAG

2022-04-21 Thread Barry Smith
It seems like it could be feasible. Say you are approximating the matrix with its 3by3 block diagonal. One can compute its inverse efficiently by simply inverting all the 3by3 blocks on the diagonal and forming a new sparse matrix with this. See, for example,

Re: [petsc-users] [EXT] Re: TSAdapt minimum step and exact final time

2022-04-21 Thread Barry Smith
> On Apr 21, 2022, at 8:52 AM, Phlipot, Greg wrote: > > I wish I could give you an definitive reason why, but I can't. Before > TS gets into this situtation where it needs to take a tiny time step, > TS takes time steps of ~1.0, and the shift in TSSetIJacobian is ~1.0. > Then it gets really

Re: [petsc-users] CHKERRQ in PETSc 3.17 Fortran

2022-04-18 Thread Barry Smith
I don't think it is depreciated from Fortran. Isn't it only being replaced in C (though still available in C)? The removal from Fortran was just an accident. Barry > On Apr 18, 2022, at 4:35 PM, Satish Balay via petsc-users > wrote: > > All CHKERRQ usages were initially removed

Re: [petsc-users] Starting in debugger

2022-04-17 Thread Barry Smith
ple knows the format for. It is the kind of asinine corporate > crap that I thought only Microsoft did, but Apple > has no problem with it here. At this point I gave up. > > Thanks, > > Matt > > Thanks again for the help. > -sanjay > On 4/17/22 8:12 AM, Ba

Re: [petsc-users] Starting in debugger

2022-04-17 Thread Barry Smith
ace issues [2] and [3], but I think I am going to move over to a > linux box for a bit where I can control things better. > > -sanjay > > On 4/16/22 8:13 PM, Barry Smith wrote: >>You should be able to use -start_in_debugger -debug_terminal xterm >> >>

Re: [petsc-users] Starting in debugger

2022-04-16 Thread Barry Smith
with-debugger=/usr/local/bin/gdb (using a patch Barry Smith created today). > > [1] When I execute "mpirun -n 2 hellow -debugger_terminal Terminal" or > "mpirun -n 2 hellow -start_in_debugger gdb -debugger_terminal Terminal". I > am getting

Re: [petsc-users] Input argument out of range with MatZeroRows

2022-04-15 Thread Barry Smith
Yes, this sounds like the intended usage. The only expected reason this would error is if one of the indices is less than 0 or greater than or equal to the number of rows in the entire matrix. In the error message, it should print both the index and the number of rows in the matrix. Can you

Re: [petsc-users] [KSP] solveTranspose fails with Strumpack and SuperLU_dist

2022-04-09 Thread Barry Smith
It would also be very straightforward for you to provide a merge request that adds support for PETSc to directly use SuperLU_DIST and Strumpacks transpose solver capability. Just add the support to superlu_dist.c (and for strumpack) mimicking the style in mumps.c More specifically add a

Re: [petsc-users] SNES Matrix-Free Parameters

2022-04-07 Thread Barry Smith
ed would handle the -snes_mf_type option. Do I need to get the Jacobian > from the snes and then call a MatSetFromOptions() on my matrix-free jacobian > to use this option? > > Thank you, > > -Alfredo > > On Wed, Apr 6, 2022 at 6:35 PM Barry Smith <mailto:bsm...@petsc.dev>

Re: [petsc-users] SNES Matrix-Free Parameters

2022-04-07 Thread Barry Smith
romOptions() on my matrix-free jacobian > to use this option? > > Thank you, > > -Alfredo > > On Wed, Apr 6, 2022 at 6:35 PM Barry Smith <mailto:bsm...@petsc.dev>> wrote: > > I notice that this part of the message does not change even when I specify > &

Re: [petsc-users] question

2022-04-07 Thread Barry Smith
DMStag may also be useful for your needs (and far simpler to use than DMPLEX) depending on where your Lagrange multipliers live. Note that regardless you should not need to be copying entire large submatrices around into bigger matrices; you can build the entire system in-place in one big

Re: [petsc-users] SNES Matrix-Free Parameters

2022-04-06 Thread Barry Smith
I notice that this part of the message does not change even when I specify "-snes_mf_type default" (which is the alternative to wp), so I am a bit confused on how I interact to the -snes_mf_type or if I am interpreting the message wrong. Could you clarify this? Hmm, the two possibilities

Re: [petsc-users] [KSP] PETSc not reporting a KSP fail when true residual is NaN

2022-04-01 Thread Barry Smith
reconditioned resid norm 4.062281042354e-02 true resid norm > -nan ||r(i)||/||b|| -nan > Linear solve converged due to CONVERGED_RTOL iterations 61 > Solver converged within 61 iterations. Elapsed time: 0.117009 > Newton iteration: 0 - L2 Position Norm: INF - L2 P

Re: [petsc-users] Memory leak when combining PETSc-based vectors and boost::odeint

2022-04-01 Thread Barry Smith
ed for armadillo-matrices. A valgrind-log is > attached for the case with removed destructor (can't run valgrind if my > program fails with a segfault). > > Regards, > > Roland > > Am 01.04.22 um 15:23 schrieb Barry Smith: >> >> I recommend first runnin

Re: [petsc-users] Memory leak when combining PETSc-based vectors and boost::odeint

2022-04-01 Thread Barry Smith
I recommend first running with valgrind. I tried to build your code but got compile errors from arma:: being unknown. Where does it come from? Is it only in a super new version of Boost? > On Apr 1, 2022, at 6:50 AM, Roland Richter wrote: > > I re-run my code with a debug version of

[petsc-users] PETSc 3.17 release

2022-03-31 Thread Barry Smith
nl.gov> This release includes contributions from Alp Dener Barry Smith Blaise Bourdin Connor Ward Daniel Finn Dave May David Wells dr-robertk Fande Kong Francesco Ballarin Getnet Grzegorz Mazur Heeho Park Hofer-Julian Hong Zhang Jacob Faibussowitsch Jed Brown Jeremy L Thompson Joe Pusztay Joe Wal

Re: [petsc-users] Failure to configure superlu_dist

2022-03-28 Thread Barry Smith
Could you please try with the main branch of PETSc? We've seen similar problems that have at least partially been dealt with in the main branch. Barry > On Mar 28, 2022, at 4:42 PM, Alexander Lindsay > wrote: > > Attached is my configure.log. Error is: > > Could NOT find MPI_C

Re: [petsc-users] Question on MATMFFD_WP

2022-03-25 Thread Barry Smith
This uses a PETSc "trick". When a norm is computed on a vector it is "stashed" in the object and retrieved quickly if requested again. https://petsc.org/main/src/vec/vec/interface/rvector.c.html#VecNorm Because PETSc

Re: [petsc-users] MatCreateSBAIJ

2022-03-23 Thread Barry Smith
m@cd-adapco.com>> wrote: > Hi Barry, >This is the total memory summed over all the ranks. >Same problem size on different np. >I call MUMPS in parallel with distributed input and centralized rhs. > > Thanks, > Sam > > On Tue, Mar 22, 2022 at 2:11 PM Barry Smith

Re: [petsc-users] MatCreateSBAIJ

2022-03-22 Thread Barry Smith
matrix) 21082260236422151734 > PETSc(using symmetric matrix) 17502100218920941727 > Those are the total water mark memory added. > > On Tue, Mar 22, 2022 at 1:10 PM Barry Smith <mailto:bsm...@petsc.dev>> wrote: > > Sam, > &g

Re: [petsc-users] MatCreateSBAIJ

2022-03-22 Thread Barry Smith
;> wrote: > Barry, >Thanks for the illustration. Is there an easy way to mimic the > implementation using shell matrix? I have been studying how the sMvctx is > created and it seems pretty involved. > > Thanks, > Sam > > On Mon, Mar 21, 2022 at 2:48 PM Barry Smith <mailto

Re: [petsc-users] Null space and preconditioners

2022-03-22 Thread Barry Smith
ints it. Is the average always around 1e-5 from the first iteration or does it start close to 1e-12 and get larger with more iterations? > > Marco Cisternino > > From: Barry Smith mailto:bsm...@petsc.dev>> > Sent: lunedì 21 marzo 2022 19:49 > To: Marco Cister

Re: [petsc-users] Null space and preconditioners

2022-03-21 Thread Barry Smith
I have made a merge request https://gitlab.com/petsc/petsc/-/merge_requests/5002 with an attempt to improve the documentation. It turns out that sometimes it works well also with right preconditioning (but generically it should not) so

Re: [petsc-users] MatCreateSBAIJ

2022-03-21 Thread Barry Smith
Mon, Mar 21, 2022 at 12:56 PM Barry Smith <mailto:bsm...@petsc.dev>> wrote: > > The "trick" is that though "more" communication is needed to complete the > product the communication can still be done in a single VecScatter instead of > two

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