Re: [petsc-users] Petsc not work in Windows-10

2020-03-30 Thread Jacob Faibussowitsch
>> We just cannot cope with spaces in paths. Can you use the shortened
>> contiguous name instead of "Program File"?

FYI: Program Files or Program Files(x86) is where windows installs all of its 
applications (from OS or installed by user). It is best to install your MPI and 
other packages in root dir C:. Thats why for example MinGW installs itself in 
there, so it doesn’t have to deal with the space in the path.

Best regards,

Jacob Faibussowitsch
(Jacob Fai - booss - oh - vitch)
Cell: (312) 694-3391

> On Mar 30, 2020, at 9:18 PM, Satish Balay via petsc-users 
>  wrote:
> 
> On Mon, 30 Mar 2020, Matthew Knepley wrote:
> 
>> On Mon, Mar 30, 2020 at 9:28 PM Qin Lu  wrote:
>> 
>>> Hi,
>>> 
>>> I installed Intel-MPI 2019, and configured petsc-3.12.4 using
>>> --with-mpi-dir="/cygdrive/c/Program Files
>>> (x86)/IntelSWTools/mpi/2019.6.166/intel64", it didn't work. So I change to
>>> use --with-mpi-include and --with-mpi-lib, still didn't work. The
>>> config.log is attached.
>>> 
>>> The following is my configuration:
>>> ===
>>> 
>>> ./configure --with-cc='win32fe icl' --with-fc='win32fe ifort'
>>> --with-cxx='win32fe icl' --with-petsc-arch="arch-win64-release-intel-mpi"
>>> --prefix=/cygdrive/c/cygwin_cache/petsc-3.12.4-release-win-64bit-intel-mpi
>>> --with-blas-lapack-dir="/cygdrive/c/Program Files
>>> (x86)/IntelSWTools/compilers_and_libraries_2018.5.274/windows/mkl/lib/intel64"
>>> --with-mpi-include="/cygdrive/c/Program Files
>>> (x86)/IntelSWTools/mpi/2019.6.166/intel64/include" 
>>> --with-mpi-lib="/cygdrive/c/Program
>>> Files (x86)/IntelSWTools/mpi/2019.6.166/intel64/lib/impicxx.lib"  --with-
>>> mpi-compilers=0 --with-debugging=0 --useThreads=0 --with-x=0 --with-x11=0
>>> --with-xt=0 --with-shared-libraries=0
>>> 
>>> =
>>> 
>>> Thanks for any suggestions.
>>> 
>> We just cannot cope with spaces in paths. Can you use the shortened
>> contiguous name instead of "Program File"?
> 
> 
> Yeah - the config/examples/arch-ci-mswin*.py lists paths without spaces - and 
> https://www.mcs.anl.gov/petsc/documentation/installation.html 
>  has the 
> instructions
> 
> The way to get this is: (for example)
> 
> balay@ps5 ~
> $ cygpath -u `cygpath -ms '/cygdrive/C/Program Files/Microsoft 
> MPI/Bin/mpiexec'`
> /cygdrive/c/PROGRA~1/MICROS~2/Bin/mpiexec.exe
> 
> Satish
> 
> 
> 
>> 
>>  Thanks,
>> 
>>Matt
>> 
>>> Regards,
>>> 
>>> Qin
>>> 
>>> 
>>> 
>>> 
>>> 
>>> On Monday, March 30, 2020, 04:15:14 PM CDT, Matthew Knepley <
>>> knep...@gmail.com> wrote:
>>> 
>>> 
>>> On Mon, Mar 30, 2020 at 4:43 PM Qin Lu via petsc-users <
>>> petsc-users@mcs.anl.gov> wrote:
>>> 
>>> Hi Satish,
>>> 
>>> The ex2.exe works with "mpiexec -np 2" when I ran it from command line.
>>> Then I ran "which mpiexec", it actually points to Intel-MPI instead of
>>> MPICH2, probably because I have set the former's path in environment
>>> variable PATH in Win-10. I will try to reinstall Intel-MPI and build Petsc
>>> with Intel-MPI.
>>> 
>>> As for the crash of calling to KSPSetPCSide(ksp_solver,PC_RIGHT,ierr) in
>>> my Fortran-90 program, do you have any idea what can be wrong? Can it be
>>> related to MPI?
>>> 
>>> I tested config/examples/arch-ci-mswin-intel.py as you suggested, but got
>>> the following output:
>>> 
>>> 
>>> python ./arch-ci-mswin-intel.py
>>> Traceback (most recent call last):
>>>  File "./arch-ci-mswin-intel.py", line 10, in 
>>>import configure
>>> ImportError: No module named configure
>>> 
>>> 
>>> 
>>> You have to run those from $PETSC_DIR.
>>> 
>>>  Matt
>>> 
>>> 
>>> Thanks,
>>> Qin
>>> 
>>> 
>>> 
>>> I will try to use Intel-MPI and see what will happen.
>>> 
>>> Thanks,
>>> Qin
>>> 
>>> On Monday, March 30, 2020, 01:47:49 PM CDT, Satish Balay <
>>> ba...@mcs.anl.gov> wrote:
>>> 
>>> 
>>> Please preserve cc: to the list
>>> 
 shared libraries: disabled
>>> 
>>> So PETSc  is correctly built as static.
>>> 
> C:/Program Files/mpich2x64/bin/mpiexec.exe: error while loading shared
>>> libraries: ?: cannot open shared object file: No such file or directory
>>> 
>>> So its not clear which shared library this error is referring to. But then
>>> - this error was with petsc-3.4.2
>>> 
>>> You can always try to run the code manually without mpiexec - and see if
>>> that works.
>>> 
>>> cd src/ksp/ksp/examples/tutorials
>>> make ex2
>>> ./ex2
>>> 
>>> Wrt MSMPI - yes its free to download
>>> 
>>> And PETSc does work with Intel-MPI. It might be a separate
>>> download/install. [so I can't say if what you have is the correct install
>>> of IntelMPI or not]
>>> 
>>> Check the builds we use for testing - for ex:
>>> config/examples/arch-ci-mswin-*.py
>>> 
>>> Satish
>>> 
>>> On Mon, 30 Mar 2020, Qin Lu wrote:
>>> 
 Hi Satish,
 The configure.log and RDict.log of  Petsc-3.12.4 build is attached.
 Is the MSMPI free to use in Windows-10?
 Does Petsc support Intel-MPI? I have it in my machine, 

Re: [petsc-users] Petsc not work in Windows-10

2020-03-30 Thread Satish Balay via petsc-users
On Mon, 30 Mar 2020, Matthew Knepley wrote:

> On Mon, Mar 30, 2020 at 9:28 PM Qin Lu  wrote:
> 
> > Hi,
> >
> > I installed Intel-MPI 2019, and configured petsc-3.12.4 using
> > --with-mpi-dir="/cygdrive/c/Program Files
> > (x86)/IntelSWTools/mpi/2019.6.166/intel64", it didn't work. So I change to
> > use --with-mpi-include and --with-mpi-lib, still didn't work. The
> > config.log is attached.
> >
> > The following is my configuration:
> > ===
> >
> > ./configure --with-cc='win32fe icl' --with-fc='win32fe ifort'
> > --with-cxx='win32fe icl' --with-petsc-arch="arch-win64-release-intel-mpi"
> > --prefix=/cygdrive/c/cygwin_cache/petsc-3.12.4-release-win-64bit-intel-mpi
> > --with-blas-lapack-dir="/cygdrive/c/Program Files
> > (x86)/IntelSWTools/compilers_and_libraries_2018.5.274/windows/mkl/lib/intel64"
> > --with-mpi-include="/cygdrive/c/Program Files
> > (x86)/IntelSWTools/mpi/2019.6.166/intel64/include" 
> > --with-mpi-lib="/cygdrive/c/Program
> > Files (x86)/IntelSWTools/mpi/2019.6.166/intel64/lib/impicxx.lib"  --with-
> > mpi-compilers=0 --with-debugging=0 --useThreads=0 --with-x=0 --with-x11=0
> > --with-xt=0 --with-shared-libraries=0
> >
> > =
> >
> > Thanks for any suggestions.
> >
> We just cannot cope with spaces in paths. Can you use the shortened
> contiguous name instead of "Program File"?


Yeah - the config/examples/arch-ci-mswin*.py lists paths without spaces - and 
https://www.mcs.anl.gov/petsc/documentation/installation.html has the 
instructions

The way to get this is: (for example)

balay@ps5 ~
$ cygpath -u `cygpath -ms '/cygdrive/C/Program Files/Microsoft MPI/Bin/mpiexec'`
/cygdrive/c/PROGRA~1/MICROS~2/Bin/mpiexec.exe

Satish



> 
>   Thanks,
> 
> Matt
> 
> > Regards,
> >
> > Qin
> >
> >
> >
> >
> >
> > On Monday, March 30, 2020, 04:15:14 PM CDT, Matthew Knepley <
> > knep...@gmail.com> wrote:
> >
> >
> > On Mon, Mar 30, 2020 at 4:43 PM Qin Lu via petsc-users <
> > petsc-users@mcs.anl.gov> wrote:
> >
> > Hi Satish,
> >
> > The ex2.exe works with "mpiexec -np 2" when I ran it from command line.
> > Then I ran "which mpiexec", it actually points to Intel-MPI instead of
> > MPICH2, probably because I have set the former's path in environment
> > variable PATH in Win-10. I will try to reinstall Intel-MPI and build Petsc
> > with Intel-MPI.
> >
> > As for the crash of calling to KSPSetPCSide(ksp_solver,PC_RIGHT,ierr) in
> > my Fortran-90 program, do you have any idea what can be wrong? Can it be
> > related to MPI?
> >
> > I tested config/examples/arch-ci-mswin-intel.py as you suggested, but got
> > the following output:
> >
> > 
> > python ./arch-ci-mswin-intel.py
> > Traceback (most recent call last):
> >   File "./arch-ci-mswin-intel.py", line 10, in 
> > import configure
> > ImportError: No module named configure
> > 
> >
> >
> > You have to run those from $PETSC_DIR.
> >
> >   Matt
> >
> >
> > Thanks,
> > Qin
> >
> >
> >
> > I will try to use Intel-MPI and see what will happen.
> >
> > Thanks,
> > Qin
> >
> > On Monday, March 30, 2020, 01:47:49 PM CDT, Satish Balay <
> > ba...@mcs.anl.gov> wrote:
> >
> >
> > Please preserve cc: to the list
> >
> > >  shared libraries: disabled
> >
> > So PETSc  is correctly built as static.
> >
> > > > C:/Program Files/mpich2x64/bin/mpiexec.exe: error while loading shared
> > libraries: ?: cannot open shared object file: No such file or directory
> >
> > So its not clear which shared library this error is referring to. But then
> > - this error was with petsc-3.4.2
> >
> > You can always try to run the code manually without mpiexec - and see if
> > that works.
> >
> > cd src/ksp/ksp/examples/tutorials
> > make ex2
> > ./ex2
> >
> > Wrt MSMPI - yes its free to download
> >
> > And PETSc does work with Intel-MPI. It might be a separate
> > download/install. [so I can't say if what you have is the correct install
> > of IntelMPI or not]
> >
> > Check the builds we use for testing - for ex:
> > config/examples/arch-ci-mswin-*.py
> >
> > Satish
> >
> > On Mon, 30 Mar 2020, Qin Lu wrote:
> >
> > >  Hi Satish,
> > > The configure.log and RDict.log of  Petsc-3.12.4 build is attached.
> > > Is the MSMPI free to use in Windows-10?
> > > Does Petsc support Intel-MPI? I have it in my machine, but for some
> > reason I only find the /mpi/intel64/bin, but not /mpi/intel64/include
> > subdirectory of it.
> > > Thanks a lot for your help.Qin
> > >On Monday, March 30, 2020, 12:26:09 PM CDT, Satish Balay <
> > ba...@mcs.anl.gov> wrote:
> > >
> > >  MPICH is unsupported - and we haven't tested with it for a long time.
> > >
> > > And petsc-3.4.2 is from 2013 - and untested with current gen
> > os/compilers/libraries.
> > >
> > > Can you send logs from Petsc-3.12.4 build [or try latest Petsc-3.13.0]?
> > >
> > > We recommend 64bit MSMPI for windows.
> > >
> > > Satish
> > >
> > > On Mon, 30 Mar 2020, Qin Lu via petsc-users wrote:
> > >
> > > > Hello,
> > > > I am trying to build Petsc-3.4.2 in my Windows-10 

Re: [petsc-users] Petsc not work in Windows-10

2020-03-30 Thread Matthew Knepley
On Mon, Mar 30, 2020 at 9:28 PM Qin Lu  wrote:

> Hi,
>
> I installed Intel-MPI 2019, and configured petsc-3.12.4 using
> --with-mpi-dir="/cygdrive/c/Program Files
> (x86)/IntelSWTools/mpi/2019.6.166/intel64", it didn't work. So I change to
> use --with-mpi-include and --with-mpi-lib, still didn't work. The
> config.log is attached.
>
> The following is my configuration:
> ===
>
> ./configure --with-cc='win32fe icl' --with-fc='win32fe ifort'
> --with-cxx='win32fe icl' --with-petsc-arch="arch-win64-release-intel-mpi"
> --prefix=/cygdrive/c/cygwin_cache/petsc-3.12.4-release-win-64bit-intel-mpi
> --with-blas-lapack-dir="/cygdrive/c/Program Files
> (x86)/IntelSWTools/compilers_and_libraries_2018.5.274/windows/mkl/lib/intel64"
> --with-mpi-include="/cygdrive/c/Program Files
> (x86)/IntelSWTools/mpi/2019.6.166/intel64/include" 
> --with-mpi-lib="/cygdrive/c/Program
> Files (x86)/IntelSWTools/mpi/2019.6.166/intel64/lib/impicxx.lib"  --with-
> mpi-compilers=0 --with-debugging=0 --useThreads=0 --with-x=0 --with-x11=0
> --with-xt=0 --with-shared-libraries=0
>
> =
>
> Thanks for any suggestions.
>
We just cannot cope with spaces in paths. Can you use the shortened
contiguous name instead of "Program File"?

  Thanks,

Matt

> Regards,
>
> Qin
>
>
>
>
>
> On Monday, March 30, 2020, 04:15:14 PM CDT, Matthew Knepley <
> knep...@gmail.com> wrote:
>
>
> On Mon, Mar 30, 2020 at 4:43 PM Qin Lu via petsc-users <
> petsc-users@mcs.anl.gov> wrote:
>
> Hi Satish,
>
> The ex2.exe works with "mpiexec -np 2" when I ran it from command line.
> Then I ran "which mpiexec", it actually points to Intel-MPI instead of
> MPICH2, probably because I have set the former's path in environment
> variable PATH in Win-10. I will try to reinstall Intel-MPI and build Petsc
> with Intel-MPI.
>
> As for the crash of calling to KSPSetPCSide(ksp_solver,PC_RIGHT,ierr) in
> my Fortran-90 program, do you have any idea what can be wrong? Can it be
> related to MPI?
>
> I tested config/examples/arch-ci-mswin-intel.py as you suggested, but got
> the following output:
>
> 
> python ./arch-ci-mswin-intel.py
> Traceback (most recent call last):
>   File "./arch-ci-mswin-intel.py", line 10, in 
> import configure
> ImportError: No module named configure
> 
>
>
> You have to run those from $PETSC_DIR.
>
>   Matt
>
>
> Thanks,
> Qin
>
>
>
> I will try to use Intel-MPI and see what will happen.
>
> Thanks,
> Qin
>
> On Monday, March 30, 2020, 01:47:49 PM CDT, Satish Balay <
> ba...@mcs.anl.gov> wrote:
>
>
> Please preserve cc: to the list
>
> >  shared libraries: disabled
>
> So PETSc  is correctly built as static.
>
> > > C:/Program Files/mpich2x64/bin/mpiexec.exe: error while loading shared
> libraries: ?: cannot open shared object file: No such file or directory
>
> So its not clear which shared library this error is referring to. But then
> - this error was with petsc-3.4.2
>
> You can always try to run the code manually without mpiexec - and see if
> that works.
>
> cd src/ksp/ksp/examples/tutorials
> make ex2
> ./ex2
>
> Wrt MSMPI - yes its free to download
>
> And PETSc does work with Intel-MPI. It might be a separate
> download/install. [so I can't say if what you have is the correct install
> of IntelMPI or not]
>
> Check the builds we use for testing - for ex:
> config/examples/arch-ci-mswin-*.py
>
> Satish
>
> On Mon, 30 Mar 2020, Qin Lu wrote:
>
> >  Hi Satish,
> > The configure.log and RDict.log of  Petsc-3.12.4 build is attached.
> > Is the MSMPI free to use in Windows-10?
> > Does Petsc support Intel-MPI? I have it in my machine, but for some
> reason I only find the /mpi/intel64/bin, but not /mpi/intel64/include
> subdirectory of it.
> > Thanks a lot for your help.Qin
> >On Monday, March 30, 2020, 12:26:09 PM CDT, Satish Balay <
> ba...@mcs.anl.gov> wrote:
> >
> >  MPICH is unsupported - and we haven't tested with it for a long time.
> >
> > And petsc-3.4.2 is from 2013 - and untested with current gen
> os/compilers/libraries.
> >
> > Can you send logs from Petsc-3.12.4 build [or try latest Petsc-3.13.0]?
> >
> > We recommend 64bit MSMPI for windows.
> >
> > Satish
> >
> > On Mon, 30 Mar 2020, Qin Lu via petsc-users wrote:
> >
> > > Hello,
> > > I am trying to build Petsc-3.4.2 in my Windows-10 workstation using
> Cygwin, with Intel-2018 compilers and MKL, and MPICH2. The
> configuration/compilation/installation seem to finish without problem, but
> test program (ex19) failed since it could not find a shared lib. Then I
> linked the libpetsc.lib with my program (in Fortran-90), but it got run
> time crash when it calls KSPSetPCSide(ksp_solver,PC_RIGHT,ierr) or other
> Petsc subroutines. Note that this package was built, tested and worked well
> with the same Fortran-90 program in my Windows-7 workstation.
> > >
> > > Also tried Petsc-3.12.4 but got the same errors.
> > >
> > > The following is my configuration:
> > >
> > >
> > > ===
> > >
> > > ./configure --with-cc='win32fe 

Re: [petsc-users] Petsc not work in Windows-10

2020-03-30 Thread Matthew Knepley
On Mon, Mar 30, 2020 at 4:43 PM Qin Lu via petsc-users <
petsc-users@mcs.anl.gov> wrote:

> Hi Satish,
>
> The ex2.exe works with "mpiexec -np 2" when I ran it from command line.
> Then I ran "which mpiexec", it actually points to Intel-MPI instead of
> MPICH2, probably because I have set the former's path in environment
> variable PATH in Win-10. I will try to reinstall Intel-MPI and build Petsc
> with Intel-MPI.
>
> As for the crash of calling to KSPSetPCSide(ksp_solver,PC_RIGHT,ierr) in
> my Fortran-90 program, do you have any idea what can be wrong? Can it be
> related to MPI?
>
> I tested config/examples/arch-ci-mswin-intel.py as you suggested, but got
> the following output:
>
> 
> python ./arch-ci-mswin-intel.py
> Traceback (most recent call last):
>   File "./arch-ci-mswin-intel.py", line 10, in 
> import configure
> ImportError: No module named configure
> 
>

You have to run those from $PETSC_DIR.

  Matt


> Thanks,
> Qin
>
>
>
> I will try to use Intel-MPI and see what will happen.
>
> Thanks,
> Qin
>
> On Monday, March 30, 2020, 01:47:49 PM CDT, Satish Balay <
> ba...@mcs.anl.gov> wrote:
>
>
> Please preserve cc: to the list
>
> >  shared libraries: disabled
>
> So PETSc  is correctly built as static.
>
> > > C:/Program Files/mpich2x64/bin/mpiexec.exe: error while loading shared
> libraries: ?: cannot open shared object file: No such file or directory
>
> So its not clear which shared library this error is referring to. But then
> - this error was with petsc-3.4.2
>
> You can always try to run the code manually without mpiexec - and see if
> that works.
>
> cd src/ksp/ksp/examples/tutorials
> make ex2
> ./ex2
>
> Wrt MSMPI - yes its free to download
>
> And PETSc does work with Intel-MPI. It might be a separate
> download/install. [so I can't say if what you have is the correct install
> of IntelMPI or not]
>
> Check the builds we use for testing - for ex:
> config/examples/arch-ci-mswin-*.py
>
> Satish
>
> On Mon, 30 Mar 2020, Qin Lu wrote:
>
> >  Hi Satish,
> > The configure.log and RDict.log of  Petsc-3.12.4 build is attached.
> > Is the MSMPI free to use in Windows-10?
> > Does Petsc support Intel-MPI? I have it in my machine, but for some
> reason I only find the /mpi/intel64/bin, but not /mpi/intel64/include
> subdirectory of it.
> > Thanks a lot for your help.Qin
> >On Monday, March 30, 2020, 12:26:09 PM CDT, Satish Balay <
> ba...@mcs.anl.gov> wrote:
> >
> >  MPICH is unsupported - and we haven't tested with it for a long time.
> >
> > And petsc-3.4.2 is from 2013 - and untested with current gen
> os/compilers/libraries.
> >
> > Can you send logs from Petsc-3.12.4 build [or try latest Petsc-3.13.0]?
> >
> > We recommend 64bit MSMPI for windows.
> >
> > Satish
> >
> > On Mon, 30 Mar 2020, Qin Lu via petsc-users wrote:
> >
> > > Hello,
> > > I am trying to build Petsc-3.4.2 in my Windows-10 workstation using
> Cygwin, with Intel-2018 compilers and MKL, and MPICH2. The
> configuration/compilation/installation seem to finish without problem, but
> test program (ex19) failed since it could not find a shared lib. Then I
> linked the libpetsc.lib with my program (in Fortran-90), but it got run
> time crash when it calls KSPSetPCSide(ksp_solver,PC_RIGHT,ierr) or other
> Petsc subroutines. Note that this package was built, tested and worked well
> with the same Fortran-90 program in my Windows-7 workstation.
> > >
> > > Also tried Petsc-3.12.4 but got the same errors.
> > >
> > > The following is my configuration:
> > >
> > >
> > > ===
> > >
> > > ./configure --with-cc='win32fe icl' --with-fc='win32fe ifort'
> --with-cxx='win32fe icl' --with-petsc-arch="arch-win64-release"
> --prefix=/cygdrive/c/cygwin_cache/petsc-3.4.2-release-win-64bit
> --with-blas-lapack-dir="/cygdrive/c/Program Files
> (x86)/IntelSWTools/compilers_and_libraries_2018.5.274/windows/mkl/lib/intel64"
> --with-mpi-dir="/cygdrive/c/Program Files/mpich2x64" --with-debugging=0
> --useThreads=0 --with-x=0 --with-x11=0 --with-xt=0 --with-shared-libraries=0
> > >
> > > ===
> > >
> > >
> > > The error message of running ex19 is:
> > >
> > >
> > > =
> > >
> > > $ make PETSC_DIR=/cygdrive/c/cygwin_cache/petsc-3.4.2-debug-win-64bit
> test
> > >
> > > Running test examples to verify correct installation
> > >
> > > Using PETSC_DIR=/cygdrive/c/cygwin_cache/petsc-3.4.2-debug-win-64bit
> and PETSC_ARCH=arch-win64-debug
> > >
> > > Possible error running C/C++ src/snes/examples/tutorials/ex19 with 1
> MPI process
> > >
> > > See http://www.mcs.anl.gov/petsc/documentation/faq.html
> > >
> > > C:/Program Files/mpich2x64/bin/mpiexec.exe: error while loading shared
> libraries: ?: cannot open shared object file: No such file or directory
> > >
> > > =
> > >
> > >
> > > Thanks a lot for any suggestions.
> > >
> > >
> > > Best Regards,
> > >
> > > Qin
> > >
> > >
> > >
> > >
> > >
>


-- 
What most experimenters take for granted before they begin their

Re: [petsc-users] Construct Matrix based on row and column values

2020-03-30 Thread Elias Karabelas

Dear Jed,

Thanks I will try to keep you updated. So I managed to get my stuff 
running with one process but it fails with more than one. The matrix 
assembly as you described it works fine but I forgot that in the FCT 
algorithm one also needs to assemble a matrix D that looks kinda like


D_ij = L_ij * (u[i] - u[j])

where u is a vector with solution data from a previous time step. So the 
problem is that I have to now access off-process values of the Vector u, 
and doing this for each row of D. My basic first idea was to utilize the 
VecScatter Example from the Petsc Manual to get the off-process values 
per row of L to build this matrix D. But somehow this does not really 
work. Any ideas on how to scatter the Vector-data so that I can get the 
correct Vector values ?


At the moment I'm using something along this lines (in a loop where I 
get the local array of u with VecGetArray --> u_arr)


MatGetRow(L, row, , , );

double * Dvals = new double[ncolsM]();
int * idx_to = new int[ncolsL]();
for(int k=0; k < ncolsM; k++)

    idx_to[k] = k;
MPI_Barrier(PETSC_COMM_WORLD);
//Scatter the right stuff
Vec x;
VecScatter scatter;
IS from, to;
double *vals;
VecCreateSeq(PETSC_COMM_SELF, ncolsL, );
ISCreateGeneral(PETSC_COMM_SELF,ncolsL,colsL,PETSC_COPY_VALUES,);
ISCreateGeneral(PETSC_COMM_SELF,ncolsL,idx_to,PETSC_COPY_VALUES,);
VecScatterCreate(u,from,x,to,);
VecScatterBegin(scatter,u,x,INSERT_VALUES,SCATTER_FORWARD);
VecScatterEnd(scatter,u,x,INSERT_VALUES,SCATTER_FORWARD);
VecGetArray(x,);
for(int c=0; c < ncolsL; c++)
{
    Dvals[c] = valsL[c] * (vals[c] -  u_arr[row])

}

MatSetValues(D, 1, , ncolsL, colsL, Dvals, ADD_VALUES);

and so on...

On 23/03/2020 15:53, Jed Brown wrote:

Thanks; please don't drop the list.

I'd be curious whether this operation is common enough that we should
add it to PETSc.  My hesitance has been that people may want many
different variants when working with systems of equations, for example.

Elias Karabelas  writes:


Dear Jed,

Yes the Matrix A comes from assembling a FEM-convection-diffusion
operator over a tetrahedral mesh. So my matrix graph should be
symmetric. Thanks for the snippet

On 23/03/2020 15:42, Jed Brown wrote:

Elias Karabelas  writes:


Dear Users,

I want to implement a FCT (flux corrected transport) scheme with PETSc.
To this end I have amongst other things create a Matrix whose entries
are given by

L_ij = -max(0, A_ij, A_ji) for i neq j

L_ii = Sum_{j=0,..n, j neq i} L_ij

where Mat A is an (non-symmetric) Input Matrix created beforehand.

I was wondering how to do this. My first search brought me to
https://www.mcs.anl.gov/petsc/petsc-current/src/mat/examples/tutorials/ex16.c.html


but this just goes over the rows of one matrix to set new values and now
I would need to run over the rows and columns of the matrix. My Idea was
to just create a transpose of A and do the same but then the row-layout
will be different and I can't use the same for loop for A and AT and
thus also won't be able to calculate the max's above.

Does your matrix have symmetric nonzero structure?  (It's typical for
finite element methods.)

If so, all the indices will match up so I think you can do something like:

for (row=rowstart; row

Re: [petsc-users] Petsc not work in Windows-10

2020-03-30 Thread Qin Lu via petsc-users
 Hi Satish,
The ex2.exe works with "mpiexec -np 2" when I ran it from command line. Then I 
ran "which mpiexec", it actually points to Intel-MPI instead of MPICH2, 
probably because I have set the former's path in environment variable PATH in 
Win-10. I will try to reinstall Intel-MPI and build Petsc with Intel-MPI.
As for the crash of calling to KSPSetPCSide(ksp_solver,PC_RIGHT,ierr) in my 
Fortran-90 program, do you have any idea what can be wrong? Can it be related 
to MPI?
I tested config/examples/arch-ci-mswin-intel.py as you suggested, but got the 
following output:
python ./arch-ci-mswin-intel.pyTraceback (most recent call last):  
File "./arch-ci-mswin-intel.py", line 10, in     import 
configureImportError: No module named configure
Thanks,Qin


I will try to use Intel-MPI and see what will happen.
Thanks,Qin
On Monday, March 30, 2020, 01:47:49 PM CDT, Satish Balay 
 wrote:  
 
 Please preserve cc: to the list

>  shared libraries: disabled

So PETSc  is correctly built as static.

> > C:/Program Files/mpich2x64/bin/mpiexec.exe: error while loading shared 
> > libraries: ?: cannot open shared object file: No such file or directory

So its not clear which shared library this error is referring to. But then - 
this error was with petsc-3.4.2

You can always try to run the code manually without mpiexec - and see if that 
works.

cd src/ksp/ksp/examples/tutorials
make ex2
./ex2

Wrt MSMPI - yes its free to download

And PETSc does work with Intel-MPI. It might be a separate download/install. 
[so I can't say if what you have is the correct install of IntelMPI or not]

Check the builds we use for testing - for ex: config/examples/arch-ci-mswin-*.py

Satish

On Mon, 30 Mar 2020, Qin Lu wrote:

>  Hi Satish,
> The configure.log and RDict.log of  Petsc-3.12.4 build is attached.
> Is the MSMPI free to use in Windows-10?
> Does Petsc support Intel-MPI? I have it in my machine, but for some reason I 
> only find the /mpi/intel64/bin, but not /mpi/intel64/include subdirectory of 
> it.
> Thanks a lot for your help.Qin
>    On Monday, March 30, 2020, 12:26:09 PM CDT, Satish Balay 
> wrote:  
>  
>  MPICH is unsupported - and we haven't tested with it for a long time.
> 
> And petsc-3.4.2 is from 2013 - and untested with current gen 
> os/compilers/libraries.
> 
> Can you send logs from Petsc-3.12.4 build [or try latest Petsc-3.13.0]?
> 
> We recommend 64bit MSMPI for windows.
> 
> Satish
> 
> On Mon, 30 Mar 2020, Qin Lu via petsc-users wrote:
> 
> > Hello, 
> > I am trying to build Petsc-3.4.2 in my Windows-10 workstation using Cygwin, 
> > with Intel-2018 compilers and MKL, and MPICH2. The 
> > configuration/compilation/installation seem to finish without problem, but 
> > test program (ex19) failed since it could not find a shared lib. Then I 
> > linked the libpetsc.lib with my program (in Fortran-90), but it got run 
> > time crash when it calls KSPSetPCSide(ksp_solver,PC_RIGHT,ierr) or other 
> > Petsc subroutines. Note that this package was built, tested and worked well 
> > with the same Fortran-90 program in my Windows-7 workstation. 
> >  
> > Also tried Petsc-3.12.4 but got the same errors.
> >  
> > The following is my configuration:
> > 
> >  
> > ===
> >  
> > ./configure --with-cc='win32fe icl' --with-fc='win32fe ifort' 
> > --with-cxx='win32fe icl' --with-petsc-arch="arch-win64-release" 
> > --prefix=/cygdrive/c/cygwin_cache/petsc-3.4.2-release-win-64bit 
> > --with-blas-lapack-dir="/cygdrive/c/Program Files 
> > (x86)/IntelSWTools/compilers_and_libraries_2018.5.274/windows/mkl/lib/intel64"
> >  --with-mpi-dir="/cygdrive/c/Program Files/mpich2x64" --with-debugging=0 
> > --useThreads=0 --with-x=0 --with-x11=0 --with-xt=0 --with-shared-libraries=0
> >  
> > ===
> > 
> >  
> > The error message of running ex19 is:
> > 
> >  
> > =
> >  
> > $ make PETSC_DIR=/cygdrive/c/cygwin_cache/petsc-3.4.2-debug-win-64bit test
> >  
> > Running test examples to verify correct installation
> >  
> > Using PETSC_DIR=/cygdrive/c/cygwin_cache/petsc-3.4.2-debug-win-64bit and 
> > PETSC_ARCH=arch-win64-debug
> >  
> > Possible error running C/C++ src/snes/examples/tutorials/ex19 with 1 MPI 
> > process
> >  
> > See http://www.mcs.anl.gov/petsc/documentation/faq.html
> >  
> > C:/Program Files/mpich2x64/bin/mpiexec.exe: error while loading shared 
> > libraries: ?: cannot open shared object file: No such file or directory
> >  
> > =
> > 
> >  
> > Thanks a lot for any suggestions.
> > 
> >  
> > Best Regards,
> >  
> > Qin
> >  
> >   
> >  
> >   
> >       

Re: [petsc-users] Petsc not work in Windows-10

2020-03-30 Thread Satish Balay via petsc-users
Please preserve cc: to the list

>  shared libraries: disabled

So PETSc  is correctly built as static.

> > C:/Program Files/mpich2x64/bin/mpiexec.exe: error while loading shared 
> > libraries: ?: cannot open shared object file: No such file or directory

So its not clear which shared library this error is referring to. But then - 
this error was with petsc-3.4.2

You can always try to run the code manually without mpiexec - and see if that 
works.

cd src/ksp/ksp/examples/tutorials
make ex2
./ex2

Wrt MSMPI - yes its free to download

And PETSc does work with Intel-MPI. It might be a separate download/install. 
[so I can't say if what you have is the correct install of IntelMPI or not]

Check the builds we use for testing - for ex: config/examples/arch-ci-mswin-*.py

Satish

On Mon, 30 Mar 2020, Qin Lu wrote:

>  Hi Satish,
> The configure.log and RDict.log of  Petsc-3.12.4 build is attached.
> Is the MSMPI free to use in Windows-10?
> Does Petsc support Intel-MPI? I have it in my machine, but for some reason I 
> only find the /mpi/intel64/bin, but not /mpi/intel64/include subdirectory of 
> it.
> Thanks a lot for your help.Qin
> On Monday, March 30, 2020, 12:26:09 PM CDT, Satish Balay 
>  wrote:  
>  
>  MPICH is unsupported - and we haven't tested with it for a long time.
> 
> And petsc-3.4.2 is from 2013 - and untested with current gen 
> os/compilers/libraries.
> 
> Can you send logs from Petsc-3.12.4 build [or try latest Petsc-3.13.0]?
> 
> We recommend 64bit MSMPI for windows.
> 
> Satish
> 
> On Mon, 30 Mar 2020, Qin Lu via petsc-users wrote:
> 
> > Hello, 
> > I am trying to build Petsc-3.4.2 in my Windows-10 workstation using Cygwin, 
> > with Intel-2018 compilers and MKL, and MPICH2. The 
> > configuration/compilation/installation seem to finish without problem, but 
> > test program (ex19) failed since it could not find a shared lib. Then I 
> > linked the libpetsc.lib with my program (in Fortran-90), but it got run 
> > time crash when it calls KSPSetPCSide(ksp_solver,PC_RIGHT,ierr) or other 
> > Petsc subroutines. Note that this package was built, tested and worked well 
> > with the same Fortran-90 program in my Windows-7 workstation. 
> >  
> > Also tried Petsc-3.12.4 but got the same errors.
> >  
> > The following is my configuration:
> > 
> >  
> > ===
> >  
> > ./configure --with-cc='win32fe icl' --with-fc='win32fe ifort' 
> > --with-cxx='win32fe icl' --with-petsc-arch="arch-win64-release" 
> > --prefix=/cygdrive/c/cygwin_cache/petsc-3.4.2-release-win-64bit 
> > --with-blas-lapack-dir="/cygdrive/c/Program Files 
> > (x86)/IntelSWTools/compilers_and_libraries_2018.5.274/windows/mkl/lib/intel64"
> >  --with-mpi-dir="/cygdrive/c/Program Files/mpich2x64" --with-debugging=0 
> > --useThreads=0 --with-x=0 --with-x11=0 --with-xt=0 --with-shared-libraries=0
> >  
> > ===
> > 
> >  
> > The error message of running ex19 is:
> > 
> >  
> > =
> >  
> > $ make PETSC_DIR=/cygdrive/c/cygwin_cache/petsc-3.4.2-debug-win-64bit test
> >  
> > Running test examples to verify correct installation
> >  
> > Using PETSC_DIR=/cygdrive/c/cygwin_cache/petsc-3.4.2-debug-win-64bit and 
> > PETSC_ARCH=arch-win64-debug
> >  
> > Possible error running C/C++ src/snes/examples/tutorials/ex19 with 1 MPI 
> > process
> >  
> > See http://www.mcs.anl.gov/petsc/documentation/faq.html
> >  
> > C:/Program Files/mpich2x64/bin/mpiexec.exe: error while loading shared 
> > libraries: ?: cannot open shared object file: No such file or directory
> >  
> > =
> > 
> >  
> > Thanks a lot for any suggestions.
> > 
> >  
> > Best Regards,
> >  
> > Qin
> >  
> >   
> >  
> >   
> >      

[petsc-users] AIJ vs BAIJ when using ILU factorization

2020-03-30 Thread Fande Kong
Hi All,

There is a system of equations arising from the discretization of 3D
incompressible Navier-Stoke equations using a finite element method. 4
unknowns are placed on each mesh point, and then there is a 4x4 saddle
point block on each mesh vertex.  I was thinking to solve the linear
equations using an incomplete LU factorization (that will be eventually
used as a subdomain solver for ASM).

Right now, I am trying to study the ILU performance using AIJ and BAIJ,
respectively. From my understanding, BAIJ should give me better results
since it inverses the 4x4 blocks exactly, while AIJ does not. However, I
found that both BAIJ and AIJ gave me identical results in terms of the
number of iterations.  Was that just coincident?  Or in theory, they are
just identical.  I understand the runtimes may be different because BAIJ
has a better data locality.


Please see the attached files for the results and solver configuration.


Thanks,

Fande,


aij.result
Description: Binary data


baij.result
Description: Binary data


Re: [petsc-users] Petsc not work in Windows-10

2020-03-30 Thread Satish Balay via petsc-users
MPICH is unsupported - and we haven't tested with it for a long time.

And petsc-3.4.2 is from 2013 - and untested with current gen 
os/compilers/libraries.

Can you send logs from Petsc-3.12.4 build [or try latest Petsc-3.13.0]?

We recommend 64bit MSMPI for windows.

Satish

On Mon, 30 Mar 2020, Qin Lu via petsc-users wrote:

> Hello, 
> I am trying to build Petsc-3.4.2 in my Windows-10 workstation using Cygwin, 
> with Intel-2018 compilers and MKL, and MPICH2. The 
> configuration/compilation/installation seem to finish without problem, but 
> test program (ex19) failed since it could not find a shared lib. Then I 
> linked the libpetsc.lib with my program (in Fortran-90), but it got run time 
> crash when it calls KSPSetPCSide(ksp_solver,PC_RIGHT,ierr) or other Petsc 
> subroutines. Note that this package was built, tested and worked well with 
> the same Fortran-90 program in my Windows-7 workstation. 
>  
> Also tried Petsc-3.12.4 but got the same errors.
>  
> The following is my configuration:
> 
>  
> ===
>  
> ./configure --with-cc='win32fe icl' --with-fc='win32fe ifort' 
> --with-cxx='win32fe icl' --with-petsc-arch="arch-win64-release" 
> --prefix=/cygdrive/c/cygwin_cache/petsc-3.4.2-release-win-64bit 
> --with-blas-lapack-dir="/cygdrive/c/Program Files 
> (x86)/IntelSWTools/compilers_and_libraries_2018.5.274/windows/mkl/lib/intel64"
>  --with-mpi-dir="/cygdrive/c/Program Files/mpich2x64" --with-debugging=0 
> --useThreads=0 --with-x=0 --with-x11=0 --with-xt=0 --with-shared-libraries=0
>  
> ===
> 
>  
> The error message of running ex19 is:
> 
>  
> =
>  
> $ make PETSC_DIR=/cygdrive/c/cygwin_cache/petsc-3.4.2-debug-win-64bit test
>  
> Running test examples to verify correct installation
>  
> Using PETSC_DIR=/cygdrive/c/cygwin_cache/petsc-3.4.2-debug-win-64bit and 
> PETSC_ARCH=arch-win64-debug
>  
> Possible error running C/C++ src/snes/examples/tutorials/ex19 with 1 MPI 
> process
>  
> See http://www.mcs.anl.gov/petsc/documentation/faq.html
>  
> C:/Program Files/mpich2x64/bin/mpiexec.exe: error while loading shared 
> libraries: ?: cannot open shared object file: No such file or directory
>  
> =
> 
>  
> Thanks a lot for any suggestions.
> 
>  
> Best Regards,
>  
> Qin
>  
>   
>  
>   
>

Re: [petsc-users] duplicate PETSC options

2020-03-30 Thread Randall Mackie
Hi Matt,

Yes I just submitted an issue.

Thanks very much.

Randy M.


> On Mar 30, 2020, at 9:15 AM, Matthew Knepley  wrote:
> 
> On Mon, Mar 30, 2020 at 11:46 AM Randall Mackie  > wrote:
> When PETSc reads in a list of options (like PetscOptionsGetReal, etc), we 
> have noticed that if there are duplicate entries, that PETSc takes the last 
> one entered as the option to use. This can happen if the user didn’t notice 
> there were two lines with the same options name (but different values set).
> 
> Is there someway to have PETSc check for duplicate entries so that we can 
> stop program execution and warn the user?
> 
> We could add an option. We make heavy use of this behavior in order to 
> override options previously specified (which act as defaults).
> Could you create an issue for it?
> 
>   Thanks,
> 
>  Matt
>  
> Thanks, 
> 
> Randy M
> 
> 
> -- 
> What most experimenters take for granted before they begin their experiments 
> is infinitely more interesting than any results to which their experiments 
> lead.
> -- Norbert Wiener
> 
> https://www.cse.buffalo.edu/~knepley/ 



[petsc-users] Petsc not work in Windows-10

2020-03-30 Thread Qin Lu via petsc-users
Hello, 
I am trying to build Petsc-3.4.2 in my Windows-10 workstation using Cygwin, 
with Intel-2018 compilers and MKL, and MPICH2. The 
configuration/compilation/installation seem to finish without problem, but test 
program (ex19) failed since it could not find a shared lib. Then I linked the 
libpetsc.lib with my program (in Fortran-90), but it got run time crash when it 
calls KSPSetPCSide(ksp_solver,PC_RIGHT,ierr) or other Petsc subroutines. Note 
that this package was built, tested and worked well with the same Fortran-90 
program in my Windows-7 workstation. 
 
Also tried Petsc-3.12.4 but got the same errors.
 
The following is my configuration:

 
===
 
./configure --with-cc='win32fe icl' --with-fc='win32fe ifort' 
--with-cxx='win32fe icl' --with-petsc-arch="arch-win64-release" 
--prefix=/cygdrive/c/cygwin_cache/petsc-3.4.2-release-win-64bit 
--with-blas-lapack-dir="/cygdrive/c/Program Files 
(x86)/IntelSWTools/compilers_and_libraries_2018.5.274/windows/mkl/lib/intel64" 
--with-mpi-dir="/cygdrive/c/Program Files/mpich2x64" --with-debugging=0 
--useThreads=0 --with-x=0 --with-x11=0 --with-xt=0 --with-shared-libraries=0
 
===

 
The error message of running ex19 is:

 
=
 
$ make PETSC_DIR=/cygdrive/c/cygwin_cache/petsc-3.4.2-debug-win-64bit test
 
Running test examples to verify correct installation
 
Using PETSC_DIR=/cygdrive/c/cygwin_cache/petsc-3.4.2-debug-win-64bit and 
PETSC_ARCH=arch-win64-debug
 
Possible error running C/C++ src/snes/examples/tutorials/ex19 with 1 MPI process
 
See http://www.mcs.anl.gov/petsc/documentation/faq.html
 
C:/Program Files/mpich2x64/bin/mpiexec.exe: error while loading shared 
libraries: ?: cannot open shared object file: No such file or directory
 
=

 
Thanks a lot for any suggestions.

 
Best Regards,
 
Qin
 
  
 
  
   

Re: [petsc-users] duplicate PETSC options

2020-03-30 Thread Matthew Knepley
On Mon, Mar 30, 2020 at 11:46 AM Randall Mackie 
wrote:

> When PETSc reads in a list of options (like PetscOptionsGetReal, etc), we
> have noticed that if there are duplicate entries, that PETSc takes the last
> one entered as the option to use. This can happen if the user didn’t notice
> there were two lines with the same options name (but different values set).
>
> Is there someway to have PETSc check for duplicate entries so that we can
> stop program execution and warn the user?
>

We could add an option. We make heavy use of this behavior in order to
override options previously specified (which act as defaults).
Could you create an issue for it?

  Thanks,

 Matt


> Thanks,
>
> Randy M



-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

https://www.cse.buffalo.edu/~knepley/ 


[petsc-users] duplicate PETSC options

2020-03-30 Thread Randall Mackie
When PETSc reads in a list of options (like PetscOptionsGetReal, etc), we have 
noticed that if there are duplicate entries, that PETSc takes the last one 
entered as the option to use. This can happen if the user didn’t notice there 
were two lines with the same options name (but different values set).

Is there someway to have PETSc check for duplicate entries so that we can stop 
program execution and warn the user?

Thanks, 

Randy M

Re: [petsc-users] PETSc 3.13 release

2020-03-30 Thread Satish Balay via petsc-users
Sorry - this subject should have said: PETSc 3.13 release

Satish

On Mon, 30 Mar 2020, Satish Balay wrote:

> 
> We are pleased to announce the release of PETSc version 3.13 at 
> http://www.mcs.anl.gov/petsc
> 
> The major changes and updates can be found at 
> http://www.mcs.anl.gov/petsc/documentation/changes/313.html
> 
> The final update to petsc-3.12 i.e petsc-3.12.5 is also available
> 
> We recommend upgrading to PETSc 3.13 soon. As always, please report problems 
> to  petsc-ma...@mcs.anl.gov and ask questions at petsc-users@mcs.anl.gov
> 
> This release includes contributions from
> 
>  Alp Dener
>  Barry Smith
>  Betrie, Getnet
>  Brandon Whitchurch
>  Claas Abert
>  Fande Kong
>  Florian
>  Getnet Betrie
>  Hannah Morgan
>  Hansol  Suh
>  Hong Zhang
>  Jacob Faibussowitsch
>  Jed Brown
>  Jeremy L Thompson
>  Jose Roman
>  Junchao Zhang
>  Klaus Zimmermann
>  Lawrence Mitchell
>  Lisandro Dalcin
>  marius
>  Martin Diehl
>  Matthew Knepley
>  Mr. Hong Zhang
>  Patrick Sanan
>  Peter Hill
>  Pierre Jolivet
>  Richard Tran Mills
>  Sajid Ali
>  Satish Balay
>  Scott Kruger
>  Scott MacLachlan
>  Shrirang Abhyankar
>  Stefano Zampini
>  Steve Benbow
>  Toby Isaac
>  Tyler Chen
>  Vaclav Hapla
>  Valeria Barra
> 
> 
> and bug reports/patches/proposed improvements received from
> 
> 
>  "Abhyankar, Shrirang G"
>  Arash Mehraban
>  Barry Smith
>  Benjamin Bugeat
>  Brandon Denton
>  Cameron Smith
>  Carl Hall
>  Claudio Tomasi
>  "David, Cedric H (US 329F)"
>  Dipankar Dwivedi
>  Dmitry Melnichuk
>  Ed Bueler
>  Emmanuel Ayala
>  Eric Chamberland
>  Fande Kong
>  Frederic Vi
>  Gautam Bisht
>  Guangming Wang
>  Hong Zhang
>  Ivan Blagopoluchnyy
>  Jacob Faibussowitsch
>  James Ramsey
>  James Wright
>  Jan Grießer
>  Jaysaval, Piyoosh
>  Jed Brown
>  Jeremy Thompson
>  Jin Chen
>  jordic
>  Jose E. Roman
>  Junchao Zhang
>  Justin Herter
>  Kai Germaschewski
>  Lisandro Dalcin
>  Marius Buerkle
>  Mark Adams
>  Mark Lohry
>  Martin Diehl
>  Matthew Knepley
>  "McInnes, Lois Curfman"
>  Mehmet Sahin
>  Miguel Fosas de Pando
>  Miguel Salazar De Troya
>  mphysx team
>  "Nourgaliev, Robert Nr"
>  "Ofori-Opoku, Nana"
>  PAEZ ESPEJO Miguel-Angel EUROGICIEL INGENIERIE
>  Patrick Zulian
>  Paul T. Bauman
>  Philippe Billuart
>  Pierre Jolivet
>  Ramin Moghadasi
>  Randall Mackie
>  Richard Tran Mills
>  Sajid Ali
>  Sam Guo
>  Satish Balay
>  Scott Kruger
>  Sébastien Gilles
>  Thibaut Appel
>  Toby Isaac
>  Tomas Mondragon
>  Valeria Barra
>  Victor Eijkhout
>  Xiaodong Liu
> 
> As always, thanks for your support,
> 
> Satish, on behalf of PETSc team


[petsc-users] PETSc 3.12 release

2020-03-30 Thread Satish Balay via petsc-users

We are pleased to announce the release of PETSc version 3.13 at 
http://www.mcs.anl.gov/petsc

The major changes and updates can be found at 
http://www.mcs.anl.gov/petsc/documentation/changes/313.html

The final update to petsc-3.12 i.e petsc-3.12.5 is also available

We recommend upgrading to PETSc 3.13 soon. As always, please report problems to 
 petsc-ma...@mcs.anl.gov and ask questions at petsc-users@mcs.anl.gov

This release includes contributions from

 Alp Dener
 Barry Smith
 Betrie, Getnet
 Brandon Whitchurch
 Claas Abert
 Fande Kong
 Florian
 Getnet Betrie
 Hannah Morgan
 Hansol  Suh
 Hong Zhang
 Jacob Faibussowitsch
 Jed Brown
 Jeremy L Thompson
 Jose Roman
 Junchao Zhang
 Klaus Zimmermann
 Lawrence Mitchell
 Lisandro Dalcin
 marius
 Martin Diehl
 Matthew Knepley
 Mr. Hong Zhang
 Patrick Sanan
 Peter Hill
 Pierre Jolivet
 Richard Tran Mills
 Sajid Ali
 Satish Balay
 Scott Kruger
 Scott MacLachlan
 Shrirang Abhyankar
 Stefano Zampini
 Steve Benbow
 Toby Isaac
 Tyler Chen
 Vaclav Hapla
 Valeria Barra


and bug reports/patches/proposed improvements received from


 "Abhyankar, Shrirang G"
 Arash Mehraban
 Barry Smith
 Benjamin Bugeat
 Brandon Denton
 Cameron Smith
 Carl Hall
 Claudio Tomasi
 "David, Cedric H (US 329F)"
 Dipankar Dwivedi
 Dmitry Melnichuk
 Ed Bueler
 Emmanuel Ayala
 Eric Chamberland
 Fande Kong
 Frederic Vi
 Gautam Bisht
 Guangming Wang
 Hong Zhang
 Ivan Blagopoluchnyy
 Jacob Faibussowitsch
 James Ramsey
 James Wright
 Jan Grießer
 Jaysaval, Piyoosh
 Jed Brown
 Jeremy Thompson
 Jin Chen
 jordic
 Jose E. Roman
 Junchao Zhang
 Justin Herter
 Kai Germaschewski
 Lisandro Dalcin
 Marius Buerkle
 Mark Adams
 Mark Lohry
 Martin Diehl
 Matthew Knepley
 "McInnes, Lois Curfman"
 Mehmet Sahin
 Miguel Fosas de Pando
 Miguel Salazar De Troya
 mphysx team
 "Nourgaliev, Robert Nr"
 "Ofori-Opoku, Nana"
 PAEZ ESPEJO Miguel-Angel EUROGICIEL INGENIERIE
 Patrick Zulian
 Paul T. Bauman
 Philippe Billuart
 Pierre Jolivet
 Ramin Moghadasi
 Randall Mackie
 Richard Tran Mills
 Sajid Ali
 Sam Guo
 Satish Balay
 Scott Kruger
 Sébastien Gilles
 Thibaut Appel
 Toby Isaac
 Tomas Mondragon
 Valeria Barra
 Victor Eijkhout
 Xiaodong Liu

As always, thanks for your support,

Satish, on behalf of PETSc team

Re: [petsc-users] Question about DMPLEX/P4EST with different Sections

2020-03-30 Thread Berend van Wachem

Dear Matt,

I am still not having success with the different sections on the DMForest.

The example you sent works only if the two sections are the same. But, 
if the first section stores the data at the cell centers and the second 
section stores the data at the cell faces, the code crashes.


I've attached the example again with 1 change compared to the example 
you sent - line 134 indicates the second section should store the data 
at the cell face. This crashes for me, see below.


Do you have any idea?

Many thanks,

Berend.


$ workingexample -on_error_attach_debugger
[0]PETSC ERROR: 

[0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, 
probably memory access out of range

[0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger
[0]PETSC ERROR: or see 
https://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind
[0]PETSC ERROR: or try http://valgrind.org on GNU/linux and Apple Mac OS 
X to find memory corruption errors

[0]PETSC ERROR: likely location of problem given in stack below
[0]PETSC ERROR: -  Stack Frames 


[0]PETSC ERROR: Note: The EXACT line numbers in the stack are not available,
[0]PETSC ERROR:   INSTEAD the line number of the start of the function
[0]PETSC ERROR:   is given.
[0]PETSC ERROR: [0] DMPlexTransferVecTree_Interpolate line 4000 
/usr/local/petsc-3.12.4/src/dm/impls/plex/plextree.c
[0]PETSC ERROR: [0] DMPlexTransferVecTree line 4505 
/usr/local/petsc-3.12.4/src/dm/impls/plex/plextree.c
[0]PETSC ERROR: [0] DMForestTransferVec_p8est line 4829 
/usr/local/petsc-3.12.4/src/dm/impls/forest/p4est/pforest.c
[0]PETSC ERROR: [0] DMForestTransferVec line 997 
/usr/local/petsc-3.12.4/src/dm/impls/forest/forest.c

[0]PETSC ERROR: User provided function() line 0 in  unknown file



On 2020-03-19 23:39, Matthew Knepley wrote:

Okay this runs for me.

   Thanks,

     Matt

On Thu, Mar 19, 2020 at 6:07 PM Matthew Knepley > wrote:


On Fri, Mar 13, 2020 at 9:45 AM Berend van Wachem
mailto:berend.vanwac...@ovgu.de>> wrote:

Dear Matt,

Thanks for your response. My understanding of the DM and DMClone
is the
same - and I have tested this with a DMPLEX DM without problems.

However, for some reason, I cannot change/set the section of a
P4EST dm.
In the attached example code, I get an error in line 140, where
I try to
create a new section from the cloned P4EST DM. Is it not
possible to
create/set a section on a P4EST DM? Or maybe I am doing
something else
wrong? Do you suggest a workaround?


Hi Berend,

Sorry I am behind. The problem on line 140 is that you call a DMPlex
function (DMPlexCreateSection)
with a DMForest object. That is illegal. You can, however, call that
function using the Plex you get from
a Forest using DMConvert(DMForestClone, DMPLEX, ). I will
get your code running as soon
as I can, but after you create the Section, attaching it should be fine.

   Thanks,

      Matt

Many thanks, Berend.


On 2020-03-13 00:19, Matthew Knepley wrote:
 > On Thu, Mar 12, 2020 at 7:40 AM Berend van Wachem
 > mailto:berend.vanwac...@ovgu.de>
>> wrote:
 >
 >     Dear All,
 >
 >     I have started to use DMPLEX with P4EST for a
computational fluid
 >     dynamics application. I am solving a coupled system of 4
discretised
 >     equations (for 3 velocity components and one pressure) on
a mesh.
 >     However, next to these 4 variables, I also have a few
single field
 >     variables (such as density and viscosity) defined over
the mesh,
 >     which I
 >     don't solve for (they should not be part of the matrix
with unknowns).
 >     Most of these variables are at the cell centers, but in a
few cases, it
 >     want to define them at cell faces.
 >
 >     With just DMPLEX, I solve this by:
 >
 >     DMPlexCreateMesh, so I get an initial DM
 >     DMPlexCreateSection, indicating the need for 4 variables
 >     DMSetLocalSection
 >     DMCreateGlobalVector (and Matrix), so I get an Unknown
vector, a RHS
 >     vector, and a matrix for the 4 variables.
 >
 >     To get a vector for a single variable at the cell center
or the cell
 >     face, I clone the original DM, I define a new Section on
it, and then
 >     create the vector from that which I need (e.g. for density,
 >     viscosity or
 >     a velocity at the cell face).
 >
 >     Then I