Re: [petsc-users] extract preconditioner matrix

2022-12-14 Thread Barry Smith
> On Dec 14, 2022, at 9:10 PM, 김성익 wrote: > > Hello, > > > > I tried to find the way to adapt my own preconditioner. > In other words, I want to apply and solve a new preconditioner rather than > using the existing one in Petsc. > > So, my questions are as below > 1. Is this possible to

Re: [petsc-users] Saving solution with monitor function

2022-12-14 Thread Barry Smith
See, for example https://petsc.org/release/docs/manualpages/TS/TSTrajectoryGetVecs/ and https://petsc.org/release/docs/manualpages/TS/TSTrajectoryGetUpdatedHistoryVecs/ One does not directly access the data inside the trajectory; one calls functions in the API to obtained desired

Re: [petsc-users] Saving solution with monitor function

2022-12-13 Thread Barry Smith
It is also possible to read the solutions back from the trajectory object from your running code. It is not just for saving to files. > On Dec 13, 2022, at 12:51 PM, Zhang, Hong via petsc-users > wrote: > > Tyler, > > The quickest solution is to use TSTrajectory as Matt mentioned. You

Re: [petsc-users] parallelize matrix assembly process

2022-12-13 Thread Barry Smith
uses 0 mallocs. > > Assemble Time : 5.238257sec > > [1] PetscCommDuplicate(): Using internal PETSc communicator > 139620736897504 94891083133744 > > [1] PetscCommDuplicate(): Using internal PETSc communicator > 139620736897504 94891083133744 > > Assemble T

Re: [petsc-users] parallelize matrix assembly process

2022-12-12 Thread Barry Smith
The problem is possibly due to most elements being computed on "wrong" MPI rank and thus requiring almost all the matrix entries to be "stashed" when computed and then sent off to the owning MPI rank. Please send ALL the output of a parallel run with -info so we can see how much

Re: [petsc-users] Union of sequential vecs

2022-12-09 Thread Barry Smith
combine them to get Vec = > {2,5,7,8,10,11,12}. > I just want them in an MPI vector. > > I finally plan to call VecScatterCreateToAll so that all processor gets a > copy. > > Thank you. > > Kind regards, > Karthik. > > From: Barry Smith mailto:bsm...@pets

Re: [petsc-users] Union of sequential vecs

2022-12-09 Thread Barry Smith
How are you combining them to get Vec = {2,5,7,8,10,11,12}? Do you want the values to remain on the same MPI rank as before, just in an MPI vector? > On Dec 9, 2022, at 2:28 PM, Karthikeyan Chockalingam - STFC UKRI via > petsc-users wrote: > > Hi, > > I want to take the union of a

Re: [petsc-users] Fortran Interface NULL object / Casting

2022-12-08 Thread Barry Smith
You would use PETSC_NULL_DMLABEL but Matt needs to customize the PETSc Fortran stub for DMAddField() for you to handle accepting the NULL from PETSc. Barry > On Dec 8, 2022, at 1:05 PM, Nicholas Arnold-Medabalimi > wrote: > > Hi Petsc Users > > I am trying to use DMAddField in a

Re: [petsc-users] prevent linking to multithreaded BLAS?

2022-12-08 Thread Barry Smith
at runtime whether child threads exist/are created when calling > BLAS and deliver a warning. How does one test for this? Some standard Unix API for checking this? > > Barry Smith writes: > >> There would need to be, for example, some symbol in all the threaded BLAS >&g

Re: [petsc-users] prevent linking to multithreaded BLAS?

2022-12-07 Thread Barry Smith
There would need to be, for example, some symbol in all the threaded BLAS libraries that is not in the unthreaded libraries. Of at least in some of the threaded libraries but never in the unthreaded. BlasLapack.py could check for the special symbol(s) to determine. Barry > On Dec

Re: [petsc-users] prevent linking to multithreaded BLAS?

2022-12-07 Thread Barry Smith
We don't have configure code to detect if the BLAS is thread parallel, nor do we have code to tell it not to use a thread parallel version. Except if it is using MKL then we do force it to not use the threaded BLAS. A "cheat" would be for you to just set the environmental variable BLAS

Re: [petsc-users] About Preconditioner and MUMPS

2022-12-06 Thread Barry Smith
> On Dec 6, 2022, at 5:15 AM, 김성익 wrote: > > Hello, > > > I have some questions about pc and mumps_icntl. > > 1. What’s the difference between adopt preconditioner by code (for > example, PetscCall(PCSetType(pc,PCLU)) and option -pc_type lu?? > And also, What’s the priority between

Re: [petsc-users] PETSc geometric multigrid use

2022-12-01 Thread Barry Smith
I don't think you want to use -pc_type gamg if you want to use geometric multigrid. You can can use -pc_type mg and the DMDA. The only thing I think you need to change from the default use of DMDA and -pc_type mg is to provide custom code that computes the interpolation between levels to

Re: [petsc-users] Report Bug TaoALMM class

2022-12-01 Thread Barry Smith
the > gradient. In trust-region methods, there are more parameters and maybe I set > one of them wrong or something like that. > At least, this is my view. But I'm also not an expert on trust-region > methods. > > On 12.11.22 06:00, Barry Smith wrote: >> >>

Re: [petsc-users] About MatMumpsSetIcntl function

2022-11-30 Thread Barry Smith
Note you can use -help to have the running code print all possible options it can currently handle. This produces a lot of output so generally, one can do things like ./code various options -help | grep mumps to see what the exact option is named for mumps in your situation. Also if

Re: [petsc-users] Fortran DMLoad bindings

2022-11-25 Thread Barry Smith
The branch is now available for you to use DMLoad() from Fortran > On Nov 25, 2022, at 1:34 PM, Barry Smith wrote: > > >Nicholas > >I will add the Fortran stubs for these two functions shortly in the git > branch barry/2022-11-25/add-dm-view-load-fortran/

Re: [petsc-users] Fortran DMLoad bindings

2022-11-25 Thread Barry Smith
Nicholas I will add the Fortran stubs for these two functions shortly in the git branch barry/2022-11-25/add-dm-view-load-fortran/release Barry > On Nov 25, 2022, at 1:05 PM, Pierre Jolivet wrote: > > That example has no DMLoad(), and the interface is indeed not automatically >

Re: [petsc-users] comparing HYPRE on CPU vs GPU

2022-11-24 Thread Barry Smith
Probably some of these questions are best asked to the hypre folks. But I can answer some > On Nov 24, 2022, at 11:19 AM, nicola varini wrote: > > Dear all, I am comparing the HYPRE boomeramg preconditioner on CPU and GPU. > It looks like the defaults are different, therefore I tried to

Re: [petsc-users] Petsc Fortran Memory stack trace

2022-11-21 Thread Barry Smith
My understanding of Fortran bounds checking is that before each array access in Fortran it checks to see if the index is valid for the array you are accessing; that is it is from start to end if you had declared the array as double precision, dimension (start:end) :: A It should also

Re: [petsc-users] Using multiple MPI ranks with COO interface crashes in some cases

2022-11-14 Thread Barry Smith
Mat of type (null) Either the entire matrix (header) data structure has gotten corrupted or the matrix type was never set. Can you run with valgrind to see if there is any memory corruption? > On Nov 14, 2022, at 1:24 PM, Fackler, Philip via petsc-users > wrote: > > In Xolotl's

Re: [petsc-users] On PCFIELDSPLIT and its implementation

2022-11-14 Thread Barry Smith
. > On Nov 14, 2022, at 2:21 PM, Edoardo alinovi > wrote: > > Hi Barry no worries! > > Thanks for letting me know! It is not a problem for me to use MPIAIJ, do you > think field split will be a game changer? > > > > Il Lun 14 Nov 2022, 20:13 Barry Smith <

Re: [petsc-users] On PCFIELDSPLIT and its implementation

2022-11-14 Thread Barry Smith
Very sorry for wasting so much of your time. The PCFIELDSPLIT generally will not work with BAIJ matrices because the MatCreateSubMatrix() for BAIJ requires indexing by block in the matrix. Your code should work if you use MPIAIJ matrices. Note you can still use MatSetValuesBlocked() with

Re: [petsc-users] Report Bug TaoALMM class

2022-11-11 Thread Barry Smith
> I attach the updated programm and also the options. > > Stephan > > > > > > <https://www.dict.cc/?s=obviously> > On 03.11.22 22:15, Barry Smith wrote: >> >> Thanks for your response and the code. I understand the potential problem >> an

Re: [petsc-users] Report Bug TaoALMM class

2022-11-11 Thread Barry Smith
solver (previous example). > > I attach the updated programm and also the options. > > Stephan > > > > > > <https://www.dict.cc/?s=obviously> > On 03.11.22 22:15, Barry Smith wrote: >> >> Thanks for your response and the code. I understand the p

Re: [petsc-users] Report Bug TaoALMM class

2022-11-11 Thread Barry Smith
l digging through all the nesting here. > > I encountered this and then I looked into the ALMM class and therefore I > tried to call the subsolver (previous example). > > I attach the updated programm and also the options. > > Stephan > > > > > > <http

Re: [petsc-users] On PCFIELDSPLIT and its implementation

2022-11-10 Thread Barry Smith
Can you share the code that produces the problem below? > On Nov 10, 2022, at 3:52 PM, Edoardo alinovi > wrote: > > The thing is, even I pass the following options: > > -UPeqn_pc_type fieldsplit -UPeqn_pc_fieldsplit_0_fields 0,1 > -UPeqn_pc_fieldsplit_1_fields 2

Re: [petsc-users] On PCFIELDSPLIT and its implementation

2022-11-10 Thread Barry Smith
Hmm, that branch does not appear to exist. > On Nov 10, 2022, at 3:48 PM, Edoardo alinovi > wrote: > > I am sorry Barry, > > I told you it works, but it is not. I changed to index to integer, but I am > still getting this: > > [0]PETSC ERROR: - Error Message >

Re: [petsc-users] On PCFIELDSPLIT and its implementation

2022-11-10 Thread Barry Smith
These beasts should be PetscInt, not real real :: ufields(2), pfields(1) Side note. We do not recommend using options like -fdefault-real-8 because the compiler may change values in surprising ways. You can use PetscReal to declare real numbers and this will automatically match with

Re: [petsc-users] Error configuring external packages

2022-11-07 Thread Barry Smith
The cmake in your path is broken TESTING: locateCMake from config.packages.cmake(/gpfs/fs1/home/h/hngharti/hngharti/lsoft/petsc-gnu/config/BuildSystem/config/packages/cmake.py:53) Looking for default CMake executable Checking for program

Re: [petsc-users] PCMGSetResidual and fortran

2022-11-04 Thread Barry Smith
Steven, Could you please send your test code. It is possible there is a bug in our Fortran interface since we do not test it for this functionality. Barry > On Nov 4, 2022, at 10:50 AM, Steven Dargaville > wrote: > > Hi all > > I have a quick question regarding the use of

Re: [petsc-users] On the usage of MatSetValuesBlocked

2022-11-04 Thread Barry Smith
> On Nov 4, 2022, at 6:55 AM, Edoardo alinovi wrote: > > Thanks Matt, > > I have found out that setValuesblocked will work if I do: > > call MatCreateVecs(A, x, y, ierr) > call setValuesBlocked(x, nblocks, varray, ierr) Ah, likely the block size for the vector was not correct, leading

Re: [petsc-users] [petsc-maint] Issues linking petsc header files and lib from FORTRAN codes

2022-11-03 Thread Barry Smith
Please send your attempted makefile and we'll see if we can get it working. I am not sure if we can organize the include files as Fortran compiler include files easily. We've always used the preprocessor approach. The Intel compiler docs indicate the procedure for finding the Fortran

Re: [petsc-users] On the usage of MatSetValuesBlocked

2022-11-03 Thread Barry Smith
You should pass 1 and 1 not 3, because you are setting one block. Regarding all the integer values passed in to PETSc routines To be completely portable you need to declare them as PetscInt and pass the variables. But if you do not use --with-64-bit-indices in ./configure and you do not

Re: [petsc-users] Report Bug TaoALMM class

2022-11-03 Thread Barry Smith
m in the > run_test_tao_neohooke.sh script. > The import part begins at line 292 in test_tao_neohooke.cpp > > Stephan > > On 02.11.22 19:04, Barry Smith wrote: >> Stephan, >> >> I have located the troublesome line in TaoSetUp_ALMM() it has the line &

Re: [petsc-users] Advice on coupling linear physics with Allen-Cahn

2022-11-03 Thread Barry Smith
> On Nov 3, 2022, at 2:33 PM, Mike Welland wrote: > > I am coupling a linear diffusion equation with Allen-Cahn in a time dependent > problem. I'd like to take advantage of the linear block to speed things up. > I'm trying two approaches: > > 1. Allen-Cahn with double well potential:

Re: [petsc-users] On the usage of MatSetValuesBlocked

2022-11-03 Thread Barry Smith
The error indicates not enough nonzero blocks are preallocated for. Try something really simple, preallocate for one block and put in one block then call MatAssemblyBegin/End(), MatView(), if that works then work up to your full problem. Barry > On Nov 3, 2022, at 3:11 PM, Edoardo

Re: [petsc-users] On the usage of MatSetValuesBlocked

2022-11-03 Thread Barry Smith
> On Nov 3, 2022, at 1:16 PM, Edoardo alinovi wrote: > > Ah, I was forgetting the most important thing... Are the size of idxm and > idxn equal to one if I insert 1 block or should I specify all the rows and > columns in the block? Yes, for a single block they are one. The block size is

Re: [petsc-users] On the usage of MatSetValuesBlocked

2022-11-03 Thread Barry Smith
You can find the current F90 interface definitions we support for MatSetValuesBlocked() in /src/mat/f90-mod/petscmat.h90 > On Nov 3, 2022, at 12:16 PM, Edoardo alinovi > wrote: > > Hello Jed/Barry/Petsc friends > > I am trying to assemble a block matrix with 3x3 in 2D and 4x4 blocks

Re: [petsc-users] Bug report LMVM matrix class

2022-11-02 Thread Barry Smith
Thanks for the bug report with reproducing example. I have a fix in https://gitlab.com/petsc/petsc/-/merge_requests/5797 Barry > On Nov 2, 2022, at 6:52 AM, Stephan Köhler > wrote: > > Dear PETSc/Tao team, > > it seems to be that there is a bug in the LMVM matrix class: > > In the

Re: [petsc-users] Report Bug TaoALMM class

2022-11-02 Thread Barry Smith
Stephan, I have located the troublesome line in TaoSetUp_ALMM() it has the line auglag->Px = tao->solution; and in alma.h it has Vec Px, LgradX, Ce, Ci, G; /* aliased vectors (do not destroy!) */ Now auglag->P in some situations alias auglag->P and in some cases

Re: [petsc-users] KSP on GPU

2022-10-31 Thread Barry Smith
s used: min 0.112623, max 1.23886 > eigenvalues provided (min 0.879582, max 1.12623) > > But I guess such differences are expected? > > /Carl-Johan > > From: Matthew Knepley mailto:knep...@gmail.com>> > Sent: den 30 oktober 2022 22:00 > To: Bar

Re: [petsc-users] KSP on GPU

2022-10-30 Thread Barry Smith
In general you should expect similar but not identical conference behavior. I suggest running with all the monitoring you can. -ksp_monitor_true_residual -fieldsplit_0_monitor_true_residual -fieldsplit_1_monitor_true_residual and compare the various convergence between the CPU and

Re: [petsc-users] Report Bug TaoALMM class

2022-10-28 Thread Barry Smith
Stephan, Thanks for your detailed report. Do you have a reproducing example? I am having trouble following the logic you indicate below. It is copying the P into auglag->P. Is auglag->P the "the current solution" you are referring to? Is it because of the line

Re: [petsc-users] Does flagging a matrix as symmetric improving performances?

2022-10-21 Thread Barry Smith
Set the flag, it cannot harm. I cannot see that hypre boomerAMG has options to indicate matrix symmetry to take advantage of it. Stefano or Mark would know better than I. No, do not change MPIAIJ it offers the most preconditioners. Barry > On Oct 21, 2022, at 11:36 AM, Edoardo

Re: [petsc-users] Does flagging a matrix as symmetric improving performances?

2022-10-21 Thread Barry Smith
For most solvers, just setting this flag will not, by itself, will not improve the setup time. An exception to this is PCGAMG in the latest release where it will improve the solution time. For some preconditioner situations you can use MATSBAIJ to store the matrix, this can help

Re: [petsc-users] Periodic boundary condition

2022-10-20 Thread Barry Smith
Some of the valgrind information does not appear to make sense PetscMemcpy() is not calling SNESSolve() so I suspect there must be some serious corruption of something to this impossible stack trace ==236074==by 0x6FD160F: SNESSolve (snes.c:4569) ==236074==by 0x711917E: PetscMemcpy

Re: [petsc-users] how to reuse Mumps factorization

2022-10-19 Thread Barry Smith
Every time a matrix entry gets changes PETSc tracks these changes so for the next KSP by default solve it repeats the numerical factorization if the matrix has changed. Otherwise it reuses the still current factorization. If you are calling KSP directly, you can call

Re: [petsc-users] Issue with single precision complex numbers in petsc4py

2022-10-13 Thread Barry Smith
Is there any reason you can't use the most recent version of PETSc4py? The one you are working with is several years old > On Oct 13, 2022, at 8:53 PM, Peng Sun wrote: > > Hi Hong, > > Thanks for the advice. I could not install petsc4py with the > --with-petsc4py=1 option, which gave

Re: [petsc-users] Laplace Equation preconditioner

2022-10-12 Thread Barry Smith
What KSP are you using? DIVERGED_BREAKDOWN is very rare for KSPGMRES. If you are using one of its lesser cousins like bcgs you might consider switching to bcgsl or gmres. I assume because of boundary conditions or the discretization you do not have symmetric positive definite and thus

Re: [petsc-users] VecScatter

2022-10-11 Thread Barry Smith
You need to first convert the Vec to the "natural" ordering and then bring that vector down to one rank. Something like DMDACreateNaturalVector(dm,); DMDAGlobalToNaturalBegin/End(dm, n); > VecScatterCreateToZero(n, , ); > VecScatterBegin(scat, n Xseq, INSERT_VALUES, SCATTER_FORWARD); >

Re: [petsc-users] make all check error

2022-10-11 Thread Barry Smith
https://petsc.org/release/faq/#what-does-the-message-hwloc-linux-ignoring-pci-device-with-non-16bit-domain-mean > On Oct 10, 2022, at 11:54 PM, Sijie Zhang wrote: > > Hi, > > When I try to install petsc on my PC and run the make all check commend it > has the following error. Can you help

[petsc-users] PETSc 2023 User Meeting and New Release 3.18

2022-10-09 Thread Barry Smith
ludes contributions from AdelekeBankole Aidan Hamilton Albert Cowie Alexis Marboeuf Barry Smith Blaise Bourdin Dave May David Andrs David Wells Fande Kong ftrigaux Getnet Betrie Hong Zhang Jacob Faibussowitsch James Wright JDBetteridge Jed Brown Jeremy L Thompson Joe Wallwork Jose Roman Junchao Zh

Re: [petsc-users] suppress CUDA warning & choose MCA parameter for mpirun during make PETSC_ARCH=arch-linux-c-debug check

2022-10-08 Thread Barry Smith
True, but when users send reports back to us they will never have used the VERBOSE=1 option, so it requires one more round trip of email to get this additional information. > On Oct 8, 2022, at 6:48 PM, Jed Brown wrote: > > Barry Smith writes: > >> I hate these k

Re: [petsc-users] suppress CUDA warning & choose MCA parameter for mpirun during make PETSC_ARCH=arch-linux-c-debug check

2022-10-08 Thread Barry Smith
I hate these kinds of make rules that hide what the compiler is doing (in the name of having less output, I guess) it makes it difficult to figure out what is going wrong. Anyways, either some of the MPI libraries are missing from the link line or they are in the wrong order and thus it

Re: [petsc-users] PetscLogView produces nan's instead of timing data when using GPUs

2022-10-05 Thread Barry Smith
It prints Nan to indicate that the time for that event is not known accurately. But the times for the larger events that contain these events are known. So for example the time for KSPSolve is know but not the time for VecNorm. The other numbers in the events, like number of times called

Re: [petsc-users] code with TS throws error at the end

2022-10-05 Thread Barry Smith
Can you try running with valgrind? https://petsc.org/release/faq/?highlight=valgrind#what-does-corrupt-argument-or-caught-signal-or-segv-or-segmentation-violation-or-bus-error-mean-can-i-use-valgrind-or-cuda-memcheck-to-debug-memory-corruption-issues

Re: [petsc-users] How to use Intel OneApi mpi wrappers on Linux

2022-10-03 Thread Barry Smith
gt; Hi Barry, > > thanks for the suggestion. I tried this but doesn’t seem to work as expected. > That is, configure actually works, but it is because it is not seeing the > LLVM based compilers, only the intel classical ones. Yet the variables seem > correctly exported. >

Re: [petsc-users] How to use Intel OneApi mpi wrappers on Linux

2022-10-03 Thread Barry Smith
bsmith@petsc-01:~$ mpicc This script invokes an appropriate specialized C MPI compiler driver. The following ways (priority order) can be used for changing default compiler name (gcc): 1. Command line option: -cc= 2. Environment variable: I_MPI_CC (current value '') 3. Environment

Re: [petsc-users] PETSc usage issues

2022-09-28 Thread Barry Smith
-pc_type fieldsplit -pc_fieldsplit_detect_saddle_point -pc_fieldsplit_type schur Now there will be two additional decisions you need to make how to precondition the A00 block and the Schur complement. For the A00 block the option is -fieldsplit_0_pc_type somethingwhere

Re: [petsc-users] Solve Linear System with Field Split Preconditioner

2022-09-27 Thread Barry Smith
preconditioner(I’m not sure I did it with the right way). > > Thanks, > Xiaofeng > >> On Sep 26, 2022, at 23:11, Barry Smith > <mailto:bsm...@petsc.dev>> wrote: >> >> >> What is your A00 operator? ILU is almost never a good choice for large >

Re: [petsc-users] Strange mpi timing and CPU load when -np > 2

2022-09-26 Thread Barry Smith
It is important to check out https://petsc.org/main/faq/?highlight=faq#why-is-my-parallel-solver-slower-than-my-sequential-solver-or-i-have-poor-speed-up In

Re: [petsc-users] Solve Linear System with Field Split Preconditioner

2022-09-26 Thread Barry Smith
What is your A00 operator? ILU is almost never a good choice for large scale problems. If it is an elliptic operator that using a PC of gamg may work well for the A00 preconditioner instead of ILU. Barry For moderate size problems you can use a PC type LU for AOO to help you

Re: [petsc-users] C++ error! MPI_Finalize() could not be located!

2022-09-25 Thread Barry Smith
It appears you want to use MPI (if not pass --with-mpi=0 also). Thus you must either 1) have the MPI compiler wrappers in your path (mpicc, mpicxx, mpif90) or use --with-mpi-dir=somedirectory where MPI is installed and do NOT provide the compiler names (since MPI provides compiler

Re: [petsc-users] PCApplySymmetricRight for PCBJACOBI (fwd)

2022-09-25 Thread Barry Smith
Thanks for the bug report; your fix is correct. I have corrected it in PETSc and also added support for multiple block per MPI rank in https://gitlab.com/petsc/petsc/-/merge_requests/5678 Barry > > > -- Forwarded message

Re: [petsc-users] PETSc with 64 bit indices and MKL Sparse BLAS fails to build

2022-09-25 Thread Barry Smith
-bit indices > during compilation of aijmkl implementation, with warnings such as: > > petsc-3.17.4/src/mat/impls/aij/seq/aijmkl/aijmkl.c:282:98: warning: > passing argument 7 of ‘mkl_sparse_d_export_csr’ from incompatible > pointer type > > Are there any other modifications

Re: [petsc-users] PETSc with 64 bit indices and MKL Sparse BLAS fails to build

2022-09-24 Thread Barry Smith
It is possible they recently added support for using it with 64 bit integers. You would need to through their documents to see how to get mkl_spblas.h. to use 64 bit integers and if the library for 64 bit integer has a different name that would need to be linked to. You would need to

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

2022-09-13 Thread Barry Smith
(col.k = 10, col.j = -1, col.i = i, col.c = 0). > > I tried insert at stencils like (col.k = 10, col.j = -1, col.i = i, col.c = > 0). The matrix assemble has no issues but TSSolve failed. I guess probably > due to wrong column locations of those Jacobian elements. > > Thank

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

2022-09-12 Thread Barry Smith
ested. > > Thank you very much. > Jiannan > From: Barry Smith mailto:bsm...@petsc.dev>> > Sent: Monday, September 12, 2022 9:31 AM > To: Tu, Jiannan mailto:jiannan...@uml.edu>> > Cc: petsc-users mailto:petsc-users@mcs.anl.gov>> > Subject: Re: [petsc-user

Re: [petsc-users] Problems with PCMGSetInterpolation

2022-09-12 Thread Barry Smith
c-ma...@mcs.anl.gov-- > ------ > > Somehow I thought that setting ComputeOperators and ComputeRHS will be > enough.. > > Oleg. > > > пн, 12 сент. 2022 г. в 19:23, Barry Smith <mailto:bsm...@petsc.

Re: [petsc-users] Problems with PCMGSetInterpolation

2022-09-12 Thread Barry Smith
    In PCSetUp_MG() it is creating needed vectors for each level. In order to create the vectors it needs to have a "template" of the vectors. It triesseveral ways to get such a template. If you have provided an vector for each level with PCMGSetRhs() it uses VecDuplicate for the needed vectors.If

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

2022-09-12 Thread Barry Smith
” happens at global row/column (26, 5265026), exactly at > wrapping jm=-1 to j=0 to the other side. > > I am thinking about how to properly use ghost grid j = -1 by setting > appropriate BC there and inserting at that location without wrapping. > > Jiannan > > From:

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

2022-09-11 Thread Barry Smith
couping to component 11 > vals[nv] = 1.0; > nv++; > > col[nv].k=k; col[nv].j=j; col[nv].i=i; > col[nv].c=22; //intra couping to component 22 > vals[nv] = 1.0; > nv++; >

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

2022-09-11 Thread Barry Smith
an determine how to proceed. Barry > > Still the problem is how to properly pre-allocate matrix. Otherwise either > “Augument out of range” error or code stuck at inserting values if > MatSetOption() is called. > > Jiannan > > From: Barry Smith mailto:bsm...@petsc

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

2022-09-10 Thread Barry Smith
dary condition. There is an error message “Augment > out of range . Insert new nonzero at global row/column (26, 520526) into > matrix” because of this far away coupling. The column index 520526 is related > to the other end of the grid in azimuthal direction. > > Thanks, >

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

2022-09-10 Thread Barry Smith
long. Barry > On Sep 10, 2022, at 8:16 AM, Tu, Jiannan wrote: > > Just found MatMPIAIJSetPreallocation is needed. Now Jacobin insertion and > assembly is fast. > > From: Barry Smith mailto:bsm...@petsc.dev>> > Sent: Thursday, September 8, 2022 9:53 PM >

Re: [petsc-users] Make error --download-hdf5-fortran-bindings=1

2022-09-08 Thread Barry Smith
> On Sep 8, 2022, at 8:38 PM, Park, Heeho via petsc-users > wrote: > > Hi PETSc Developers, > > I am having trouble compiling with the --download-hdf5-fortran-bindings=yes > option on Sandia’s HPC system. > It compiles with make version 3.82, but fails to compile with make version > 4.2.1

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

2022-09-08 Thread Barry Smith
; Jiannan > > > > Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for Windows > > From: Barry Smith <mailto:bsm...@petsc.dev> > Sent: Wednesday, September 7, 2022 11:53 AM > To: Tu, Jiannan <mailto:jiannan...@uml.edu> > Cc: petsc-users@mcs.anl.go

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

2022-09-07 Thread Barry Smith
only up to 10 non-zeros at each row. I'll try > DMDASetBlockFills() or DMDASetBlockFillsSparse() and see how they can reduce > the memory usage. > > Jiannan > From: Barry Smith mailto:bsm...@petsc.dev>> > Sent: Tuesday, September 6, 2022 11:33 PM > To: Tu, Jiannan mailto:j

Re: [petsc-users] [slepc] nan output for eigenvectors

2022-09-07 Thread Barry Smith
You can run with -fp_trap to have the program stop as soon as the first Nan or Inf appears, this can help track down why it is happening. In a debugger you can also set the debugger to trap on floating point exceptions (syntax is debugger dependent) to focus in on where it first happens.

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

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