Q-Chem & BrianQC
Q-Chem is an ab initio quantum chemistry software package for fast and accurate simulations of molecular systems, including electronic and molecular structure, reactivities, properties, and spectra. Q-Chem runs under Linux and Windows operating systems from small laptops to large HPC systems.
BrianQC is an advanced quantum chemistry software that speeds up every calculation that uses Coulomb or Exchange integrals over Gaussian basis function. BrianQC is optimized for simulating large molecules and has been tested for up to 40,000 Cartesian Gaussian basis functions with full support for s, p, d, f and g-type orbitals. BrianQC works on NVIDIA Pascal, Volta, Turing, Ampere, Ada Lovelace and Hopper architectures and provides calculation results with double-precision accuracy.
Prerequisites for Q-Chem & BrianQC
In order to start a job with either of Q-Chem, BrianQC or Q-Chem & BrianQC on HPC Komondor you need to have your login credentials, and have a positive balance (sbalance command).
accessing Komondor see: https://docs.hpc.dkf.hu/first-steps/index.html
signing in to Komondor see: https://docs.hpc.dkf.hu/first-steps/ssh-key.html
requesting projects and HPC processor and GPU time see: https://docs.hpc.dkf.hu/first-steps/projects.html
Allocating resource on HPC, salloc, srun, sbatch see: https://slurm.schedmd.com/tutorials.html
This is only accessible if the user is a member of the gaussian group on Komondor. To request membership, please send a message via https://portal.hpc.dkf.hu/ in the “Report bug” section.
Installed versions
Q-Chem 6.1.0 (default)
BrianQC version: v1_3_1_8f2f13b062
For Q-Chem manual/documentation, please visit: https://manual.q-chem.com/latest/
For BrianQC manual please visit: https://streamnovation-brianqc-manual.s3.amazonaws.com/BrianQC_Manual_v1_3_1.pdf
For more information on Q-Chem please visit: https://www.q-chem.com/
For more information on BrianQC see: https://www.brianqc.com/
Input
The following Q-Chem input performs a single-point Hartree–Fock energy calculation of cis-decalin using the cc-pVDZ basis set, with molecular symmetry disabled:
$comment
Single point Hartree-Fock energy calculation for cis-decalin in cc-pVDZ
$end
$molecule
0 1
C -2.360531 -0.566955 -0.556000
C -1.547996 -1.213282 0.597000
H -1.619087 -2.311341 0.530000
H -2.005250 -0.906660 1.553000
C -0.055357 -0.776046 0.597000
C 2.243811 -0.978142 -0.497000
C 1.547996 1.213282 0.597000
C 2.360531 0.566955 -0.556000
C 0.055357 0.776046 0.597000
C 0.758172 -1.415373 -0.570000
H 2.692116 -1.345771 0.441000
H 2.005250 0.906660 1.553000
H 2.005229 0.931661 -1.532000
C -0.758172 1.415373 -0.570000
H 0.356938 -1.132705 -1.553000
H 0.397951 -1.148671 1.531000
H 2.805185 -1.429678 -1.337000
H 1.619087 2.311341 0.530000
H 3.421293 0.854833 -0.457000
H -0.397951 1.148671 1.531000
H 0.699082 -2.514422 -0.497000
C -2.243811 0.978142 -0.497000
H -0.356938 1.132705 -1.553000
H -0.699082 2.514422 -0.497000
H -3.421293 -0.854833 -0.457000
H -2.005229 -0.931661 -1.532000
H -2.805185 1.429678 -1.337000
H -2.692116 1.345771 0.441000
$end
$rem
JOBTYPE SP
METHOD HF
BASIS CC-PVDZ Basis Set
SYM_IGNORE TRUE
SYMMETRY FALSE
S2THRESH 16
$end
Interactive submission of a Q-Chem or Q-Chem & BrianQC calculation
Allocate resources using salloc:
salloc -c 10 --mem-per-cpu=1900 -p ai --gpus=1
This reserves resources on the ai partition with 1 GPU, 10 CPU cores, and approximately 19 GB of total memory.
Once the allocation becomes active, you can start an interactive shell session with srun (or alternatively submit a batch job with sbatch). For example:
srun --jobid=<ALLOCATED_JOBID> --pty bash -i
This ‘source’ command is needed once per session:
source /opt/software/packages/qchem/6.1.0/qcenv.sh
This commands starts Q-Chem on 32 CPU threads:
qchem -nt 32 ~/user-inputs/calculation1.in
This commands starts Q-Chem on 16 CPU threads and on the available GPUs:
qchem -nt 16 -gpu ~/user-inputs/calculation1.in
BrianQC will, by default, use as many GPUs as possible during execution. Therefore, if none of the environment variables listed above are set, BrianQC will attempt to use all GPU devices available on the system as permitted by the license. There are several ways to control how many GPUs are used for a calculation:
CUDA_VISIBLE_DEVICES environment variable,
BRIANQC_GPU_COUNT environment variable
For more info see section 5.3 ‘Handling multiple GPUs’ in the BrianQC manual.
Q-Chem & BrianQC calculation (GPU-accelerated computation) using SLURMM script
To run a Q-Chem & BrianQC calculation, create a SLURM submission script (e.g., subQChem.sh) with the following content:
#!/bin/bash
#SBATCH --job-name=<QCHEM_TEST_XX>
#SBATCH --time=1-02:03:04
#SBATCH --nodes=1
#SBATCH --partition=gpu
#SBATCH --gpus=2
#SBATCH --cpus-per-task=16
#SBATCH --mem-per-cpu=1900M
source /opt/software/packages/qchem/6.1.0/qcenv.sh
qchem -nt 16 -gpu ~/user-inputs/task_to_calculate.in > ~/user-inputs/task_to_calculate.out 2>&1
This submits a job to the gpu partition, requesting 1 node, 16 CPU cores, 2 GPUs, and approximately 30.4 GB RAM (16 × 1900M). It loads the Q-Chem environment and runs Q-Chem with 16 threads and GPU support enabled via the -gpu option (required for BrianQC acceleration).
If the -gpu flag is omitted, the script will run a CPU-only Q-Chem calculation. In that case, it is more appropriate to submit the job to the cpu partition rather than the gpu queue (--partition=cpu).
Q-Chem-only calculation using SLURMM script
To run a Q-Chem-only calculation, the SLURMM script (subQChem.sh) should look like this:
#!/bin/bash
#SBATCH --job-name=QChem
#SBATCH --time=2-01:01:07
#SBATCH --nodes=1
#SBATCH --partition=cpu
#SBATCH --cpus-per-task=16
#SBATCH --mem-per-cpu=1900M
source /opt/software/packages/qchem/6.1.0/qcenv.sh
qchem -nt 16 ~/user-inputs/task_to_calculate.in > ~/user-inputs/task_to_calculate.out 2>&1
In this case the calculation can run on the cpu partition since Q-Chem cannot use gpu itself. The result will be written to the ~/user-inputs/task_to_calculate.out text file.
Then, to submit either a Q-Chem-only or a Q-Chem & BrianQC job via SLURM to the KOMONDOR queue:
sbatch subQChem.sh
How to Cite Q-Chem & BrianQC
Q-Chem (main program reference)
Epifanovsky, E.; Gilbert, A. T. B.; Feng, X.; Lee, J.; Mao, Y.; Mardirossian, N.; Pokhilko, P.; White, A. F.; Coons, M. P.; Dempwolff, A. L.; et al. Software for the Frontiers of Quantum Chemistry: An Overview of Developments in the Q-Chem 5 Package. J. Chem. Phys. 2021, 155, 084801. https://doi.org/10.1063/5.0055522
Q-Chem 6 Krylov, A. I.; Gill, P. M. W. Q-Chem: An Engine for Innovation. WIREs Comput. Mol. Sci. 2013, 3, 317–326. https://doi.org/10.1002/wcms.1122
BrianQC
Jász, Ádám, Ádám Rák, István Ladjánszki, and György Cserey. Classical Molecular Dynamics on Graphics Processing Unit Architectures. WIREs Computational Molecular Science 2019, e1444. https://doi.org/10.1002/wcms.1444.
Tornai, Gábor János, István Ladjánszki, Ádám Rák, Gergely Kis, and György Cserey. “Calculation of Quantum Chemical Two-Electron Integrals by Applying Compiler Technology on GPU.” Journal of Chemical Theory and Computation 2019, 15, 5319–31. https://doi.org/10.1021/acs.jctc.9b00560.