I now intend to model a water-chloroform interface with some polymer chains. How can I calculate the number of atoms and the size of the simulation box for the MD simulation? Your guidance in resolving this issue would be greatly appreciated. Additionally, could you provide some references for modeling a simulation box?
Thank you.
It is difficult to recommend a size for your box. You need it large enough to avoid self-interactions across the periodic boundary. In many cases a larger simulation box can be more stable (e.g., to thermostat and barostat fluctuations) and might give you more relevant statistics. For an interface like you describe, a 4 x 4 x 8 nm system may be a reasonable starting point.
Exactly how many molecules you need is not easy to say. Is your system a two-phase (water and chloroform mixed) or three-phase (water and chloroform separated by the polymers) system? If water and chloroform are mixed then it is easier, as you will not need to separate them by an additional polymer phase. You could start generating a water-chloroform mixture and equilibrate it. Make sure that you start from the relative concentration that you are interested in. After NPT pressure equilibration (might take a while to get it properly equilibrated) you should have a reasonable density.
After that you can extend your simulation box and add the polymer layer. Exactly how you generate the polymer layer is up to you.
Another way would be to generate a water-polymer system (might be an easier alternative, if you’ve got external tools to help you generate such a system) and equilibrate that. Then you can use gmx insert-molecules
to add chloroform to the water phase. You might need to do that in steps (and you might have to scale down the chloroform with -scale
and/or use the -replace
option - but then you need to make sure you arrive at the right concentration in the end), e.g., add 1/4 of the chloroform molecules, equilibrate the system (I’d recommend semi-isotropic with no compressibility in the X/Y dimensions during this setup-phase), add more chloroform molecules etc. Then you should equilibrate the system, preferably with a semi-isotropic pressure coupling in both X/Y and Z dimensions.
At least those are ideas how to get you started.
1 Like
Thank you, @MagnusL. I need to generate a biphasic system with chloroform below and water above it. After equilibration, I am going to insert the polymer into it. I will try the method you suggested. Thank you once again.
Then you will need two layers of polymer to avoid water and chloroform mixing across the periodic boundary.
Okay, let me ask you one more question. How can we add a specific number of SPC/SPCE water molecules into the box? I tried using packmol, but since I don’t have its pdb file, I couldn’t do it. Is there any solution for specifying the number of molecules to be solvated, for example, 8340 molecules of SPC water? Thanks in advanc
You can use gmx insert-molecules
for that. You might have to specify where you insert and you might have to scale down the molecules you insert.
okay sir @MagnusL , Thank you. I will try that
[quote=“aish.warya_2024, post:8, topic:9082, full:true”]
Thank you, @MagnusL, for your support. I’ve incorporated 1491 SPC water molecules into a box containing 288 TCE molecules with dimensions of 3.3x3.3x7.8 Å, resulting in a total of 5913 atoms, which I’ve named tce-water-box.gro
. However, during the energy minimization MD run, I encountered a fatal error related to domain decomposition:
vbnet
Copy code
Fatal error:
There is no domain decomposition for 4 ranks that is compatible with the given
box and a minimum cell size of 4.15298 nm
Change the number of ranks or mdrun option -rdd or -dds
Look in the log file for details on the domain decomposition
This issue arose while executing my em-run.sh
script:
#!/bin/bash
#SBATCH --job-name=packmol_test # Job name
#SBATCH --ntasks=4 # Number of MPI tasks (i.e., processes)
#SBATCH --cpus-per-task=1 # Number of cores per MPI task
#SBATCH --ntasks-per-node=4
#SBATCH --nodes=1 # Maximum number of nodes to be allocated
#SBATCH --partition=shortq
#SBATCH --output=tce-run.log
module load apps/gromacs/2020.7/gromacs-2020.7-gpu
Name of the executable
exe=“gmx_mpi”
export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK
Run the application
mpirun -bootstrap slurm -n $SLURM_NTASKS $exe mdrun -v -deffnm em-tce-water
The em-tce-water.tpr
file was generated using the following grompp
command:
grompp -f minim.mdp -c tce-water-box.gro -p topol.top -o em-tce-water.tpr -maxwarn 10
How can I resolve this issue? I’ve searched for solutions, and some suggest to use fewer nodes or adding -np 1 to the command line, but that didn’t work for me. I am already using fewer number of nodes. Could you help me?
Thanks in advance
If your box dimensions are 3.3x3.3x7.8 Ă… it is far too small. If you mean nm, then it may be OK. However, that box may still be too small to divide over 4 MPI ranks, i.e. into four domains. I do not think it is worth trying to set the -rdd
or -rds
options in this case. Small systems like this are usually better to run on one MPI rank. Try:
#SBATCH --ntasks=1 # Number of MPI tasks (i.e., processes)
#SBATCH --cpus-per-task=<number of cores/threads> # Number of cores per MPI task
#SBATCH --nodes=1 # Maximum number of nodes to be allocated
And set <number of cores/threads> to a suitable number, such as 8, 12 or 16 all depending on the hardware. One core/thread per MPI rank is usually not what I’d recommend anyhow.
You say that you are “already using fewer number of nodes”. Try one instead.
Thank you sir @MagnusL , the box dimension is: 3.3x3.3x7.8 nm. I have tried with -nodes=1 and partition=gpuq. Now its working.
Thank you once again