Running and Verification
If multiple nodes are running, configure the network environment:
- In the /etc/hosts file, add the IP addresses and host names of the nodes.
- Enable SSH password-free login between the nodes.
- Disable the firewall and ensure that clients and servers are not disconnected.
Procedure
- Use PuTTY to log in to the server as the root user.
- Load the environment variables.
export PATH=/path/to/CP2K/cp2k-7.1.0/exe/Linux-x86-64-gfortran:$PATH
- Create a hostfile file.
- Create hostfile.
vi hostfile
- Press i to enter the edit mode and add the following content:
Node1 Node2
Node1 and Node2 are the node names. Change them based on the site requirements and ensure that the nodes can ping each other.
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Create hostfile.
- Run the following commands as the root user:
- Single node
mpirun --allow-run-as-root -np 96 -x OMP_NUM_THREADS=1 cp2k.psmp /path/to/CP2K/cp2k-7.1.0/benchmarks/QS/H2O-256.inp > cp2k.H2O-256.inp.log
- Dual nodes
mpirun --allow-run-as-root -np 192 -N 96 -x PATH=$PATH -x LD_LIBRARY_PATH=$LD_LIBRARY_PATH -hostfile hostfile -x OMP_NUM_THREADS=1 cp2k.psmp /path/to/CP2K/cp2k-7.1.0/benchmarks/QS/H2O-256.inp > cp2k.H2O-256.inp.log
The time difference between Figure 1 and Figure 2 and is 927s.
Table 1 Parameter description Parameter
Description
-np
Total number of running MPI processes.
-N
Number of processes running on each server.
-hostfile
Name of the node to be used.
- Single node
Parent topic: CP2K 7.1 Porting Guide (openEuler 21.03)

