Identify what's causing segmentation fault in Yambo: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
(9 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
There may be different reasons why the Yambo code generates segmentation faults in a run.<br> | There may be different reasons why the Yambo code generates segmentation faults in a run.<br> | ||
To help Yambo developers understand where the problem lies and help you, please follow the steps below. | To help Yambo developers understand where the problem lies and help you, please follow the steps below. | ||
If one of the step solves your problem and please report the result in the [http://www.yambo-code. | If one of the step solves your problem, and please report the result in the [http://www.yambo-code.eu/forum/ forum]. | ||
'''Rule out possible causes of the segmentation fault:''' | '''Rule out possible causes of the segmentation fault:''' | ||
# '''GPU''': recompile without GPU support, remove the <code>--enable-cuda</code> flag. If this | # '''GPU''': recompile without GPU support, remove the <code>--enable-cuda</code> flag. If this solves the problem report the bug in forum GPU section [http://www.yambo-code.eu/forum/viewforum.php?f=38 Yambo on GPU machines]. | ||
# '''OPEN-MP''': compile and run Yambo without open-mp support, no <code>--enable-open-mp</code> flag in the configure and <code>OMP_NUM_THREADS="1"</code>. | # '''OPEN-MP''': compile and run Yambo without open-mp support, no <code>--enable-open-mp</code> flag in the configure and <code>OMP_NUM_THREADS="1"</code>. | ||
# '''Lapack/Blas''': use internal Lapack/Blas. Reconfigure | # '''Lapack/Blas''': use internal Lapack/Blas. Reconfigure Yambo with the flag <code>--enable-int-linalg</code>, recompile and run our job again. | ||
# '''FFT''': compile Yambo with internal FFT libraries <code>--enable-internal-fftsg</code> . | # '''FFT''': compile Yambo with internal FFT libraries <code>--enable-internal-fftsg</code>. | ||
# '''Scalapack''': compile without Scalpack, unset the flag <code>--with-scalapack-libs</code>. | # '''Scalapack''': compile without Scalpack, unset the flag <code>--with-scalapack-libs</code>. | ||
# '''Parallelism''' | # '''Parallelism''' | ||
## Change the number of processors | ## Change the number of processors | ||
## Use automatic parallelization, unset all parallel variable in input | ## Use automatic parallelization, unset all parallel variable in input | ||
## | ## Try to disable MPI parallelism by doing <code>yambo -nompi</code> and/or OPEN-MP parallelism by doing <code>yambo -noopenmp</code> | ||
# '''Optimization''': use a lower optimization level for example -O1 or -O0, by doing <code>./configure FCFLAGS="-O0" | ## Compile yambo without MPI and run in serial | ||
# '''Compilers''': change | # '''Optimization''': use a lower optimization level for example -O1 or -O0, by doing <code>./configure FCFLAGS="-O0" FFLAGS="-O1"</code> | ||
# '''Compilers''': change C/Fortran compiler if it is possible, move from intel Fortran to gfortran or vice-versa. <br>In order to set compilers in the configure, use <code>./configure FC=ifort F77=ifort CC=icc</code> for Intel and <code>./configure FC=gfortran F77=gfortran CC=gcc</code> for gfortran. | |||
<br> | <br> | ||
If no one of the previous steps solved your problem, contact us again in the [http://www.yambo-code. | If no one of the previous steps solved your problem, contact us again in the [http://www.yambo-code.eu/forum/ forum]. <br> | ||
If you want | If you want you can try to debug Yambo and identity the origin of segmentation fault following the steps below. This will help developers to find a solution to the problem more quickly: <br> | ||
'''Debugging the segmentation fault:''' | '''Debugging the segmentation fault:''' | ||
Line 25: | Line 26: | ||
# '''Checking options''': compile Yambo with the compiler checking options and run again your simulation, then report the result in the forum: | # '''Checking options''': compile Yambo with the compiler checking options and run again your simulation, then report the result in the forum: | ||
## for g-fortran compiler <code>./configure FCFLAGS="-O1 -g -fcheck=all" UFLAGS="-O0 -g -fcheck=all" FFLAGS="-O1 -g -fcheck=all" --enable-keep-src"</code> | ## for g-fortran compiler <code>./configure FCFLAGS="-O1 -g -fcheck=all" UFLAGS="-O0 -g -fcheck=all" FFLAGS="-O1 -g -fcheck=all" --enable-keep-src"</code> | ||
## for intel | ## for intel Fortran <code>./configure FCFLAGS="-O1 -g -CB -CA -debug" UFLAGS="-O0 -g -CB -CA -debug" FFLAGS="-O1 -g -CB -CA -debug" --enable-keep-src"</code> | ||
# '''Use a debugger''': Compile with debugging options <br> | # '''Use a debugger''': Compile with debugging options<br> for g-fortran compiler <code>./configure FCFLAGS="-Og -g" UFLAGS="-Og -g" FFLAGS="-Og -g" --enable-keep-src" CFLAGS="-g"</code><br> for intel Fortran <code>./configure FCFLAGS="-O1 -g -debug" UFLAGS="-O0 -g -debug" FFLAGS="-O1 -g -debug" --enable-keep-src" CFLAGS="-g -debug"</code><br> then execute the job in a debugger for example <code>[https://www.gnu.org/software/gdb/ gdb] --args yambo -F yambo_input.in</code>. It can work also in parallel see [https://www.open-mpi.org/faq/?category=debugging here] and [https://stackoverflow.com/questions/329259/how-do-i-debug-an-mpi-program here] | ||
# '''Memory leaks''': [only for experts] compile Yambo with debugging options then run your job with [https://valgrind.org/ valgrind]: <code>valgrind --tool=memcheck --leak-check=summary ./yambo</code> | # '''Memory leaks''': [only for experts] compile Yambo with debugging options then run your job with [https://valgrind.org/ valgrind]: <code>valgrind --tool=memcheck --leak-check=summary ./yambo</code> |
Latest revision as of 10:07, 23 February 2024
There may be different reasons why the Yambo code generates segmentation faults in a run.
To help Yambo developers understand where the problem lies and help you, please follow the steps below.
If one of the step solves your problem, and please report the result in the forum.
Rule out possible causes of the segmentation fault:
- GPU: recompile without GPU support, remove the
--enable-cuda
flag. If this solves the problem report the bug in forum GPU section Yambo on GPU machines. - OPEN-MP: compile and run Yambo without open-mp support, no
--enable-open-mp
flag in the configure andOMP_NUM_THREADS="1"
. - Lapack/Blas: use internal Lapack/Blas. Reconfigure Yambo with the flag
--enable-int-linalg
, recompile and run our job again. - FFT: compile Yambo with internal FFT libraries
--enable-internal-fftsg
. - Scalapack: compile without Scalpack, unset the flag
--with-scalapack-libs
. - Parallelism
- Change the number of processors
- Use automatic parallelization, unset all parallel variable in input
- Try to disable MPI parallelism by doing
yambo -nompi
and/or OPEN-MP parallelism by doingyambo -noopenmp
- Compile yambo without MPI and run in serial
- Optimization: use a lower optimization level for example -O1 or -O0, by doing
./configure FCFLAGS="-O0" FFLAGS="-O1"
- Compilers: change C/Fortran compiler if it is possible, move from intel Fortran to gfortran or vice-versa.
In order to set compilers in the configure, use./configure FC=ifort F77=ifort CC=icc
for Intel and./configure FC=gfortran F77=gfortran CC=gcc
for gfortran.
If no one of the previous steps solved your problem, contact us again in the forum.
If you want you can try to debug Yambo and identity the origin of segmentation fault following the steps below. This will help developers to find a solution to the problem more quickly:
Debugging the segmentation fault:
- Checking options: compile Yambo with the compiler checking options and run again your simulation, then report the result in the forum:
- for g-fortran compiler
./configure FCFLAGS="-O1 -g -fcheck=all" UFLAGS="-O0 -g -fcheck=all" FFLAGS="-O1 -g -fcheck=all" --enable-keep-src"
- for intel Fortran
./configure FCFLAGS="-O1 -g -CB -CA -debug" UFLAGS="-O0 -g -CB -CA -debug" FFLAGS="-O1 -g -CB -CA -debug" --enable-keep-src"
- for g-fortran compiler
- Use a debugger: Compile with debugging options
for g-fortran compiler./configure FCFLAGS="-Og -g" UFLAGS="-Og -g" FFLAGS="-Og -g" --enable-keep-src" CFLAGS="-g"
for intel Fortran./configure FCFLAGS="-O1 -g -debug" UFLAGS="-O0 -g -debug" FFLAGS="-O1 -g -debug" --enable-keep-src" CFLAGS="-g -debug"
then execute the job in a debugger for examplegdb --args yambo -F yambo_input.in
. It can work also in parallel see here and here - Memory leaks: [only for experts] compile Yambo with debugging options then run your job with valgrind:
valgrind --tool=memcheck --leak-check=summary ./yambo