Out of memory- QM/MM

Dear all,

I defined to memory but many times It has given to the problem as an out of memory and my calculation has not been able to complete.
I tried to so many things but I haven’t any idea what is wrong. I got this error with PBE, WB97X-D and BLYP.
It was only completed with PM3.

I am trying to apply QM/MM

Do you have any idea what I need to do about “out of memory”?

Best regards



How big is your QM system?
Seems like you are using cluster with slurm.
What is your run setup: how many cores, nodes, etc you are trying to use?
Some clusters want to explicitly mention how much memory you want to use, try --mem-per-cpu= option of sbatch.

Best regards,

I have specified 1024MB (1GB) of memory. Is this per task, per core, for all the processes combined, or counted in yet some other way? I didn’t understand. Also, how does CP2K handle memory? Is there a shared memory for all threads (like Gaussian, which has a single process), or does it actually run as a bunch of separate processes (Turbomole is built this way, for a different kind of example)? I need a deeper technical understanding of the memory requirements and architecture –from CP2K. Can you help me, please?

I was trying to apply this tutorial

with PBE.
I’m sure I’m doing something wrong, but I don’t know which one. I am sharing with you my all files.


Thank you in advance.

  1. --mem is for all processes in total, but you need to setup it for each process with --mem-per-cpu=1G
  2. You are trying to run ssmp (cp2k-8.2-Linux-x86_64.ssmp, which is OpenMP without MPI) version of CP2K with srun. It results in running several separate tasks, which will conflict to each other. Correct would be to use psmp (cp2k-8.2-Linux-x86_64.psmp, which is MPI+OpenMP) version of CP2K.
  3. In the header of your script:
#SBATCH --nodes=1
#SBATCH --tasks-per-node=4
#SBATCH --cpus-per-task=2 

But then you are using srun like that: srun -n 24 while request was for 4 tasks only, it is inconsistent.

  1. If you want to use --cpus-per-task=2 then setup then put export OMP_NUM_THREADS=2 instead of 1

Also, how does CP2K handle memory? Is there a shared memory for all threads (like Gaussian, which has a single process), or does it actually run as a bunch of separate processes (Turbomole is built this way, for a different kind of example)?

SSMP version of CP2K runs 1 process then whole memory will be allocated within that process.
PSMP version can run several processes in MPI then each process will have its own memory, which is not shared.

Thank you so much!! I understood clearly so many thanks!!

I guess something is wrong about my cp2k.psmp

Nearly I have the same problem with this link https://groups.google.com/g/cp2k/c/t3Yp00Pt3yg and
my exe files always empty

and my cp2k.psmp is in bin file I don’t know is it normal or not. like this

cp2k-8.2-Linux-x86_64.ssmp available on HPC cluster(TALTECH -Tallinn/Estonia) so I tried to download my account on cluster, but I haven’t started to parallel work (again).

and also I downloaded that file linux-64/cp2k-8.2.0-py38_openmpi_1.tar.bz2 from this page (Files :: Anaconda.org) however it still doesn’t work.

I have to be honest that I’m sure I made a stupid mistake but I can’t find it.
I am sending you my files as well maybe it will be more meaningful about my problem.
I am also sending you cp2k.psmp file (I want to be sure that is it correct one or wrong. I have no idea)

Thank you in advance


How did you installed CP2K?

  1. Did you just downloaded it from somewhere?
  2. Or did you compiled it yourself?

I downloaded from this page https://github.com/cp2k/cp2k/releases/

is it wrong? and I tried to compile it by myself . and I followed these pages

Apparently you compiling it wrong:

  1. What was in your ./install_cp2k_toolchain.sh command line?

  2. What was in your make command line?

It is really hard to track down what is wrong in the procedure without access to the cluster. I could suggest you to contact cluster administrators. They for sure could help you much better with compiling CP2K for you particular cluster (maybe they have it already installed?)

make -j 6 ARCH=Linux-x86-64-intel-minimal VERSION=psmp

  1. ./install_cp2k_toolchain.sh --install-all I used to that one

I contact cluster administrators. they are trying to understand what is wrong on cluster and my account. Thank you for your all reply!

got to cp2k directory and try the following commands:
cp ./tools/toolchain/install/arch/local.psmp ./arch/local.psmp
make -j 6 ARCH=local VERSION=psmp

executable should appear in <cp2k>/exe/local

I tried however I got this message :confused:

and I tried to compile again toolchain and I realized that I got that

Soo my exe file is still empty but many thanks!!

try the following toolchain compilation:
./install_cp2k_toolchain.sh --math-mode=openblas --install-all

If this not work then I suggest too wait for the administrators response.

again the same :confused: but thank you much! many many thanks!!