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

2022-10-08 Thread Jed Brown
Barry Smith writes: >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. You can make VERBOSE=1 with CMake-generated makefiles.

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

2022-09-26 Thread Jed Brown
gt; >> Are there other approaches to solve this kind of systems in PETSc except >> for field-split methods? >> >> Thanks, >> Xiaofeng >> >> On Sep 26, 2022, at 14:13, Jed Brown wrote: >> >> This is the joy of factorization field-split methods. Th

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

2022-09-26 Thread Jed Brown
This is the joy of factorization field-split methods. The actual Schur complement is dense, so we represent it implicitly. A common strategy is to assemble the mass matrix and drop it in the 11 block of the Pmat. You can check out some examples in the repository for incompressible flow (Stokes

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

2022-09-25 Thread Jed Brown
The usual issue is that you need a preconditioner for the Schur complement S = A11 - A01 A00^{-1} A10. For incompressible elasticity, this S is spectrally equivalent to a scaled mass matrix. 晓峰 何 writes: > Hi all, > > I have a linear system formed from structural mechanics, and there exists

Re: [petsc-users] Read and write HDF5 files

2022-09-08 Thread Jed Brown
It sounds like the PETSc inside your container was not built with --download-hdf5 (or --with-hdf5). That can be fixed by updating the Dockerfile and rebuilding the image. Quentin Chevalier writes: > Hello PETSc users ! > > I'm trying to use PETSc routine to read and write complex vectors to

Re: [petsc-users] Scaling of PETSc example ex2f.F90

2022-08-16 Thread Jed Brown
Your observed performance is explained by the number of iterations, which varies based on a number of factors, plus imperfect memory bandwidth scaling (https://petsc.org/release/faq/#what-kind-of-parallel-computers-or-clusters-are-needed-to-use-petsc-or-why-do-i-get-little-speedup). Problems

Re: [petsc-users] 3D Model Coupled to 0D Model

2022-08-10 Thread Jed Brown
Have you considered PCFieldSplit? The SCHUR variant gives you all sorts of approximate factorization schemes, though you might find that an additive or multiplicative split is almost as good for this problem. "Karabelas, Elias (elias.karabe...@uni-graz.at)" writes: > Hey all, > > so

Re: [petsc-users] DMPlex PETSCViewer for Surface Component

2022-08-01 Thread Jed Brown
I would create a sub-DM containing only the part you want to view. Mike Michell writes: > Hi, > > I am a user of DMPlex object in 3D grid topology. Currently the solution > field is printed out using viewer PETSCVIEWERVTK in .vtu format. By doing > that the entire volume components are written

Re: [petsc-users] Import Matlab matrix

2022-07-29 Thread Jed Brown
You can use share/petsc/matlab/PetscBinaryWrite.m. matlab> PetscBinaryWrite('matrix.petsc', sparse(A)) Then load it with MatLoad in PETSc. Ahmed Mansur writes: > How to import a sparse matrix from Matlab using C++ and PETSC , if anyone > has any example code, thanks

Re: [petsc-users] Install PETSc with other libraries via package manager

2022-07-21 Thread Jed Brown
Looks like the Debian package is built with PTScotch, which is a partitioner similar to ParMETIS that has better license. (ParMETIS has a non-free license and is flagged as such on Debian.) All PETSc builds have LAPACK. If you get it from your package manager, you'll be stuck with a somewhat

Re: [petsc-users] PETSc / AMRex

2022-07-15 Thread Jed Brown
Matthew Knepley writes: >> I currently set up a 3D DMDA using a box stencil and a stencil width of 2. >> The i,j,k coordinates refer both to the cell (where there is a physical >> value assigned) and to the 3 edges of the cell at the top SW corner. >> For local computations, I need to be able to

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

2022-07-06 Thread Jed Brown
You'll usually have a GlobalToLocal operation for each rank to get the halo data it needs, then either a LocalToGlobal to collect the result (e.g., finite element methods) or the local compute will write directly into the owned portion of the global vector. If you're doing the communication

Re: [petsc-users] Load mesh as DMPlex along with Solution Fields obtained from External Codes

2022-06-26 Thread Jed Brown
(Sorry you didn't get a reply earlier.) That's generally right: DM gives what is basically a distributed "function space". Actual fields in that space are Vecs. You can have one or more Vecs. The implementation of VecLoad will depend on the file format. Mike Michell writes: > Dear PETSc

Re: [petsc-users] Writing VTK output

2022-06-13 Thread Jed Brown
n you just use the simple procedure: >>> >>> PetscCall(DMCreate(comm, dm)); >>> PetscCall(DMSetType(*dm, DMPLEX)); >>> PetscCall(DMSetFromOptions(*dm)); >>> PetscCall(DMViewFromOptions(*dm, NULL, "-dm_view")); >>> >>

Re: [petsc-users] VecConcatenate in petsc4py

2022-06-09 Thread Jed Brown
You don't want to create a new vector here, but read from (and write to) multiple parts of the same vector. You can use PETSc interfaces for subvectors, or do it with NumPy slices (perhaps more natural and ergonomic, depending on how your code is written). Armand Touminet via petsc-users

Re: [petsc-users] Writing VTK output

2022-06-08 Thread Jed Brown
answer, to solve my problem, should just upgrade all my > software ? > > Thanks, > Sami, > > > -- > Dr. Sami BEN ELHAJ SALAH > Ingénieur de Recherche (CNRS) > Institut Pprime - ISAE - ENSMA > Mobile: 06.62.51.26.74 > Email: sami.ben-elhaj-sa...@ensma.fr > www.samibenelhajs

Re: [petsc-users] Writing VTK output

2022-06-08 Thread Jed Brown
You're using pretty old versions of all software; I'd recommend upgrading. I recommend choosing the file name "solution.vtu" to use the modern (non-legacy) format. Does that work for you? Sami BEN ELHAJ SALAH writes: > Dear Petsc Developer team, > > I solved a linear elastic problem in 3D

Re: [petsc-users] Solving a linear system with sparse matrices

2022-05-21 Thread Jed Brown
You can MatConvert your sparse matrix to dense, but there's almost always a better way. Why do you want this product (which is dense) represented explicitly rather than via the sequence (multiply by B, then solve with A)? What will you use it for? Mateo José Moinelo writes: > Hi. I am

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

2022-05-20 Thread Jed Brown
Barry Smith writes: >> 1. Is there a way to set the mg_levels_pc_type via an API call? >> 2. Are there any changes in efficiency expected with this new PC? > > This was changed mainly because PCSOR is not effective (currently in PETSc) > for GPUs. For CPUs > it will definitely be problem

Re: [petsc-users] Convergence issues for SNES NASM

2022-05-11 Thread Jed Brown
Can you add -snes_linesearch_monitor -sub_snes_linesearch_monitor -ksp_converged_reason and send the output?? "Takahashi, Tadanaga" writes: > Hello, > > We are working on a finite difference solver for a 2D nonlinear PDE with > Dirichlet Boundary conditions on a rectangular domain. Our goal is

Re: [petsc-users] Quasi newton

2022-05-03 Thread Jed Brown
bian is exactly what I > need. We will try that. > > I always thought ngmres is a fancy version of Anderson. Is there any > reference or example related to what you said in which one actually > implemented an approximated Jacobian through ngmres? This sounds very > interesting. >

Re: [petsc-users] GMRES for outer solver

2022-04-30 Thread Jed Brown
In general, no. A fixed number of Krylov iterations (CG, GMRES, etc.) is a nonlinear operation. A fixed number of iterations of a method with a fixed polynomial, such as Chebyshev, is a linear operation so you don't need a flexible outer method. Ramakrishnan Thirumalaisamy writes: > Hi, > >

Re: [petsc-users] Finding PETSc from CMake

2022-04-21 Thread Jed Brown
Yeah, use this; it's distributed with base CMake. https://cmake.org/cmake/help/latest/module/FindPkgConfig.html CMake upstream recommends writing a ${Package}Config.cmake file, but petsc.pc contains the same semantic information and the conversion to CMake dialect can be lossy. Those

Re: [petsc-users] Fast triangular solve

2022-04-13 Thread Jed Brown
Yes, it's automatic when you use methods that have triangular solves, such as the default (incomplete LU). Peter Kavran writes: > Dear team, > > Could you tell me whether the method described in the paper: > > BARRY SMITH AND HONG ZHANG - SPARSE TRIANGULAR SOLVE REVISITED: DATA LAYOUT >

[petsc-users] PETSc support for Ukraine

2022-04-08 Thread Jed Brown
Dear PETSc community, The DOE Office of Science has offered to supplement current projects to support collaboration and hosting of students, postdoctoral researchers, and scientists who have been impacted by the conflict in Ukraine. This can include support via European universities. Details

Re: [petsc-users] Feature request for DMPlexCreateGmsh()/DMPlexCreateGmshFromFile()

2022-04-05 Thread Jed Brown
It's sort of available (see -dm_plex_gmsh_use_regions), but we still plan to support a better version of the translation you want. I'd have done it long ago, but have had more urgent things. https://gitlab.com/petsc/petsc/-/issues/689 If you'd like to start a merge request on this, we can

Re: [petsc-users] Regarding the status of VecSetValues(Blocked) for GPU vectors

2022-03-17 Thread Jed Brown
The question is about vectors. I think it will work, but haven't tested. Barry Smith writes: > We seem to be emphasizing using MatSetValuesCOO() for GPUs (can also be for > CPUs); in the main branch you can find a simple example in > src/mat/tutorials/ex18.c which demonstrates its use. > >

Re: [petsc-users] One question on configuring / compiling PETSc

2022-03-17 Thread Jed Brown
-march=native, which is also recognized by the new Intel compilers (icx), which are based on LLVM. Ernesto Prudencio via petsc-users writes: > Hi all. > > When compiling PETSc with INTEL compilers, we have been using the options > "-Ofast -xHost". Is there an equivalent to -xHost for GNU

Re: [petsc-users] How to obtain the local matrix from a global matrix in DMDA?

2022-03-14 Thread Jed Brown
Could you explain more of what you mean by "local matrix"? If you're thinking of finite elements, then that doesn't exist and can't readily be constructed except at assembly time (see MATIS, for example). If you mean an overlapping block, then MatGetSubMatrix() or MatGetSubMatrices(), as used

Re: [petsc-users] TSBDF prr-load higher order solution

2022-03-11 Thread Jed Brown
; mentioning already exist? > > Or you are simply sketching out what is going to be needed? > > Thank you, > > -Alfredo > > > On Thu, Mar 10, 2022 at 3:40 PM Zhang, Hong wrote: > >> >> > On Mar 10, 2022, at 2:51 PM, Jed Brown wrote: >&

Re: [petsc-users] TSBDF prr-load higher order solution

2022-03-10 Thread Jed Brown
ve any questions, > > -Alfredo > > On Wed, Mar 9, 2022 at 4:49 PM Zhang, Hong > mailto:hongzh...@anl.gov>> wrote: > TSTrajectory supports checkpointing for multistage methods and can certainly > be extended to multistep methods. But I doubt it is the best solution to > Al

Re: [petsc-users] TSBDF prr-load higher order solution

2022-03-10 Thread Jed Brown
doubt it is the best >> solution to Alfredo’s problem. Alfredo, can you elaborate a bit on what you >> would like to do? TSBDF_Restart is already using the previous solution to >> restart the integration with first-order BDF. >> >> Hong(Mr.) >> >> > On M

Re: [petsc-users] TSBDF prr-load higher order solution

2022-03-09 Thread Jed Brown
Can you restart using small low-order steps? Hong, does (or should) your trajectory stuff support an exact checkpointing scheme for BDF? I think we could add an interface to access the stored steps, but there are few things other than checkpointing that would make sense mathematically. Would

Re: [petsc-users] Two questions regarding SNESLinesearchPrecheck

2022-03-08 Thread Jed Brown
I think SNESLineSearchApply_Basic will clarify these points. Note that the pre-check is applied before "taking the step", so X is x_k. You're right that the sign is flipped on search direction Y, as it's using -lambda below. /* precheck */ ierr =

Re: [petsc-users] Preconditioner for LSQR

2022-02-28 Thread Jed Brown
This is a small problem for which direct Householder QR may be fast enough (depending on the rest of your application). For multi-node, you can use TSQR (backward stable like Householder) or Cholesky (unstable). julia> A = rand(20, 200); julia> @time Q, R = qr(A); 0.866989 seconds (14

Re: [petsc-users] Question about the performance of KSP solver

2022-02-27 Thread Jed Brown
revent such crashes. > >> On Feb 27, 2022, at 4:24 PM, Jed Brown wrote: >> >> I assume this would be running VecWAXPY on CPU (and GPU) with some empty >> ranks? I'd be mildly concerned about allocating GPU memory because a crash >> here would be

Re: [petsc-users] Question about the performance of KSP solver

2022-02-27 Thread Jed Brown
econds it could automatically run a few levels of streams > (taking presumably well less than a few seconds) and adjust suitable the > output. If the user runs, for example, 10min they surely don't mind .5 > seconds to get more useful information. > > > >> On Feb 27, 2022

Re: [petsc-users] Question about the performance of KSP solver

2022-02-27 Thread Jed Brown
Probably not implied by -log_view alone, but -streams_view or some such doing it automatically would save having to context switch elsewhere to obtain that data. Barry Smith writes: > We should think about have -log_view automatically running streams on > subsets of ranks and using the

Re: [petsc-users] Question about the performance of KSP solver

2022-02-27 Thread Jed Brown
This is pretty typical. You see the factorization time is significantly better (because their more compute-limited) but MatMult and MatSolve are about the same because they are limited by memory bandwidth. On most modern architectures, the bandwidth is saturated with 16 cores or so.

Re: [petsc-users] Configuring with CMake

2022-02-22 Thread Jed Brown
It would be good to report a reduced test case upstream. They may not fix it, but a lot of things related to static libraries don't work without coaxing and they'll never get fixed if people who use CMake with static libraries don't make their voices heard. "Palmer, Bruce J via petsc-users"

Re: [petsc-users] Cray perftools

2022-02-21 Thread Jed Brown
If you can share before/after output from -log_view, it would likely help localize. Another unintrusive thing (if you're allowed to run Linux perf) is to $ perf record --call-graph dwarf -F99 ./app [... runs ...] $ perf script | stackcollapse-perf | flamegraph > flame.svg and open flame.svg in

Re: [petsc-users] Kokkos Interface for PETSc

2022-02-15 Thread Jed Brown
We need to make these docs more explicit, but the short answer is configure with --download-kokkos --download-kokkos-kernels and run almost any example with -dm_mat_type aijkokkos -dm_vec_type kokkos. If you run with -log_view, you should see that all the flops take place on the device and

Re: [petsc-users] Creating multiple Vecs with petsc4py

2022-02-12 Thread Jed Brown
VecDuplicateVecs isn't implemented in petsc4py, but it internally just loops over VecDuplicate so you can use qs = [x.duplicate() for i in range(4)] y.maxpy(alphas, qs) where the Python binding here handles qs being a Python array. Samar Khatiwala writes: > Hello, > > I’d like to create an

Re: [petsc-users] Gmsh 8-noded quadrilateral

2022-02-11 Thread Jed Brown
ut the numerics. However, this does not look hard. Here >> is my try at it: >> >> https://gitlab.com/petsc/petsc/-/merge_requests/4838 >> >> Please tell me if this works and I will make a test and merge. >> >> Thanks, >> >> Matt >> >> On T

Re: [petsc-users] Gmsh 8-noded quadrilateral

2022-02-10 Thread Jed Brown
Susanne, do you want PetscFE to make the serendipity (8-node) finite element space or do you just want to read these meshes? I.e., would it be okay with you if the coordinates were placed in a Q_2 (9-node, biquadratic) finite element space? This won't matter if you're traversing the dofs per

Re: [petsc-users] [petsc-dev] MatPreallocatorPreallocate segfault with PETSC 3.16

2022-02-03 Thread Jed Brown
s > actually not allocate the nonzeros and just stores the nonzero structure. But > if this is not the case then of course I just duplicate the matrix. > > Thanks for the feedback. > >> Gesendet: Donnerstag, den 03.02.2022 um 03:09 Uhr >> Von: "Jed Brown" >> A

Re: [petsc-users] cannot open source file "petsc.h"

2022-02-03 Thread Jed Brown
"Evstafyeva,Tamara" writes: > Thanks for your prompt reply. I am attaching the makefile; the line for > execution “make all -j 4” > > I guess using both was my attempt at trying multiple things until they work – > using either one or the other produced the same error for me. petsc.pc isn't

Re: [petsc-users] cannot open source file "petsc.h"

2022-02-03 Thread Jed Brown
Hmm, usually we don't use BOTH the makefile includes and pkgconfig (as in Makefile.user). You can use either. If you share the whole file and the command line that executes, I think it'll be easy enough to fix. "Evstafyeva,Tamara" writes: > To whom it may concern, > > I am using a code that

Re: [petsc-users] [petsc-dev] MatPreallocatorPreallocate segfault with PETSC 3.16

2022-02-02 Thread Jed Brown
Marius Buerkle writes: > Thanks for they reply. Yes the example works, this is how I was doing it > before. But the matrix is rather big and i need a matrix with the same > structure at various points in my code. So it was convenient to create the > matrix with preallocate, destroy it after

Re: [petsc-users] Using Finite Difference Jacobian with TS

2022-02-02 Thread Jed Brown
Matthew Knepley writes: > On Wed, Feb 2, 2022 at 6:08 PM Jorti, Zakariae via petsc-users < > petsc-users@mcs.anl.gov> wrote: > >> Hello, >> >> I am using a TS to solve a differential algebraic equation (DAE). >> I do not provide the Jacobian matrix but instead set the TS to use a >> finite

Re: [petsc-users] [petsc-dev] MatPreallocatorPreallocate segfault with PETSC 3.16

2022-02-01 Thread Jed Brown
Stefano Zampini writes: > Il giorno mar 1 feb 2022 alle ore 18:34 Jed Brown ha > scritto: > >> Patrick Sanan writes: >> >> > Am Di., 1. Feb. 2022 um 16:20 Uhr schrieb Jed Brown : >> > >> >> Patrick Sanan writes: >>

Re: [petsc-users] [petsc-dev] MatPreallocatorPreallocate segfault with PETSC 3.16

2022-02-01 Thread Jed Brown
Patrick Sanan writes: > Am Di., 1. Feb. 2022 um 16:20 Uhr schrieb Jed Brown : > >> Patrick Sanan writes: >> >> > Sorry about the delay on this. I can reproduce. >> > >> > This regression appears to be a result of this optimization: >> >

Re: [petsc-users] [petsc-dev] MatPreallocatorPreallocate segfault with PETSC 3.16

2022-02-01 Thread Jed Brown
Patrick Sanan writes: > Sorry about the delay on this. I can reproduce. > > This regression appears to be a result of this optimization: > https://gitlab.com/petsc/petsc/-/merge_requests/4273 Thanks for tracking this down. Is there a reason to prefer preallocating twice ierr =

Re: [petsc-users] Crusher configure problem

2022-01-28 Thread Jed Brown
Let's move Crusher stuff to petsc-maint. If top/htop doesn't make it obvious why there is no memory, I think you should follow up with OLCF support. Mark Adams writes: > Something is very messed up on Crusher. I've never seen this "Cannot > allocate memory", but see it for everything: > >

Re: [petsc-users] Hypre in Petsc

2022-01-25 Thread Jed Brown
"multigrid as a solver" generally means stationary (Richardson) iterations: -ksp_type richardson -pc_type hypre This might not converge, and you'll almost certainly see faster convergence if you use it with a Krylov method. -ksp_type cg -pc_type hypre if your problem is SPD. sijie tang

Re: [petsc-users] hypre / hip usage

2022-01-24 Thread Jed Brown
"Paul T. Bauman" writes: > 1. `rocgdb` will be in your PATH when the `rocm` module is loaded. This is > gdb, but with some extra AMDGPU goodies. AFAIK, you cannot, yet, do > stepping through a kernel in the source (only the ISA), but you can query > device variables in host code, print their

Re: [petsc-users] hypre / hip usage

2022-01-21 Thread Jed Brown
"Paul T. Bauman" writes: > On Fri, Jan 21, 2022 at 8:52 AM Paul T. Bauman wrote: >> Yes. The way HYPRE's memory model is setup is that ALL GPU allocations are >> "native" (i.e. [cuda,hip]Malloc) or, if unified memory is enabled, then ALL >> GPU allocations are unified memory (i.e.

Re: [petsc-users] hypre / hip usage

2022-01-21 Thread Jed Brown
Mark Adams writes: >> >> >> >> > Is there a way to tell from log_view data that hypre is running on the >> GPU? >> >> Is it clear from data transfer within PCApply? >> >> > Well, this does not look right. '-mat_type hypre' fails. I guess we have to > get that working or could/should it work with

Re: [petsc-users] hypre / hip usage

2022-01-21 Thread Jed Brown
"Paul T. Bauman" writes: > On Fri, Jan 21, 2022 at 8:19 AM Jed Brown wrote: > >> Mark Adams writes: >> >> > Two questions about hypre on HIP: >> > >> > * I am doing this now. Is this correct? >> > >> > '--downloa

Re: [petsc-users] hypre / hip usage

2022-01-21 Thread Jed Brown
Mark Adams writes: > Two questions about hypre on HIP: > > * I am doing this now. Is this correct? > > '--download-hypre', > '--download-hypre-configure-arguments=--enable-unified-memory', > '--with-hypre-gpuarch=gfx90a', I's recommended to use --with-hip-arch=gfx90a, which forwards

Re: [petsc-users] Cannot eagerly initialize cuda, as doing so results in cuda error 35 (cudaErrorInsufficientDriver) : CUDA driver version is insufficient for CUDA runtime version

2022-01-20 Thread Jed Brown
Junchao Zhang writes: > I don't see values using PetscUnlikely() today. It's usually premature optimization and PetscUnlikelyDebug makes it too easy to skip important checks. But at the time when I added PetscUnlikely, it was important for CHKERRQ(ierr). Specifically, without PetsUnlikely,

Re: [petsc-users] Cannot eagerly initialize cuda, as doing so results in cuda error 35 (cudaErrorInsufficientDriver) : CUDA driver version is insufficient for CUDA runtime version

2022-01-20 Thread Jed Brown
LEL) > at > /home/kongf/workhome/sawtooth/moosegpu/scripts/../libmesh/installed/include/libmesh/petsc_vector.h:693 > > On Thu, Jan 20, 2022 at 1:09 PM Fande Kong wrote: > >> Thanks, Jed, >> >> This worked! >> >> Fande >> >> On Wed, Jan 19, 202

Re: [petsc-users] Cannot eagerly initialize cuda, as doing so results in cuda error 35 (cudaErrorInsufficientDriver) : CUDA driver version is insufficient for CUDA runtime version

2022-01-19 Thread Jed Brown
Fande Kong writes: > On Wed, Jan 19, 2022 at 11:39 AM Jacob Faibussowitsch > wrote: > >> Are you running on login nodes or compute nodes (I can’t seem to tell from >> the configure.log)? >> > > I was compiling codes on login nodes, and running codes on compute nodes. > Login nodes do not have

Re: [petsc-users] PetscFV without ghost boundary conditions

2022-01-17 Thread Jed Brown
Matthew Knepley writes: > What you suggest (flux boundary conditions) would require short-circuiting > the Riemann solver loop to stick in the flux. It is doable, but we opted > against it in the initial > design because it seemed more complex than ghost cells and did not seem to > have any

Re: [petsc-users] PetscFV without ghost boundary conditions

2022-01-17 Thread Jed Brown
Thibault Bridel-Bertomeu writes: > Sorry I wasn't clear I think. > I was thinking that for finite volume codes, you have two options: either > you use ghost cells that you fill up with the appropriate primitive state > for the boundary condition, or you directly enforce the boundary condition >

Re: [petsc-users] PetscFV without ghost boundary conditions

2022-01-17 Thread Jed Brown
Thibault Bridel-Bertomeu writes: > Hi everyone, > > I was wondering if it was possible to build a solver based on PetscFV > without using ghost cells for the boundary conditions ? > Would it be possible to call PetscDSAddBoundary with DM_BC_ESSENTIAL and so > on instead of DM_BC_NATURAL_RIEMANN

Re: [petsc-users] DMPlex filter with Face Sets

2022-01-15 Thread Jed Brown
Thibault Bridel-Bertomeu writes: > I think it would be perfect if the 0-sized labels were also completely > filtered out. Is that something that you could add to the > DMPlexFliterLabels_Internal function ? Why do you want it filtered? Determining that it's zero sized requires all processes

Re: [petsc-users] Finite difference approximation of Jacobian

2022-01-11 Thread Jed Brown
gt; >> On Jan 12, 2022, at 12:43 AM, Jed Brown wrote: >> >> I agree with this and even started a branch jed/mat-hash in (yikes!) 2017. I >> think it should be default if no preallocation functions are called. But it >> isn't exactly the MATPREALLOCATOR code bec

Re: [petsc-users] Fluid-Structure interaction with multiple DMPlex

2022-01-11 Thread Jed Brown
Matthew Knepley writes: > Hmm, let's start here because that does not make sense to me. Can you write > down the mathematical model? Usually I think of temperature as being > a continuous field. I have only seen discontinuities for rareified gases. Well, you can still model it as a

Re: [petsc-users] Finite difference approximation of Jacobian

2022-01-11 Thread Jed Brown
I agree with this and even started a branch jed/mat-hash in (yikes!) 2017. I think it should be default if no preallocation functions are called. But it isn't exactly the MATPREALLOCATOR code because it needs to handle values too. Should not be a lot of code and will essentially remove this FAQ

Re: [petsc-users] A problem with MatFDColoringSetFunction

2022-01-11 Thread Jed Brown
Barry Smith writes: > Thanks for the alternative. > > @jed does this mean we need to do our casting of functions like this > everywhere? Whenever our interfaces accept a function with a non-unique prototype, the interface should take void(*)(void) instead of PetscErrorCode(*)(void). I

Re: [petsc-users] Fluid-Structure interaction with multiple DMPlex

2022-01-11 Thread Jed Brown
Thibault Bridel-Bertomeu writes: > Hello everybody, > > So, let's say i have the mesh attached to this email that has 2 physical > surfaces and 5 physical curves. This gives me 2 strata in the "Cell Sets" > and 5 strata in the "Face Sets". > Would something like the following piece of code be

Re: [petsc-users] Fluid-Structure interaction with multiple DMPlex

2022-01-09 Thread Jed Brown
Thibault Bridel-Bertomeu writes: > However if you use IMEX for strong coupling of the two physics solved in > each field, then it means you need to write a single set of PDEs that > covers everything, don’t you ? > If I want to solve Euler equations in one PetscDS and heat equation in the >

Re: [petsc-users] Building apps on Cori (FindPETSc.cmake)

2022-01-05 Thread Jed Brown
Yeah, recommendation is to use FindPkgConfig.cmake. https://petsc.org/release/faq/#can-i-use-cmake-to-build-my-own-project-that-depends-on-petsc If you are forced to use a very old CMake, then you need to inspect CMakeFiles/CMakeOutput.log and CMakeFiles/CMakeError.log. These files are

Re: [petsc-users] [EXTERNAL] Re: DM misuse causes massive memory leak?

2022-01-05 Thread Jed Brown
dinates(PetscInt dim, PetscReal time, const PetscReal x[], > PetscInt Nf, PetscScalar *u, void *ctx){ > const PetscInt Ncomp = dim; > PetscInt comp; > for (comp = 0; comp < Ncomp; ++comp) u[comp] = 0.0; > return 0; > } > > >

Re: [petsc-users] [EXTERNAL] Re: DM misuse causes massive memory leak?

2022-01-04 Thread Jed Brown
]PETSC ERROR: #4 main() at /home/jesus/SAND/FEA/3D/gmshBACKUP4.c:215 > [0]PETSC ERROR: No PETSc Option Table entries > [0]PETSC ERROR: End of Error Message ---send entire error > message to petsc-ma...@mcs.anl.gov-- > > > > > > > __

Re: [petsc-users] DM misuse causes massive memory leak?

2021-12-29 Thread Jed Brown
"Ferrand, Jesus A." writes: > Dear PETSc Team: > > I have a question about DM and PetscSection. Say I import a mesh (for FEM > purposes) and create a DMPlex for it. I then use PetscSections to set degrees > of freedom per "point" (by point I mean vertices, lines, faces, and cells). I > then

Re: [petsc-users] KSPBuildResidual and KSPType compatibility

2021-12-07 Thread Jed Brown
"Fischer, Greg A. via petsc-users" writes: > I've attached typical examples of "A" and "b". Do these qualify as large > values? Yeah, the matrix values are of order 1e12. Usually modelers choose units so that these are closer to order 1. (One can do this by formal non-dimensionalization, but

Re: [petsc-users] KSPBuildResidual and KSPType compatibility

2021-12-06 Thread Jed Brown
is to amortize some vector and reduction costs). It'd be worth comparing when you use normal BCGS. "Fischer, Greg A." writes: > I tried your suggestion, but the values are still quite different. > > -Original Message- > From: Jed Brown > Sent: Monday, December 6, 20

Re: [petsc-users] KSPBuildResidual and KSPType compatibility

2021-12-06 Thread Jed Brown
"Fischer, Greg A. via petsc-users" writes: > Hello petsc-users, > > I would like to check convergence against the infinity norm, so I defined my > own convergence test routine with KSPSetConvergenceTest. (I understand that > it may be computationally expensive.) > > I would like to do this

Re: [petsc-users] Doubt about BT and BASIC NEWTONLS

2021-11-17 Thread Jed Brown
Francesc Levrero-Florencio writes: > Hi Barry, > > I believe that what you are referring to is what Jed is referring to in > this thread, am I right? > https://scicomp.stackexchange.com/questions/3298/appropriate-space-for-weak-solutions-to-an-elliptical-pde-with-mixed-inhomogeneo/3300#3300

Re: [petsc-users] Strange behavior of TS after setting hand-coded Jacobian

2021-11-08 Thread Jed Brown
Barry Smith writes: > Note that you get the same result if you think of the problem as a DAE > because the residual equation is R_{V_1} = V_1^{n+1} and the derivative of > this with respect to V_1^{n+1} is 1 (not zero). So you still end up with a > nonzero on the diagonal, not zero.

Re: [petsc-users] Tutorials test case cannot run in parallel

2021-11-03 Thread Jed Brown
Mark Adams writes: > Do we have a policy on this? I know some tests say they are serial. > Maybe just say that tests are only supported for the parameters in the test. If a test is serial, it should check the size of PETSC_COMM_WORLD and error if it's bigger than 1. It doesn't help to have a

Re: [petsc-users] How to construct DMPlex of cells with different topological dimension?

2021-11-02 Thread Jed Brown
袁煕 writes: > Well! All objects in this world could definitely be modeled as 3D volumes. > But considering costs of meshing and following calculations, in most cases > it is neither practical nor necessary. And in some specific cases, e.g., to > model cell membranes, 2D membrane elements may

Re: [petsc-users] Why PetscDestroy global collective semantics?

2021-10-22 Thread Jed Brown
Junchao Zhang writes: > On Fri, Oct 22, 2021 at 9:13 PM Barry Smith wrote: > >> >> One technical reason is that PetscHeaderDestroy_Private() may call >> PetscCommDestroy() which may call MPI_Comm_free() which is defined by the >> standard to be collective. Though PETSc tries to limit its use

Re: [petsc-users] TS initial guess

2021-10-15 Thread Jed Brown
Some methods have extrapolation options. For THETA (which includes backward Euler as theta=1), you can use -ts_theta_initial_guess_extrapolate. This type of extrapolation is sometimes unstable or may produce an invalid state, such as negative density. I'm assuming in your question that you're

Re: [petsc-users] HDF5 corruption

2021-10-07 Thread Jed Brown
Adrian Croucher writes: > hi Jed, > > It looked to me like a call to h5f_flush() is all that is required. > > Some people said there would be a performance hit (maybe ~ 10% slower), > which would be the trade-off for increased reliability. So if this were > made available via

Re: [petsc-users] HDF5 corruption

2021-10-07 Thread Jed Brown
Adrian Croucher writes: > hi, > > One of the users of my PETSc-based code has reported that HDF5 output > files can be corrupted and unusable if e.g. the run is killed. I've just > done a bit of reading about this and it appears to be a known issue with > HDF5. > > Some people suggest

Re: [petsc-users] FGMRES and BCGS

2021-09-29 Thread Jed Brown
It is not surprising. BCGS uses less memory for the Krylov vectors, but that might be a small fraction of the total memory used (considering your matrix and GAMG). FGMRES(30) needs 60 work vectors (2 per iteration). If you're using a linear (non-iterative) preconditioner, then you don't need a

Re: [petsc-users] Mat preallocation in case of variable stencils

2021-08-31 Thread Jed Brown
Matteo Semplice writes: > Hi. > > We are writing a code for a FD scheme on an irregular domain and thus > the local stencil is quite variable: we have inner nodes, boundary nodes > and inactive nodes, each with their own stencil type and offset with > respect to the grid node. We currently

Re: [petsc-users] Static Library based app for petsc

2021-08-24 Thread Jed Brown
PETSc does not "wrap" cout. Creating a library first, with an executable front-end that most/all initial users will use is generally good design. More users of the library emerge as people try to do more advanced/custom things that are not appropriate to do with the executable. "Abhishek

Re: [petsc-users] Reaching limit number of communicator with Spectrum MPI

2021-08-19 Thread Jed Brown
Junchao Zhang writes: > Hi, Feimi, > I need to consult Jed (cc'ed). > Jed, is this an example of > https://lists.mcs.anl.gov/mailman/htdig/petsc-dev/2018-April/thread.html#22663? > If Feimi really can not free matrices, then we just need to attach a > hypre-comm to a petsc inner comm, and

Re: [petsc-users] malloc error

2021-08-16 Thread Jed Brown
"Jorti, Zakariae via petsc-users" writes: > Hello, > > > I am using TSSolve to solve a linear problem. > > In the FormIJacobian function that I provide to TSSetIJacobian, I first set > the coefficients of both J and Jpre matrices the same way (J and Jpre > matrices are equal in the first

Re: [petsc-users] Is PetscSFBcast deterministic (just checking, I assume it is)

2021-07-30 Thread Jed Brown
>> On Jul 29, 2021, at 11:45 AM, Jed Brown wrote: >> >> Provided it's the same SF, yes. (We use MPI_Waitall instead of MPI_Waitsome >> or this, though we may be able to shave some time using MPI_Waitsome.) >> >> Matrix assembly from the stash is a common pla

Re: [petsc-users] Is PetscSFBcast deterministic (just checking, I assume it is)

2021-07-29 Thread Jed Brown
Provided it's the same SF, yes. (We use MPI_Waitall instead of MPI_Waitsome or this, though we may be able to shave some time using MPI_Waitsome.) Matrix assembly from the stash is a common place; try -matstash_reproduce. Mark Adams writes: > GAMG is not deterministic and I'm trying to figure

Re: [petsc-users] is PETSc's random deterministic?

2021-07-28 Thread Jed Brown
Barry Smith writes: > As we are moving the PETSc docs to petsc.org there may > be a bit of time before google again automatically finds the most appropriate > page. At the moment google and duckduckgo seem terribly confused. The 301 Redirects are evidently still missing.

Re: [petsc-users] [SLEPc] Computing Smallest Eigenvalue+Eigenvector of Many Small Matrices

2021-07-06 Thread Jed Brown
Have you tried just calling LAPACK directly? (You could try dsyevx to see if there's something to gain by computing less than all the eigenvalues.) I'm not aware of a batched interface at this time, but that's what you'd want for performance. Jacob Faibussowitsch writes: > Hello PETSc/SLEPc

Re: [petsc-users] MatNest with Shell blocks for multipysics

2021-07-01 Thread Jed Brown
Matteo Semplice writes: > Hi. > > We are designing a PETSc application that will employ a SNES solver on a > multiphysics problem whose jacobian will have a 2x2 block form, say > A=[A00,A01;A10,A11]. We already have code for the top left block A_00 (a > MatShell and a related Shell

Re: [petsc-users] Scatter parallel Vec to sequential Vec on non-zeroth process

2021-07-01 Thread Jed Brown
Peder Jørgensgaard Olesen writes: > Each process is assigned an indexed subset of the tasks (the tasks are of > constant size), and, for each task index, the relevant data is scattered as a > SEQVEC to the process (this is done for all processes in each step, using an > adaption of the code

Re: [petsc-users] Scatter parallel Vec to sequential Vec on non-zeroth process

2021-06-30 Thread Jed Brown
Peder Jørgensgaard Olesen via petsc-users writes: > I'm distributing a set of independent tasks over different processes, so I'm > afraid sending everything to the zeroth process would rather thoroughly > defeat the purpose of what I'm doing. It sounds like you're going to run this a

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