Partitioned calculations using LAMMPS as a library

Is it possible to specify a multi-partition calculation from the LAMMPS
library interface? Here's what I'm trying to do:
   (1) Compute the starting and ending configurations using an external
       program
   (2) Use LAMMPS to run an NEB calculation.
   (3) Extract some data back to the calling program and do other stuff
       with them.

It is conceivable (though sloppy) to run LAMMPS as a standalone
application, grab the relevant data through awk/grep/etc., and read it in,
but it seems more logical (and accurate) to do it through the library.
However, I'm not sure how to specify the equivalent of the '-partition'
command line switch when using the library interface (if such a mythical
creature exists). I suspect I will run into trouble when dealing with the
number of processes involved---I'd have to parallelize the calling
program and somehow tell LAMMPS to inherit its communicator (or simply
create another one on the same processor space).

Karl D. Hammond
University of Tennessee, Knoxville
[email protected]

Karl,

Is it possible to specify a multi-partition calculation from the LAMMPS
library interface? Here's what I'm trying to do:
  (1) Compute the starting and ending configurations using an external
      program
  (2) Use LAMMPS to run an NEB calculation.
  (3) Extract some data back to the calling program and do other stuff
      with them.

My first suggestion for a strategy to implement this would be to write
your own 'startup' code, i.e. an alternate version of main.cpp and
then do the partitioning as you see fit.

A second possible strategy would be to write a custom fix that will
override the initial coordinates from a template input according to
your external program and then copy back the results at the end of the
calculation.

Cheers,
     Axel.

The lammps_open() call in the library interface
takes argc and argv, which are the same as
LAMMPS receives from the OS when running
it standalone. In other words, if you pass
it an argc and argv that represent "-partition ..."
then you can launch LAMMPS in multi-partition
mode thru the lib interface.

Steve