Segfault on baobab

Hi, I am having trouble running my C code, with minimal parallelization using openmp, that runs fine on my local machine but crashes when running on baobab. Below are additional information. I am not sure if there is an obvious reason for this. I would appreciate your guidance if possible.

Thanks,

  1. what did you try: Running a C code via slurm and using srun
  2. what didn’t work: I got a segfault
  3. what was the expected result: the code runs fine on my laptop using 8 cores
  4. what was the error message: srun: error: cpu066: task 0: Segmentation fault
  5. path to the relevant files (logs, sbatch script, etc):
#!/bin/bash
#SBATCH -J BD_all_10p5                      #Jobname
#SBATCH -e BD_all_10p5-err_%j.error  #Jobname error file
#SBATCH -o BD_all_10p5-out_%j.out    #Jobname out file  
#SBATCH --cpus-per-task=16                #total number of threads  
#SBATCH -t 04-00:00                             # Runtime in D-HH:MM
#SBATCH --mem-per-cpu=4000
#SBATCH -p private-dpt-cpu

module load  GCCcore/11.2.0 Python/3.9.6
module load  GCC/11.2.0  OpenMPI/4.1.1  SciPy-bundle/2021.10
module load GCC/10.2.0 GCC/10.3.0 LAPACK/3.9.1
module load GCC/10.3.0
module load GCC/11.2.0
module load GSL/2.7

export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}
srun mydirectory/limFisher 83 116

Hi @Azadeh.MoradinezhadDizgah

you should start by cleaning the libraries you load using module. You are loading many GCC version, and only one can be loaded. When you load another one, the previous is unloaded.

To load everything you are trying to load:

ml foss/2021a LAPACK SciPy-bundle GSL

You need to have the same modules loaded when compiling and when running your code.

Did you compiled your code on Baobab?

Hi @Yann.Sagon

Thanks for the quick response. Yes, I compiled my code on Baobab, loading the same module. Now I ll try to compile and run with the modules you said and see if the issue is sorted out. I ll post an update here.

A related question; I noticed that compilation of my code on baobab takes significantly
longer than on my laptop (a MacBook pro). Is there a reason for this?