acemd | manual | plugins | resources | gallery | contact


Third parties available plugins

PLUMED (metadynamics,SMD,US plugin)

The PLUMED plugin is now available for ACEMD. The latest plugin code can be downloaded from the PLUMED website. Main reference is:

M. Bonomi, D. Branduardi, G. Bussi, C. Camilloni, D. Provasi, P. Raiteri, D. Donadio, F. Marinelli, F. Pietrucci, R.A. Broglia and M. Parrinello, PLUMED: a portable plugin for free energy calculations with molecular dynamics, arXiv:0902.0874 [physics.comp-ph].

Download:

PLUMED demo in ACEMD

A demo on how to compute the phi-psi free energy surface of the alanine dimer, with reference results and an animation, which you can also watch online. An extract of the input file of demo is also given below:

//META_INP file
PRINT W_STRIDE 100
TORSION LIST 13 15 17 1 SIGMA 0.2
TORSION LIST 15 17  1 3 SIGMA 0.2
HILLS HEIGHT 0.1 W_STRIDE 100
WELLTEMPERED SIMTEMP 300 BIASFACTOR 10
ENDMETA

//ACEMD input file
...
pluginload meta plumed-1.1.0.so
pluginarg meta input META_INP
pluginarg meta boxx  65 
pluginarg meta boxy  65 
pluginarg meta boxz  65 
pluginfreq 1
...


ACEMD open plugins interface

How to write a plugin for ACEMD

A plugin offers an effective way to extend the features of ACEMD by executing a function written by you every timestep. This subroutine has access to positions, masses and charges of the atoms and can assign forces on the atoms. It is compiled as a sharable object which is dynamically loaded by ACEMD.

How to use a plugin

From the ACEMD configuration file, you can use the following TCL commands to load a plugin and assign input arguments. The plugin is then execute every timestep (unless differently specified).

  • pluginload {tag} {dso}: tag is a string descriptor for the plugin, dso the path to the dynamic sharable object.

  • pluginarg {tag} {key} {value}: to pass an argument to the plugin tag, use key, value are strings representing the tuple key=value

  • pluginfreq {value}: specify the frequency of execution of the plugin. Default 1, i.e every step.

Example. In your ACEMD input script simply add before the run command:

...
pluginload testplug ./plugin.so
pluginarg testplug one 1
pluginfreq 1

run 1000

How to write a plugin for ACEMD

The ACEMD plugin interface is exposed as:

struct aceplug_sim_t {
  int version;
  double4 *pos;
  float4 *frc;
  float  *mass;
  float  *charge;
  int    natoms;
  unsigned long step;
  void *privdata;
  float4 box;
};

A simple example of a plugin using the interface:

#include "aceplug.h"
#include <stdio.h>
#include <stdlib.h>

//IDX can be any private data of the plugin
#define IDX 1

int aceplug_init(
  struct aceplug_sim_t *s,
  int argc,
  char **argkey,
  char **argval
) {
  int i;

  printf("Hello! I am plugin-example %d %d \n", IDX, s->natoms );
  printf("I have %d arguments: \n", argc );
  for(i=0; i < argc; i++ ) {
    printf("\t[%s] = [%s]\n", argkey[i], argval[i] );
  }

  s->privdata = malloc( sizeof(int) );
  *((int *)s->privdata) = IDX;
  return 0;
}

int aceplug_update( struct aceplug_sim_t *s) {
  printf("Hello! I am plugin-example [%d] there are %d atoms, iteration %d\n", 
           *((int *)s->privdata), s->natoms, s->step);
  return 0;
}

int aceplug_terminate( void *privdata ) {
  printf("Hello! I am plugin-example %d\n", *(int*)privdata );
  free(privdata);
  return 0;
}

DOWNLOAD interface

Here you can download the ACEMD plugin interface (distributed under the LGPL license lgpl-3.0.txt).

Copyright 2008-2009. All rights reserved.