PetIGA icon indicating copy to clipboard operation
PetIGA copied to clipboard

Problem with PETSC_DIR

Open o-kazemi opened this issue 2 years ago • 10 comments
trafficstars

Hello there,

I have compiled PETSC and followed the instruction to set the PETSC_DIR. But when I run "make all" command in PetIGA directory I get this error: /home/omid/PetIGA/lib/petiga/conf/variables:6: *** Incorrect PETSC_DIR: . Stop. I checked the variables file in lib/petiga/conf folder, which makes this error. It seems that the file can not read the data at all. e.g. when I check the DIR, it echos correctly, but when I run make command it pops up that error. I defined the DIR manually in the variables file, it goes ahead till it reaches to lib/petiga/conf/variables:45: *** Incorrect PETSC_ARCH: /home/omid/Desktop/Program/petsc-3.18.2/arch-linux-c-debug. Stop. According to line 45, if the petscconf.h is missing, it has to print this error. The file is there! It seems that this error comes from disability of reading the data from PETSC folder. I checked the permissions, it's OK. Do you have any advice for me?

Thanks and regards, Omid

o-kazemi avatar Dec 06 '22 06:12 o-kazemi

question updated.

o-kazemi avatar Dec 06 '22 20:12 o-kazemi

What's the output of the following two commands?

echo $PETSC_DIR
echo $PETSC_ARCH

Did you check the permissions of all the intermediate folders? I'm a bit clueless about what could be going on. Could you try re-building PETSc from scratch in a different PETSC_DIR, let say /home/omid/petsc?

dalcinl avatar Dec 07 '22 13:12 dalcinl

I tried to install again from scratch and the outputs are:

echo $PETSC_DIR: /home/omid/petsc-3.18.2 echo $PETSC_ARCH /home/omid/petsc-3.18.2/arch-linux-c-debug I set the full permission to the all folders that are engaged. But it seems that something is wrong with the file called variable in PetIGA/lib/petiga/conf . I added the DIRs manually to beginning of this file, it goes ahead till it reaches to checking petscconf.h, then stops! Although the file is there and is nor empty!

o-kazemi avatar Dec 07 '22 17:12 o-kazemi

echo $PETSC_ARCH /home/omid/petsc-3.18.2/arch-linux-c-debug

There is the problem, your PETSC_ARCH is wrong! You should do it the following way:

export PETSC_DIR=/home/omid/petsc-3.18.2
export PETSC_ARCH=arch-linux-c-debug

dalcinl avatar Dec 07 '22 19:12 dalcinl

It's so strange! I did but I get the same error!

(base) omid@omid-HP:~/PetIGA-master$ echo $PETSC_DIR /home/omid/petsc-3.18.2 (base) omid@omid-HP:~/PetIGA-master$ echo $PETSC_ARCH arch-linux-c-debug (base) omid@omid-HP:~/PetIGA-master$ sudo make all [sudo] password for omid: lib/petiga/conf/variables:27: *** PETSC_DIR not defined. Stop.

o-kazemi avatar Dec 07 '22 19:12 o-kazemi

You did not tell me precisely what you were exactly doing. Originally, you told me you were doing "make all", but now you say "sudo make all". The problem is because you using sudo, which does not pass down environment variables by default. You can add the -E flag to sudo to pass all environment variables. But before you go that route, PLEASE consider NOT using sudo to compile code, running make all WITHOUT sudo should be enough. You man need to run sudo rm -rf arch-linux-c-debug to clean previous stuff and start fresh.

dalcinl avatar Dec 07 '22 20:12 dalcinl

The reason for using sudo was the stop, caused by authentication issues. But I forgot to avoid it after I fixed the permissions. My bad! Now make all worked and is fixed. Thanks a lot buddy. But when I run make test I get this error that I paste down below. Do you have any advice in that regard? I appreciate your help buddy. [>] runex1 .[0]PETSC ERROR: --------------------- Error Message -------------------------------------------------------------- [0]PETSC ERROR: Corrupt argument: https://petsc.org/release/faq/#valgrind [0]PETSC ERROR: Invalid type of object: Parameter # 1 [0]PETSC ERROR: WARNING! There are option(s) set that were not used! Could be the program crashed before they were used or a spelling mistake, etc! [0]PETSC ERROR: Option left: name:-nox (no value) [0]PETSC ERROR: See https://petsc.org/release/faq/ for trouble shooting. [0]PETSC ERROR: Petsc Release Version 3.18.2, Nov 28, 2022 [0]PETSC ERROR: ./IGACreate on a arch-linux-c-debug named omid-HP by omid Wed Dec 7 12:21:57 2022 [0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-fblaslapack --download-mpich --download-metis --download-parmetis --download-superlu_dist [0]PETSC ERROR: #1 PetscObjectProcessOptionsHandlers() at /home/omid/petsc-3.18.2/src/sys/objects/inherit.c:557 [0]PETSC ERROR: #2 IGASetFromOptions() at /home/omid/PetIGA-master/src/petiga.c:887 [0]PETSC ERROR: #3 main() at /home/omid/PetIGA-master/test/IGACreate.c:80 [0]PETSC ERROR: PETSc Option Table entries: [0]PETSC ERROR: -iga_dim 1 [0]PETSC ERROR: -iga_dof 4 [0]PETSC ERROR: -malloc_debug [0]PETSC ERROR: -malloc_dump [0]PETSC ERROR: -nox [0]PETSC ERROR: ----------------End of Error Message -------send entire error message to [email protected] application called MPI_Abort(MPI_COMM_SELF, 64) - process 0 gmake[1]: *** [makefile:25: runex1] Error 64 make: *** [makefile:89: test] Error 2

o-kazemi avatar Dec 07 '22 22:12 o-kazemi

Sorry, totally my fault. As I'm not keeping a close watch on PetIGA, some changes in PETSc 3.18 broke things. I just pushed the required fixes. Please git pull your PetIGA git repo clone, and things should be fixed. There is still a few test regressions, but I do not have time right now to further investigate them.

dalcinl avatar Dec 08 '22 14:12 dalcinl

Thanks buddy, I tried to do but it returns another error:

[>] runex1 ..............[1]PETSC ERROR: --------------------- Error Message -------------------------------------------------------------- [1]PETSC ERROR: Argument out of range [1]PETSC ERROR: Trying to set preallocation for row 112 greater than last local row 111 [1]PETSC ERROR: WARNING! There are option(s) set that were not used! Could be the program crashed before they were used or a spelling mistake, etc! [1]PETSC ERROR: Option left: name:-nox (no value) [1]PETSC ERROR: See https://petsc.org/release/faq/ for trouble shooting. [1]PETSC ERROR: Petsc Release Version 3.18.2, Nov 28, 2022 [1]PETSC ERROR: ./IGACreate on a arch-linux-c-debug named omid-HP by omid Thu Dec 8 13:25:30 2022 [1]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-fblaslapack --download-mpich --download-metis --download-parmetis --download-superlu_dist [1]PETSC ERROR: #1 IGACreateMat() at /home/omid/PetIGA-master/src/petigamat.c:469 [1]PETSC ERROR: #2 main() at /home/omid/PetIGA-master/test/IGACreate.c:94 [1]PETSC ERROR: PETSc Option Table entries: [1]PETSC ERROR: -iga_degree 1,2 [1]PETSC ERROR: -iga_dim 2 [1]PETSC ERROR: -iga_dof 2 [1]PETSC ERROR: -iga_mat_type is [1]PETSC ERROR: -iga_periodic 1,0 [1]PETSC ERROR: -malloc_debug [1]PETSC ERROR: -malloc_dump [1]PETSC ERROR: -nox [1]PETSC ERROR: ----------------End of Error Message -------send entire error message to [email protected] application called MPI_Abort(MPI_COMM_SELF, 63) - process 0 [0]PETSC ERROR: --------------------- Error Message -------------------------------------------------------------- [0]PETSC ERROR: Argument out of range [0]PETSC ERROR: Trying to set preallocation for row 128 greater than last local row 127 [0]PETSC ERROR: WARNING! There are option(s) set that were not used! Could be the program crashed before they were used or a spelling mistake, etc! [2]PETSC ERROR: --------------------- Error Message -------------------------------------------------------------- [2]PETSC ERROR: Argument out of range [2]PETSC ERROR: Trying to set preallocation for row 112 greater than last local row 111 [2]PETSC ERROR: WARNING! There are option(s) set that were not used! Could be the program crashed before they were used or a spelling mistake, etc! [0]PETSC ERROR: Option left: name:-nox (no value) [2]PETSC ERROR: Option left: name:-nox (no value) [0]PETSC ERROR: See https://petsc.org/release/faq/ for trouble shooting. [2]PETSC ERROR: See https://petsc.org/release/faq/ for trouble shooting. [0]PETSC ERROR: Petsc Release Version 3.18.2, Nov 28, 2022 [2]PETSC ERROR: Petsc Release Version 3.18.2, Nov 28, 2022 [0]PETSC ERROR: ./IGACreate on a arch-linux-c-debug named omid-HP by omid Thu Dec 8 13:25:30 2022 [2]PETSC ERROR: ./IGACreate on a arch-linux-c-debug named omid-HP by omid Thu Dec 8 13:25:30 2022 [0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-fblaslapack --download-mpich --download-metis --download-parmetis --download-superlu_dist [2]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-fblaslapack --download-mpich --download-metis --download-parmetis --download-superlu_dist [0]PETSC ERROR: #1 IGACreateMat() at /home/omid/PetIGA-master/src/petigamat.c:469 [2]PETSC ERROR: #1 IGACreateMat() at /home/omid/PetIGA-master/src/petigamat.c:469 [0]PETSC ERROR: #2 main() at /home/omid/PetIGA-master/test/IGACreate.c:94 [2]PETSC ERROR: #2 main() at /home/omid/PetIGA-master/test/IGACreate.c:94 [0]PETSC ERROR: PETSc Option Table entries: [2]PETSC ERROR: PETSc Option Table entries: [0]PETSC ERROR: -iga_degree 1,2 [2]PETSC ERROR: -iga_degree 1,2 [0]PETSC ERROR: -iga_dim 2 [2]PETSC ERROR: -iga_dim 2 [0]PETSC ERROR: -iga_dof 2 [2]PETSC ERROR: -iga_dof 2 [0]PETSC ERROR: -iga_mat_type is [2]PETSC ERROR: -iga_mat_type is [0]PETSC ERROR: -iga_periodic 1,0 [2]PETSC ERROR: -iga_periodic 1,0 [0]PETSC ERROR: -malloc_debug [2]PETSC ERROR: -malloc_debug [0]PETSC ERROR: -malloc_dump [2]PETSC ERROR: -malloc_dump [0]PETSC ERROR: -nox [2]PETSC ERROR: -nox gmake[1]: *** [makefile:38: runex1] Error 63 make: *** [makefile:89: test] Error 2

o-kazemi avatar Dec 08 '22 21:12 o-kazemi

That’s the test regression I was talking about. Other tests are OK. I’m not sure when I’ll have time to debug the issue. I think you should be good to go. Please ignore these test failure for now and move on.

@stefanozampini This regression is related to MATIS. Are you aware of any recent changes that may have triggered it?

dalcinl avatar Dec 08 '22 22:12 dalcinl

https://github.com/dalcinl/PetIGA/pull/4

stefanozampini avatar Nov 28 '24 14:11 stefanozampini

It should be fixed when the PR lands in master

stefanozampini avatar Nov 28 '24 14:11 stefanozampini