# Technical limitation in replica exchange MD simulation

**URL:** <https://gromacs.bioexcel.eu/t/technical-limitation-in-replica-exchange-md-simulation/9659>\
**Category:** User discussions\
**Created:** [July 16, 2024, 8:00am UTC](https://gromacs.bioexcel.eu/t/technical-limitation-in-replica-exchange-md-simulation/9659 "2024-07-16T08:00:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![baharebamdad](https://avatars.discourse-cdn.com/v4/letter/b/9e8a1a/32.png) [@baharebamdad](https://gromacs.bioexcel.eu/u/baharebamdad)\
**Post date:** [July 16, 2024, 8:00am UTC](https://gromacs.bioexcel.eu/t/technical-limitation-in-replica-exchange-md-simulation/9659/1 "2024-07-16T08:00:20Z")

</div>

GROMACS version: 2024  
GROMACS modification: No  
Dear All,

I need to perform a replica exchange MD simulation for a chromophore system. When I prepare the system with 30 chromophore molecules and 68 replicas, the simulation finishes successfully. However, for a system containing 100 chromophore molecules and 124 replicas, I encounter the following error:

Fatal error:  
Not enough memory. Failed to allocate 18446744073103078171 aligned elements of  
size 4 for grid-\>grid  
(called from file  
/home/conda/feedstock\_root/build\_artifacts/gromacs\_1720551832028/work/src/gromacs/ewald/pme\_grid.cpp,  
line 620)

It seems that the required memory exponentially increases with the number of replicas. My question is: Is there a technical limitation on the number of replicas for REMD simulations? If not, what could be the problem?  
FYI: I‌ am using Gromacs version 2024

Best regards,  
Bahareh

---

<div class="post-metadata">

**Author:** ![scinikhil](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/scinikhil/32/3483_2.png) [@scinikhil](https://gromacs.bioexcel.eu/u/scinikhil)\
**Post date:** [July 16, 2024, 4:00pm UTC](https://gromacs.bioexcel.eu/t/technical-limitation-in-replica-exchange-md-simulation/9659/2 "2024-07-16T16:00:36Z")

</div>

> [@baharebamdad](#):
>
> Not enough memory. Failed to allocate 18446744073103078171 aligned elements of  
> size 4 for grid-\>grid  
> (called from file  
> /home/conda/feedstock\_root/build\_artifacts/gromacs\_1720551832028/work/src/gromacs/ewald/pme\_grid.cpp,

what is your configuration for REMD simulation to run,

---

<div class="post-metadata">

**Author:** ![baharebamdad](https://avatars.discourse-cdn.com/v4/letter/b/9e8a1a/32.png) [@baharebamdad](https://gromacs.bioexcel.eu/u/baharebamdad)\
**Post date:** [July 16, 2024, 7:13pm UTC](https://gromacs.bioexcel.eu/t/technical-limitation-in-replica-exchange-md-simulation/9659/3 "2024-07-16T19:13:29Z")

</div>

I have a box containing 100 chromophores. I prepared 124 replicas with temperatures ranging from 100 to 800 K. I used a geometric progression to divide the temperature range into 124 values. Please let me know if you need more information.

---

<div class="post-metadata">

**Author:** ![scinikhil](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/scinikhil/32/3483_2.png) [@scinikhil](https://gromacs.bioexcel.eu/u/scinikhil)\
**Post date:** [July 16, 2024, 10:50pm UTC](https://gromacs.bioexcel.eu/t/technical-limitation-in-replica-exchange-md-simulation/9659/4 "2024-07-16T22:50:53Z")

</div>

what command you used and your system configuration, how many cores you assigned and how many RAM you got? also provide your mdp file. specifically your grid spacing.

---

<div class="post-metadata">

**Author:** ![baharebamdad](https://avatars.discourse-cdn.com/v4/letter/b/9e8a1a/32.png) [@baharebamdad](https://gromacs.bioexcel.eu/u/baharebamdad)\
**Post date:** [July 17, 2024, 10:28am UTC](https://gromacs.bioexcel.eu/t/technical-limitation-in-replica-exchange-md-simulation/9659/5 "2024-07-17T10:28:17Z")

</div>

Hi,

The following is the script I am using for running my job using slurm. From it you can find all necessary information:  
#!/bin/bash  
#SBATCH --job-name=remd  
#SBATCH --mem=60000  
#SBATCH --nodes=8  
#SBATCH --tasks-per-node=62  
#SBATCH --time=1259200

module load gromacs  
mpirun -np 496 gmx\_mpi mdrun -v -s remd -multidir repl\* -replex 1000

and here is my mdp file for one case:  
title = OPLS Lysozyme NPT equilibration  
; Run parameters  
integrator = md  
nsteps = 200000000  
dt = 0.001  
; Output control  
nstxout = 100000  
nstvout = 100000  
nstenergy = 100000  
nstlog = 100000  
; Bond parameters  
continuation = yes  
constraint\_algorithm = lincs  
constraints = h-bonds  
lincs\_iter = 1  
lincs\_order = 4  
; Nonbonded settings  
cutoff-scheme = Verlet  
ns\_type = grid  
nstlist = 10  
rcoulomb = 1.2  
rvdw = 1.2  
DispCorr = EnerPres  
; Electrostatics  
coulombtype = PME  
pme\_order = 4  
fourierspacing = 0.16  
; Temperature coupling is on  
tcoupl = V-rescale  
tc-grps = UNL  
tau\_t = 0.1  
ref\_t = 100

pcoupl = Parrinello-Rahman  
pcoupltype = isotropic  
tau\_p = 2.0  
ref\_p = 1.0  
compressibility = 4.5e-5  
refcoord\_scaling = com  
pbc = xyz  
gen\_vel = no

---

<div class="post-metadata">

**Author:** ![scinikhil](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/scinikhil/32/3483_2.png) [@scinikhil](https://gromacs.bioexcel.eu/u/scinikhil)\
**Post date:** [July 17, 2024, 11:51pm UTC](https://gromacs.bioexcel.eu/t/technical-limitation-in-replica-exchange-md-simulation/9659/6 "2024-07-17T23:51:25Z")

</div>

1. why you are using 1 fs, time step? do you need to save this much data? or in this short time? try to reduce those, if i remember correctly, i never used more than 20 GB in my setting.
2. what is your node configuration? can you try using this way:

```auto
#SBATCH --ntasks=496
#SBATCH --cpus-per-task=1

```
