malloc: *** error: pointer being freed was not allocated

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
bingzhang_chen
Posts: 7
Joined: Mon Mar 16, 2015 3:42 pm
Location: Japan Agency for Marine-Earth Science & Tech.

malloc: *** error: pointer being freed was not allocated

#1 Unread post by bingzhang_chen »

Hi ROMS Users:

I am a new user of ROMS. I am trying to run the default upwelling test case, but now I got a problem:

Model Input Parameters: ROMS/TOMS version 3.7
Wednesday - March 18, 2015 - 1:41:58 PM
-----------------------------------------------------------------------------

Wind-Driven Upwelling/Downwelling over a Periodic Channel

Operating system : Darwin
CPU/hardware : x86_64
Compiler system : ifort
Compiler command : /usr/bin/ifort
Compiler flags : -heap-arrays -fp-model source -openmp -fpp -ip -O3 -free -free -free

SVN Root URL : https://www.myroms.org/svn/src/trunk
SVN Revision : 758

Local Root : /Users/apple/ROMS
Header Dir : /Users/apple/ROMSTEST/upwelling_bz
Header file : upwelling.h
Analytical Dir: /Users/apple/ROMSTEST/upwelling_bz

Resolution, Grid 01: 0041x0080x016, Parallel Threads: 12, Tiling: 003x004


Physical Parameters, Grid: 01
=============================

288 ntimes Number of timesteps for 3-D equations.
300.000 dt Timestep size (s) for 3-D equations.
30 ndtfast Number of timesteps for 2-D equations between
each 3D timestep.
1 ERstr Starting ensemble/perturbation run number.
1 ERend Ending ensemble/perturbation run number.
0 nrrec Number of restart records to read from disk.
T LcycleRST Switch to recycle time-records in restart file.
72 nRST Number of timesteps between the writing of data
into restart fields.
1 ninfo Number of timesteps between print of information
to standard output.
T ldefout Switch to create a new output NetCDF file(s).
72 nHIS Number of timesteps between the writing fields
into history file.
1 ntsAVG Starting timestep for the accumulation of output
time-averaged data.
72 nAVG Number of timesteps between the writing of
time-averaged data into averages file.
1 ntsDIA Starting timestep for the accumulation of output
time-averaged diagnostics data.
72 nDIA Number of timesteps between the writing of
time-averaged data into diagnostics file.
0.0000E+00 nl_tnu2(01) NLM Horizontal, harmonic mixing coefficient
(m2/s) for tracer 01: temp
0.0000E+00 nl_tnu2(02) NLM Horizontal, harmonic mixing coefficient
(m2/s) for tracer 02: salt
0.0000E+00 nl_visc2 NLM Horizontal, harmonic mixing coefficient
(m2/s) for momentum.
F LuvSponge Turning OFF sponge on horizontal momentum.
F LtracerSponge(01) Turning OFF sponge on tracer 01: temp
F LtracerSponge(02) Turning OFF sponge on tracer 02: salt
1.0000E-06 Akt_bak(01) Background vertical mixing coefficient (m2/s)
for tracer 01: temp
1.0000E-06 Akt_bak(02) Background vertical mixing coefficient (m2/s)
for tracer 02: salt
1.0000E-05 Akv_bak Background vertical mixing coefficient (m2/s)
for momentum.
3.0000E-04 rdrg Linear bottom drag coefficient (m/s).
3.0000E-03 rdrg2 Quadratic bottom drag coefficient.
2.0000E-02 Zob Bottom roughness (m).
2 Vtransform S-coordinate transformation equation.
4 Vstretching S-coordinate stretching function.
3.0000E+00 theta_s S-coordinate surface control parameter.
0.0000E+00 theta_b S-coordinate bottom control parameter.
25.000 Tcline S-coordinate surface/bottom layer width (m) used
in vertical coordinate stretching.
1025.000 rho0 Mean density (kg/m3) for Boussinesq approximation.
0.000 dstart Time-stamp assigned to model initialization (days).
0.00 time_ref Reference time for units attribute (yyyymmdd.dd)
0.0000E+00 Tnudg(01) Nudging/relaxation time scale (days)
for tracer 01: temp
0.0000E+00 Tnudg(02) Nudging/relaxation time scale (days)
for tracer 02: salt
0.0000E+00 Znudg Nudging/relaxation time scale (days)
for free-surface.
0.0000E+00 M2nudg Nudging/relaxation time scale (days)
for 2D momentum.
0.0000E+00 M3nudg Nudging/relaxation time scale (days)
for 3D momentum.
0.0000E+00 obcfac Factor between passive and active
open boundary conditions.
F VolCons(1) NLM western edge boundary volume conservation.
F VolCons(2) NLM southern edge boundary volume conservation.
F VolCons(3) NLM eastern edge boundary volume conservation.
F VolCons(4) NLM northern edge boundary volume conservation.
14.000 T0 Background potential temperature (C) constant.
35.000 S0 Background salinity (PSU) constant.
1027.000 R0 Background density (kg/m3) used in linear Equation
of State.
1.7000E-04 Tcoef Thermal expansion coefficient (1/Celsius).
7.6000E-04 Scoef Saline contraction coefficient (1/PSU).
1.000 gamma2 Slipperiness variable: free-slip (1.0) or
no-slip (-1.0).
F LuvSrc Turning OFF momentum point Sources/Sinks.
F LwSrc Turning OFF volume influx point Sources/Sinks.
F LtracerSrc(01) Turning OFF point Sources/Sinks on tracer 01: temp
F LtracerSrc(02) Turning OFF point Sources/Sinks on tracer 02: salt
F LsshCLM Turning OFF processing of SSH climatology.
F Lm2CLM Turning OFF processing of 2D momentum climatology.
F Lm3CLM Turning OFF processing of 3D momentum climatology.
F LtracerCLM(01) Turning OFF processing of climatology tracer 01: temp
F LtracerCLM(02) Turning OFF processing of climatology tracer 02: salt
F LnudgeM2CLM Turning OFF nudging of 2D momentum climatology.
F LnudgeM3CLM Turning OFF nudging of 3D momentum climatology.
F LnudgeTCLM(01) Turning OFF nudging of climatology tracer 01: temp
F LnudgeTCLM(02) Turning OFF nudging of climatology tracer 02: salt
T Hout(idFsur) Write out free-surface.
T Hout(idUbar) Write out 2D U-momentum component.
T Hout(idVbar) Write out 2D V-momentum component.
T Hout(idUvel) Write out 3D U-momentum component.
T Hout(idVvel) Write out 3D V-momentum component.
T Hout(idWvel) Write out W-momentum component.
T Hout(idOvel) Write out omega vertical velocity.
T Hout(idTvar) Write out tracer 01: temp
T Hout(idTvar) Write out tracer 02: salt
T Hout(idDano) Write out density anomaly.

T Aout(idFsur) Write out averaged free-surface.
T Aout(idUbar) Write out averaged 2D U-momentum component.
T Aout(idVbar) Write out averaged 2D V-momentum component.
T Aout(idUvel) Write out averaged 3D U-momentum component.
T Aout(idVvel) Write out averaged 3D V-momentum component.
T Aout(idWvel) Write out averaged W-momentum component.
T Aout(idOvel) Write out averaged omega vertical velocity.
T Aout(idTvar) Write out averaged tracer 01: temp
T Aout(idTvar) Write out averaged tracer 02: salt
T Aout(idDano) Write out averaged density anomaly.

T Dout(M2rate) Write out 2D momentum acceleration.
T Dout(M2pgrd) Write out 2D momentum pressure gradient.
T Dout(M2fcor) Write out 2D momentum Coriolis force.
T Dout(M2hadv) Write out 2D momentum horizontal advection.
T Dout(M2xadv) Write out 2D momentum horizontal X-advection.
T Dout(M2yadv) Write out 2D momentum horizontal Y-advection.
T Dout(M2hvis) Write out 2D momentum horizontal viscosity.
T Dout(M2xvis) Write out 2D momentum horizontal X-viscosity.
T Dout(M2yvis) Write out 2D momentum horizontal Y-viscosity.
T Dout(M2sstr) Write out 2D momentum surface stress.
T Dout(M2bstr) Write out 2D momentum bottom stress.

T Dout(M3rate) Write out 3D momentum acceleration.
T Dout(M3pgrd) Write out 3D momentum pressure gradient.
T Dout(M3fcor) Write out 3D momentum Coriolis force.
T Dout(M3hadv) Write out 3D momentum horizontal advection.
T Dout(M3xadv) Write out 3D momentum horizontal X-advection.
T Dout(M3yadv) Write out 3D momentum horizontal Y-advection.
T Dout(M3vadv) Write out 3D momentum vertical advection.
T Dout(M3hvis) Write out 3D momentum horizontal viscosity.
T Dout(M3xvis) Write out 3D momentum horizontal X-viscosity.
T Dout(M3yvis) Write out 3D momentum horizontal Y-viscosity.
T Dout(M3vvis) Write out 3D momentum vertical viscosity.

T Dout(iTrate) Write out rate of change of tracer 01: temp
T Dout(iTrate) Write out rate of change of tracer 02: salt
T Dout(iThadv) Write out horizontal advection, tracer 01: temp
T Dout(iThadv) Write out horizontal advection, tracer 02: salt
T Dout(iTxadv) Write out horizontal X-advection, tracer 01: temp
T Dout(iTxadv) Write out horizontal X-advection, tracer 02: salt
T Dout(iTyadv) Write out horizontal Y-advection, tracer 01: temp
T Dout(iTyadv) Write out horizontal Y-advection, tracer 02: salt
T Dout(iTvadv) Write out vertical advection, tracer 01: temp
T Dout(iTvadv) Write out vertical advection, tracer 02: salt
T Dout(iThdif) Write out horizontal diffusion, tracer 01: temp
T Dout(iThdif) Write out horizontal diffusion, tracer 02: salt
T Dout(iTxdif) Write out horizontal X-diffusion, tracer 01: temp
T Dout(iTxdif) Write out horizontal X-diffusion, tracer 02: salt
T Dout(iTydif) Write out horizontal Y-diffusion , tracer 01: temp
T Dout(iTydif) Write out horizontal Y-diffusion , tracer 02: salt
T Dout(iTvdif) Write out vertical diffusion, tracer 01: temp
T Dout(iTvdif) Write out vertical diffusion, tracer 02: salt

Output/Input Files:

Output Restart File: ocean_rst.nc
Output History File: ocean_his.nc
Output Averages File: ocean_avg.nc
Output Diagnostics File: ocean_dia.nc

Tile partition information for Grid 01: 0041x0080x0016 tiling: 003x004

tile Istr Iend Jstr Jend Npts

0 1 14 1 20 4480
1 15 28 1 20 4480
2 29 41 1 20 4160
3 1 14 21 40 4480
4 15 28 21 40 4480
5 29 41 21 40 4160
6 1 14 41 60 4480
7 15 28 41 60 4480
8 29 41 41 60 4160
9 1 14 61 80 4480
10 15 28 61 80 4480
11 29 41 61 80 4160

Tile minimum and maximum fractional coordinates for Grid 01:
(interior points only)

tile Xmin Xmax Ymin Ymax grid

0 -1.50 43.50 0.50 82.50 RHO-points
1 -2.50 43.50 0.50 82.50 RHO-points
2 -2.50 42.50 0.50 82.50 RHO-points
3 -1.50 43.50 -0.50 82.50 RHO-points
4 -2.50 43.50 -0.50 82.50 RHO-points
5 -2.50 42.50 -0.50 82.50 RHO-points
6 -1.50 43.50 -0.50 82.50 RHO-points
7 -2.50 43.50 -0.50 82.50 RHO-points
8 -2.50 42.50 -0.50 82.50 RHO-points
9 -1.50 43.50 -0.50 81.50 RHO-points
10 -2.50 43.50 -0.50 81.50 RHO-points
11 -2.50 42.50 -0.50 81.50 RHO-points

0 -2.00 43.50 0.50 82.50 U-points
1 -2.50 43.50 0.50 82.50 U-points
2 -2.50 42.00 0.50 82.50 U-points
3 -2.00 43.50 -0.50 82.50 U-points
4 -2.50 43.50 -0.50 82.50 U-points
5 -2.50 42.00 -0.50 82.50 U-points
6 -2.00 43.50 -0.50 82.50 U-points
7 -2.50 43.50 -0.50 82.50 U-points
8 -2.50 42.00 -0.50 82.50 U-points
9 -2.00 43.50 -0.50 81.50 U-points
10 -2.50 43.50 -0.50 81.50 U-points
11 -2.50 42.00 -0.50 81.50 U-points

0 -1.50 43.50 0.00 82.50 V-points
1 -2.50 43.50 0.00 82.50 V-points
2 -2.50 42.50 0.00 82.50 V-points
3 -1.50 43.50 -0.50 82.50 V-points
4 -2.50 43.50 -0.50 82.50 V-points
5 -2.50 42.50 -0.50 82.50 V-points
6 -1.50 43.50 -0.50 82.50 V-points
7 -2.50 43.50 -0.50 82.50 V-points
8 -2.50 42.50 -0.50 82.50 V-points
9 -1.50 43.50 -0.50 81.00 V-points
10 -2.50 43.50 -0.50 81.00 V-points
11 -2.50 42.50 -0.50 81.00 V-points

Lateral Boundary Conditions: NLM
============================

Variable Grid West Edge South Edge East Edge North Edge
--------- ---- ---------- ---------- ---------- ----------

zeta 1 Periodic Closed Periodic Closed

ubar 1 Periodic Closed Periodic Closed

vbar 1 Periodic Closed Periodic Closed

u 1 Periodic Closed Periodic Closed

v 1 Periodic Closed Periodic Closed

temp 1 Periodic Closed Periodic Closed

salt 1 Periodic Closed Periodic Closed

Activated C-preprocessing Options:

UPWELLING Wind-Driven Upwelling/Downwelling over a Periodic Channel
ANA_BSFLUX Analytical kinematic bottom salinity flux.
ANA_BTFLUX Analytical kinematic bottom temperature flux.
ANA_GRID Analytical grid set-up.
ANA_INITIAL Analytical initial conditions.
ANA_SMFLUX Analytical kinematic surface momentum flux.
ANA_SSFLUX Analytical kinematic surface salinity flux.
ANA_STFLUX Analytical kinematic surface temperature flux.
ANA_VMIX Analytical vertical mixing coefficients.
ASSUMED_SHAPE Using assumed-shape arrays.
AVERAGES Writing out time-averaged nonlinear model fields.
DIAGNOSTICS_TS Computing and writing tracer diagnostic terms.
DIAGNOSTICS_UV Computing and writing momentum diagnostic terms.
DJ_GRADPS Parabolic Splines density Jacobian (Shchepetkin, 2002).
DOUBLE_PRECISION Double precision arithmetic.
MIX_S_TS Mixing of tracers along constant S-surfaces.
MIX_S_UV Mixing of momentum along constant S-surfaces.
NONLINEAR Nonlinear Model.
!NONLIN_EOS Linear Equation of State for seawater.
_OPENMP OpenMP parallel shared-memory directives.
POWER_LAW Power-law shape time-averaging barotropic filter.
PROFILE Time profiling activated .
!RST_SINGLE Double precision fields in restart NetCDF file.
SALINITY Using salinity.
SOLVE3D Solving 3D Primitive Equations.
SPLINES Conservative parabolic spline reconstruction.
TS_U3HADVECTION Third-order upstream horizontal advection of tracers.
TS_C4VADVECTION Fourth-order centered vertical advection of tracers.
TS_DIF2 Harmonic mixing of tracers.
UV_ADV Advection of momentum.
UV_COR Coriolis term.
UV_U3HADVECTION Third-order upstream horizontal advection of 3D momentum.
UV_C4VADVECTION Fourth-order centered vertical advection of momentum.
UV_LDRAG Linear bottom stress.
UV_VIS2 Harmonic mixing of momentum.
VAR_RHO_2D Variable density barotropic mode.

Process Information:

Thread # 0 (pid= 6708) is active.
Thread # 11 (pid= 6708) is active.
Thread # 3 (pid= 6708) is active.
Thread # 10 (pid= 6708) is active.
Thread # 4 (pid= 6708) is active.
Thread # 6 (pid= 6708) is active.
Thread # 8 (pid= 6708) is active.
Thread # 5 (pid= 6708) is active.
Thread # 9 (pid= 6708) is active.
Thread # 2 (pid= 6708) is active.
Thread # 7 (pid= 6708) is active.
Thread # 1 (pid= 6708) is active.

INITIAL: Configuring and initializing forward nonlinear model ...
*******
oceanO(6708,0x10f67d000) malloc: *** error for object 0x7fc425b03420: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
oceanO(6708,0x110e8f000) malloc: *** error for object 0x7fc425b03420: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
oceanO(6708,0x111292000) malloc: *** error for object 0x7fc425b03420: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
oceanO(6708,0x110286000) malloc: *** error for object 0x7fc425b03420: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
oceanO(6708,0x110a8c000) malloc: *** error for object 0x7fc425b03420: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
oceanO(6708,0x10fe83000) malloc: *** error for object 0x7fc425b03420: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
oceanO(6708,0x110689000) malloc: *** error for object 0x7fc425b03420: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
oceanO(6708,0x111e9b000) malloc: *** error for object 0x7fc425b03420: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Abort trap: 6

I googled the error of "pointer being freed was not allocated", which seems be caused by a problem in in the C++ code. Since I only changed the upwelling.h file, is this a problem related to the head file?

Any advice would be appreciated!

Bingzhang

bingzhang_chen
Posts: 7
Joined: Mon Mar 16, 2015 3:42 pm
Location: Japan Agency for Marine-Earth Science & Tech.

Re: malloc: *** error: pointer being freed was not allocated

#2 Unread post by bingzhang_chen »

I find that it is related with the parallel computing. If I disable parallelism, the model runs normally. But I wonder why...

User avatar
kate
Posts: 4089
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: malloc: *** error: pointer being freed was not allocated

#3 Unread post by kate »

What exactly did you change? Just turning on the OpenMP option or anything else? I haven't run ROMS in OpenMP mode in many, many years, but I thought it should be working. If you want it to work, you have to be very careful in your ROMS modifications not to break it.

bingzhang_chen
Posts: 7
Joined: Mon Mar 16, 2015 3:42 pm
Location: Japan Agency for Marine-Earth Science & Tech.

Re: malloc: *** error: pointer being freed was not allocated

#4 Unread post by bingzhang_chen »

Yes. I just turned on the openmp option. My platform is a Mac Pro with 6 physical CPUs, so I thought I should use the shared-memory parallelism... I may need to learn more about OPENMPI...

User avatar
kate
Posts: 4089
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: malloc: *** error: pointer being freed was not allocated

#5 Unread post by kate »

I may need to learn more about OPENMPI...
I know the OpenMPI works - but that's something else again entirely. Did you mean OpenMP or the OpenMPI implementation of MPI?

bingzhang_chen
Posts: 7
Joined: Mon Mar 16, 2015 3:42 pm
Location: Japan Agency for Marine-Earth Science & Tech.

Re: malloc: *** error: pointer being freed was not allocated

#6 Unread post by bingzhang_chen »

Sorry, I meant the OpenMP implementation.

Post Reply