.. _orca: ==== ORCA ==== .. contents:: In this section: :local: :depth: 2 Description =========== According to the `page of ORCA `_, ORCA is a quantum chemistry software package that provides advanced methods in density functional theory (DFT) and correlated wavefunction methods. It is widely used in computational chemistry. Available Versions ================== * orca/4.0.1 (default) * orca/4.2.1 * orca/5.0.3 * orca/5.0.4 * orca/6.0.0 * orca/6.0.1 * orca/6.1.0 Loading the Module ================== .. code-block:: bash # Load ORCA module load orca/6.1.0 # Verify installation orca --version Serial Job Submission ===================== .. code-block:: bash :caption: submit_orca_serial.sh #!/bin/bash #SBATCH -J orca_serial #SBATCH -N 1 #SBATCH -n 1 #SBATCH -t 24:00:00 #SBATCH --mem=8G export INPUT="water.inp" export OUTPUT="water.out" module load orca/6.1.0 job-nanny orca water.inp Parallel Job Submission (OpenMP) ================================ .. code-block:: bash :caption: submit_orca_omp.sh #!/bin/bash #SBATCH -J orca_omp #SBATCH -N 1 #SBATCH -c 8 #SBATCH -t 48:00:00 #SBATCH --mem=32G export INPUT="benzene.inp" export OUTPUT="benzene.out" module load orca/6.1.0 # ORCA automatically uses threads job-nanny orca benzene.inp .. note:: The number of threads must be specified in the ORCA input file using the ``%pal nprocs`` directive. MPI Job Submission ================== .. code-block:: bash :caption: submit_orca_mpi.sh #!/bin/bash #SBATCH -J orca_mpi #SBATCH -N 2 #SBATCH --ntasks-per-node=14 #SBATCH -t 72:00:00 #SBATCH --mem-per-cpu=4G export INPUT="large.inp" export OUTPUT="large.out" module load orca/6.1.0 module load openmpi/4.1.8 # ORCA calls mpirun internally - do not use mpirun explicitly job-nanny $ORCA_BIN large.inp .. important:: ORCA manages MPI execution internally. Do not use ``mpirun`` directly — just use ``$ORCA_BIN large.inp``. The number of processes must be specified in the input file. It is possible that **Orca** may fail when using MPI parallelization with 2 or more nodes. In this case, a possible solution would be to create a file containing the node names using the command ``srun hostname -s | sort -u > hosts.$SLURM_JOB_ID``: .. code-block:: bash :caption: submit_orca_mpi.sh #!/bin/bash #SBATCH -J orca_mpi #SBATCH -N 2 #SBATCH --ntasks-per-node=14 #SBATCH -t 72:00:00 #SBATCH --mem-per-cpu=4G export INPUT="large.inp" export OUTPUT="large.out" module load orca/6.1.0 module load openmpi/4.1.8 srun hostname -s | sort -u > hosts.$SLURM_JOB_ID # ORCA calls mpirun internally - do not use mpirun explicitly job-nanny $ORCA_BIN large.inp Example Input File ================== .. code-block:: text :caption: water.inp ! RHF SVP OPT %pal nprocs 8 ! Number of threads/processes end %base "water" * xyz 0 1 O 0.000000 0.000000 0.000000 H 0.000000 0.757000 0.586000 H 0.000000 -0.757000 0.586000 * DFT Calculation with Optimization ================================= .. code-block:: bash :caption: submit_orca_dft.sh #!/bin/bash #SBATCH -J orca_dft #SBATCH -N 1 #SBATCH -c 8 #SBATCH -t 48:00:00 #SBATCH --mem=32G export INPUT="dft_opt.inp" export OUTPUT="dft_opt.out" module load orca/6.1.0 job-nanny orca dft_opt.inp .. code-block:: text :caption: dft_opt.inp ! B3LYP DEF2-TZVP OPT FREQ %pal nprocs 8 end %maxcore 4000 %scf maxiter 500 tole 1e-6 end * xyz 0 1 C 0.000000 0.000000 0.000000 C 1.400000 0.000000 0.000000 H -0.550000 0.940000 0.000000 H -0.550000 -0.940000 0.000000 H 1.950000 0.940000 0.000000 H 1.950000 -0.940000 0.000000 * Properties Calculation (NMR, TD-DFT) ==================================== .. code-block:: bash :caption: submit_orca_props.sh #!/bin/bash #SBATCH -J orca_props #SBATCH -N 1 #SBATCH -c 8 #SBATCH -t 36:00:00 #SBATCH --mem=32G export INPUT="nmr.inp" export OUTPUT="nmr.out" module load orca/6.1.0 job-nanny orca nmr.inp .. code-block:: text :caption: nmr.inp ! B3LYP DEF2-TZVP NMR %pal nprocs 8 end %eprnmr nuclei = all C {shift} nuclei = all H {shift} end * xyz 0 1 C 0.000000 0.000000 0.000000 H 1.089000 0.000000 0.000000 H -0.363000 1.026000 0.000000 H -0.363000 -0.513000 -0.889000 H -0.363000 -0.513000 0.889000 * .. code-block:: text :caption: td.inp ! B3LYP DEF2-TZVP TDDFT %pal nprocs 8 end %tddft nroots 10 end * xyz 0 1 C 0.000000 0.000000 0.000000 C 1.400000 0.000000 0.000000 H -0.550000 0.940000 0.000000 H -0.550000 -0.940000 0.000000 H 1.950000 0.940000 0.000000 H 1.950000 -0.940000 0.000000 * Job Array for Parameter Scan ============================ .. code-block:: bash :caption: submit_orca_array.sh #!/bin/bash #SBATCH -J orca_array #SBATCH --array=1-5 #SBATCH -N 1 #SBATCH -c 8 #SBATCH -t 24:00:00 #SBATCH --mem=16G PARAMS=( "B3LYP" "PBE0" "M06" "wB97X" "TPSS" ) METHOD=${PARAMS[$SLURM_ARRAY_TASK_ID-1]} export INPUT="template.inp" export OUTPUT="${METHOD}/" module load orca/6.1.0 mkdir -p ${METHOD} cd ${METHOD} # Modify method in input file sed "s/FUNCTIONAL/${METHOD}/g" ../template.inp > input.inp job-nanny orca input.inp Results Analysis ================ .. code-block:: bash :caption: analyze_orca.sh #!/bin/bash #SBATCH -J analyze_orca #SBATCH -N 1 #SBATCH -n 1 #SBATCH -t 00:30:00 #SBATCH --mem=2G # Extract final energy grep "FINAL SINGLE POINT ENERGY" *.out | awk '{print $6}' > energies.txt # Extract optimized geometry for out in *.out; do echo "Optimized geometry for $out:" >> optimized.txt awk '/CARTESIAN COORDINATES/,/CARTESIAN COORDINATES/ { if(NF==4 && $1!="CARTESIAN") print $0 }' $out >> optimized.txt echo "" >> optimized.txt done # Extract vibrational frequencies grep "FREQUENCIES IN CM" -A 5 *.out > frequencies.txt # Extract HOMO/LUMO orbitals grep "HOMO" *.out | awk '{print $3, $5}' > homo_lumo.txt # Extract gaps grep "GAP" *.out | awk '{print $3}' > gaps.txt # Extract excitation times (TD-DFT) grep "STATE" *.out | grep -v "TOTAL" > excitations.txt References ========== - Documentation: https://www.faccts.de/orca/ - Manuals: https://www.faccts.de/docs/orca/ - Forum: https://orcaforum.kofo.mpg.de/ .. seealso:: - :ref:`gamess` - Ab initio quantum chemistry - :ref:`gaussian` - Commercial quantum chemistry - :ref:`running_simulations` - How to submit jobs