Re: [petsc-users] multiple definition of `main' with intel compilers

2020-05-21 Thread Alfredo Jaramillo
I just read at the end of the section "compilers" here https://www.mcs.anl.gov/petsc/documentation/installation.html that one can indicate these libraries by doing ./configure --LIBS='-Bstatic -lifcore -Bdynamic' thank you very much for your help, Satish alfredo On Thu, May 21, 2020 at 10:08 PM

Re: [petsc-users] multiple definition of `main' with intel compilers

2020-05-21 Thread Satish Balay via petsc-users
Configure attempts to automatically determine the language compatible libraries by running 'icc -v' and 'ifort -v' - and uses what it says. [this list can be different based on compiler options used] And PETSc examples work fine - so its not clear why fcoremt_pic is causing issues with your

Re: [petsc-users] multiple definition of `main' with intel compilers

2020-05-21 Thread Alfredo Jaramillo
In fact, removing -lifcore_pic from PETSC_DIR/PETSC_ARCH/lib/petscvariables solved the problem (this was the first I traied and it worked), it compiles and the program runs fine. Also, -lpetsc was being listed some times when compiling .c to .o, I fixed that in the scripts. Now, I'm a bit lost

Re: [petsc-users] error of compiling complex

2020-05-21 Thread Sam Guo
Hi Satish, Works. Thanks a lot for your help. BR, Sam On Thu, May 21, 2020 at 2:51 PM Satish Balay wrote: > Its PETSC_USE_COMPLEX [undefined for --with-scalar-type=real] > > Satish > > On Thu, 21 May 2020, Sam Guo wrote: > > > What preprocessor directive should I use for real:

Re: [petsc-users] multiple definition of `main' with intel compilers

2020-05-21 Thread Satish Balay via petsc-users
For one - PETSc is built without -qopenmp flag - but your makefile is using it. Intel compiler can link in with different [incompatible] compiler libraries when some flags change this way [causing conflict]. However - the issue could be: your makefile is listing PETSC_LIB [or however you are

Re: [petsc-users] multiple definition of `main' with intel compilers

2020-05-21 Thread Alfredo Jaramillo
here is the output: alfredo.jaramillo@sdumont11 tutorials]$ make ex19 mpiicc -fPIC -O3 -march=native -mtune=native -fPIC -O3 -march=native -mtune=native -I/scratch/simulreserv/softwares/petsc-3.13.0/include -I/scratch/simulreserv/softwares/petsc-3.13.0/x64-O3-3.13-intel2016-64/include

Re: [petsc-users] multiple definition of `main' with intel compilers

2020-05-21 Thread Satish Balay via petsc-users
Please copy/paste complete [compile] commands from: src/snes/tutorials/ make clean make ex19 make ex5f Likely the link command used in your code is different than what is used here - triggering errors. Satish On Thu, 21 May 2020, Alfredo Jaramillo wrote: > hello Satish, no the tests seem to

Re: [petsc-users] error of compiling complex

2020-05-21 Thread Satish Balay via petsc-users
Its PETSC_USE_COMPLEX [undefined for --with-scalar-type=real] Satish On Thu, 21 May 2020, Sam Guo wrote: > What preprocessor directive should I use for real: PETSC_USE_SCALAR_REAL > or PETSC_USE_REAL_DOUBLE? > > On Thu, May 21, 2020 at 2:00 PM Satish Balay wrote: > > > We usually do the

Re: [petsc-users] multiple definition of `main' with intel compilers

2020-05-21 Thread Alfredo Jaramillo
hello Satish, no the tests seem to be ok altough some error related to mpd. ==THE TESTS=== Running check examples to verify correct installation Using PETSC_DIR=/scratch/simulreserv/softwares/petsc-3.13.0 and PETSC_ARCH=x64-O3-3.13-intel2016-64 Possible error running

Re: [petsc-users] error of compiling complex

2020-05-21 Thread Sam Guo
What preprocessor directive should I use for real: PETSC_USE_SCALAR_REAL or PETSC_USE_REAL_DOUBLE? On Thu, May 21, 2020 at 2:00 PM Satish Balay wrote: > We usually do the other way around [build petsc with the correct > compilers and option] and make apps use the same flags [via petsc >

Re: [petsc-users] multiple definition of `main' with intel compilers

2020-05-21 Thread Satish Balay via petsc-users
Do you get this error when building PETSc examples [C and/or fortran] - when you build them with the corresponding petsc makefile? Can you send the log of the example compiles? Satish --- [the attachment got deleted - don't know by who..] DENIAL OF SERVICE ALERT A denial of service

Re: [petsc-users] error of compiling complex

2020-05-21 Thread Satish Balay via petsc-users
We usually do the other way around [build petsc with the correct compilers and option] and make apps use the same flags [via petsc formatted makefiles]. However you should be able to construct petsc configure command and force petsc to build exactly as you need. Satish On Thu, 21 May 2020, Sam

Re: [petsc-users] error of compiling complex

2020-05-21 Thread Sam Guo
The reason we don’t use petsc build tool is to make sure we use same compiler and flags to build our code and petsc. On Thursday, May 21, 2020, Satish Balay wrote: > Is there a reason you can't use petsc build tools? > > config/gmakegen.py processes the mkaefiles in source dirs - and determines

Re: [petsc-users] error of compiling complex

2020-05-21 Thread Satish Balay via petsc-users
Is there a reason you can't use petsc build tools? config/gmakegen.py processes the mkaefiles in source dirs - and determines the list of files to build [for a given configure setup] src/ksp/pc/impls/tfs/makefile has: #requiresscalar real i.e the sources in this dir are compiled only when

Re: [petsc-users] error of compiling complex

2020-05-21 Thread Sam Guo
Thanks for the quick response. I have my own makefile based on PETSc makefile. I need to update my makefile. It seems PETSc generates the makefile on fly. I struggle to figure out which files I should skip for complex. Could you tell me what files I should skip? Thanks, Sam On Thu, May 21, 2020

Re: [petsc-users] error of compiling complex

2020-05-21 Thread Matthew Knepley
On Thu, May 21, 2020 at 3:25 PM Sam Guo wrote: > Dear PETSc dev team, >I got following error of compiling complex: > ../../../petsc/src/ksp/pc/impls/tfs/ivec.c: In function ‘PCTFS_rvec_max’: > ../../../petsc/include/petscmath.h:532:30: error: invalid operands to > binary < (have

Re: [petsc-users] error of compiling complex

2020-05-21 Thread Satish Balay via petsc-users
Something wrong with your build. This source-file should not get compiled for complex. > ../../../petsc/src/ksp/pc/impls/tfs/ivec.c And this relative path looks wierd. How are you building PETSc? Might start with a fresh petsc install. [and look at updating to latest release - petsc-3.13]

[petsc-users] error of compiling complex

2020-05-21 Thread Sam Guo
Dear PETSc dev team, I got following error of compiling complex: ../../../petsc/src/ksp/pc/impls/tfs/ivec.c: In function ‘PCTFS_rvec_max’: ../../../petsc/include/petscmath.h:532:30: error: invalid operands to binary < (have ‘PetscScalar’ {aka ‘_Complex double’} and ‘PetscScalar’ {aka ‘_Complex

Re: [petsc-users] Possible bug PETSc+Complex+CUDA

2020-05-21 Thread Junchao Zhang
I tested this example with cuda 10.2, it did segfault. I'm looking into it. --Junchao Zhang On Thu, May 21, 2020 at 11:04 AM Matthew Knepley wrote: > On Thu, May 21, 2020 at 11:31 AM Stefano Zampini < > stefano.zamp...@gmail.com> wrote: > >> Oh, there is also an issue I have recently noticed

Re: [petsc-users] Possible bug PETSc+Complex+CUDA

2020-05-21 Thread Matthew Knepley
On Thu, May 21, 2020 at 11:31 AM Stefano Zampini wrote: > Oh, there is also an issue I have recently noticed and did not have yet > the time to fix it > > With complex numbers, we use the definitions for complexes from thrust and > this does not seem to be always compatible to whatever the C

Re: [petsc-users] Possible bug PETSc+Complex+CUDA

2020-05-21 Thread Rui Silva
Hi Matt, I am using CUDA 9.2. I will try to compile with CUDA 10.2. Best regards, Rui Às 17:21 de 21/05/2020, Matthew Knepley escreveu: On Thu, May 21, 2020 at 10:53 AM Rui Silva > wrote: Hello everyone, I am trying to run PETSc (with complex numbers in the

Re: [petsc-users] Possible bug PETSc+Complex+CUDA

2020-05-21 Thread Stefano Zampini
Oh, there is also an issue I have recently noticed and did not have yet the time to fix it With complex numbers, we use the definitions for complexes from thrust and this does not seem to be always compatible to whatever the C compiler uses Matt, take a look at petscsytypes.h and you will see

Re: [petsc-users] Possible bug PETSc+Complex+CUDA

2020-05-21 Thread Matthew Knepley
On Thu, May 21, 2020 at 10:53 AM Rui Silva wrote: > Hello everyone, > > I am trying to run PETSc (with complex numbers in the GPU). When I call > the VecWAXPY routine using the complex version of PETSc and mpicuda > vectors, the program fails with a segmentation fault. This problem does > not

[petsc-users] Possible bug PETSc+Complex+CUDA

2020-05-21 Thread Rui Silva
Hello everyone, I am trying to run PETSc (with complex numbers in the GPU). When I call the VecWAXPY routine using the complex version of PETSc and mpicuda vectors, the program fails with a segmentation fault. This problem does not appear, if I run the complex version with mpi vectors or with

Re: [petsc-users] a question about MatSetValue

2020-05-21 Thread Yang Bo (Asst Prof)
I see, it is working now, thanks! On 21 May 2020, at 6:23 PM, Dave May mailto:dave.mayhe...@gmail.com>> wrote: On Thu 21. May 2020 at 12:17, Yang Bo (Asst Prof) mailto:yang...@ntu.edu.sg>> wrote: Hi Dave, Yes it is parallel so the preallocation calls are not lowered by the allocation. I am

Re: [petsc-users] a question about MatSetValue

2020-05-21 Thread Dave May
On Thu 21. May 2020 at 12:17, Yang Bo (Asst Prof) wrote: > Hi Dave, > > Yes it is parallel so the preallocation calls are not lowered by the > allocation. > > I am trying to use MatXAIJSetPreallocation, but not sure how, since the > following link does not give an example: > > >

Re: [petsc-users] a question about MatSetValue

2020-05-21 Thread Yang Bo (Asst Prof)
Hi Dave, Yes it is parallel so the preallocation calls are not lowered by the allocation. I am trying to use MatXAIJSetPreallocation, but not sure how, since the following link does not give an example:

Re: [petsc-users] a question about MatSetValue

2020-05-21 Thread Dave May
On Thu 21. May 2020 at 10:49, Yang Bo (Asst Prof) wrote: > Hi Dave, > > Thank you very much for your reply. That is indeed the problem. I have > been working with matrices in Slepc but I don’t really understand it. I > tried to preallocate but it still does not work. > Meaning the number of

Re: [petsc-users] a question about MatSetValue

2020-05-21 Thread Yang Bo (Asst Prof)
Hi Dave, Thank you very much for your reply. That is indeed the problem. I have been working with matrices in Slepc but I don’t really understand it. I tried to preallocate but it still does not work. If you look at my code below: ierr = MatCreate(PETSC_COMM_WORLD,);CHKERRQ(ierr); ierr =

Re: [petsc-users] a question about MatSetValue

2020-05-21 Thread Dave May
On Thu, 21 May 2020 at 08:55, Yang Bo (Asst Prof) wrote: > Hi Everyone, > > I have a question about adding values to the matrix. The code I have is > > > for (int i=0;i MatSetValue(A,row[i],column[i],h[i],INSERT_VALUES); > } > > where row.size() is a large number. It seems the running time of

[petsc-users] a question about MatSetValue

2020-05-21 Thread Yang Bo (Asst Prof)
Hi Everyone, I have a question about adding values to the matrix. The code I have is for (int i=0;i