[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[netCDF #IEC-876213]: Segmentation fault in fortran program compiled with OpenMP
- Subject: [netCDF #IEC-876213]: Segmentation fault in fortran program compiled with OpenMP
- Date: Wed, 30 Dec 2015 15:13:34 -0700
Hello Sourish,
You do not say, but I suspect that libnetcdf was not built with a
parallel/openmpi compiler. I am not familiar with the intel fortran compiler,
but I do not see anything in how you configured netcdf-fortran to suggest that
it is being built with a parallel compiler, either. My suggestion would be to
rebuild netcdf-c with parallel functionality; you would then rebuild
netcdf-fortran and link that against the parallel libnetcdf.
Instructions for building parallel netcdf may be found here:
*
http://www.unidata.ucar.edu/software/netcdf/docs/getting_and_building_netcdf.html#build_parallel
I hope this helps!
-Ward
>
>
>
> Hello,
>
> I'm trying to use netcdf fortran library 4.4.2 in a fortran 90
> program. I compiled the netcdf fortran library (and the netcdf C
> library 4.3.3.1) with the intel fortran compiler (ifort). During the
> configure step of the netcdf fortran library, I used the following
> command line:
>
> ./configure --prefix=/u/sbasu1/packages/netcdf-fortran/4.4.2
> --enable-f03 CC=icc FC=ifort F77=ifort CFLAGS='-m64 -O3 -xSSE4.2
> -fPIC -ftz -fp-model strict -g' FFLAGS='-m64 -O3 -xSSE4.2 -fPIC -ftz
> -fp-model strict -g' FCFLAGS='-m64 -O3 -xSSE4.2 -fPIC -ftz -fp-model
> strict -g' CPPFLAGS='-I/u/sbasu1/packages/netcdf-c/4.3.3.1/include'
> LDFLAGS='-L/u/sbasu1/packages/netcdf-c/4.3.3.1/lib'
>
> Now, if I compile my main program (the one that's using the netcdf
> fortran functions) without openmp, everything works fine. If,
> however, I compile my main program with openmp (by specifying
> '-openmp' to ifort), my code segfaults right at the beginning,
> before even getting to the first executable statement in the code
> (and certainly before reaching the first call to a netcdf function).
> It dumps a core, and if I use the core to try and figure out where
> the segfault happened, I get:
>
> $ gdb tm5-var4d.x core.95085
> GNU gdb (GDB) SUSE (7.5.1-0.7.29)
> Copyright (C) 2012 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later
> <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and
> redistribute it.
> There is NO WARRANTY, to the extent permitted by law. Type
> "show copying"
> and "show warranty" for details.
> This GDB was configured as "x86_64-suse-linux".
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/gdb/bugs/>...
> Reading symbols from
> /nobackupp2/sbasu1/var4d/CO2/glb3x2/ei/tropo25/tm5-var4d.x...done.
> ...
> ...
> Core was generated by `./tm5-var4d.x
> insitu/output/2014060100-2014070100/forward_001.rc'.
> Program terminated with signal 11, Segmentation fault.
> #0 0x0000000000d1dfb4 in init_resource ()
> (gdb) where
> #0 0x0000000000d1dfb4 in init_resource ()
> #1 0x0000000000d1df1a in reentrancy_init ()
> #2 0x0000000000d1de38 in for__reentrancy_init ()
> #3 0x00007ffe3bbc7a15 in for_rtl_init_ () from
> /u/sbasu1/packages/netcdf-fortran/4.4.2/lib/libnetcdff.so.6
> #4 0x000000000041a179 in main ()
>
> i.e., it happened in libnetcdff.so.6. What does this mean and how
> can I fix this?
>
> Thanks,
> Sourish
>
>
>
> --
>
>
> Sourish Basu
> National Oceanic and Atmospheric Administration
> Global Monitoring Division
> 325 Broadway St, R/GMD
> Boulder, CO 80305, USA
> Phone: +1 303 497 6650
> Fax: +1 303 497 6290
>
>
>
>
>
>
>
Ticket Details
===================
Ticket ID: IEC-876213
Department: Support netCDF
Priority: Normal
Status: Closed