1

I receive the following errors from valgrind.

==30996== Conditional jump or move depends on uninitialised value(s)
==30996==    at 0x12B28904: ??? (in /usr/lib64/libmlx4-rdmav2.so)
==30996==    by 0xE12CF9A: ibv_open_device (in /usr/lib64/libibverbs.so.1.0.0)
==30996==    by 0xAAFA03B: btl_openib_component_init (in /sw/arcts/centos7/openmpi/1.10.2-gcc-4.8.5/lib/libmpi.so.12.0.2)
==30996==    by 0xAAF0832: mca_btl_base_select (in /sw/arcts/centos7/openmpi/1.10.2-gcc-4.8.5/lib/libmpi.so.12.0.2)
==30996==    by 0xAAF0160: mca_bml_r2_component_init (in /sw/arcts/centos7/openmpi/1.10.2-gcc-4.8.5/lib/libmpi.so.12.0.2)
==30996==    by 0xAAEE95D: mca_bml_base_init (in /sw/arcts/centos7/openmpi/1.10.2-gcc-4.8.5/lib/libmpi.so.12.0.2)
==30996==    by 0xABE96D9: mca_pml_ob1_component_init (in /sw/arcts/centos7/openmpi/1.10.2-gcc-4.8.5/lib/libmpi.so.12.0.2)
==30996==    by 0xABE75A8: mca_pml_base_select (in /sw/arcts/centos7/openmpi/1.10.2-gcc-4.8.5/lib/libmpi.so.12.0.2)
==30996==    by 0xAA98BD3: ompi_mpi_init (in /sw/arcts/centos7/openmpi/1.10.2-gcc-4.8.5/lib/libmpi.so.12.0.2)
==30996==    by 0xAAB87EC: PMPI_Init_thread (in /sw/arcts/centos7/openmpi/1.10.2-gcc-4.8.5/lib/libmpi.so.12.0.2)
==30996==    by 0x5D4664: PetscInitialize.part.3 (in /scratch/kfid_flux/ykmizu/ROMLSS/bin/ks_main.x)
==30996==    by 0x49B5B4: main (in /scratch/kfid_flux/ykmizu/ROMLSS/bin/ks_main.x)
==30996== 

and this error repeats itself over and over again. I don't understand why PetscInitialize would give me a hard time. It's one of the first things I call in my main.c file after I initialize ints and doubles and etc.

PetscInitialize(&argc, &argv, NULL, NULL);
SlepcInitialize(&argc, &argv, NULL, NULL);
PetscViewerPushFormat(PETSC_VIEWER_STDOUT_SELF, PETSC_VIEWER_ASCII_MATLAB);

Are these just false errors? Any help would be greatly appreciated. Getting a little desperate about this. Thank you.

Yue
  • 23
  • 5

1 Answers1

0

There are discussions here.

It seems that you use Open MPI which is noisy under valgrind. You can try to compiler two versions of PETSc (so two different PETS_ARCHs): one uses the optimized MPI in your system, and another is built using MPICH with the configure option --download-mpich.

For debugging, you can select the PETSC_ARCH compiled with mpich. For performance evaluation, you can select another PETSC_ARCH compiled with optimized MPI of your platform.

Additionaly, if you want to use both PETSc and SLEPc, you can select either PetscInitialize or SlepcInitialize for start their environment. It makes no sense to repeat two times.

I hope it's helpful for you.

Xinzhe Wu
  • 16
  • 5
  • How do I have two different builds one fore mpich and one for open-mpi? I installed mpich, which forced me to unlink open-mpi. Once I did that I tried to make and then my program couldn't find mpi.h. I tried to relink mpich to get my program to work again, but it can't find mpi.h. How do I build two different two different versions if only one of the two open-mpi and mpich can be linked at a time? – Yue Dec 29 '17 at 03:23
  • Sorry for late. Have you tried to install with the configure option --download-mpich? or you installed mpich by yourself. In my opinions, the safest way is using directly this option. – Xinzhe Wu Jan 04 '18 at 14:29
  • For the building of two versions, you can configure PETSc with same PETSC_DIR, but different PETSC_ARCH. For example, for openmpi version: ./confugre PETSC_DIR=yourdir PETSC_ARCH=arch-linux-openmpi --with-mpi-dir=your_openmpi_dir ... for mpich version: ./confugre PETSC_DIR=yourdir PETSC_ARCH=arch-linux-mpich --download-mpich..., you can link two different versions of mpi by switch environment variable PETSC_ARCH and recompile your codes. – Xinzhe Wu Jan 04 '18 at 14:53
  • Thank you for your help. I really appreciate it! I realized that Homebrew uses open-mpi, which I've been using. I installed a completely seperate petsc version from scratch using mpich. I ran valgrind on it and it's definitely less noisy than using open-mpi petsc, but I still get the PetscInitialize/SlepcInitialize error when I use valgrind. It has made it a lot easier for me to debug now, but I still wonder why I get these memory errors from valgrind. – Yue Jan 05 '18 at 19:50