NAMD and VMD have recently been successfully coupled to the Swift/T high performance parallel scripting language developed as part of the ExM project, a collaboration led by Argonne National Laboratory with University of Chicago and University of British Columbia, as a part of the Department of Energy ASCR X-Stack program. Swift/T is now supported as part of the Swift project under the NSF SI2 program. Standard NAMD 2.10 and VMD 1.9.2 binaries can be launched across the nodes of a parallel computer and efficiently execute Swift/T dataflow programs with functions implemented in the embedded Tcl scripting language. The NAMD and VMD user communities are already familiar with Tcl, and Tcl allows access to the two programs' complete functionality. The NAMD integration with Swift/T has been used to demonstrate n:m multiplexing of n replicas across a smaller arbitrary number m of NAMD processes, a very complex capability to implement with normal NAMD scripting that can be expressed naturally in under 100 lines of Swift/T code.


James C. Phillips, John E. Stone, Kirby L. Vandivort, Timothy G. Armstrong, Justin M. Wozniak, Michael Wilde, and Klaus Schulten.
Petascale Tcl with NAMD, VMD, and Swift/T.
In SC'14 workshop on High Performance Technical Computing in Dynamic Languages, SC '14. IEEE Press, 2014.
abstract, journal

Example Files:

All example files: directory, tar archive
Input files: apoa1 benchmark plus apoa1_init files

VMD Swift/T Hello World

VMD and Turbine must be built with compatible Tcl libraries so that VMD can dynamically load
  • Example command: mpiexec -n 8 vmdwrapper -e vmdswift.tcl
  • Wrapper script to run standard VMD under MPI: vmdwrapper
  • Tcl package and Swift startup for VMD: vmdswift.tcl
  • Swift program source code: hello.swift
  • Swift compiler Tcl output: hello.tcl

NAMD Swift/T Replica Exchange

NAMD and Turbine must be built with compatible Tcl libraries so that NAMD can dynamically load
  • Example command: mpiexec -n 8 namdwrapper namdswift.tcl apoa1.namd --run 0 --source $cwd/replica.tcl < /dev/null &
  • Wrapper script to run multicore NAMD under MPI: namdwrapper
  • Tcl package and Swift startup for NAMD: namdswift.tcl
  • Swift program source code: replica.swift
  • Swift compiler Tcl output: replica.tcl

NAMD Swift/T MPI Tight Binding

Charm++ and NAMD must be built from source code. An MPI-based Charm++ must be used. Apply the patches below to Charm++ and NAMD, respectively, to allow Turbine to access the Charm++ inter-partition communicator. Charm++, NAMD, and Turbine must be built with compatible Tcl and MPI libraries so that NAMD can dynamically load
  • Example command: mpiexec -n 32 Linux-x86_64-g++.mpi/namd2 namdswift.tcl apoa1.namd --run 0 --source $cwd/replica.tcl +replicas 8 +stdout /var/tmp/stdout.%d.log < /dev/null &
  • Patches for Charm++ source code: charm-6.7.0-swift.patch charm-6.6.1-swift.patch
    (The inserted code is identical, but the original Charm++ patch was inserting it before CmiCreatePartitions() so Turbine was only seeing a single partition and complaining that there were no workers available.)
  • Patch for NAMD source code: namdswift.patch