### JAX Installation for CUDA 12 (local) Source: https://github.com/plumed/plumed2/blob/master/plugins/pycv/README.md Example command to install JAX with CUDA 12 support using pip, for systems where CUDA is already installed locally. ```bash pip install "jax[cuda12_local]" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html ``` -------------------------------- ### Install Artistic Style to Custom Prefix Source: https://github.com/plumed/plumed2/blob/master/astyle/doc/install.html Installs the astyle executable and documentation files to a custom directory specified by the $(prefix) macro. This example installs to the user's home bin directory. ```makefile sudo make prefix=$HOME install ``` -------------------------------- ### JAX Installation for CUDA 12 (pip) Source: https://github.com/plumed/plumed2/blob/master/plugins/pycv/README.md Example command to install JAX with CUDA 12 support using pip, suitable for systems with a compatible NVIDIA GPU. ```bash pip install "jax[cuda12_pip]" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html ``` -------------------------------- ### Exercise 1: Multi-Replica Simulation Setup Source: https://github.com/plumed/plumed2/blob/master/user-doc/tutorials/old_tutorials/a-trieste-5.txt This is a starting point for Exercise 1, demonstrating how to set up a multi-replica simulation using the special replica syntax for PLUMED 2.4. It includes placeholders for defining dihedral angles and setting up metadynamics. ```plumed # load the pdb to better select torsions later MOLINFO __FILL__ # Compute the backbone dihedral angle phi, defined by atoms C-N-CA-C phi: TORSION ATOMS=__FILL__ # Compute the backbone dihedral angle psi, defined by atoms N-CA-C-N psi: TORSION ATOMS=__FILL__ metad: METAD ... # Activate well-tempered metadynamics ``` -------------------------------- ### Multi-Replica Metadynamics Setup Source: https://github.com/plumed/plumed2/blob/master/user-doc/tutorials/old_tutorials/a-trieste-5.txt This example demonstrates setting replica-specific arguments, heights, paces, sigmas, and grid ranges for METAD using the @replicas: keyword. It's suitable for bias exchange simulations. ```plumed #SETTINGS NREPLICAS=2 # Compute distance between atoms 1 and 2 d: DISTANCE ATOMS=1,2 # Compute a torsional angle t: TORSION ATOMS=30,31,32,33 # Metadynamics. METAD ... ARG=@replicas:d,t HEIGHT=1.0 PACE=100 SIGMA=@replicas:0.1,0.3 GRID_MIN=@replicas:0.0,-pi GRID_MAX=@replicas:2.0,pi ... ``` -------------------------------- ### METAGUI Replica Configuration Examples Source: https://github.com/plumed/plumed2/blob/master/user-doc/tutorials/old_tutorials/belfast-8.txt Examples of ACTIVE keyword configurations for different replica biasing strategies. ```text COLVAR.0: #! FIELDS time cv1 cv2 cv3 #! ACTIVE 1 1 A #! .. ... COLVAR.1: #! FIELDS time cv1 cv2 cv3 #! ACTIVE 1 2 B #! .. ... COLVAR.2: #! FIELDS time cv1 cv2 cv3 #! ACTIVE 1 2 C #! .. ... COLVAR.3: #! FIELDS time cv1 cv2 cv3 #! ACTIVE 0 #! .. ... ``` -------------------------------- ### Command-Line Input Example Source: https://github.com/plumed/plumed2/blob/master/developer-doc/AddingACLTool.md Example of invoking a tool using command-line flags. ```bash plumed driver --plumed plumed.dat --ixyz trajectory.xyz --dump-forces ``` -------------------------------- ### Install Artistic Style Source: https://github.com/plumed/plumed2/blob/master/astyle/doc/install.html Installs the astyle executable and documentation files to their default locations (/usr/bin and /usr/share/doc/astyle). Requires appropriate permissions. ```makefile sudo make install ``` -------------------------------- ### Install Chemiscope Source: https://github.com/plumed/plumed2/blob/master/user-doc/tutorials/aa-masterclass-21-6.txt Install the chemiscope package for data visualization. ```bash pip install chemiscope ``` -------------------------------- ### Setup Tutorial Directory Source: https://github.com/plumed/plumed2/blob/master/user-doc/tutorials/aaaa-lugano-1.txt Commands to create and enter the working directory for the tutorial. ```bash mkdir hands_on_1 cd hands_on_1 ``` -------------------------------- ### Install Documentation Dependencies Source: https://github.com/plumed/plumed2/blob/master/new-manual/README.md Installs the required Python packages for building the documentation. Ensure pip is up-to-date. ```bash pip install mkdocs-material pip install python-markdown-math ``` -------------------------------- ### Get User Documentation Path Source: https://github.com/plumed/plumed2/blob/master/README.md If you compiled your own documentation, use this command to find the path to the installed user documentation. ```bash plumed info --user-doc ``` -------------------------------- ### Install Artistic Style Documentation on MacOS Source: https://github.com/plumed/plumed2/blob/master/astyle/doc/install.html Install documentation files using the provided install.sh script. Requires sudo privileges. ```bash sudo bash install.sh ``` -------------------------------- ### Install PLUMED via Conda Source: https://github.com/plumed/plumed2/blob/master/user-doc/tutorials/aaaa-lugano-1.txt Reference for PLUMED installation instructions. ```text https://github.com/plumed/conda ``` -------------------------------- ### Regression test configuration file example Source: https://github.com/plumed/plumed2/blob/master/developer-doc/AddingRegressionTests.md Example configuration file defining MPI processes, test type, required modules, and command-line arguments. ```text mpiprocs=2 type=driver plumed_modules=adjmat arg="--plumed plumed.dat --trajectory-stride 50 --timestep 0.005 --ixyz diala_traj_nm.xyz --dump-forces forces --dump-forces-fmt=%10.6f" extra_files="../../trajectories/diala_traj_nm.xyz ../trajectories/path_msd/all.pdb" ``` -------------------------------- ### Run PLUMED Help Command Source: https://github.com/plumed/plumed2/blob/master/README.md Once installed, you can run PLUMED commands, such as 'plumed help', to verify the installation and access usage information. ```bash plumed help ``` -------------------------------- ### Install PLUMED2 Source: https://github.com/plumed/plumed2/blob/master/README.md After successful compilation, use this command to install PLUMED2 to the configured prefix. Ensure the umask is set to 022 for proper file permissions. ```bash umask 022 make install ``` -------------------------------- ### Install Artistic Style Executable on MacOS Source: https://github.com/plumed/plumed2/blob/master/astyle/doc/install.html Install the astyle executable to the default directory (/usr/bin) using xcodebuild. Requires sudo privileges and the project file AStyle.xcodeproj. ```bash cd astyle/build/xcode sudo xcodebuild install -project AStyle.xcodeproj ``` -------------------------------- ### PLUMED Replica Syntax Example Source: https://github.com/plumed/plumed2/blob/master/new-manual/parsing.md Example of PLUMED's special syntax for preparing multiple replicas with slight input variations. The '@replicas' syntax allows specifying different values for each replica. ```plumed #SETTINGS NREPLICAS=3 # Compute a distance d: DISTANCE ATOMS=1,2 # Apply a restraint. RESTRAINT ARG=d AT=@replicas:1.0,1.1,1.2 KAPPA=1.0 # On replica 0, this means: # RESTRAINT ARG=d AT=1.0 KAPPA=1.0 # On replica 1, this means: # RESTRAINT ARG=d AT=1.1 KAPPA=1.0 # On replica 2, this means: ``` -------------------------------- ### Serve Documentation Locally Source: https://github.com/plumed/plumed2/blob/master/new-manual/README.md Starts a local development server to preview the documentation. Access the website via your browser at the provided address. ```bash mkdocs serve ``` -------------------------------- ### Download tutorial resources Source: https://github.com/plumed/plumed2/blob/master/user-doc/tutorials/aaaa-lugano-6b.txt Use wget to retrieve the reference trajectory and associated files for the tutorial. ```bash wget https://github.com/plumed/lugano2019/raw/master/lugano-6b.tgz ``` -------------------------------- ### Implement a Moving Restraint in Plumed2 Source: https://github.com/plumed/plumed2/blob/master/user-doc/tutorials/old_tutorials/munster.txt Apply a restraint that can be modified over time, for example, to guide a system from one minimum to another. This example shows the syntax for a moving restraint on a torsion angle. ```plumed phi: TORSION ATOMS=5,7,9,15 psi: TORSION ATOMS=7,9,15,17 # notice that a long line can be splitted with this syntax MOVINGRESTRAINT ... # also notice that a LABEL keyword can be used and is equivalent ``` -------------------------------- ### Example Option File Syntax Source: https://github.com/plumed/plumed2/blob/master/astyle/doc/astyle.html Demonstrates the syntax for options in a default or project option file, including comments, long options without '--', and short options. ```text # this line is a comment --style=allman # this is a line-end comment # long options can be written without the preceding '--' indent-switches # cannot do this on the command line # short options must have the preceding '-' -t -p # short options can be concatenated together -M60Ucv ``` -------------------------------- ### Commented Out Action Source: https://github.com/plumed/plumed2/blob/master/new-manual/actions.md An example showing a commented-out action. PLUMED ignores lines starting with '#', so this command will not be processed. ```plumed # d1: DISTANCE ATOMS=1,2 COMPONENTS ``` -------------------------------- ### Download tutorial resources Source: https://github.com/plumed/plumed2/blob/master/user-doc/tutorials/old_tutorials/a-trieste-6.txt Command to download the reference trajectories and input files for the tutorial exercises. ```bash wget https://github.com/plumed/trieste2017/raw/master/tutorial/data/tutorial_6.tgz ``` -------------------------------- ### Validation Setup for Neighbor Lists Source: https://github.com/plumed/plumed2/blob/master/user-doc/tutorials/performance-optimization.txt Example configuration for validating neighbor list settings against a standard calculation. ```plumed #SETTINGS MOLFILE=regtest/basic/rt32/helix.pdb MOLINFO STRUCTURE=conf.pdb wat: GROUP ATOMS=@water ow: GROUP ATOMS=@water REMOVE=@hydrogens mg: GROUP ATOMS=10484 p: GROUP ATOMS=@P-2 dp: DISTANCE ATOMS=mg,p cn: COORDINATION GROUPA=mg GROUPB=ow R_0=0.261 ``` -------------------------------- ### Unpack Tutorial Resources Source: https://github.com/plumed/plumed2/blob/master/user-doc/tutorials/aaa-advanced-methods.txt Use this command to unpack the tutorial resources archive. Ensure you are in the directory where you downloaded the file. ```bash tar xvzf advanced-methods.tar.gz ``` -------------------------------- ### Override PLUMED installation paths Source: https://github.com/plumed/plumed2/blob/master/developer-doc/InstallationLayout.md Example of launching the PLUMED executable after moving the build directory by overriding the PLUMED_ROOT environment variable. ```bash PLUMED_ROOT=/build/directory2 /build/directory2/src/lib/plumed ``` -------------------------------- ### Multi-Replica Restraint Setup Source: https://github.com/plumed/plumed2/blob/master/user-doc/tutorials/old_tutorials/a-trieste-5.txt Use the @replicas: keyword to specify replica-dependent values for keywords like AT in RESTRAINT. This example shows setting different restraint centers for three replicas. ```plumed #SETTINGS NREPLICAS=3 # Compute a distance d: DISTANCE ATOMS=1,2 # Apply a restraint. RESTRAINT ARG=d AT=@replicas:1.0,1.1,1.2 KAPPA=1.0 ``` -------------------------------- ### Download Tutorial Resources Source: https://github.com/plumed/plumed2/blob/master/user-doc/tutorials/aaaa-lugano-1.txt Command to download the required trajectory and PDB files. ```bash wget https://github.com/plumed/lugano2019/raw/master/handson_1/handson_1.tgz ``` -------------------------------- ### PLUMED MOVINGRESTRAINT Example Source: https://github.com/plumed/plumed2/blob/master/user-doc/tutorials/old_tutorials/belfast-5.txt This example demonstrates how to use the MOVINGRESTRAINT directive to steer a system. It defines two dihedral angles, phi and psi, and then configures a moving restraint on phi. The restraint starts at phi=-1.0 with zero spring constant, increases to 1000 at STEP1=2000, moves to phi=1.0 with a constant spring of 1000 until STEP3=6000, and then releases the spring. This allows for controlled movement and state preparation. ```plumed # set up two variables for Phi and Psi dihedral angles # drag this phi: TORSION ATOMS=5,7,9,15 # this is just to monitor that you end up in the interesting state psi: TORSION ATOMS=7,9,15,17 # the movingrestraint restraint: ... MOVINGRESTRAINT ARG=phi AT0=-1.0 STEP0=0 KAPPA0=0 AT1=-1.0 STEP1=2000 KAPPA1=1000 AT2=1.0 STEP2=4000 KAPPA2=1000 AT3=1.0 STEP3=6000 KAPPA3=0 ... ``` -------------------------------- ### Concatenate multiple regex for PRINT arguments Source: https://github.com/plumed/plumed2/blob/master/new-manual/specifying_arguments.md Combine multiple regular expressions using commas to specify different sets of arguments for the PRINT action. This example selects '.x' and '.y' components of 'd1' and any action starting with 't' followed by digits. ```plumed t1: TORSION ATOMS=5,7,9,15 t2: TORSION ATOMS=7,9,15,17 d1: DISTANCE ATOMS=7,17 COMPONENTS # The first expression matches d1.x and d1.y # The second expression matches t1 and t2 PRINT ARG=(d1\.[xy]),(t[0-9]) FILE=colvar ``` -------------------------------- ### Multi-Replica Vector Restraint Setup Source: https://github.com/plumed/plumed2/blob/master/user-doc/tutorials/old_tutorials/a-trieste-5.txt When a keyword's value is a vector, use double curly braces {{...}} with the @replicas: syntax to group values for each replica. This example applies a restraint on two variables with different vector values per replica. ```plumed #SETTINGS NREPLICAS=3 # Compute distance between atoms 1 and 2 d: DISTANCE ATOMS=10,20 # Compute a torsional angle t: TORSION ATOMS=30,31,32,33 # Apply a restraint: RESTRAINT ... ARG=d,t AT=@replicas:{{1.0,2.0} {3.0,4.0} {5.0,6.0}} KAPPA=1.0,3.0 ... ``` -------------------------------- ### Define Components and Calculate Source: https://github.com/plumed/plumed2/blob/master/plugins/pycv/README.md Example of configuring multiple components and returning calculated values, derivatives, and box derivatives. ```python import plumedCommunications as PLMD plumedInit = { "COMPONENTS": { "first": PLMD.defaults.COMPONENT_NODEV, "second": {"derivative": True, "period": ["-pi", "pi"]}, } } def plumedCalculate(action: PLMD.PythonCVInterface): #...complex calculation are called here... return { "first": [resForFirst], "second": [resForSecond, derivativeForSecond, boxDerivativeForSecond], } ``` -------------------------------- ### Install CUDA Runtime Libraries Source: https://github.com/plumed/plumed2/blob/master/patches/gromacs-2022.5.diff/src/gromacs/CMakeLists.txt Conditionally installs CUDA runtime libraries when CUDA support is enabled and the installation flag is set. ```cmake if (INSTALL_CUDART_LIB) #can be set manual by user if (GMX_GPU_CUDA) foreach(CUDA_LIB ${CUDA_LIBRARIES}) string(REGEX MATCH "cudart" IS_CUDART ${CUDA_LIB}) if(IS_CUDART) #libcuda should not be installed #install also name-links (linker uses those) file(GLOB CUDA_LIBS ${CUDA_LIB}*) install(FILES ${CUDA_LIBS} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries) endif() endforeach() else() message(WARNING "INSTALL_CUDART_LIB only makes sense when configuring for CUDA support") endif() endif() ``` -------------------------------- ### Install metadynminer Package in R Source: https://github.com/plumed/plumed2/blob/master/user-doc/tutorials/a-masterclass-22-02.txt Use this command to install the metadynminer package in R. Ensure Rtools is installed on Windows if you encounter permission issues. ```r install.packages("metadynminer") ``` -------------------------------- ### Build Documentation Locally Source: https://github.com/plumed/plumed2/blob/master/new-manual/README.md Executes the make command to build the website locally. This command compiles the documentation assets. ```bash make ``` -------------------------------- ### Install OpenCL Utility and Kernel Files Source: https://github.com/plumed/plumed2/blob/master/patches/gromacs-2022.5.diff/src/gromacs/CMakeLists.txt Installs various OpenCL utility headers and kernel source files into the designated GROMACS installation directory. ```cmake if(GMX_GPU_OPENCL) # Install the utility headers file(GLOB OPENCL_INSTALLED_FILES gpu_utils/vectype_ops.clh gpu_utils/device_utils.clh ) install(FILES ${OPENCL_INSTALLED_FILES} DESTINATION ${GMX_INSTALL_OCLDIR}/gromacs/gpu_utils COMPONENT libraries) file(GLOB OPENCL_INSTALLED_FILES pbcutil/ishift.h ) install(FILES ${OPENCL_INSTALLED_FILES} DESTINATION ${GMX_INSTALL_OCLDIR}/gromacs/pbcutil COMPONENT libraries) # Install the NBNXM source and headers file(GLOB OPENCL_INSTALLED_FILES nbnxm/constants.h ) install(FILES ${OPENCL_INSTALLED_FILES} DESTINATION ${GMX_INSTALL_OCLDIR}/gromacs/nbnxm COMPONENT libraries) file(GLOB OPENCL_INSTALLED_FILES nbnxm/opencl/nbnxm_ocl_kernels.cl nbnxm/opencl/nbnxm_ocl_kernel.clh nbnxm/opencl/nbnxm_ocl_kernel_pruneonly.clh nbnxm/opencl/nbnxm_ocl_kernels.clh nbnxm/opencl/nbnxm_ocl_kernels_fastgen.clh nbnxm/opencl/nbnxm_ocl_kernels_fastgen_add_twincut.clh nbnxm/opencl/nbnxm_ocl_kernel_utils.clh nbnxm/opencl/nbnxm_ocl_consts.h ) install(FILES ${OPENCL_INSTALLED_FILES} DESTINATION ${GMX_INSTALL_OCLDIR}/gromacs/nbnxm/opencl COMPONENT libraries) # Install the PME source and headers file(GLOB OPENCL_INSTALLED_FILES ewald/pme_spread.clh ewald/pme_solve.clh ewald/pme_gather.clh ewald/pme_gpu_calculate_splines.clh ewald/pme_program.cl ewald/pme_gpu_types.h ) install(FILES ${OPENCL_INSTALLED_FILES} DESTINATION ${GMX_INSTALL_OCLDIR}/gromacs/ewald COMPONENT libraries) endif() ``` -------------------------------- ### Extract Tutorial Archive Source: https://github.com/plumed/plumed2/blob/master/user-doc/tutorials/aaaa-lugano-1.txt Command to unpack the downloaded tutorial files. ```bash tar xvzf handson_1.tgz ``` -------------------------------- ### Uninstall Artistic Style using install_manifest.txt Source: https://github.com/plumed/plumed2/blob/master/astyle/doc/install.html This command can be used to uninstall Artistic Style after it has been installed using the make install option. It reads the list of installed files from install_manifest.txt. ```bash xargs rm < install_manifest.txt ``` -------------------------------- ### Clone the Masterclass repository Source: https://github.com/plumed/plumed2/blob/master/user-doc/tutorials/a-masterclass-22-12.txt Use this command to download the data required for the tutorial exercises. ```bash git clone https://github.com/PabloPiaggi/masterclass-22-12 ``` -------------------------------- ### Displaying Initial Replica Exchange Patterns Source: https://github.com/plumed/plumed2/blob/master/user-doc/tutorials/old_tutorials/a-trieste-5.txt Show the first 10 lines of replica exchange events from the log file to observe initial swap behavior. ```bash grep "Repl ex" md0.log | head ``` -------------------------------- ### MOVINGRESTRAINT Usage Example Source: https://github.com/plumed/plumed2/blob/master/developer-doc/usingDoxygen.md Example of how to define MOVINGRESTRAINT in a PLUMED input file. ```plumed DISTANCE ATOMS=1,2 LABEL=d1 DISTANCE ATOMS=3,4 LABEL=d2 MOVINGRESTRAINT ARG=d1,d2 AT0=2,2 AT1=6,6 STEP0=0 STEP1=100 KAPPA=1 ``` -------------------------------- ### Build Artistic Style with Intel Source: https://github.com/plumed/plumed2/blob/master/astyle/doc/install.html Commands to navigate to the Intel build directory and execute the make process, requiring prior environment variable setup. ```bash cd astyle/build/intel make ``` ```bash cd astyle/build/intel make debug shareddebug staticdebug ``` -------------------------------- ### Install Python dependencies Source: https://github.com/plumed/plumed2/blob/master/user-doc/tutorials/aa-masterclass-21-6.txt Install the required Python packages for data analysis and visualization. ```bash conda install -c conda-forge py-plumed Numpy pandas matplotlib notebook mdtraj mdanalysis git ase ``` -------------------------------- ### Update Starting Geometry Source: https://github.com/plumed/plumed2/blob/master/user-doc/tutorials/a-masterclass-22-11.txt Modify the starting geometry configuration in the GROMACS generation script. ```bash StartingGeometry=NaCl_StartingStructure-2.gro ``` -------------------------------- ### Install PLUMED and GROMACS with Conda Source: https://github.com/plumed/plumed2/blob/master/user-doc/tutorials/a-master-ISDD-1.txt Install PLUMED and GROMACS using the specified conda channels. The --strict-channel-priority flag is important to ensure the correct versions are installed, especially to avoid a GROMACS version not patched with PLUMED. ```bash conda install --strict-channel-priority -c plumed/label/isdd-2024 -c conda-forge plumed conda install --strict-channel-priority -c plumed/label/isdd-2024 -c conda-forge gromacs conda install -c conda-forge numpy ``` -------------------------------- ### Initialize Replica Topologies Source: https://github.com/plumed/plumed2/blob/master/user-doc/tutorials/old_tutorials/cineca.txt Distributes topology files between two states (A and B) for replica exchange simulations. ```bash if((i%2==0)); then cp ../SETUP/topolA.tpr topol$i.tpr else cp ../SETUP/topolB.tpr topol$i.tpr fi done ``` -------------------------------- ### Install PLUMED and GROMACS via Conda Source: https://github.com/plumed/plumed2/blob/master/user-doc/tutorials/aa-masterclass-21-5.txt Installs MPI-enabled versions of PLUMED and GROMACS from the masterclass-mpi channel. ```bash conda install --strict-channel-priority -c plumed/label/masterclass-mpi -c conda-forge plumed conda install --strict-channel-priority -c plumed/label/masterclass-mpi -c conda-forge gromacs ``` -------------------------------- ### Clone the Masterclass repository Source: https://github.com/plumed/plumed2/blob/master/user-doc/tutorials/a-masterclass-22-13.txt Use this command to download the necessary data for the exercises. ```bash git clone https://github.com/andrea-arsiccio/masterclass-22-13 ``` -------------------------------- ### Install Anaconda via Homebrew Source: https://github.com/plumed/plumed2/blob/master/user-doc/tutorials/aa-masterclass-21-1.txt Install the Anaconda distribution using the Homebrew package manager on macOS. ```bash brew install --cask anaconda ``` -------------------------------- ### Install dependencies via conda Source: https://github.com/plumed/plumed2/blob/master/src/metatomic/module.md Install libmetatomic-torch from conda-forge and manually configure the environment variables for compilation. ```bash conda install -c conda-forge libmetatomic-torch # setup compiler flags: CPPFLAGS="-I$CONDA_PREFIX/include $CPPFLAGS" CPPFLAGS="-I$CONDA_PREFIX/include/torch/csrc/api/include $CPPFLAGS" LDFLAGS="-L$CONDA_PREFIX/lib $LDFLAGS" LDFLAGS="-Wl,-rpath,$CONDA_PREFIX/lib $LDFLAGS" # if you are using linux, force the use of rpath instead of runpath # (we rely on the rpath to find dependencies of dependencies) LDFLAGS="-Wl,--disable-new-dtags" ``` -------------------------------- ### Clone the masterclass repository Source: https://github.com/plumed/plumed2/blob/master/user-doc/tutorials/aa-masterclass-21-2.txt Use this command to download the necessary data files for the exercises. ```bash git clone https://github.com/plumed/masterclass-21-2.git ``` -------------------------------- ### Initialize PLUMED Configuration Source: https://github.com/plumed/plumed2/blob/master/developer-doc/mdTemplate.md Commands to set up the environment, log files, and input parameters before calling the initialization routine. ```C plumed_cmd(plumedmain,"setNatoms",&natoms); // Pass a pointer to the number of atoms in the system to plumed plumed_cmd(plumedmain,"setMDEngine","gromacs"); // Pass the name of your md engine to plumed (now it is just a label) plumed_cmd(plumedmain,"setLog",fplog); // Pass the file on which to write out the plumed log (if the file is already open) plumed_cmd(plumedmain,"setLogFile",fplog); // Pass the file on which to write out the plumed log (to be created) plumed_cmd(plumedmain,"setTimestep",&delta_t); // Pass a pointer to the molecular dynamics timestep to plumed // This is valid only if API VERSION > 1 plumed_cmd(plumedmain,"setKbT",&kbT); // Pointer to a real containing the value of kbT // This is valid only if API VERSION > 2 plumed_cmd(plumedmain,"setRestart",&res); // Pointer to an integer saying if we are restarting (zero means no, one means yes) // This is valid only if API VERSION > 3 plumed_cmd(plumedmain,"readInputLine","d: DISTANCE ATOMS=1,2");// Read a single input line directly from a string // This is valid only if API VERSION > 7 plumed_cmd(plumedmain,"readInputLines","d: DISTANCE ATOMS=1,2\n" "PRINT ARG=d"); // Read a multiple lines directly from a string. Allows comments and continuation lines. // Calls to do the actual initialization (all the above commands must appear before this call) plumed_cmd(plumedmain,"init",NULL); // Do all the initialization of plumed plumed_cmd(plumedmain,"read",read); // Read the plumed input. N.B. This is called during init and so this call is only required in special cases. ``` -------------------------------- ### Launch Jupyter Notebook Source: https://github.com/plumed/plumed2/blob/master/user-doc/tutorials/aa-masterclass-21-1.txt Starts the Jupyter notebook server for the specified analysis file. ```bash jupyter notebook plumed-pandas.ipynb ``` -------------------------------- ### HILLS file format example Source: https://github.com/plumed/plumed2/blob/master/user-doc/tutorials/old_tutorials/belfast-6.txt Example content of a HILLS file generated during a well-tempered metadynamics simulation. ```text #! FIELDS time phi psi sigma_phi sigma_psi height biasf #! SET multivariate false #! SET min_phi -pi #! SET max_phi pi #! SET min_psi -pi #! SET max_psi pi 1.0000 -1.3100 0.0525 0.35 0.35 1.4400 6 2.0000 -1.4054 1.9742 0.35 0.35 1.4400 6 3.0000 -1.9997 2.5177 0.35 0.35 1.4302 6 4.0000 -2.2256 2.1929 0.35 0.35 1.3622 6 ``` -------------------------------- ### Run HREX simulation with GROMACS and PLUMED Source: https://github.com/plumed/plumed2/blob/master/user-doc/tutorials/hrex.txt Example commands for preparing and executing a Hamiltonian replica exchange simulation. ```bash grompp_mpi_d -maxwarn 1 -o topol$i.tpr -f grompp$i.mdp -p topol$i.top done mpirun -np $nrep gmx_mpi mdrun_d -v -plumed plumed.dat -multi $nrep -replex 100 -nsteps 15000000 -hrex -dlb no ``` -------------------------------- ### Creating and Setting Components Source: https://github.com/plumed/plumed2/blob/master/developer-doc/usingDoxygen.md Commands for creating dynamically named components and setting their values. ```cpp comp=getPntrToArgument(i)->getName()+"_cntr"; addComponent(comp); componentIsNotPeriodic(comp); ``` ```cpp getPntrToComponent(getPntrToArgument(i)->getName()+"_work")->set(val[i]); ``` -------------------------------- ### Verify MPI and PLUMED installation Source: https://github.com/plumed/plumed2/blob/master/user-doc/tutorials/aa-masterclass-21-5.txt Checks if the installed GROMACS and PLUMED binaries are correctly configured with MPI and PLUMED support. ```bash gmx_mpi mdrun -h 2> /dev/null | grep -q plumed && echo ok ``` ```bash plumed --has-mpi && echo ok ``` -------------------------------- ### Install dependencies via pip Source: https://github.com/plumed/plumed2/blob/master/src/metatomic/module.md Use pip to install the metatomic-torch package and retrieve the necessary compiler and linker flags. ```bash # change this version to get newer releases pip install "metatomic-torch ==0.1.2" # you can then get the compiler and linker flags using the script at # src/metatomic/flags-from-python.py CPPFLAGS=$(python src/metatomic/flags-from-python.py --cppflags) LDFLAGS=$(python src/metatomic/flags-from-python.py --ldflags) ``` -------------------------------- ### Display PLUMED Help Source: https://github.com/plumed/plumed2/blob/master/user-doc/tutorials/old_tutorials/belfast-1.txt Use this command to view the general help options available for the PLUMED executable. ```bash plumed --help ``` -------------------------------- ### Configure libgromacs installation Source: https://github.com/plumed/plumed2/blob/master/patches/gromacs-2024.3.diff/src/gromacs/CMakeLists.txt Defines installation targets, compile definitions, and legacy API support for the libgromacs shared library. ```cmake if (BUILD_SHARED_LIBS) install(TARGETS libgromacs EXPORT libgromacs LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT libraries ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries INCLUDES DESTINATION include) target_compile_definitions(libgromacs PUBLIC $) # legacy headers use c++17 features, so consumer codes need to use that standard, too if(GMX_INSTALL_LEGACY_API) target_compile_features(libgromacs INTERFACE cxx_std_${CMAKE_CXX_STANDARD}) endif() # only install pkg-config and cmake target files when library is installed include(InstallLibInfo.cmake) endif() add_library(Gromacs::libgromacs ALIAS libgromacs) ``` -------------------------------- ### Clone the repository Source: https://github.com/plumed/plumed2/blob/master/developer-doc/intro-git.md Initializes the local repository by cloning the remote source. ```bash > git clone git@github.com:plumed/plumed2.git > cd plumed2 ``` -------------------------------- ### Install PLUMED via MacPorts Source: https://github.com/plumed/plumed2/blob/master/user-doc/tutorials/lyon.txt Use this command to install the PLUMED executable on macOS systems using the MacPorts package manager. ```bash sudo port install plumed ``` -------------------------------- ### Install PLUMED and AMBER environments Source: https://github.com/plumed/plumed2/blob/master/user-doc/tutorials/a-masterclass-22-13.txt Commands to create and activate the necessary conda environments for the tutorial. ```bash #install the PLUMED environment conda create --name plumed-masterclass-2022 conda activate plumed-masterclass-2022 conda install -c conda-forge plumed py-plumed numpy pandas matplotlib notebook mdtraj mdanalysis git #install the AMBER environment conda create --name plumed-masterclass-2022-amber conda activate plumed-masterclass-2022-amber conda install -c conda-forge ambertools #stack the two environments together conda activate plumed-masterclass-2022 conda activate --stack plumed-masterclass-2022-amber export PLUMED_KERNEL=/your_path_here/plumed-masterclass-2022/lib/libplumedKernel.so ``` -------------------------------- ### Check GROMACS Installation Source: https://github.com/plumed/plumed2/blob/master/user-doc/tutorials/a-master-ISDD-1.txt Verify that GROMACS is installed and functioning correctly. The output of this command will indicate if GROMACS has been compiled with PLUMED support. ```bash gmx_mpi mdrun -h ``` -------------------------------- ### Clone the masterclass repository Source: https://github.com/plumed/plumed2/blob/master/user-doc/tutorials/a-masterclass-22-15.txt Use this command to download the data and exercises required for the masterclass. ```bash git clone https://github.com/hockyg/masterclass-22-15 ``` -------------------------------- ### PLUMED Output File Example Source: https://github.com/plumed/plumed2/blob/master/user-doc/tutorials/old_tutorials/a-trieste-1.txt Example format of the `COLVAR` output file generated by PLUMED, showing fields and variable ranges. ```text #! FIELDS time r c co ch d #! SET min_c -pi #! SET max_c pi 0.000000 0.788694 -2.963150 207.795793 502.027244 0.595611 1.000000 0.804101 -2.717302 208.021688 499.792595 0.951945 2.000000 0.788769 -2.939333 208.347867 500.552127 1.014850 3.000000 0.790232 -2.940726 211.274315 514.749124 1.249502 4.000000 0.796395 3.050949 212.352810 507.892198 2.270682 ``` -------------------------------- ### Basic PLUMED Command Structure Source: https://github.com/plumed/plumed2/blob/master/src/cltools/module.md Illustrates the general syntax for invoking PLUMED tools from the command line. This is useful for understanding how to interact with PLUMED's various utilities. ```bash plumed ``` -------------------------------- ### Example phi.weight file content Source: https://github.com/plumed/plumed2/blob/master/user-doc/tutorials/aaa-advanced-methods.txt This is an example of the content of the phi.weight file, which contains dihedral angle values and their corresponding un-normalized weights. ```text 0.907347 0.0400579 0.814296 0.0169656 1.118951 0.0651276 1.040781 0.0714174 1.218571 0.0344903 1.090823 0.0700568 1.130800 0.0622998 ```