[petsc-users] Question about DMDAGetElements

2018-11-12 Thread Sajid Ali via petsc-users
Hi, I'm trying to understand this example from a tutorial. DM is used as an alternative to setting up the matrix and vector separately (as was done in the previous example

Re: [petsc-users] Question about DMDAGetElements

2018-11-13 Thread Sajid Ali via petsc-users
I'm still confused and have the following questions : 1) Suppose as in the case above a DM object (created using DMCreate1D) is used to created a matrix A using DMCreateMatrix, how does one convert the indices obtained from DMDAGetElements to the row and column indices for the matrix A ? Is there

Re: [petsc-users] Question about correctly catching fp_trap

2019-01-04 Thread Sajid Ali via petsc-users
Trying it slightly differently, I do see it's a SIGFPE, arithmetic exception but all it shows is that it's an error in TSSolve but no further than that. [sajid@xrm free_space]$ gdb ex_modify GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-100.el7 Copyright (C) 2013 Free Software Foundation, Inc.

Re: [petsc-users] VecCopy fails after VecDuplicate

2019-01-17 Thread Sajid Ali via petsc-users
Nevermind, it was my fault in thinking the error was with u_abs and not u. I switched from local array based value setting for initial conditions to VecSetValues when converting the uniprocessor example to an MPI program. While I removed VecRestoreArray and swapped u_local[*ptr] assignments with

[petsc-users] VecCopy fails after VecDuplicate

2019-01-17 Thread Sajid Ali via petsc-users
Hi, I have the following 2 lines in a function in my code : ierr = VecDuplicate(u,_abs);CHKERRQ(ierr); ierr = VecCopy(u,u_abs);CHKERRQ(ierr); The VecCopy fails with the error message : [0]PETSC ERROR: Object is in wrong state [0]PETSC ERROR: Not for unassembled vector adding the following

Re: [petsc-users] VecCopy fails after VecDuplicate

2019-01-17 Thread Sajid Ali via petsc-users
As requested : [sajid@xrm free_space]$ ./ex_modify Solving a linear TS problem on 1 processor m : 256, slices : 1000.00, lambda : 1.239800e-10 [0]PETSC ERROR: - Error Message -- [0]PETSC ERROR: Object is in wrong

[petsc-users] X-Viewer for complex numbers

2018-12-12 Thread Sajid Ali via petsc-users
Hi , Does petsc automatically convert complex valued vectors to absolute value vectors before passing it to a viewer ? Is there a way to view the phase of a vector ? Thank You, Sajid Ali Applied Physics Northwestern University

Re: [petsc-users] X-Viewer for complex numbers

2018-12-12 Thread Sajid Ali via petsc-users
Specifically in the context of drawing a vector using the X-viewer ( PetscDraw ). On Wed, Dec 12, 2018 at 9:33 AM Sajid Ali wrote: > Hi , > > Does petsc automatically convert complex valued vectors to absolute value > vectors before passing it to a viewer ? Is there a way to view the phase of >

Re: [petsc-users] Question about PetscViewerHDF5SetTimestep usage

2018-12-20 Thread Sajid Ali via petsc-users
b8a3f9897d55e531412'. >> >> >> On Fri, Dec 14, 2018 at 12:56 PM Matthew Knepley >> wrote: >> >>> I believe this is now fixed in 'master', It was a bug in HDF5 attribute >>> creation. >>> >>> Thanks, >>> >>> Ma

Re: [petsc-users] Question about PetscViewerHDF5SetTimestep usage

2018-12-20 Thread Sajid Ali via petsc-users
The example is the same as above. Link : https://pastebin.com/cAeZsUgA Here's what happens when I try to compile and run using petsc@3.10.3: https://pastebin.com/EGVSxJu5 Thank You, Sajid Ali Applied Physics Northwestern University

Re: [petsc-users] Question about PetscViewerHDF5SetTimestep usage

2018-12-20 Thread Sajid Ali via petsc-users
I tried running the same with petsc@develop and it worked. But if the fix was committed on Dec5, then it should in theory work with petsc@3.10.3 . I'm not sure why it doesn't work either.

[petsc-users] Some questions about TS/examples/tutorials/ex13

2018-12-22 Thread Sajid Ali via petsc-users
Hi, I have a few questions about ex13 from TS explaining how to solve the following PDE in 2D : u_t = uxx + uyy 1) Can I get a reference/explanation for how the RHSJacobian function is derived ? 2) If the problem is linear, why is TSSetProblemType never set to TS_LINEAR? 3) Since this is just

Re: [petsc-users] Some questions about TS/examples/tutorials/ex13

2018-12-22 Thread Sajid Ali via petsc-users
> No, A(t) has five diagonals as indicated by the calls to MatSetValues() with five entries per row; they correspond to the usual 5 pt stencil in 2d. This might not be the right place to ask this, but I'm new to PDE's and I expected to find something like the matrix to be used as the one derived

Re: [petsc-users] Question about PetscViewerHDF5SetTimestep usage

2018-12-14 Thread Sajid Ali via petsc-users
bug in HDF5 attribute > creation. > > Thanks, > > Matt > > On Fri, Dec 14, 2018 at 1:16 PM Sajid Ali via petsc-users < > petsc-users@mcs.anl.gov> wrote: > >> Hi, >> >> I have a question about PetscViewerHDF5SetTimestep usage. >> >&g

[petsc-users] Question about PetscViewerHDF5SetTimestep usage

2018-12-14 Thread Sajid Ali via petsc-users
Hi, I have a question about PetscViewerHDF5SetTimestep usage. I have tried the following minimal example which tries to write a vector twice to an hdf5 file and it fails with the error message shown below. Example : https://pastebin.com/cAeZsUgA Error : writing vector in hdf5 to vector.dat

[petsc-users] Load dense matrices from hdf5

2018-11-30 Thread Sajid Ali via petsc-users
Hi, I'm trying to solve the Helmholtz equation in 1D for x-rays which roughly like : u_dot = a*u_xx + h(t)*u I've already implemented the case where h(t) is always zero (free-space) in PETSc as per the last box on

Re: [petsc-users] Some clarifications about TS ex3.c

2018-11-29 Thread Sajid Ali via petsc-users
Another question I want to ask is about dttol that is used in the Monitor function as follows : 417: dttol = .0001; 418: PetscOptionsGetReal(NULL,NULL,"-dttol",,NULL); 419: if (dt < dttol) { 420: dt *= .999; 421: TSSetTimeStep(ts,dt); 422: } Is this decreasing dt if it's less

Re: [petsc-users] Load dense matrices from hdf5

2018-11-30 Thread Sajid Ali via petsc-users
I use spack variants which do the same thing behind the scenes. Thanks ! On Fri, Nov 30, 2018 at 5:10 PM Smith, Barry F. wrote: > >I assume you are ./configure PETSc with --with-scalar-type=complex? If > so, the values in the file are the real and imaginary parts interlaced: > That is > r0

Re: [petsc-users] Error in vec/vec/examples/tutorials/ex19.c

2018-11-30 Thread Sajid Ali via petsc-users
rote: > > > > On Nov 30, 2018, at 1:30 PM, Sajid Ali via petsc-users < > petsc-users@mcs.anl.gov> wrote: > > > > Hi, > > > > I tried running ex19.c and I get the following error (I added a small > snippet to print the local size on rank0 as well) : > >

Re: [petsc-users] Load dense matrices from hdf5

2018-11-30 Thread Sajid Ali via petsc-users
u are getting your h(t) values from). > > Barry > > > > On Nov 30, 2018, at 4:27 PM, Sajid Ali via petsc-users < > petsc-users@mcs.anl.gov> wrote: > > > > Hi, > > > > I'm trying to solve the Helmholtz equation in 1D for x-rays which > roughly l

Re: [petsc-users] Load dense matrices from hdf5

2018-11-30 Thread Sajid Ali via petsc-users
If the matrix is filled with complex numbers is each complex number stored as a sequences of doubles ? Or is it better to split the matrix into real/imaginary and store each part separately?

Re: [petsc-users] PETSc binary write format

2018-12-07 Thread Sajid Ali via petsc-users
For future reference, attached is a snippet of code in C to convert ascii numbers (integers and doubles) to petsc readable binary vectors. -- Sajid Ali Applied Physics Northwestern University ascii_to_bin.c Description: Binary data

Re: [petsc-users] PETSc binary write format

2018-12-03 Thread Sajid Ali via petsc-users
, Barry F. wrote: > >You saved a Vec to the file, not a Mat. > > > > > On Dec 3, 2018, at 1:38 PM, Sajid Ali via petsc-users < > petsc-users@mcs.anl.gov> wrote: > > > > Hi, > > > > I ran ex10 from /vec/examples/tutorials and saved the ma

[petsc-users] PETSc binary write format

2018-12-03 Thread Sajid Ali via petsc-users
Hi, I ran ex10 from /vec/examples/tutorials and saved the matrix in binary format. Looking at the matrix in binary using xxd, I see [sajid@xrm temp]$ xxd -b vector.dat 000: 00010010 0011 01001110 ..{N.. 006: 00010100

Re: [petsc-users] PETSc binary write format

2018-12-06 Thread Sajid Ali via petsc-users
I'm attaching the file vector.dat and the file petsc saves (vec_old.dat) with this email. Thank You, Sajid Ali Applied Physics Northwestern University vector.dat Description: Binary data vec_old.dat Description: Binary data

Re: [petsc-users] PETSc binary write format

2018-12-04 Thread Sajid Ali via petsc-users
For future reference, the numbers do look like they're stored as per IEEE 754 64-bit convention. I don't know what the special characters in the xxd output are but the size of the file is consistent with 2*int_32+num_elements*dobule_64. Thank you ! Sajid Ali Applied Physics Northwestern

Re: [petsc-users] PETSc binary write format

2018-12-05 Thread Sajid Ali via petsc-users
To clarify : The data from xxd -b petsc_output_dat is what I've reordered. The binary dump is confusing to read since it contains 6 bytes per line (alongside the unnecessary ascii conversions) and the numbers start and end in odd places. I wanted each line to have only one number and copy pasted

Re: [petsc-users] PETSc binary write format

2018-12-05 Thread Sajid Ali via petsc-users
It's just a cleaner re-write of the petsc output that I can understand (which I intend to modify from python in the future). I tried removing the new line characters but that didn't work either. Looking at the first line of the binary dump from petsc output : [sajid at xrm

Re: [petsc-users] PETSc binary write format

2018-12-05 Thread Sajid Ali via petsc-users
I have created a file as per the specification as shown below [sajid@xrm temp]$ cat vector.dat 00010010001101001110 00010100 0011

Re: [petsc-users] PETSc binary write format

2018-12-05 Thread Sajid Ali via petsc-users
Exactly. When I run ex10 and inspect it with cat, I get garbage since the data is in binary : [sajid@xrm temp]$ cat vector.dat {N?�▒@@ @"@$@&@(@*@,@.@0@1@2@3[sajid@xrm temp]$ But doing a binary dump shows the data : [sajid@xrm temp]$ xxd -b vector.dat 000: 00010010 0011

Re: [petsc-users] Question about DMDAGetElements

2018-11-19 Thread Sajid Ali via petsc-users
So, DMDA is used for sparse matrices arising from FD/FE and MatCreateMPIAIJ can be used for dense matrices (though it is strongly discouraged). My confusion stemmed from DMDAGetElements giving the element indices for the 1D mesh/vector of size N(when the DMDACreate1d is used). But these indices

Re: [petsc-users] Question about DMDAGetElements

2018-11-19 Thread Sajid Ali via petsc-users
I think what confused me was the fact that using DMCreateMatrix(da,) created a 12x12 matrix with 144 elements but summing up nel*nen from each rank gives only 2*2+3*2+3*2+3*2=20 elements. So this means that DMDAGetElements returns the elements for the vector created on the mesh and this happens to

Re: [petsc-users] Question about DMDAGetElements

2018-11-19 Thread Sajid Ali via petsc-users
Bingo! So, DMDAGetElements gives the indices of the mesh, right ? Thank you !

[petsc-users] Some clarifications about TS ex3.c

2018-11-27 Thread Sajid Ali via petsc-users
Hi, I wanted to ask a few questions about the TS example ex3.c when using the ifunc option 190: Mat J; 192: RHSMatrixHeat(ts,0.0,u,A,A,);193: MatDuplicate

Re: [petsc-users] Question about correctly catching fp_trap

2019-01-07 Thread Sajid Ali via petsc-users
> Anyway the FPE occurs in MatSolve_SeqAIJ_NaturalOrdering which usually indicates a zero on the diagonal of the matrix. Is that possible? It looks like this is indeed the case here. Thanks for the hint. @Satish Balay : I tried building with the patch and don't see any difference. Do you want

[petsc-users] Set diagonals other than main diagonal

2019-01-03 Thread Sajid Ali via petsc-users
Hi, Is there any simple way of setting minor diagonals. The main diagonal can be set by MatDiagonalSet but there's no equivalent way of doing it for for minor diagonals. Does the preferred way to do this involve using MatSetValues or there a simpler way? Thank You, Sajid Ali Applied Physics

Re: [petsc-users] Question about correctly catching fp_trap

2019-01-04 Thread Sajid Ali via petsc-users
Spack changes the configuration if debug variant is enabled as per this line : '--with-debugging=%s' % ('1' if '+debug' in spec else '0'), I'm not sure what needs to be done to change this. In the meantime, I added -g to CFLAGS in the makefile and now I have this : https://pastebin.com/wxf05BH0

Re: [petsc-users] Question about correctly catching fp_trap

2019-01-04 Thread Sajid Ali via petsc-users
Should gdb : https://spack.readthedocs.io/en/latest/package_list.html#gdb be listed as an explicit dependency ? Also, why is the error message asking me to re-install my system blas/lapack ? I installed petsc with intel-mkl as blas/lapack provider and the linking failed for superlu-dist. Is that

Re: [petsc-users] Question about correctly catching fp_trap

2019-01-04 Thread Sajid Ali via petsc-users
I asked in the spack-slack channel and was told to include the explicitly link the gfortran associated with the gcc version I build petsc with. Following that advice, I'm using gcc@7.3.0, linking gcc@7.3.0/lib64 in FFLAGS and setting -g option to CFLAGS in my makefile. Yet, somehow the executable

[petsc-users] Question about correctly catching fp_trap

2019-01-03 Thread Sajid Ali via petsc-users
Hi, I've compiled a program using petsc with debugging enabled. Confirmation of the same : https://pastebin.com/aa0XDheD (check if the loaded module is indeed petsc+debug, compile) When I run it in a debugger, I get the error as shown below: https://pastebin.com/GJtB2Ghz What am I missing?

Re: [petsc-users] Set diagonals other than main diagonal

2019-01-03 Thread Sajid Ali via petsc-users
Got it. Thank you! On Thu, Jan 3, 2019 at 11:46 AM Matthew Knepley wrote: > On Thu, Jan 3, 2019 at 12:24 PM Sajid Ali via petsc-users < > petsc-users@mcs.anl.gov> wrote: > >> Hi, >> >> Is there any simple way of setting minor diagonals. The main diagona

Re: [petsc-users] Question about correctly catching fp_trap

2019-01-04 Thread Sajid Ali via petsc-users
Going by the advice given here : https://stackoverflow.com/a/2792735 I tried running the program, hoping to catch the FP exception and I got the error I had before (which turned out to be due to an FP exception as per previous petsc thread): Missing separate debuginfos, use: debuginfo-install

[petsc-users] Error in vec/vec/examples/tutorials/ex19.c

2018-11-30 Thread Sajid Ali via petsc-users
Hi, I tried running ex19.c and I get the following error (I added a small snippet to print the local size on rank0 as well) : [sajid@xrm temp]$ mpirun -np 2 ./ex19 local_sizes : 3 4 [1]PETSC ERROR: - Error Message --

Re: [petsc-users] Question about TSSetRHSJacobian for linear time dependent problem

2019-01-27 Thread Sajid Ali via petsc-users
The form is u_t = A(t)u. On Sun, Jan 27, 2019 at 4:24 PM Smith, Barry F. wrote: > > > > On Jan 25, 2019, at 4:51 PM, Sajid Ali via petsc-users < > petsc-users@mcs.anl.gov> wrote: > > > > Hi, > > > > If I have a linear time dependent equat

[petsc-users] Estimate memory needs for large grids

2019-04-05 Thread Sajid Ali via petsc-users
Hi, I've solving a simple linear equation [ u_t = A*u_xx + A*u_yy + F_t*u ] on a grid size of 55296x55296. I'm reading a vector of that size from an hdf5 file and have the jacobian matrix as a modified 5-point stencil which is preallocated with the following ``` ierr =

[petsc-users] Converting complex PDE to real for KNL performance ?

2019-03-27 Thread Sajid Ali via petsc-users
Hi, I'm able to solve the following equation using complex numbers (with ts_type cn and pc_type gamg) : u_t = A*u'' + F_t*u; (where A = -1j/(2k) amd u'' refers to u_xx+u_yy implemented with the familiar 5-point stencil) Now, I want to solve the same problem using

Re: [petsc-users] Direct PETSc to use MCDRAM on KNL and other optimizations for KNL

2019-02-28 Thread Sajid Ali via petsc-users
Hi Hong, Thanks for the advice. I see that the example takes ~180 seconds to run but I can't see the DRAM vs MCDRAM info from Intel APS. I'll try to fix the profiling and get back with further questions. Also, the intel-mpi manpages say that the use of tmi is now deprecated :

Re: [petsc-users] Direct PETSc to use MCDRAM on KNL and other optimizations for KNL

2019-03-01 Thread Sajid Ali via petsc-users
Hi Hong, So, the speedup was coming from increased DRAM bandwidth and not the usage of MCDRAM. There is moderate MPI imbalance, large amount of Back-End stalls and good vectorization. I'm attaching my submit script, PETSc log file and Intel APS summary (all as non-HTML text). I can give more

Re: [petsc-users] Direct PETSc to use MCDRAM on KNL and other optimizations for KNL

2019-02-27 Thread Sajid Ali via petsc-users
Hi Junchao, I’m confused with the syntax. If I submit the following as my job script, I get an error : #!/bin/bash #SBATCH --job-name=petsc_test #SBATCH -N 1 #SBATCH -C knl,quad,flat #SBATCH -p apsxrmd #SBATCH --time=1:00:00 module load intel/18.0.3-d6gtsxs module load

[petsc-users] Link to the latest tutorials broken

2019-02-07 Thread Sajid Ali via petsc-users
Hi, The links to the Jan 2019 presentations at https://www.mcs.anl.gov/petsc/documentation/tutorials/index.html are broken. Could these be fixed ? Thank You, Sajid Ali Applied Physics Northwestern University

[petsc-users] petsc4py for numpy array <-> MATDENSE binary

2019-01-31 Thread Sajid Ali via petsc-users
Hi, I have a large (~25k x 25k x 50) 3D array that I want to store as binary PETSc readable matrix using the MATDENSE format. I've currently achieved this (for smaller arrays) by writing the matrix out to an ASCII file and converting this ASCII file to binary, one number at a time using a C

[petsc-users] Reading a complex vector from HDF5

2019-02-01 Thread Sajid Ali via petsc-users
Hi, I'm trying to load a complex vector from hdf5 and I get and I get the following error: [0]PETSC ERROR: - Error Message -- [0]PETSC ERROR: No support for this operation for this object type [0]PETSC ERROR: File

Re: [petsc-users] Reading a complex vector from HDF5

2019-02-01 Thread Sajid Ali via petsc-users
Column 1 contains the real value and column 2 contains the imaginary value, correct? I did that last time as well (and opened it using h5py just to be sure that the shape is indeed dim x 2 and the datatype is f8), yet I get the error. The error comes from these lines in PETSc : #if

Re: [petsc-users] petsc4py for numpy array <-> MATDENSE binary

2019-02-01 Thread Sajid Ali via petsc-users
The vector is essentially snapshots in time of a data array. I should probably store this as a 2D dense matrix of dimensions (dim_x*dim_y) * dim_z. Now I can pick one column at a time and use it for my TS Jacobian. Apologies for being a little unclear. -- Sajid Ali Applied Physics Northwestern

Re: [petsc-users] Reading a complex vector from HDF5

2019-02-01 Thread Sajid Ali via petsc-users
I think I understand what's happening here, when I look at a data file I create similar to the aforementioned example, I see a complex=1 attribute that I'm missing when I make my hdf5 file.

[petsc-users] Question about TSSetRHSJacobian for linear time dependent problem

2019-01-25 Thread Sajid Ali via petsc-users
Hi, If I have a linear time dependent equation I'm trying to solve using TS, I can use : TSSetProblemType(ts,TS_LINEAR); TSSetRHSFunction(ts,NULL,TSComputeRHSFunctionLinear,NULL); TSSetRHSJacobian(ts,A,A,YourComputeRHSJacobian, ); If the matrix that's being evaluated by YourComputeRHSJacobian is

Re: [petsc-users] Argument out of range error only in certain mpi sizes

2019-04-10 Thread Sajid Ali via petsc-users
Thanks a lot for the advice Matt and Barry. One thing I wanted to confirm is that when I change from using a regular Vec to a Vec created using DMDACreateGlobalVector, to fill these with data from hdf5, I have to change the dimensions of hdf5 vectors from (dim_x*dim_y) to (dim_x,dim_y), right?

Re: [petsc-users] Argument out of range error only in certain mpi sizes

2019-04-11 Thread Sajid Ali via petsc-users
One last question I have is : Does PETSc automatically chose a good chunk size for the size of the vector it has and use it to write the dataset ? Or is this something I shouldn't really worry about (not that it affects me now but it would be good to not have a slow read from a python script for

Re: [petsc-users] Error with VecDestroy_MPIFFTW+0x61

2019-04-14 Thread Sajid Ali via petsc-users
Thanks for the temporary fix. (PS: I was wondering if it would be trivial to just extend the code to have four mallocs and create a new function but it looks like the logic is much more complicated.)

Re: [petsc-users] Error with VecDestroy_MPIFFTW+0x61

2019-04-14 Thread Sajid Ali via petsc-users
Hi Matt, While in theory, that sounds perfect I still get the same error. I'm attaching a minimal test program which creates 3 vectors x,y,z via the petsc-fftw interface and a test vector via VecDuplicate and then destroy all the vectors. Without the test vector everything works fine. Thank

[petsc-users] Error with VecDestroy_MPIFFTW+0x61

2019-04-14 Thread Sajid Ali via petsc-users
Hi PETSc Developers, I happen to be a user who needs 4 vectors whose layout is aligned with FFTW. The usual MatCreateVecsFFTW allows one to make 3 such vectors. To get around this I call the function twice, once with three vectors, once with one vector (and 2x NULL). This causes a strange

Re: [petsc-users] How to build FFTW3 interface?

2019-04-12 Thread Sajid Ali via petsc-users
Hi Balay, Confirming that the spack variant works. Thanks for adding it.

Re: [petsc-users] Error with VecDestroy_MPIFFTW+0x61

2019-04-15 Thread Sajid Ali via petsc-users
Hi Barry & Matt, I'd be happy to contribute a patch once I understand what's going on. @Matt, Where is the padding occurring? In the VecCreateFFTW I see that each process looks up the dimension of array it's supposed to hold and asks for memory to hold that via fftw_malloc (which as you say is

[petsc-users] VecView to hdf5 broken for large (complex) vectors

2019-04-16 Thread Sajid Ali via petsc-users
Hi PETSc developers, I’m trying to write a large vector created with VecCreateMPI (size 32768x32768) concurrently from 4 nodes (+32 tasks per node, total 128 mpi-ranks) and I see the following (indicative) error : [Full error log is here : https://file.io/CdjUfe] HDF5-DIAG: Error detected in

Re: [petsc-users] VecView to hdf5 broken for large (complex) vectors

2019-04-16 Thread Sajid Ali via petsc-users
Hi Matt, I tried running the same example with a smaller grid on a workstation and I see that for a grid size of 8192x8192 (vector write dims 67108864, 2), the output file has a chunk size of (16777215, 2). I can’t see HDF5_INT_MAX in the spack build-log (which includes configure). Is there a

Re: [petsc-users] Error with VecDestroy_MPIFFTW+0x61

2019-04-16 Thread Sajid Ali via petsc-users
Hi Barry/Matt, Since VecDuplicate calls v->ops->duplicate, can't we just add custom duplicate ops to the (f_in/f_out/b_out) vectors when they are created via MatCreateFFTW? (just like the custom destroy ops are defined) Also, what is the PetscObjectStateIncrease function doing ? Thank You,

Re: [petsc-users] VecView to hdf5 broken for large (complex) vectors

2019-04-16 Thread Sajid Ali via petsc-users
>Perhaps if spack had an easier mechanism to allow the user to "point to" local git clones it could get closer to the best of both worlds. Maybe spack could support a list of local repositories and branches in the yaml file. I wonder if a local git clone of petsc can become a "mirror" for petsc

Re: [petsc-users] VecView to hdf5 broken for large (complex) vectors

2019-04-16 Thread Sajid Ali via petsc-users
@Barry: Thanks for the bugfix! @Satish: Thanks for pointing out this method! My preferred way previously was to download the source code, unzip, edit, zip. Now ask spack to not checksum (because my edit has changed stuff) and build. Lately, spack has added git support and now I create a branch

Re: [petsc-users] VecView to hdf5 broken for large (complex) vectors

2019-04-16 Thread Sajid Ali via petsc-users
oblems valgrind > flags are real. MPICH needs to be configured with the option > --enable-g=meminit to be valgrind clean. PETSc's --download-mpich always > installs a valgrind clean MPI. > > > > It is unfortunate Spack doesn't provide a variant of MPICH that is > valgrind

Re: [petsc-users] VecView to hdf5 broken for large (complex) vectors

2019-04-16 Thread Sajid Ali via petsc-users
> develop > 3.11.99 > 3.10.xx > maint (or other strings) Just discovered this issue when trying to build with my fork of spack at [1 ]. So, ideally each developer has to have their develop point to the branch

[petsc-users] Question about TSComputeRHSJacobianConstant

2019-05-16 Thread Sajid Ali via petsc-users
Hi PETSc developers, I have a question about TSComputeRHSJacobianConstant. If I create a TS (of type linear) for a problem where the jacobian does not change with time (set with the aforementioned option) and run it for different number of time steps, why does the time it takes to evaluate the

Re: [petsc-users] Question about TSComputeRHSJacobianConstant

2019-05-16 Thread Sajid Ali via petsc-users
While there is a ~3.5X speedup, deleting the aforementioned 20 lines also leads the new version of petsc to give the wrong solution (off by orders of magnitude for the same program). I tried switching over the the IFunction/IJacobian interface as per the manual (page 146) which the following

Re: [petsc-users] Question about TSComputeRHSJacobianConstant

2019-05-16 Thread Sajid Ali via petsc-users
Hi Barry, Thanks a lot for pointing this out. I'm seeing ~3X speedup in time ! Attached are the new log files. Does everything look right ? Thank You, Sajid Ali Applied Physics Northwestern University out_50 Description: Binary data out_100 Description: Binary data

Re: [petsc-users] Question about TSComputeRHSJacobianConstant

2019-05-17 Thread Sajid Ali via petsc-users
Hi Hong, The solution has the right characteristics but it's off by many orders of magnitude. It is ~3.5x faster as before. Am I supposed to keep the TSRHSJacobianSetReuse function or not? Thank You, Sajid Ali Applied Physics Northwestern University

Re: [petsc-users] MPI-FFTW example crashes

2019-06-02 Thread Sajid Ali via petsc-users
Hi Barry, fftw-configure fails on login node. I'm attaching the error message at the bottom of this email. I tried request 1 hour of time on a compute node to compile fftw on it but for some reason 1 hour is not enough to compile fftw, hence I was forced to use cray-fftw-3.3.8.1 for which I had

[petsc-users] MPI-FFTW example crashes

2019-06-02 Thread Sajid Ali via petsc-users
Hi PETSc-developers, I'm trying to run ex143 on a cluster (alcf-theta). I compiled PETSc on login node with cray-fftw-3.3.8.1 and there was no error in either configure or make. When I try running ex143 with 1 MPI rank on compute node, everything works fine but with 2 MPI ranks, it crashes due

Re: [petsc-users] MPI-FFTW example crashes

2019-06-02 Thread Sajid Ali via petsc-users
@Barry : Perahps config/BuildSystem/config/packages/fftw.py should use the --host option when configure for PETSc is run with-batch=1. If anyone here knows what --host must be set to for KNL, I'd appreciate it. PS : I know that Intel-MKL-FFT provides FFTW api. If I'd want to try with this, is

Re: [petsc-users] Question about TSComputeRHSJacobianConstant

2019-05-22 Thread Sajid Ali via petsc-users
Hi Matt, Thanks for the explanation. That makes sense since I'd get reasonably close convergence with preonly sometimes and not at other times which was confusing. Anyway, since there's no pc_tol (analogous to ksp_rtol/ksp_atol, etc), I'd have to more carefully set the gamg preconditioner

Re: [petsc-users] Question about TSComputeRHSJacobianConstant

2019-05-22 Thread Sajid Ali via petsc-users
Hi Hong, Looks like this is my fault since I'm using -ksp_type preonly -pc_type gamg. If I use the default ksp (GMRES) then everything works fine on a smaller problem. Just to confirm, -ksp_type preonly is to be used only with direct-solve preconditioners like LU,Cholesky, right ? Thank You,

[petsc-users] Quick question about ISCreateGeneral

2019-04-30 Thread Sajid Ali via petsc-users
Hi PETSc Developers, I see that in the examples for ISCreateGeneral, the index sets are created by copying values from int arrays (which were created by PetscMalloc1 which is not collective). If I the ISCreateGeneral is called with PETSC_COMM_WORLD and the int arrays on each rank are

Re: [petsc-users] Quick question about ISCreateGeneral

2019-05-01 Thread Sajid Ali via petsc-users
Hi Barry, I've written a simple program that does a scatter and reverses the order of data between two vectors with locally generate index sets and it works. While I'd have expected that I would need to concatenate the index sets before calling vecscatter, the program works without doing so

Re: [petsc-users] Possible Bug ?

2019-04-22 Thread Sajid Ali via petsc-users
This can be tracked down to n vs N being used. The vector in the second loop is created using N while MatCreateVecsFFTW uses n (for real numbers). n!=N and hence the error. If the lines 50/51 and line 91 are switched to MatCreateVecsFFW instead of MatGetVecs and VecCreateSeq respectively, the

Re: [petsc-users] Possible Bug ?

2019-04-22 Thread Sajid Ali via petsc-users
Hi Barry, I'm not sure why MatCreateVecsFFW is not used at line 50/51. The error occurs at line 94 because in the second loop, the example manually creates the x vector instead of the one created using the A matrix. For complex numbers this is not an issue but for real numbers the dimensions

[petsc-users] Possible Bug ?

2019-04-22 Thread Sajid Ali via petsc-users
Hi, I see that src/mat/examples/tests/ex112.c is failing for petsc@3.11.1 configured without complex scalars. With complex scalars everything works fine. The error I see is : ``` [sajid@xrmlite bugfix]$ ./ex112 No protocol specified 1-D: FFTW on vector of size 10 Error norm of |x - z|

Re: [petsc-users] Possible Bug ?

2019-04-22 Thread Sajid Ali via petsc-users
Apologies for the post. I didn't see that it was for complex vectors only. On Mon, Apr 22, 2019 at 5:00 PM Sajid Ali wrote: > Hi, > > I see that src/mat/examples/tests/ex112.c is failing for petsc@3.11.1 > configured without complex scalars. With complex scalars everything works > fine. > > The

[petsc-users] Argument out of range error only in certain mpi sizes

2019-04-10 Thread Sajid Ali via petsc-users
Hi PETSc developers, I wanted to convert my code that in which I was using general Vec/Mat to DMDA based grid management (nothing fancy just a 5-point complex stencil). For this, I created a DA object and created the global solution vector using this. This worked fine. Now, I created the matrix

Re: [petsc-users] Error with VecDestroy_MPIFFTW+0x61

2019-04-17 Thread Sajid Ali via petsc-users
Hi Matt/Barry, I've implemented this for 1D-complex-mpi vec and tested it. Here is the modified source file -> https://bitbucket.org/sajid__ali/petsc/src/86fb19b57a7c4f8f42644e5160d2afbdc5e03639/src/mat/impls/fft/fftw/fftw.c Functions definitions at

[petsc-users] How to build FFTW3 interface?

2019-04-11 Thread Sajid Ali via petsc-users
Hi PETSc Developers, To run an example that involves the petsc-fftw interface, I loaded both petsc and fftw modules (linked of course to the same mpi) but the compiler complains of having no knowledge of functions like MatCreateVecsFFTW which happens to be defined at (in the source repo)

Re: [petsc-users] Question about TSComputeRHSJacobianConstant

2019-09-30 Thread Sajid Ali via petsc-users
Hi PETSc-developers, Has this bug been fixed in the new 3.12 release ? Thank You, Sajid Ali Applied Physics Northwestern University s-sajid-ali.github.io

Re: [petsc-users] VecDuplicate for FFTW-Vec causes VecDestroy to fail conditionally on VecLoad

2019-11-01 Thread Sajid Ali via petsc-users
Hi Junchao/Barry, It doesn't really matter what the h5 file contains, so I'm attaching a lightly edited script of src/vec/vec/examples/tutorials/ex10.c which should produce a vector to be used as input for the above test case. (I'm working with ` --with-scalar-type=complex`). Now that I think

Re: [petsc-users] VecView output to HDF5 in 3.12.0 broken ?

2019-10-16 Thread Sajid Ali via petsc-users
Hi Barry, Looking at the current code, am I right in assuming that the change is only in naming conventions and not in logic? I'll make a MR soon. Thank You, Sajid Ali Applied Physics Northwestern University s-sajid-ali.github.io

Re: [petsc-users] VecView output to HDF5 in 3.12.0 broken ?

2019-10-15 Thread Sajid Ali via petsc-users
Hi PETSc-developers, I think I’ve found the commit that broke this. In MR-1706 , the definition of PETSC_HDF5_INT_MAX was changed from being set to 2147483647 to (~(hsize_t)0). This new

Re: [petsc-users] VecView output to HDF5 in 3.12.0 broken ?

2019-10-11 Thread Sajid Ali via petsc-users
Hi Stefano/PETSc Developers, The chunksize is indeed limited to 4GB as per this page : https://portal.hdfgroup.org/pages/viewpage.action?pageId=48808714. With a (complex) DMDA vector of size (16384,16384,2) I see that PETSc saves it as a hdf5 file with chunks of size (1024,1024,2). But with a

Re: [petsc-users] VecView output to HDF5 in 3.12.0 broken ?

2019-10-11 Thread Sajid Ali via petsc-users
Also, both versions of PETSc were built with ^hdf5@1.10.5 ^mpich@3.3 %gcc@8.3.0 so the error is most likely not from hdf5.