This is part of the generic module |
Embed a separate PLUMED instance.
This command can be used to embed a separate PLUMED instance. Only required atoms will be passed to that instance, using an interface that is similar to the one used when calling PLUMED from the NAMD engine.
Notice that the two instances are running in the same UNIX process, so that they cannot be perfectly isolated. However, most of the features are expected to work correctly.
Notes:
CHDIR
is not thread safe. However, in most implementations there will be a single process running PLUMED, with perhaps multiple OpenMP threads spawn in order to parallelize the calculation of individual variables. So, this is likely not a problem.As an advanced feature, one can use the option KERNEL
to select the version of the guest PLUMED instance. In particular, an empty KERNEL
(default) implies that the guest PLUMED instance is the same as the host one (no library is loaded). On the other hand, KERNEL=/path/to/libplumedKernel.so
will allow specifying a library to be loaded for the guest instance. In addition to those mentioned above, this feature has limitations mostly related to clashes in the symbols defined in the different instances of the PLUMED library:
--runtime
and you should export PLUMED_LOAD_NAMESPACE=LOCAL
before starting the MD engine.plumed-runtime
executable (contained in the prefix/lib/plumed/
directory), export PLUMED_KERNEL
equal to the path of the host kernel library (as usual in runtime loading) and export PLUMED_LOAD_NAMESPACE=LOCAL
before launching plumed-runtime driver
.KERNEL
should in principle work correctly. To achieve namespace separation we are loading the guest kernel with RTLD_DEEPBIND
. However, this might create difficult to track problems in other linked libraries.RTLD_DEEPBIND
is not available kernels will not load correctly.A possible solution for the symbol clashes (not tested) could be to recompile the alternative PLUMED versions using separate C++ namespaces (e.g. ./configure CPPFLAGS=-DPLMD=PLMD_2_3
).
STRIDE
different from 1).DataFetchingObject
class.Quantity | Description |
bias | the instantaneous value of the bias potential |
STRIDE | ( default=1 ) stride different from 1 are not supported yet |
NOREPLICAS | ( default=off ) run multiple replicas as isolated ones, without letting them know that the host has multiple replicas |
FILE | input file for the guest PLUMED instance |
KERNEL | kernel to be used for the guest PLUMED instance (USE WITH CAUTION!) |
LOG | log file for the guest PLUMED instance. By default the host log is used |
CHDIR | run guest in a separate directory |
Here an example plumed file:
# plumed.dat p: PLUMED FILE=plumed2.dat PRINT ARG=p.bias FILE=COLVAR
plumed2.dat
can be an arbitrary plumed input file, for instance
# plumed2.dat d: DISTANCE ATOMS=1,10 RESTRAINT ARG=d KAPPA=10 AT=2
Now a more useful example. Imagine that you ran simulations using two different PLUMED input files. The files are long and complex and there are some clashes in the name of the variables (that is: same names are used in both files, same files are written, etc). In addition, files might have been written using different units (see UNITS`). If you want to run a single simulation with a bias potential that is the sum of the two bias potentials, you can: