{ "cells": [ { "cell_type": "markdown", "id": "0005911c-593c-43c0-9811-5e328b4ad1df", "metadata": {}, "source": [ "# Spack Example - Gromacs" ] }, { "cell_type": "markdown", "id": "798611c1-5537-4ea1-8da9-4154ae1489ee", "metadata": {}, "source": [ "The trick to spack is realizing that spack compiles software with multiple variables.\n", "\n", "```\n", "+variant <- built with variant\n", "~variant <- build without variant\n", "```\n", "\n", "Gromacs is installed via spack, and there are multiple variants that you will use depending on the scenario." ] }, { "cell_type": "code", "execution_count": 1, "id": "76a83d72-d360-45d1-9e3e-4df9acaf9666", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "-- \u001b[0;35mlinux-amzn2-x86_64_v3\u001b[0m / \u001b[0;32mgcc@7.3.1\u001b[0m ----------------------------\n", "\u001b[0;90mpxsw7er\u001b[0m gromacs\u001b[0;36m@2021\u001b[0m\u001b[0;94m~blas~cp2k~cuda~cycle_subcounters~double+hwloc~ipo~lapack~mdrun_only+mpi~nosuffix~opencl+openmp~plumed~relaxed_double_precision+shared~sycl build_system=cmake build_type=RelWithDebInfo\u001b[0m\n", "\u001b[0;90mxrwhukf\u001b[0m gromacs\u001b[0;36m@2021\u001b[0m\u001b[0;94m~blas~cp2k+cuda~cycle_subcounters~double+hwloc~ipo~lapack~mdrun_only~mpi~nosuffix~opencl+openmp~plumed~relaxed_double_precision+shared~sycl build_system=cmake build_type=RelWithDebInfo\u001b[0m\n", "\u001b[0;90mh6qe4ag\u001b[0m gromacs\u001b[0;36m@2021\u001b[0m\u001b[0;94m+blas~cp2k~cuda~cycle_subcounters~double+hwloc~ipo+lapack~mdrun_only+mpi~nosuffix~opencl+openmp~plumed~relaxed_double_precision+shared~sycl build_system=cmake build_type=RelWithDebInfo\u001b[0m\n", "\u001b[0;90mhwzyc7f\u001b[0m gromacs\u001b[0;36m@2022\u001b[0m\u001b[0;94m~blas~cp2k~cuda~cycle_subcounters~double+hwloc~ipo~lapack~mdrun_only+mpi~nosuffix~opencl+openmp~plumed~relaxed_double_precision+shared~sycl build_system=cmake build_type=RelWithDebInfo\u001b[0m\n", "\u001b[0;90meyjhnmz\u001b[0m gromacs\u001b[0;36m@2022\u001b[0m\u001b[0;94m~blas~cp2k+cuda~cycle_subcounters~double+hwloc~ipo~lapack~mdrun_only~mpi~nosuffix~opencl+openmp~plumed~relaxed_double_precision+shared~sycl build_system=cmake build_type=RelWithDebInfo\u001b[0m\n", "\u001b[0;90mn3nfmby\u001b[0m gromacs\u001b[0;36m@2022\u001b[0m\u001b[0;94m~blas~cp2k+cuda~cycle_subcounters~double+hwloc~ipo~lapack~mdrun_only+mpi~nosuffix~opencl+openmp~plumed~relaxed_double_precision+shared~sycl build_system=cmake build_type=RelWithDebInfo\u001b[0m\n", "\u001b[0;90m4ggo354\u001b[0m gromacs\u001b[0;36m@2022\u001b[0m\u001b[0;94m+blas~cp2k~cuda~cycle_subcounters~double+hwloc~ipo+lapack~mdrun_only+mpi~nosuffix~opencl+openmp~plumed~relaxed_double_precision+shared~sycl build_system=cmake build_type=RelWithDebInfo\u001b[0m\n", "\u001b[1;34m==>\u001b[0m 7 installed packages\n" ] } ], "source": [ "spack find -l -v gromacs" ] }, { "cell_type": "markdown", "id": "4459adad-ba28-4e15-bc88-561de77e0de6", "metadata": {}, "source": [ "## Gromacs + GPU" ] }, { "cell_type": "code", "execution_count": 2, "id": "4d016a3f-57e5-4982-8aab-b707acc3d9c3", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "-- \u001b[0;35mlinux-amzn2-x86_64_v3\u001b[0m / \u001b[0;32mgcc@7.3.1\u001b[0m ----------------------------\n", "\u001b[0;90mxrwhukf\u001b[0m gromacs\u001b[0;36m@2021\u001b[0m\u001b[0;94m~blas~cp2k+cuda~cycle_subcounters~double+hwloc~ipo~lapack~mdrun_only~mpi~nosuffix~opencl+openmp~plumed~relaxed_double_precision+shared~sycl build_system=cmake build_type=RelWithDebInfo\u001b[0m\n", "\u001b[0;90meyjhnmz\u001b[0m gromacs\u001b[0;36m@2022\u001b[0m\u001b[0;94m~blas~cp2k+cuda~cycle_subcounters~double+hwloc~ipo~lapack~mdrun_only~mpi~nosuffix~opencl+openmp~plumed~relaxed_double_precision+shared~sycl build_system=cmake build_type=RelWithDebInfo\u001b[0m\n", "\u001b[0;90mn3nfmby\u001b[0m gromacs\u001b[0;36m@2022\u001b[0m\u001b[0;94m~blas~cp2k+cuda~cycle_subcounters~double+hwloc~ipo~lapack~mdrun_only+mpi~nosuffix~opencl+openmp~plumed~relaxed_double_precision+shared~sycl build_system=cmake build_type=RelWithDebInfo\u001b[0m\n", "\u001b[1;34m==>\u001b[0m 3 installed packages\n" ] } ], "source": [ "spack find -l -v gromacs+cuda" ] }, { "cell_type": "markdown", "id": "863c181f-c00d-4c27-a06d-b10d8d5f2e63", "metadata": {}, "source": [ "## Gromacs + Other Variant Combinations" ] }, { "cell_type": "code", "execution_count": 3, "id": "adc46e30-236f-4ffb-b5ea-c6eb376f58f8", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "-- \u001b[0;35mlinux-amzn2-x86_64_v3\u001b[0m / \u001b[0;32mgcc@7.3.1\u001b[0m ----------------------------\n", "\u001b[0;90mpxsw7er\u001b[0m gromacs\u001b[0;36m@2021\u001b[0m\u001b[0;94m~blas~cp2k~cuda~cycle_subcounters~double+hwloc~ipo~lapack~mdrun_only+mpi~nosuffix~opencl+openmp~plumed~relaxed_double_precision+shared~sycl build_system=cmake build_type=RelWithDebInfo\u001b[0m\n", "\u001b[0;90mh6qe4ag\u001b[0m gromacs\u001b[0;36m@2021\u001b[0m\u001b[0;94m+blas~cp2k~cuda~cycle_subcounters~double+hwloc~ipo+lapack~mdrun_only+mpi~nosuffix~opencl+openmp~plumed~relaxed_double_precision+shared~sycl build_system=cmake build_type=RelWithDebInfo\u001b[0m\n", "\u001b[0;90mhwzyc7f\u001b[0m gromacs\u001b[0;36m@2022\u001b[0m\u001b[0;94m~blas~cp2k~cuda~cycle_subcounters~double+hwloc~ipo~lapack~mdrun_only+mpi~nosuffix~opencl+openmp~plumed~relaxed_double_precision+shared~sycl build_system=cmake build_type=RelWithDebInfo\u001b[0m\n", "\u001b[0;90m4ggo354\u001b[0m gromacs\u001b[0;36m@2022\u001b[0m\u001b[0;94m+blas~cp2k~cuda~cycle_subcounters~double+hwloc~ipo+lapack~mdrun_only+mpi~nosuffix~opencl+openmp~plumed~relaxed_double_precision+shared~sycl build_system=cmake build_type=RelWithDebInfo\u001b[0m\n", "\u001b[1;34m==>\u001b[0m 4 installed packages\n" ] } ], "source": [ "spack find -l -v gromacs~cuda" ] }, { "cell_type": "code", "execution_count": 4, "id": "71018421-e1dd-422f-9273-15bcc38c5b4b", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "-- \u001b[0;35mlinux-amzn2-x86_64_v3\u001b[0m / \u001b[0;32mgcc@7.3.1\u001b[0m ----------------------------\n", "\u001b[0;90mpxsw7er\u001b[0m gromacs\u001b[0;36m@2021\u001b[0m\u001b[0;94m~blas~cp2k~cuda~cycle_subcounters~double+hwloc~ipo~lapack~mdrun_only+mpi~nosuffix~opencl+openmp~plumed~relaxed_double_precision+shared~sycl build_system=cmake build_type=RelWithDebInfo\u001b[0m\n", "\u001b[0;90mh6qe4ag\u001b[0m gromacs\u001b[0;36m@2021\u001b[0m\u001b[0;94m+blas~cp2k~cuda~cycle_subcounters~double+hwloc~ipo+lapack~mdrun_only+mpi~nosuffix~opencl+openmp~plumed~relaxed_double_precision+shared~sycl build_system=cmake build_type=RelWithDebInfo\u001b[0m\n", "\u001b[0;90mhwzyc7f\u001b[0m gromacs\u001b[0;36m@2022\u001b[0m\u001b[0;94m~blas~cp2k~cuda~cycle_subcounters~double+hwloc~ipo~lapack~mdrun_only+mpi~nosuffix~opencl+openmp~plumed~relaxed_double_precision+shared~sycl build_system=cmake build_type=RelWithDebInfo\u001b[0m\n", "\u001b[0;90mn3nfmby\u001b[0m gromacs\u001b[0;36m@2022\u001b[0m\u001b[0;94m~blas~cp2k+cuda~cycle_subcounters~double+hwloc~ipo~lapack~mdrun_only+mpi~nosuffix~opencl+openmp~plumed~relaxed_double_precision+shared~sycl build_system=cmake build_type=RelWithDebInfo\u001b[0m\n", "\u001b[0;90m4ggo354\u001b[0m gromacs\u001b[0;36m@2022\u001b[0m\u001b[0;94m+blas~cp2k~cuda~cycle_subcounters~double+hwloc~ipo+lapack~mdrun_only+mpi~nosuffix~opencl+openmp~plumed~relaxed_double_precision+shared~sycl build_system=cmake build_type=RelWithDebInfo\u001b[0m\n", "\u001b[1;34m==>\u001b[0m 5 installed packages\n" ] } ], "source": [ "spack find -l -v gromacs+mpi" ] }, { "cell_type": "code", "execution_count": 5, "id": "015a5f5c-555a-4503-aa5d-455ec3d7376e", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "-- \u001b[0;35mlinux-amzn2-x86_64_v3\u001b[0m / \u001b[0;32mgcc@7.3.1\u001b[0m ----------------------------\n", "\u001b[0;90mxrwhukf\u001b[0m gromacs\u001b[0;36m@2021\u001b[0m\u001b[0;94m~blas~cp2k+cuda~cycle_subcounters~double+hwloc~ipo~lapack~mdrun_only~mpi~nosuffix~opencl+openmp~plumed~relaxed_double_precision+shared~sycl build_system=cmake build_type=RelWithDebInfo\u001b[0m\n", "\u001b[0;90meyjhnmz\u001b[0m gromacs\u001b[0;36m@2022\u001b[0m\u001b[0;94m~blas~cp2k+cuda~cycle_subcounters~double+hwloc~ipo~lapack~mdrun_only~mpi~nosuffix~opencl+openmp~plumed~relaxed_double_precision+shared~sycl build_system=cmake build_type=RelWithDebInfo\u001b[0m\n", "\u001b[1;34m==>\u001b[0m 2 installed packages\n" ] } ], "source": [ "spack find -l -v gromacs~mpi" ] }, { "cell_type": "code", "execution_count": 6, "id": "fc6841d7-0cfd-46c8-afc7-61bc00e5041d", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "-- \u001b[0;35mlinux-amzn2-x86_64_v3\u001b[0m / \u001b[0;32mgcc@7.3.1\u001b[0m ----------------------------\n", "\u001b[0;90mn3nfmby\u001b[0m gromacs\u001b[0;36m@2022\u001b[0m\u001b[0;94m~blas~cp2k+cuda~cycle_subcounters~double+hwloc~ipo~lapack~mdrun_only+mpi~nosuffix~opencl+openmp~plumed~relaxed_double_precision+shared~sycl build_system=cmake build_type=RelWithDebInfo\u001b[0m\n", "\u001b[1;34m==>\u001b[0m 1 installed package\n" ] } ], "source": [ "spack find -l -v gromacs@2022+cuda+mpi" ] }, { "cell_type": "markdown", "id": "7bb08351-2138-41d5-aee1-a013adc8f000", "metadata": {}, "source": [ "The hash in the first column is the unique identifier." ] }, { "cell_type": "code", "execution_count": 7, "id": "054a2ed5-397f-4fdc-b63b-69148aa5141a", "metadata": {}, "outputs": [], "source": [ "# load gromacs + mpi\n", "spack load gromacs@2022+mpi+cuda" ] }, { "cell_type": "code", "execution_count": 8, "id": "0bb9370d-ed24-483d-ac4e-a2c51a8b7fd2", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "/apps/spack/0.19.0/opt/spack/linux-amzn2-x86_64_v3/gcc-7.3.1/gromacs-2022-n3nfmbygz2rfkwlv2idaqfut7rwbyl6u/bin/gmx_mpi\n" ] } ], "source": [ "which gmx_mpi" ] }, { "cell_type": "code", "execution_count": 9, "id": "7ef0841b-228f-48bc-b1e6-d27962bf77cd", "metadata": {}, "outputs": [], "source": [ "spack load gromacs@2022~mpi+cuda" ] }, { "cell_type": "code", "execution_count": 10, "id": "29d6db16-c400-48e3-bfb3-869030daeaca", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "/apps/spack/0.19.0/opt/spack/linux-amzn2-x86_64_v3/gcc-7.3.1/gromacs-2022-eyjhnmzplx6yjwwzd23amr55ruwcbmvu/bin/gmx\n" ] } ], "source": [ "which gmx" ] }, { "cell_type": "code", "execution_count": 11, "id": "963b548d-a0a0-4a2a-ac70-df9e3ef65490", "metadata": {}, "outputs": [], "source": [ "spack unload" ] } ], "metadata": { "kernelspec": { "display_name": "Bash", "language": "bash", "name": "bash" }, "language_info": { "codemirror_mode": "shell", "file_extension": ".sh", "mimetype": "text/x-sh", "name": "bash" } }, "nbformat": 4, "nbformat_minor": 5 }