User Tools

Site Tools


howto:ipi

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
howto:ipi [2021/04/16 13:59] jglanhowto:ipi [2024/01/03 13:08] (current) oschuett
Line 1: Line 1:
-This a short tutorial on how to run I-PI with CP2K. +This page has been moved to: https://manual.cp2k.org/trunk/methods/sampling/i-pi.html
- +
- +
-i-PI is a Python interface for ab initio path integral molecular dynamics simulations.  +
-i-PI is composed of a Python server (i-pi itself, that does not need to be compiled but only requires a relatively recent version of Python and Numpy) that propagates the (path integral) dynamics of the nuclei, and of an external code that acts as a client and computes the electronic energy and forces. +
- +
-The i-PI manual can be found in {{:howto:i-pi-manual.pdf | i-PI Manual}} +
- +
- +
-Please cite the following paper if you use I-PI with CP2K +
- +
-1. [[https://www.sciencedirect.com/science/article/abs/pii/S0010465518303436|i-PI 2.0: A universal force engine for advanced molecular simulations]] +
- +
-2. [[https://aip.scitation.org/doi/10.1063/1.4941091|Accurate molecular dynamics and nuclear quantum effects at low cost by multiple steps in real and imaginary time: Using density functional theory to accelerate wavefunction methods]] +
- +
-===== Download i-PI from Github ===== +
- +
-<code> +
-git clone https://github.com/i-pi/i-pi.git +
-</code> +
- +
-To run i-PI, one need to source the environment file from the i-PI directory +
- +
-<code> +
-source ${PATH_TO_IPI}/env.sh +
-</code> +
- +
-Then one can run i-PI by using  +
- +
-<code> +
-i-pi input.xml > log & +
-</code> +
- +
-There are many input examples in i-pi/examples/ folder, which contains different methods, e.g. NVE, NVT, NPT, PIMD, REMP, etc. +
- +
- +
-===== Run i-PI with INET socket ===== +
-To use CP2K as the client code using an **internet** domain socket on the host address “host_address” and on the port number “port” the following lines must be added to its input file: +
- +
-<code> +
-&MOTION  +
-... +
-   &DRIVER +
-      HOST host_address +
-      PORT port +
-   &END DRIVER +
-... +
-&END MOTION    +
-</code> +
-In the **input.xml**, one need to use the same host_address and port to CP2K input. +
-<code> +
-  <ffsocket mode='inet' name='driver'> +
-    <address>host_address</address> +
-    <port>port</port> +
-    <latency>0.01</latency> +
-    <timeout>5000</timeout> +
-  </ffsocket> +
- +
-</code> +
- +
- +
-===== Run i-PI with UNIX socket ===== +
- +
-If instead a **unix** domain socket is required then the following modification is necessary: +
- +
-<code> +
-&MOTION  +
-... +
-   &DRIVER +
-      HOST host_address +
-      PORT port +
-      UNIX +
-   &END DRIVER +
-   ... +
-&END MOTION +
-</code> +
- +
-In the **input.xml**, one to specify the mode=unix to enable the communication via UNIX socket. +
-<code> +
-  <ffsocket mode='unix' name='driver'> +
-    <address>host_address</address> +
-    <port>port</port> +
-    <latency>0.01</latency> +
-    <timeout>5000</timeout> +
-  </ffsocket> +
- +
-</code> +
- +
-===== Run I-PI with CP2K in a supercomputer ===== +
-To run I-PI with CP2K on a supercomputer is also straightforward, one needs to get the hostname where the i-PI is executed, and then replace this variable in the CP2K input files. Here is an example script one can use to run I-PI with CP2K on the Daint machine (CSCS).  +
- +
-<code> +
-HOST=$(hostname) +
- +
-source ~/i-pi/env.sh +
- +
-if [ -e simulation.restart ]; then +
-   sed -i "s/address>[^<]*</address>$HOST</" simulation.restart +
-   i-pi simulation.restart  >> log.ipi 2>&1 & +
-else +
-   sed -i "s/address>[^<]*</address>$HOST</" input.xml +
-   i-pi input.xml &> log.ipi & +
-fi +
-sleep 5 +
- +
- +
-sed -i "s/HOST.*/HOST $HOST/" cp2k.inp +
- +
-srun cp2k.psmp -i cp2k.inp -o cp2k.out +
- +
-wait +
- +
- +
-</code>+
howto/ipi.1618581546.txt.gz · Last modified: 2021/04/16 13:59 by jglan