8. Special Topics

8.1. The Parallel mode

The parallel mode of CALYPSO enables the geometrical optimization of structures through desirable number of CPUs. The parallel mode of CALYPSO supports torque pbs system.

  1. The keywords “Parallel” and “NumberOfParallel” are needed for using the parallel mode.

    For example, you can add Parallel = T and NumberOfParallel = 4 to the input.dat. NumberOfParallel defines the number of structure relaxations you want to run in parallel.

  2. Modify the pbs script for generating the machinefile. The machinefile is a file that contains a list of the possible machines on which you want your MPI program to run.

    For example, you should add cat $PBS\_NODEFILE > machinefile before the line of executable calypso.x (usually ./calypso.x > caly.log).

  3. Modify the script for VASP execution.

    For example, you can write the submit.sh as below:

mpiexec –machine snodefile –n 12 vasp > out.vasp 2 > /dev/null

8.2. Remote Submission

The remote submission mode will allow the calypso running on a local machine while the VASP is running on the remote cluster. This feature is yet under testing on Torque PBS system at present.

Here is the workflow:

  1. You should set the keywords ‘RemoteParallel = T’ to enable the remote submission mode. And you can define the number of structures you want to relax at the same time by setting the keyword NumberOfParallel which just like in the parallel mode.

  2. Modify the submitremote.sh file.

    server='test@10.60.36.168'
    port='22'
    

    Please modify the ‘server’ and the ‘port’ to adapt your cluster.

  3. To set up passwordless connection from local machine to remote cluster, you need to copy the public key from you local machine (directory ~/.ssh/) to the remote cluster. Here is the list of commands you need to execute.

    On the local machine:

    ssh-keygen
    scp ~/.ssh/id_rsa.pub test@cluster.calypso.cn:~/ssh/local.pub
    

    On the remote cluster:

    cd ~/.ssh/
    cat local.pub >> authorized\_keys
    rm local.pub
    
  4. Prepare the pbs script ‘vasp.pbs’ to calculate the vasp. Here is an example.

    vasp.pbs

    #!/bin/bash
    #PBS -l nodes=1:ppn=6
    #PBS -j oe
    #PBS -V
    
    cd $PBS_O_WORKDIR
    if [ ! -f ~/.mpd.conf ]; then
    /bin/echo "secretword=dfadfs" >> ~/.mpd.conf
    /bin/chmod 600 ~/.mpd.conf
    fi
    # Intel MPI Home
    MPI_HOME=/opt/intel/impi/4.0.0.027
    # setup Nums of Processor
    NP=cat $PBS_NODEFILE|wc -l
    echo "Numbers of Processors:  $NP"
    echo "---------------------------"
    # Number of MPD
    N_MPD=cat $PBS_NODEFILE|uniq|wc -l
    echo "started mpd Number: $N_MPD"
    echo "---------------------------"
    # setup mpi env (em64t)
    $MPI_HOME/bin64/mpdboot -r ssh -n $N_MPD -f $PBS_NODEFILE
    # running program
    for i in 1 2 3
    do
    cp INCAR_$i INCAR
    python writekp.py 0.1
    mpiexec -n $NP /share/apps/vasp/vasp.4.6 > log 2 > /dev/null
    cp CONTCAR POSCAR
    done
    
    cp INCAR_4 INCAR
    python writekp.py 0.07
    mpiexec -n $NP /share/apps/vasp/vasp.4.6 > log 2 > /dev/null
    

    note

    the writekp.py arguments can be modified to control the precision of the k-mesh sampling for local optimization.

  5. When you have prepared the necessary files (such as POTCAR, INCAR_*, vasp.pbs, submitremote.sh), you can execute the calypso.x on your local machine.

8.3. The Split mode

The split mode of CALYPSO can provide a more flexible way to relax the structures.

The structural files with POSCAR format (POSCAR_*) are generated by calypso.x. You can relax these structures on any computer clusters or workstations.

Here is the workflow:

  1. Enabling the split mode by setting Split = T in the input.dat.

  2. Executing the calypso.x to generate the structural files (in POSCAR format) of ‘POSCAR_1, POSCAR_2, …’ for one particular generation.

  3. After optimizing all these structures one by one on all possible computer clusters, please copy the OUTCAR and CONTCAR to ‘OUTCAR_1 and CONTCAR_1’, or ‘OUTCAR_2 and CONTCAR_2’ and then moves all these files to the directory where you executed calypso.x.

  4. Executing calypso.x again to generate the POSCAR_* files for the next generation.

  5. To repeat the steps 2-4 until the halting criterion is reached.

note

One best practice to use the split mode is on Bohrium platform, the guide can be found here