Re: [petsc-users] How to confirm the performance of asynchronous computations

2021-01-21 Thread Barry Smith
ierr = VecNormBegin(u,NORM_2,); ierr = PetscCommSplitReductionBegin(PetscObjectComm((PetscObject)Ax)); How come you call this on Ax and not on u? For clarity, if nothing else, I think you should call it on u. comb.c has /* Split phase global vector reductions with support for

Re: [petsc-users] Kokkos with OpenMP

2021-01-17 Thread Barry Smith
Mark, Looks like you tried to do two things at once, you removed the fopenmp and put back the --with-cuda. Like I said if you want PETSc to build OpenMP and CUDA you need to remove this line (and some others) from kokkos.py if self.openmp.found + pthreadfound + self.cuda.found

Re: [petsc-users] Kokkos with OpenMP

2021-01-17 Thread Barry Smith
Mark, > On Jan 17, 2021, at 3:08 PM, Mark Adams wrote: > > I am getting this Kokkos build failure with OpenMP. Here is the problem. You set --CXXOPTFLAGS="-g -O0 -fPIC -fopenmp" to indicate how to compile for OpenMP but when ./configure checks the installed KokkosKernel include files

Re: [petsc-users] Error of MatMPIAIJSetPreallocation

2021-01-14 Thread Barry Smith
A merge request to catch more cases of integer overflow https://gitlab.com/petsc/petsc/-/merge_requests/3562 > On Jan 14, 2021, at 5:18 PM, Barry Smith wrote: > > > These giant sizes are sometime an indication of integer overflow. Did you > previously build PETSc with th

Re: [petsc-users] Error of MatMPIAIJSetPreallocation

2021-01-14 Thread Barry Smith
These giant sizes are sometime an indication of integer overflow. Did you previously build PETSc with the --with-64-bit-indices ? Are you sure the d_nnz and o_nnz arguments are correct and not too large? Barry > On Jan 14, 2021, at 4:13 PM, Matthew Knepley wrote: > > On Thu, Jan 14,

Re: [petsc-users] PetscAllreduceBarrierCheck is valgrind clean?

2021-01-13 Thread Barry Smith
Fande, Look at https://scm.mvapich.cse.ohio-state.edu/svn/mpi/mvapich2/trunk/src/mpid/ch3/channels/common/src/detect/arch/mv2_arch_detect.c cpubind_set = hwloc_bitmap_alloc(); but I don't find a corresponding hwloc_bitmap_free(cpubind_set ); in get_socket_bound_info().

Re: [petsc-users] counter->tag = *maxval - 128

2021-01-13 Thread Barry Smith
no longer needed. Barry > On Jan 13, 2021, at 12:04 PM, Fande Kong wrote: > > > > On Tue, Jan 12, 2021 at 6:49 PM Barry Smith <mailto:bsm...@petsc.dev>> wrote: > >Fande, > >/* hope that any still active tags were issued right at the beginning of > t

Re: [petsc-users] counter->tag = *maxval - 128

2021-01-12 Thread Barry Smith
Fande, /* hope that any still active tags were issued right at the beginning of the run */ PETSc actually starts with *maxval (see line 130). It is only when it runs out that it does this silly thing for the reason indicated in the comment. PETSc should actually keep track which

Re: [petsc-users] Not displaying petsc options with -help

2021-01-11 Thread Barry Smith
Change the value of PetscHelpPrintf() to do nothing before PetscInitialize() and then change it PetscHelpPrintfDefault() just around your options. I have fixed up the manual page in https://gitlab.com/petsc/petsc/-/merge_requests/3553 But are you sure you want to do this? Even

Re: [petsc-users] calling both MatSeqAIJSetPreallocation and MatMPIAIJSetPreallocation

2021-01-11 Thread Barry Smith
Sam, In the master development branch of PETSc Stefano has started to add support for directly providing matrix entries in "coordinate" form (COO) (the triple arrays you use). It supports MatSetPreallocationCOO() and MatSetValuesCOO(). Currently Stefano has optimized it for

Re: [petsc-users] convergence problem- 3D Cahn Hillard

2021-01-10 Thread Barry Smith
gree. What are your boundary conditions? Is it possible there is a null space lurking around, unlikely since the direct solver has no issues but if so it could cause difficulties. Barry > Best, > Sepideh > From: Barry Smith mailto:bsm...@petsc.dev>> > Sent: Thursday, Janu

Re: [petsc-users] convergence problem- 3D Cahn Hillard

2021-01-07 Thread Barry Smith
t; > From: Jed Brown mailto:j...@jedbrown.org>> > Sent: Tuesday, January 5, 2021 10:31 PM > To: Matthew Knepley mailto:knep...@gmail.com>>; Barry > Smith mailto:bsm...@petsc.dev>> > Cc: petsc-users@mcs.anl.gov <mailto:petsc-users@mcs.anl.gov> > mailto:petsc-us

Re: [petsc-users] MatScale returns different results depending on matrix size

2021-01-06 Thread Barry Smith
$ ./main -start_in_debugger noxterm PETSC: Attaching lldb to ./main of pid 17914 on Barry-Smiths-MacBook-Pro.local (lldb) process attach --pid 17914 warning: (x86_64) /Users/barrysmith/soft/clang-ifort/lib/libmpifort.12.dylib empty dSYM file detected, dSYM was created with an executable with no

Re: [petsc-users] Elementwise pow/exponential-function on PETSc-vectors and matrices

2021-01-05 Thread Barry Smith
Use VecGetArray() and then loop over the array entries performing whatever element operations you like. For dense matrices use MatDenseGetArray() and loop over the entries. For sequential AIJ matrices uses MatSeqAIJGetArray() For MPIAIJ use MatMPIAIJGetSeqAIJ() then use

Re: [petsc-users] Error occurred when version change

2020-12-29 Thread Barry Smith
der if there are > some inner functions or parameters which changes with different versions > leading to the disconvergence in 3.4.5 version ? > > Best regards, > Zhaoni Zhu > > > > -- Original -- > From: "Barry Smith"; > D

Re: [petsc-users] Files saved with PetscViewerBinaryOpen - Binary file format ?

2020-12-29 Thread Barry Smith
https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Vec/VecLoad.html and https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatLoad.html

Re: [petsc-users] Error occurred when version change

2020-12-29 Thread Barry Smith
It looks like both converged in your image, just at different rates? Note the two sides used different number of linear iterations, my guess is some default behavior of the linear solvers changed between those two ancient releases. First make sure both are using identical linear solvers.

Re: [petsc-users] TS tutorial ex11 in Fortran

2020-12-28 Thread Barry Smith
gt; >> PetscFunctionReturn(0); > >> } > >> > >> > Can anyone develop that idea ? Because for TSAdaptRegister, i guess the > >> > wrapper would start like : > >> > > >> > PETSC_EXTERN void tsadaptre

Re: [petsc-users] TS tutorial ex11 in Fortran

2020-12-22 Thread Barry Smith
ve any idea what could be going wrong with those two wrappers ? > > Thank you very much in advance !! > > Thibault > > Le ven. 18 déc. 2020 à 11:02, Thibault Bridel-Bertomeu > <mailto:thibault.bridelberto...@gmail.com>> a écrit : > Aah that is a nice trick,

Re: [petsc-users] Parsing user-defined variables using YAML

2020-12-21 Thread Barry Smith
You can make up your own options and provide them in YAML format then query for them in your PETSc code using the routines Blaise pointed out. There is no restriction that the arguments need to be only pre-defined PETSc options. Barry As documented the YAML format supported is very

Re: [petsc-users] Output cell data related to DMDA

2020-12-18 Thread Barry Smith
erstanding is that DMCreateGlobalVector will create a vector >>> associated with the field/discretization/nodal unknowns/etc (that would be >>> PETSC_VTK_POINT_FIELD?), which is not what I would like to visualize. >>> >>> Could you point me to the right direction to look at

Re: [petsc-users] Output cell data related to DMDA

2020-12-18 Thread Barry Smith
; > Could you point me to the right direction to look at? > > If this is not possible with VTK interface, I am fine to go for other viewer > formats (maybe it’s coincidentally easier to visualize in MATLAB). > > Sincerely, > Denis > >> Am 18.12.2020 um 10:03 schrieb

Re: [petsc-users] TS tutorial ex11 in Fortran

2020-12-18 Thread Barry Smith
s possible then so that specialists can indeed > have a look. Do I have to fork PETSc to start a MR or are PETSc repo settings > such that can I push a branch from the PETSc clone I got ? > > Thibault > > > Le mer. 16 déc. 2020 à 07:47, Barry Smith <mailto:bs

Re: [petsc-users] Output cell data related to DMDA

2020-12-18 Thread Barry Smith
> On Dec 18, 2020, at 2:29 AM, Denis Davydov wrote: > > Hi Matt, > > By global vector you mean one created with > > VecCreateMPI(..., nel, PETSC_DETERMINE,...) > > ? If so, that gives segfault (even with 1 MPI process) in user write > function, which is just > > VecView((Vec)obj,viewer);

Re: [petsc-users] TS tutorial ex11 in Fortran

2020-12-15 Thread Barry Smith
I have got something working. By the > way, does the fortran-version of the example have to be a single file ? If my > push contains a directory with several files (different modules and the > main), and the Makefile that goes with it, is that ok ? > > Thibault Bridel-Bertomeu > &

Re: [petsc-users] TS tutorial ex11 in Fortran

2020-12-15 Thread Barry Smith
This is great. If you make a branch off of the PETSc git repository with these additions and work on ex11 you can make a merge request and we can run the code easily on all our test systems (for security reasons one of use needs to launch the tests from your MR).

Re: [petsc-users] Petsc makefile and PETSC_COMPILE variable

2020-12-15 Thread Barry Smith
Alex, Since you are explicitly defining your rules you might as well just do it completely, so use something like >> objects/%.o: src/%.c $(DEP) >>${PCC} -c $< -o $@ ${PCC_FLAGS} ${PFLAGS} ${CCPPFLAGS} The P indicates either C and C flags or C++ compiler and its flags if

Re: [petsc-users] valgrind with petscmpiexec

2020-12-15 Thread Barry Smith
No idea. Perhaps petscmpiexec could be modified so it only ran valgrind on the first 10 ranks? Not clear how to do that. Or valgrind should get a MR that removes this small arbitrary limitation on the number of processes. 576 is so 2000 :-) Barry > On Dec 14, 2020, at 11:59 PM, Fande

Re: [petsc-users] Transform of algorithm containing zgemv/FFT/Slicing into PETSc-functions

2020-12-14 Thread Barry Smith via petsc-users
I think you can again use MatDenseGetArray() and do the copies directly respecting the shift that you desire. Each process will just do the local rows so you need not worry about parallelism. I think it may be as simple as get the array pointer for A, shift it by number of local rows *

Re: [petsc-users] TS tutorial ex11 in Fortran

2020-12-12 Thread Barry Smith
rtran(vin,v); *ierr = DMView(*da,v); } dm/interface/ftn-custom/zdmf.c > > Thank you very much again, > > Thibault Bridel-Bertomeu > > Le sam. 12 déc. 2020 à 21:48, Barry Smith <mailto:bsm...@petsc.dev>> a écrit : > >PETSc Fortran interfaces are a combination o

Re: [petsc-users] TS tutorial ex11 in Fortran

2020-12-12 Thread Barry Smith
PETSc Fortran interfaces are a combination of automatically generated and manually generated. For any C PETSc function if the manual page begins with /*@ it generates the Fortran interface automatically (make allfortranstubs). If it begins /*@C then either the Fortran interface is

Re: [petsc-users] Usage of PETSC_NULL_INTEGER for PCASMGetSubKSP via Fortran interface

2020-12-11 Thread Barry Smith
Nathan, This is an oversight on our part. We need to provide each possibility for the function arguments as scalars or arrays, some of them are missing in the interface definition. git checkout barry/2020-12-11/fix-fortran-pcasmgetsubksp/release will get you the fix. Barry

Re: [petsc-users] TSAdjoint multilevel checkpointing running out of memory

2020-12-10 Thread Barry Smith
Anton, You can try running a smaller problem that does not run out of memory with -log_view -log_view_memory. This should show in the right most columns how much memory is being used and added for each event in the computation and might help you track down where the memory is being

Re: [petsc-users] Is there a way to estimate total memory prior to solve

2020-12-10 Thread Barry Smith
Randy This is a great question, I have made an issue based on it https://gitlab.com/petsc/petsc/-/issues/799 It is difficult, but not impossible to get some bounds on the memory required, but it would need to be done for each

Re: [petsc-users] PETSc with MUMPS

2020-12-09 Thread Barry Smith
> So I think the installation is complete. However, when I run my dealii codes, > I still received the same error message > “ > Additional information: > Your PETSc installation does not include a copy of the MUMPS package > necessary for this solver. You will need to configure PETSc so

Re: [petsc-users] Setting an unknown initial guess

2020-12-08 Thread Barry Smith
David, Let me rephrase what you are saying so I understand it. You have multiple linear solves in time stepping (one linear solve per time step?) and it you call KSPSetInitialGuessNonzero(ksp,PETSC_TRUE); after the first solve then the later solves converge (using the solution to

Re: [petsc-users] Multiplying a row-vector to each row in a dense matrix, sliced or full

2020-12-08 Thread Barry Smith
Roland, You would need an algorithm to decide which entries of the vector you wish to use and then make sure those entries end up on the appropriate MPI process before the matrix vector product. You would use VecScatterCreate() and VecScatterBegin/End to move the vector entries to the

Re: [petsc-users] PetscBagView issues with SAWs

2020-12-05 Thread Barry Smith
Zane, I'm sorry I didn't answer this sooner. We simply don't have the code for PetscBagView() with SAWS at this time. Unfortunately I don't have the time to write it now, basically you can extend PetscBagView() with a new else if () for the SAWs viewer and then publish the Bag items

Re: [petsc-users] Usage of parallel FFT for doing batch 1d-FFTs over the columns of a dense 2d-matrix

2020-12-04 Thread Barry Smith
Roland, If you store your matrix as described in a parallel PETSc dense matrix then you should be able to call fftw_plan_many_dft() directly on the value obtained with MatDenseGetArray(). You just need to pass the arguments regarding column major ordering appropriately. Probably

Re: [petsc-users] CPU speed or DRAM speed bottlenecks ?

2020-12-03 Thread Barry Smith
> On Dec 3, 2020, at 2:25 PM, C B wrote: > > Resorting to your expertise in software performance: > > Subject: Looking for a crude assessment of CPU speed or DRAM speed > bottlenecks in shared memory multi-core PCs > > On a typical PC with one Xeon CPU (8 cores), a serial code runs a case

Re: [petsc-users] Using Petsc-Matlab engine on a cluster

2020-11-28 Thread Barry Smith
t; Browse and locate the license file. > > > > Matlab is activated and ready to use. > > > > From: Amneet Bhalla mailto:mail2amn...@gmail.com>> > Date: Tuesday, November 10, 2020 at 6:10 PM > To: Barry Smith mailto:bsm...@petsc.dev>> > Cc: Kaus

Re: [petsc-users] Using Petsc-Matlab engine on a cluster

2020-11-28 Thread Barry Smith
std::cout << "\nsample_size = " << mpc->sample_size << std::endl; > > mpc->F_past.resize(mpc->sample_size); > mpc->t_past.resize(mpc->sample_size); > > double dt = input_db->getDouble("

Re: [petsc-users] rtol convergence

2020-11-27 Thread Barry Smith
Nicola, With left preconditioner it is actually ||r(i)||/|| B b || < 1.e-7 as the stopping criteria (note the B inside the norm). Where B is the action of the preconditioner and r(0) = B b which is printed on the first line as 5.033493299009e+03 With left preconditioning

Re: [petsc-users] CVODE N_Vector PETSc interface gives a memory corruption error

2020-11-19 Thread Barry Smith
> On Nov 19, 2020, at 9:04 AM, Praharsh Suryadevara via petsc-users > wrote: > > Thanks! > The main reason is I want to be able to use SNES within CVODE as they > state in the sundials manual; however, the notes in the documentation > here >

Re: [petsc-users] Install PETSc 3.14 with Conda type environment

2020-11-15 Thread Barry Smith
cs.anl.gov>> > Date: Sunday, November 15, 2020 at 5:03 PM > To: Barry Smith mailto:bsm...@petsc.dev>> > Cc: petsc-users@mcs.anl.gov <mailto:petsc-users@mcs.anl.gov> > mailto:petsc-users@mcs.anl.gov>> > Subject: Re: [petsc-users] Install PETSc 3.14 with Conda

Re: [petsc-users] Install PETSc 3.14 with Conda type environment

2020-11-15 Thread Barry Smith
Ling, Configure is failing here. TESTING: checkCPreprocessor from config.setCompilers(config/BuildSystem/config/setCompilers.py:699) Locate a functional C preprocessor Checking for program /Users/lzou/miniconda3/bin/gcc...found Defined make macro "CPP" to "gcc -E"

Re: [petsc-users] How to correctly call MatXAIJSetPreallocation for MATIS?

2020-11-11 Thread Barry Smith
> On Nov 10, 2020, at 11:10 PM, Eric Chamberland > wrote: > > Hi, > > I am trying to add support for MATIS in our code to be able to use PCBDDC and > others. > > So far, I have modify our matrix creation to add a call to > MatSetLocalToGlobalMapping and also modified our non-zeros count

Re: [petsc-users] Using Petsc-Matlab engine on a cluster

2020-11-10 Thread Barry Smith
In the git branch barry/2020-11-10/add-matlab-engine-host I have added the option -matlab_engine_host hostname Note this does require you have ssh access to hostname from where your PETSc program is running which may require setting up some ssh files Good luck Barry > On

Re: [petsc-users] Using Petsc-Matlab engine on a cluster

2020-11-10 Thread Barry Smith
Kaustubh In theory this should be possible, I looked at our code and it looks like a little bit is missing for this to work. I'll send you a branch to try later today. Barry > On Nov 9, 2020, at 5:35 PM, Kaustubh Khedkar wrote: > > Hello, > I am using PETSc with Matlab engine. I

Re: [petsc-users] Tough to reproduce petsctablefind error

2020-11-03 Thread Barry Smith
the number of diagonal and off diagonal values that > we had specified in our previous call to MatMPIAIJSetPreallocation. > > So that is at least a theory for what was happening. The theory would be: > very rarely, due to a bug in our code, we were running MatSetValues wit

Re: [petsc-users] Problem with SNESsetFunction()

2020-11-03 Thread Barry Smith
This will find any errors in your Jacobian 2) If your Jacobian is suppose to have zeros on the diagonal then generally you cannot use LU or ILU as preconditioner. You can start with -pc_type fieldsplit -pc_fieldsplit_detect_saddle_point PCFIELDSPLIT has many options. Barry > > Apologi

Re: [petsc-users] Errors with KSP solver

2020-11-02 Thread Barry Smith
Hoang, Could you please send the entire code as a .F90 file as an attachment so we can reproduce the problem? Thanks Barry > On Nov 2, 2020, at 8:38 PM, Hien HN- wrote: > > Hi Matt, > > 1) As I understood, the VecScatterCreateToAll function will create the vector > sol_to_all,

Re: [petsc-users] superlu_dist segfault

2020-11-02 Thread Barry Smith
t; > > Gesendet: Montag, 02. November 2020 um 23:58 Uhr > Von: "Barry Smith" > An: "Marius Buerkle" > Cc: "Stefano Zampini" , "petsc-users@mcs.anl.gov" > , "Sherry Li" > Betreff: Re: [petsc-users] superlu_dist segfau

Re: [petsc-users] superlu_dist segfault

2020-11-02 Thread Barry Smith
u_test.c:28) > > I don't know if this are real errors or only some problem of valgrind. I > attached th whole valgrind logs, they are rather noisy though. > > Best, > Marius > > > Gesendet: Sonntag, 01. November 2020 um 19:09 Uhr > Von: "Stefano Z

Re: [petsc-users] Preconditioners for rectangular matrices

2020-11-01 Thread Barry Smith
Rakesh, LSQR takes a square matrix from which to build a preconditioner. When you call KSPSetOperators( ... Rectangular, Square...) where Square is generally Rectangular transpose * Rectangular. LSQR essentially solves the normal equations so it makes sense to use for a

Re: [petsc-users] superlu_dist segfault

2020-11-01 Thread Barry Smith
2) > ==43569==by 0x55FB716: MatMatSolve (matrix.c:3485) > ==43569==by 0x40465D: main (superlu_test.c:59) > ==43569== > > I also attached the whole log. Does this make any sense? The problem seems to > be around where I get the original segfault. > > best, > marius

Re: [petsc-users] Problem with SNESsetFunction()

2020-10-31 Thread Barry Smith
> On Oct 30, 2020, at 10:11 PM, baikadi pranay wrote: > > Hello, > I have a couple of questions regarding SNESSetFunction usage, when > programming in Fortran90. > > 1) I have the following usage paradigm. >call SNESSetFunction(snes,f_non,FormFunction,0,ierr) >subroutine

Re: [petsc-users] Regarding changes in the 3.14 release

2020-10-30 Thread Barry Smith
> On Oct 28, 2020, at 7:56 PM, Sajid Ali > wrote: > > Hi Matt, > > Thanks for the clarification. The documentation > > for SNESSetLagPreconditioner states "If -1 is used before the very first > nonlinear

Re: [petsc-users] superlu_dist segfault

2020-10-30 Thread Barry Smith
Have you run it yet with valgrind, good be memory corruption earlier that causes a later crash, crashes that occur at different places for the same run are almost always due to memory corruption. If valgrind is clean you can run with -on_error_attach_debugger and if the X forwarding is

Re: [petsc-users] TSSetEventHandler and TSSetPostEventIntervalStep

2020-10-27 Thread Barry Smith
Pushed > On Oct 27, 2020, at 3:41 PM, Matthew Knepley wrote: > > On Tue, Oct 27, 2020 at 4:24 PM Barry Smith <mailto:bsm...@petsc.dev>> wrote: > > I'm sorry the code is still fundamentally broken, I know I promised a long > time ago to fix it all up but it is

Re: [petsc-users] TSSetEventHandler and TSSetPostEventIntervalStep

2020-10-27 Thread Barry Smith
I'm sorry the code is still fundamentally broken, I know I promised a long time ago to fix it all up but it is actually pretty hard to get right. It detects the zero by finding a small value when it should detect it by find a small region where it changes sign but surprising it is so

Re: [petsc-users] Blas undefined references when build an app linking to a shared library that is linked to a static Petsc library

2020-10-23 Thread Barry Smith
I found http://icl.cs.utk.edu/lapack-forum/viewtopic.php?f=2=1730 but I do not understand it. I am pretty sure PETSc is not providing in anyway even through its packages like fblaslapack blas_sgemv_x anyway I would focus on

Re: [petsc-users] MatOrdering for rectangular matrix

2020-10-23 Thread Barry Smith
agonal in B. What terms to move etc is unknown to me. There are many games one can play but I don't know which ones would be good for your problem. Barry > > Thank you very much in advance for taking time for this topic! I really > appreciate it. > > Marcel > > >

Re: [petsc-users] reset the sparsity pattern of a matrix without destroying and recreating it

2020-10-23 Thread Barry Smith
You should be able to call MatResetPreallocation() MatSeqAIJSetPreallocation(new data) or any other preallocations routines again and it will clean out the old material. Let us know if this does not work, Barry > On Oct 23, 2020, at 9:11 AM, Aulisa, Eugenio wrote: > > > Hi > > I

Re: [petsc-users] Enhancing MatScale computing time

2020-10-22 Thread Barry Smith
utputs are attached. The same problem was run with arch-master-optThe overall time was cut in half, but %T remain roughly the same...Thanks,AntoineDe : Matthew Knepley <knep...@gmail.com>Envoyé : 22 octobre 2020 16:28À : Antoine Côté <antoine.co...@usherbrooke.ca>Cc : Barry Smith <bsm

Re: [petsc-users] Enhancing MatScale computing time

2020-10-22 Thread Barry Smith
Yes, you are correct I missed that part of the run As you can see below MatScale calls only BLAS dscal() there is really no way to make that go faster. How big is the matrix. What are you doing with the matrix after you scale it? The only way to improve the time is to find some way to scale

Re: [petsc-users] FPE when trying to find the condition number

2020-10-22 Thread Barry Smith
The reference implementation of LAPACK tries a divide by zero in its setup to see if it can divide by zero and that is happening for you. Hence the PETSc code has ierr = PetscFPTrapPush(PETSC_FP_TRAP_OFF);CHKERRQ(ierr); #if !defined(PETSC_USE_COMPLEX)

Re: [petsc-users] Enhancing MatScale computing time

2020-10-22 Thread Barry Smith
MatMult 9553 1.0 3.2824e+01 1.0 3.54e+10 1.0 0.0e+00 0.0e+00 0.0e+00 23 48 0 0 0 61 91 0 0 0 1079 MatScale 6 1.0 5.3896e-02 1.0 2.52e+07 1.0 0.0e+00 0.0e+00 0.0e+00 0 0 0 0 0 0 0 0 0 0 467 Though the flop rate of MatScale is not so high (467) it

Re: [petsc-users] MatOrdering for rectangular matrix

2020-10-22 Thread Barry Smith
Marcel, He also has SuiteSparseQR AMD, so with your interpretation this means AMD can also reorder a rectangular matrix? I think you need to dig into SuiteSparseQR or his papers to find out what he is actually reordering; I suspect it is not actually the rectangular matrix. Barry

Re: [petsc-users] MatOrdering for rectangular matrix

2020-10-22 Thread Barry Smith
Marcel, Would you like to do the following? Compute Q A P where Q is a row permutation, P a column permutation and then apply LSQR on QAP? From the manual page: In exact arithmetic the LSQR method (with no preconditioning) is identical to the KSPCG algorithm applied to

Re: [petsc-users] Guidelines for Nested fieldsplit for domains with a hybrid mesh

2020-10-18 Thread Barry Smith
From src/ksp/pc/impls/fieldsplit/fieldsplit.c this is how the saddle point is detected and set into the PC if (jac->detect) { IS zerodiags,rest; PetscInt nmin,nmax; ierr = MatGetOwnershipRange(pc->mat,,);CHKERRQ(ierr); if (jac->diag_use_amat) {

Re: [petsc-users] Preconditioner for Helmholtz-like problem

2020-10-16 Thread Barry Smith
ichardson/sor and not chebyshev smoothers and in > smoothed aggregation (gamg) don't smooth (-pc_gamg_agg_nsmooths 0). > Mark > > On Sat, Sep 19, 2020 at 2:11 AM Alexey Kozlov <mailto:alexey.v.kozlo...@nd.edu>> wrote: > Thanks a lot! I'll check them out. > > On Sat, Se

Re: [petsc-users] Eisenstat-Walker method with GPU assembled matrices

2020-10-15 Thread Barry Smith
a SeqAICUSPARSE matrix through a CUDA > kernel using the new MatCUSPARSEGetDeviceMatWrite function (thanks Barry > Smith and Mark Adams!). However, I am now facing problems when trying to use > this matrix within a SNES solver with the Eisenstat-Walker method enabled. > > Accor

Re: [petsc-users] About MAT_NEW_NONZERO_LOCATION[]

2020-10-13 Thread Barry Smith
You only need to provide one of the options. The docs are slightly misleading.The flags only tells the matrix what to do with new nonzero locations, preventing new ones. The Mat actually tracks if new non-zeros locations are actually entered independent of the flags. So, for example

Re: [petsc-users] Ainsworth formula to solve saddle point problems / preconditioner for shell matrices

2020-10-12 Thread Barry Smith
it. Barry > Thanks a lot, > Olivier > > On 09/10/2020 03:50, Barry Smith wrote: >> >> Olivier, >> >> The branch barry/2020-10-08/invert-block-diagonal-aij contains an >> example src/mat/tests/ex178.c that shows how to compute inv(CC'). It works

Re: [petsc-users] Convergence Error Debugging with KSP solvers in SNES

2020-10-11 Thread Barry Smith
t took care of constant null space? > > And if it is necessary, could you give me some help on what's the best > location to call MatNullSpaceRemove as the ksp solver is hiding after SNES > solver and FIELDSPLIT_PC. > > Regards > Juntao > > > On Oct 9 2020, at 2:25 pm, Barr

Re: [petsc-users] Regarding SNESSetFunction and SNESSetJacobian

2020-10-09 Thread Barry Smith
F'(x) gives a Newton that converges much faster than Picard. Barry > Best Regards, > Pranay. > ᐧ > > On Fri, Oct 9, 2020 at 7:43 AM Barry Smith <mailto:bsm...@petsc.dev>> wrote: > > To provide the functions to the Picard iteration you call SNESSetPicard() > no

Re: [petsc-users] Regarding SNESSetFunction and SNESSetJacobian

2020-10-09 Thread Barry Smith
To provide the functions to the Picard iteration you call SNESSetPicard() not SNESSetFunction() and SNESSetJacobian(), you provide code to compute A(x) and b(x). Note that in the Picard iteration the matrix A(x) is NOT the Jacobian of F(x) = A(x) x - b(x). The Jacobian of F(x) is the

Re: [petsc-users] Convergence Error Debugging with KSP solvers in SNES

2020-10-09 Thread Barry Smith
total: nonzeros=9213, allocated nonzeros=9213 > total number of mallocs used during MatSetValues > calls=0 > not using I-node routines > linear system matrix = precond matrix: > M

Re: [petsc-users] [petsc-maint] Poisson with Neumann BC on a stretched grid

2020-10-08 Thread Barry Smith
how and maybe get a nice example for PETSc out of it. Barry > > Sorry for asking so much questions, > > > > Thanks again for your help, > > > > Best regards, > > > > Victoria > > > > > > On 7/10/20 17:59, Barry Smit

Re: [petsc-users] Ainsworth formula to solve saddle point problems / preconditioner for shell matrices

2020-10-08 Thread Barry Smith
t 8, 2020, at 3:59 PM, Barry Smith wrote: > > > Olivier > > I am working on extending the routines now and hopefully push a branch you > can try fairly soon. > > Barry > > >> On Oct 8, 2020, at 3:07 PM, Jed Brown wrote: >> >> Olivier

Re: [petsc-users] Ainsworth formula to solve saddle point problems / preconditioner for shell matrices

2020-10-08 Thread Barry Smith
Olivier I am working on extending the routines now and hopefully push a branch you can try fairly soon. Barry > On Oct 8, 2020, at 3:07 PM, Jed Brown wrote: > > Olivier Jamond writes: > >>>Given the structure of C it seems you should just explicitly construct >>> Sp and use

Re: [petsc-users] Convergence Error Debugging with KSP solvers in SNES

2020-10-08 Thread Barry Smith
When you get a huge change at restart this means something is seriously wrong with either the linear operator or the linear preconditioner. How are you doing the matrix vector product? Note both the operator and preconditioner must be linear operators for GMRES. FGMRES allows the

Re: [petsc-users] Regarding FormFunction in the SNES class

2020-10-07 Thread Barry Smith
implicit none SNES snes Vec x,f PetscErrorCode ierr integer dummy(*) > Thank you in advance. > Best Regards, > Pranay. > > ᐧ > > On Wed, Oct 7, 2020 at 1:26 PM Barry Smith <mailto:bsm...@petsc.dev>> wrote: > > > > On Oct

Re: [petsc-users] Regarding FormFunction in the SNES class

2020-10-07 Thread Barry Smith
> On Oct 7, 2020, at 1:41 PM, baikadi pranay wrote: > > Hello, > I have a few questions regarding FormFunction when using the SNES solvers. I > am using Fortran90. > > 1) I went through the example (ex1f.F90) provided in the documentation that > uses Newton method to solve a two-variable

Re: [petsc-users] [petsc-maint] Poisson with Neumann BC on a stretched grid

2020-10-07 Thread Barry Smith
> On Oct 7, 2020, at 8:11 AM, Mark Adams wrote: > > > On Wed, Oct 7, 2020 at 8:27 AM Victoria Hamtiaux > mailto:victoria.hamti...@uclouvain.be>> > wrote: > Thanks for all the answers, > > > > How can I do the "semi-coarsening"? I don't really know how those > preconditionners work so I

Re: [petsc-users] Ainsworth formula to solve saddle point problems / preconditioner for shell matrices

2020-10-06 Thread Barry Smith
> On Oct 6, 2020, at 6:57 AM, Olivier Jamond wrote: > > > On 03/10/2020 00:23, Barry Smith wrote: >>I think what Jed is saying is that you should just actually build your >> preconditioner for your Ct*C + Qt*S*Q operator with S. Because Ct is tall >> and s

Re: [petsc-users] Ainsworth formula to solve saddle point problems / preconditioner for shell matrices

2020-10-02 Thread Barry Smith
> On Oct 2, 2020, at 6:50 AM, Olivier Jamond wrote: > > Dear Jed, > > The code I am working on is quite generic and at the solve step, the matrix C > can be 'whatever' (but is supposed to be full rank). But in practice, in 99% > of the cases, C contain MPCs that refers to boundary

Re: [petsc-users] reset release branch

2020-10-01 Thread Barry Smith
Thibaut, master has not changed in any way, it's usage is the same as before the release. Only the maint branch has been renamed to release. Barry > On Oct 1, 2020, at 3:30 AM, Appel, Thibaut wrote: > > Is ‘master’ still considered stable? > > Thibaut > >>

Re: [petsc-users] Adaptive time stepping for implicit solvers

2020-09-30 Thread Barry Smith
s your new ODE has large oscillations and needs a much smaller time step), if you need a smaller time step after the event then you can just set the new smaller tilmestep in your post event function. Barry > > Thanks > Miguel > > From: Barry Smith mailto:bsm...@petsc.dev>&g

Re: [petsc-users] Adaptive time stepping for implicit solvers

2020-09-30 Thread Barry Smith
You might consider using the Event feature of TS to manage this. It detects when your "indicator function" changes sign and stops the integration right at that point allowing you to change your ODE or do what ever you need. It allows managing discontinuous changes in the ODE without needing

Re: [petsc-users] Assembling MatSeqAICUSPARSE from kernel

2020-09-30 Thread Barry Smith
Hector, You asked at just the right time. Mark Adams has started to implement some code to do this https://gitlab.com/petsc/petsc/-/merge_requests/3137 it is now in the PETSc master branch. It is preliminary and not yet well

[petsc-users] PETSc 3.14 release available

2020-09-29 Thread Barry Smith
better documentation in the future. This release includes contributions from Alejandro Otero Alexei Colin Alex Lindsay Alp Dener Aron Ahmadia Arthur Soprano Asbjørn Nilsen Riseth Barry Smith Ben Mather Brandon Whitchurch Chris Eldred Chris Hennekinne David A Ham David Ham Dmitry Karpe

Re: [petsc-users] Failed to build Petsc statically linked to MKL for Windows

2020-09-29 Thread Barry Smith
Thank you very much for looking into this. I really appreciate it. Attached > is the configure log generated by the first configuration listed below. > > Best regards, > Thuc > > From: Barry Smith [mailto:bsm...@petsc.dev <mailto:bsm...@petsc.dev>] > Sent: Tuesday,

Re: [petsc-users] Failed to build Petsc statically linked to MKL for Windows

2020-09-29 Thread Barry Smith
> On Sep 29, 2020, at 3:50 PM, Thuc Bui wrote: > > Dear Petsc Users, > > I have successfully built Petsc v3.13.5 for Windows 10 VS2015 without Fortran > compiler and without MPI. These successful builds are either linked > statically with Blas-Lapack or dynamically with Intel MKL.

Re: [petsc-users] Information on SNES

2020-09-29 Thread Barry Smith
It is documented in the manual page for SNESConvergedDefault > On Sep 29, 2020, at 12:41 PM, Matthew Knepley wrote: > > On Tue, Sep 29, 2020 at 9:21 AM Oliver Zacharias > wrote: > Dear Sir or Madam, > > regarding your SNES-Tool one can specifiy at least three types

Re: [petsc-users] using real and complex together

2020-09-28 Thread Barry Smith
> On Sep 28, 2020, at 5:32 PM, Sam Guo wrote: > > Another idea I am pursuing is to prefix real and complex using some compiler > flags. Didn’t figure out how to do this cross platform for shared libs yet. This is very hairy because there are some symbols that can be common and some that

Re: [petsc-users] Tough to reproduce petsctablefind error

2020-09-26 Thread Barry Smith
> On Sep 26, 2020, at 5:58 PM, Junchao Zhang wrote: > > > > On Sat, Sep 26, 2020 at 5:44 PM Mark Adams > wrote: > > > On Sat, Sep 26, 2020 at 1:07 PM Matthew Knepley > wrote: > On Sat, Sep 26, 2020 at 11:17 AM Mark McClure

Re: [petsc-users] Tough to reproduce petsctablefind error

2020-09-25 Thread Barry Smith
don't use ierr > print rank, gid1; > } > CHKERRQ(ierr); > > I am guessing that somehow you have a table that is bad and too small. It > failed on an index not much bigger than the largest key allowed. Maybe just > compute the max and see if it goes much larger than the lar

Re: [petsc-users] Matrix Free Method questions

2020-09-24 Thread Barry Smith
but it prints Matrix15 15 8744032 0. Not sure why it is not logging correctly. Anyways probably not important. > > Thanks, > > Matt > > Cheers, > > Sophie > From: Barry Smith mailto:bsm...@petsc.dev>> > Sent: Wednesd

<    5   6   7   8   9   10   11   12   13   14   >