Skip to content

Releases

Barranquilla MOPAC v1.2.1-gpu

Choose a tag to compare

@juvenalyosa juvenalyosa released this 20 Nov 19:06

Barranquilla MOPAC v1.2.1-gpu: fixes found while checking the documentation against the code of v1.2-gpu, and the documentation brought up to date. MOZYME, solids, QM/MM and the benchmark results are as in v1.2-gpu: 18 worked examples of the wiki (single points, COSMO, optimizations, dynamics, solids, MM_CHARGES), re-run with the CPU build of this release, gave the same heats as with v1.2-gpu. Inputs do not change; NOGPU or MOPAC_NOGPU=1 gives the CPU code path of the same program.

Fixes

  • TRUST writes a restart file at the cycle limit, at the time limit and every DUMP interval (b46602aa). RESTART with TRUST continues from the stored geometry with an empty memory; without TRUST the default optimizer starts there; 1SCF RESTART PDBOUT writes that geometry. Before, TRUST wrote none, and RESTART stopped with RESTART file '<input>.res' does not exist.
  • MM_CHARGES without MOZYME stops with MM_CHARGES AND NO MOZYME (e13e5f99). The point charges act only in MOZYME; before, they were silently unused in a conventional-SCF job.
  • HMTR works (8221d864). Its interface to compfg declared assumed-shape arrays for explicit-shape ones, so every evaluation received a wrong geometry: the job stopped with TWO ATOMS ARE COINCIDENT or did not end. Also fixed: angles in radians (MOPAC) against degrees (HMTR); only dihedral angles of atoms in internal coordinates are varied (with Cartesian input it now says so and skips); the members are evaluated one after the other (in parallel OpenMP threads they overwrote MOPAC's global arrays); members with a non-finite energy or gradient are never kept. Test: PM7 n-hexane in internal coordinates, started at +84.15 kcal/mol, reached −35.27 kcal/mol after HMTR and one BFGS cycle, against −8.95 after one BFGS cycle without it (all-anti conformer −36.68). HMTR stays experimental.
  • gmetry/renum no longer loops forever on coordinates that are not numbers (8221d864); present in MOPAC 23.1.2.
  • tests/check_qmmm_pme_ewald.py runs again: in v1.2-gpu it stopped with an AttributeError after two of its checks (a fault of the test, not of the program; ef0e500d). All 11 CPU checks pass.
  • Header lines of EDIIS and HMTR say what the code does (e13e5f99).

Documentation

  • The wiki page New keywords describes every new keyword (BUSSI, EDIIS, HB-SMOOTH, HMTR, MM_CHARGES, SEED, SMEAR, SWIG, TEMPERATURE, TRUST) and the existing keywords whose behaviour changed, in the manner of the MOPAC manual.
  • Corrected in the README, the wiki and docs/: the GPU trace lines ([MOZYME GPU SCF] status=success) appear only with MOPAC_GPU_DEBUG=1; jobs of 100 atoms or fewer run on the CPU unless MOPAC_FORCEGPU=1, which does not undo NOGPU; a positive ENERGY TO BATH is energy the thermostat took out of the system; SMEAR and EDIIS act only in the conventional SCF; EDIIS is a damped start with an adaptive level shift, not energy DIIS; SHIFT=80 restores only the shift of MOPAC 23.1.2 in solids; the QM/MM page of the wiki gives the current limits, defaults and times per step.

The changes are in Fortran and Python; no CUDA source changed. They were compiled and run in the CPU build; the GPU sections of hmtr.F90 were syntax-checked with the GPU macro, not compiled with nvcc.

Barranquilla MOPAC is an independent derivative of MOPAC (Apache License 2.0), not affiliated with or endorsed by MolSSI or Virginia Tech.

Barranquilla MOPAC v1.2-gpu

Choose a tag to compare

@juvenalyosa juvenalyosa released this 19 Nov 14:05

Barranquilla MOPAC v1.2-gpu: faster QM/MM dynamics with MOPAC on the GPU, MOPAC on the GPU for smaller QM regions, and tools to find the sources of energy drift in QM/MM NVE runs. MOZYME, solids and the benchmark results are as in v1.1-gpu (benchmark run at commit c85eb96d). Inputs do not change; NOGPU or MOPAC_NOGPU=1 gives the CPU code path of the same program.

QM/MM speed (one A100, 0.5-fs steps, MOPAC and the long-range QM–MM term on the GPU)

QM region QM atoms Atoms in total Before v1.2-gpu (e6fddf48)
Trypsin–BPTI active site 54 + 5 link 46 859 0.129 s (52c7f964) 0.021 s (0.027 s at tolerance=0.001)
Chignolin, whole peptide 138 12 095 0.185 s (c85eb96d) 0.031 s
Crambin, whole protein 642 24 828 1.33 s (c85eb96d) 0.245 s

NVT steps from one prepared state, no trajectory output. How each change contributed, with the checks of heats and forces, is in docs/QMMM_OPENMM.md (Speed).

  • CUDA stack limit: the stack limit of the sp pair kernels is kept between QM/MM steps instead of being grown again on every call (52c7f964; MOPAC_GPU_STACK_RESTORE=d restores it only after d kernels, e8da522c).
  • MOPAC on the GPU above 20 QM atoms (was 100, a8509e2a). Smaller regions run MOPAC on the CPU, which was faster for 10 atoms (0.022 against 0.033 s per step).
  • QM–MM charges: OpenMP loops in qmmm_hcore/qmmm_grad and the long-range term in CUDA kernels (a6a4992e), the MM-charge work in fused CUDA kernels with cuFFT plans (46637c1f, 1caa9976), and MOZYME's MM point charges on the GPU (c484ceee, 48bc1100).
  • LMO rotations in QM/MM sessions: staggered diagg2 chains (2cb2f2be), diagg2 on dense LMO rows (c8fd1164, default since bba4e09c) and diagg1 with dense matrices (33c1a78b, 977d7e25, default since e6fddf48). These are defaults of QM/MM sessions only; MOPAC_MOZYME_DIAGG2_STAGGER, MOPAC_MOZYME_DIAGG2_DENSE and MOPAC_MOZYME_DIAGG1_DENSE switch them.

Energy conservation of QM/MM dynamics

  • scripts/qmmm/nve_drift.py follows the work of the QM/MM force along the path, to separate the drift of the QM/MM force from that of the MM integration (a6a4992e; minimum image across OpenMM's box wrapping, 29dd3c4d).
  • run_qmmm_md.py uses OpenMM's mixed precision on CUDA by default (--precision): in single precision the MM-only NVE of trypsin–BPTI drifted +11.1 kJ/mol/ps, in mixed −0.06 (29dd3c4d). New options --mm-only, --nve-every, --nve-traj (15d20491).
  • Optional X–H constraints in the QM region (qm_constraints=True, --qm-constraints; 229b6fe4).
  • Optional SCF start from extrapolated LMOs (guess=linear|aspc; b8a6f508, 6ea3c4b5). Not recommended: it halves the SCF iterations, but on the GPU the step was slower and NVE runs of trypsin–BPTI heated in episodes. The default stays previous.
  • For NVE, docs/QMMM_OPENMM.md recommends 0.5-fs steps and tolerance=0.001.

Fix

  • API, odd charges: mopac_initialize set MS from the parity of the valence electrons without the charge, so a system of odd charge (e.g. a QM/MM region of charge +1) stopped with "Value of MS not consistent with number of electrons". MS now comes from the electron count including the charge (a28dbf08). Present in MOPAC 23.1.2.

Barranquilla MOPAC is an independent derivative of MOPAC (Apache License 2.0), not affiliated with or endorsed by MolSSI or Virginia Tech.

Barranquilla MOPAC v1.1.1-gpu

Choose a tag to compare

@juvenalyosa juvenalyosa released this 09 Nov 11:39

Barranquilla MOPAC v1.1.1-gpu: a bug fix of the TRUST geometry optimizer, and a wiki of worked examples.

Fix

  • TRUST optimizer, first step. Without curvature information the first step was the negative gradient scaled so that the largest coordinate change equalled the trust radius (0.05 Å). From a structure that was already close to a minimum this moved every coordinate too far: for an optimized chignolin (gradient norm 7.6) the heat rose by 47 kcal/mol on the first step, and the optimizer needed about 6 cycles to recover. The first step is now −g/1000 Å per kcal/(mol Å) before the trust radius applies. Same chignolin: +0.015 kcal/mol on the first step, gradient norm below 1 in 6 cycles. From an unoptimized structure (crambin, gradient norm 1 008) the trust radius still limits the step and the optimization is unchanged. (e84123a8; the CPU and GPU paths share this code.)

Documentation

  • Wiki with 64 worked examples (dynamics with TEMPERATURE=/BUSSI=/SEED=, TRUST, SWIG, HB-SMOOTH, SMEAR, solids, conventional SCF, QM/MM with OpenMM, checks and benchmarks), a keyword reference, GPU switches and troubleshooting. The inputs marked Checked were run with the CPU build before publication.
  • README links to the wiki.

Everything else is as in v1.1-gpu, including the benchmark results, which were measured with v1.1-gpu (the benchmark optimizations do not use TRUST).

Barranquilla MOPAC v1.1-gpu

Choose a tag to compare

@juvenalyosa juvenalyosa released this 09 Nov 08:46

Barranquilla MOPAC v1.1-gpu: the code of the complete A100 benchmark run (commit c85eb96d), with the fixes found while running it, the benchmark suite, and a new README and logo. Inputs do not change; NOGPU or MOPAC_NOGPU=1 gives the CPU code path of the same program.

Fixes since v1.0-gpu

  • QM/MM through the API: the atom labels were left uninitialized, so a + or - in stale memory was read as an explicit ion charge (random "COMPUTED CHARGE ON SYSTEM", then a CHECK failure). They are now blanked (c85eb96d).
  • MOZYME GPU, very large systems: stage counters compared modulo 2³² (the 21 156-atom water cluster failed the resident density, 1585b0dc); virtual and occupied LMOs that do not fit the shared tables go to spill slots instead of failing the resident SCF (6e3bd1da, 91eb7992); the density index sort is sized from the number of occupied LMOs (a15d8323).
  • Large solids: the number of two-electron integrals is counted in 64-bit arithmetic (Si₁₇₂₈ overflowed it, 355f9cf4).
  • Pseudo-diagonalization: rotations start only once the density change PL is below 0.05, for solids too, and a rotation stretch that lets PL grow is ended (forced-GPU graphene reached another state; MgO slab with water crept for 4 200 iterations) (455deb0b, 53ef28ed, ee0488c5).
  • QM-PME: the whole GPU grid is tested before it is used (9f83cebf).

New

  • Benchmark suite: scripts/paper/paper_bench.py and paper_figures.py, the Colab notebook colab/paper_benchmarks_colab.ipynb, and a Modal driver; a check of the QM/MM long-range electrostatics against a direct Ewald sum (tests/check_qmmm_pme_ewald.py).
  • README rewritten with the results of the benchmark run, QM/MM with OpenMM, how to run the benchmarks, accuracy and limitations; new logo.

Performance (one A100-SXM4-40GB; CPU: Xeon 2.2 GHz of the same machine)

Job Atoms CPU GPU Speed-up
Crambin, MOZYME single point 642 25.4 s (1 core) 1.22 s 21×
Adenylate kinase, MOZYME single point 6 689 695 s (1 core) 9.09 s 76×
Water cluster, 7 052 H₂O 21 156 — 29.4 s
Crambin, 100 optimization cycles 642 993 s 27.0 s 37×
Crambin, NVE dynamics 642 11.0 s/step 0.27 s/step 40×
Silicon, 1SCF GRADIENTS 512 369 s (12 threads) 22.0 s 17×
Rutile TiO₂, 1SCF GRADIENTS 576 179 s (12 threads) 14.0 s 13×
QM/MM, crambin as QM region in water 24 813 34.5 s/step 1.33 s/step 26×

GPU times are medians of three runs. MOZYME on the CPU does not use threads, so its reference is one core. Details, accuracy and limitations (among them a PM7 gradient error in molecular crystals that MOPAC 23.1.2 shares) are in the README.

Barranquilla MOPAC is an independent derivative of MOPAC (Apache License 2.0), not affiliated with or endorsed by MolSSI or Virginia Tech.

Barranquilla MOPAC v1.0-gpu

Choose a tag to compare

@juvenalyosa juvenalyosa released this 01 Nov 16:14

First stable release of Barranquilla MOPAC: MOPAC with its MOZYME method and the conventional SCF running on an NVIDIA GPU. Inputs do not change; a capable GPU is used automatically (NOGPU or MOPAC_NOGPU=1 gives the original CPU program).

What runs on the GPU

MOZYME (proteins, DNA/RNA, large complexes)

  • Resident SCF: localized orbitals, density and Fock matrix stay on the device for the whole SCF and between geometry steps.
  • One-electron matrix, gradient (d orbitals included), PM6/PM7 dispersion and hydrogen-bond corrections, COSMO.
  • MOZYME with translation vectors (Tv) for molecular crystals.

Conventional SCF (solids with Tv, molecules of 300+ orbitals)

  • One-electron matrix, Fock matrix, pseudo-diagonalization between full diagonalizations, gradient; RHF and UHF; COSMO.
  • FORCE (Γ-point vibrations), DRC (NVE/NVT), Fermi smearing (SMEAR=kT).
  • Analytical C.I. gradients through one Z-vector solve (chignolin doublet: DERIV 873 s → 0.6 s).

New in this fork

  • Molecular dynamics at a temperature: TEMPERATURE=, BUSSI= (stochastic velocity rescaling), SEED=.
  • Input chemistry check for PDB-derived inputs.
  • SMEAR, SWIG, HB-SMOOTH, TRUST, MM_CHARGES= (QM/MM with OpenMM).
  • Fixes found along the way: D3 dispersion in solids summed over all images (it used the nearest image only), D3 gradient units, per-image dispersion gradients, the hydrogen-bond gradient of weak bonds, the SCF of solids (20 eV shift + damped start; rutile no longer lands in a wrong state).

Performance (one A100)

Job Atoms CPU GPU
Crambin, MOZYME single point 642 28.3 s (1 core) 1.1 s
Adenylate kinase, MOZYME single point 6 689 449 s (1 core) 7.6 s
Crambin, 100 optimization cycles 642 1 042 s 17.7 s
α-quartz, 1SCF GRADIENTS 576 240 s (4 vCPU) ¹ 5.3 s
Silicon, 1SCF GRADIENTS 512 809 s (4 vCPU) ¹ 8.4 s
Rutile TiO₂, 1SCF GRADIENTS 576 1 224 s (4 vCPU) ¹ 5.5 s
Diamond, FORCE 64 682 s 87 s

¹ measured with the earlier SCF of solids (more iterations); see the README.

Accuracy

  • MOZYME heats within 0.05 kcal/mol of the CPU (typically < 0.01).
  • Conventional SCF: device Fock matrix within 3·10⁻⁹ eV, gradients within 9·10⁻⁷ kcal/mol/Å of the CPU loops; diamond frequencies within 0.07 cm⁻¹.
  • The MOPAC test suite passes (132/132) with the GPU build.

Known limits

  • MOZYME in dense covalent solids (quartz, silicon) falls back to the CPU: use the conventional SCF there.
  • Some solids have several RHF solutions (Li, graphene); PM7 aluminium does not converge.
  • The pseudo-diagonalization can stall in very hard SCFs (MOPAC_PDIAG=0 turns it off).
  • GPU runs are not bit-reproducible.

Getting started

  • Build: cmake -S . -B build -G Ninja -DGPU=ON -DCUDA_ARCHS=native -DCMAKE_BUILD_TYPE=Release (CUDA 12, compute capability ≥ 7.0; FP64 data-centre GPUs are much faster).
  • Colab notebooks (no local GPU needed): colab/mozyme_md_colab.ipynb (proteins, dynamics), colab/materials_gpu_a100_colab.ipynb (solids).
  • Full details: README.md, docs/GPU_GUIDE.md, docs/MOZYME_GPU_USER_GUIDE.md.

Based on MOPAC (Apache License 2.0); please cite MOPAC as described in CITATION.cff.

🤖 Generated with Claude Code