Re: [AMBER] Cpptraj: std::bad_alloc error

From: Pratul Agarwal <>
Date: Wed, 9 Jan 2019 13:36:16 +0000


Before you look at other reasons, it might be worth making sure that allocation of memory is not an issue.

Before you run cpptraj, can you check amount of memory available by using Linux command "free" (or equivalent command on your OS)? Make sure that at least 6.73 GB is listed in the free column (don't count swap, only free Mem). Your system may have more memory, but if other processes are using part of the memory and not enough is available to allocate -- your job will fail with same error message as indicated by the output.


Pratul K. Agarwal, Ph.D.
(Editorial Board Member: PLoS ONE, Microbial Cell Factories)

On 1/9/2019 6:33 AM, Nikolay N. Kuzmich wrote:

Dear Amber users and developers,

I received the following error after attempt to build all-to-all (2D) RMSD
from a long trajectory:

CPPTRAJ: Trajectory Analysis. V18.01
    ___ ___ ___ ___
     | \/ | \/ | \/ |

| Date/time: 01/09/19 14:03:45
| Available memory: 15.367 GB

        Loading previous history from log 'cpptraj.log'

parm abk_oct_spc2_1264_HMR.prmtop

  [parm abk_oct_spc2_1264_HMR.prmtop]
        Reading 'abk_oct_spc2_1264_HMR.prmtop' as Amber Topology
        Radius Set: modified Bondi radii (mbondi)
Warning: Amber topology flag 'LENNARD_JONES_CCOEF' is unrecognized and will
be skipped.

trajin Abk2_NPT_Prodrun8us_GPU_HMR.mdcrd

  [trajin Abk2_NPT_Prodrun8us_GPU_HMR.mdcrd]
        Reading 'Abk2_NPT_Prodrun8us_GPU_HMR.mdcrd' as Amber NetCDF

strip !:1-42

  [strip !:1-42]
    STRIP: Stripping atoms in mask [!:1-42]

rms2d .CA out mass Abk2_NPT_Prodrun8us_GPU_HMR.2drms.gnu

  [rms2d .CA out mass Abk2_NPT_Prodrun8us_GPU_HMR.2drms.gnu]
    RMS2D: COORDS set [_DEFAULTCRD_], mask [.CA], using RMSD (fit),
        Output to 'mass'


Warning: One or more analyses requested creation of default COORDS DataSet.
    CREATECRD: Saving coordinates from Top abk_oct_spc2_1264_HMR.prmtop to
---------- RUN BEGIN -------------------------------------------------

 0: abk_oct_spc2_1264_HMR.prmtop, 14799 atoms, 4746 res, box: Trunc. Oct.,
4705 mol, 4698 solvent

 0: 'Abk2_NPT_Prodrun8us_GPU_HMR.mdcrd' is a NetCDF AMBER trajectory with
coordinates, time, box, Parm abk_oct_spc2_1264_HMR.prmtop (Trunc. Oct. box)
(reading 800000 of 800000)
  Coordinate processing will occur on 800000 frames.

ACTION SETUP FOR PARM 'abk_oct_spc2_1264_HMR.prmtop' (2 actions):
  0: [strip !:1-42]
        Stripping 14100 atoms.
        Stripped topology: 699 atoms, 42 res, box: Trunc. Oct., 1 mol
  1: [createcrd _DEFAULTCRD_]
Warning: COORDS data sets do not store times.
        Estimated memory usage (800000 frames): 6.730 GB
----- Abk2_NPT_Prodrun8us_GPU_HMR.mdcrd (1-800000, 1) -----
 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% Complete.

Read 800000 frames and processed 800000 frames.
TIME: Avg. throughput= 924.7276 frames / second.


ANALYSIS: Performing 1 analyses:
  0: [rms2d .CA out mass Abk2_NPT_Prodrun8us_GPU_HMR.2drms.gnu]
        Mask [.CA] corresponds to 42 atoms.
terminate called after throwing an instance of 'std::bad_alloc'
  what(): std::bad_alloc
Aborted (core dumped)

The amount of memory should be sufficient.
Could you please tell me what is the possible source of trouble here?

Kind regards,

Nikolay Kuzmich
Department of Drug Safety,
Research Institute of Influenza,
WHO National Influenza Centre of Russia,
15/17 Professor Popov St.,
AMBER mailing list<>

AMBER mailing list
Received on Wed Jan 09 2019 - 06:00:04 PST
Custom Search