From: John Stone (johns_at_ks.uiuc.edu)
Date: Fri Nov 22 2013 - 23:33:07 CST

Hi,
  Sorry for the slow response, I've been out of town at
the annual Supercomputing conference until late last night.

There are various ways to write plugins in C, but generally they
work like the psfgen plugin, where the user communicates with them
via new script commands. Generally, they do not have direct access
to the internal VMD data structures, and they get the data they need
via parameters that are passed to them via the commands they implement.

Before you go writing plugins in C, it might be useful to have a look
at what you're doing in the script-based code you have now. In the majority
of cases, there is not a need (or a benefit) for coding a plugin in C,
unless the plugin is doing most of the arithmetic work for itself
(e.g. not using built-in VMD analysis routines).
If you tell us more about what kind of analysis you're doing, and/or
show an example of one of the scripts that is running slow, we can
probably give you some tips on how to speed things up quite a bit.
If it turns out that your cases are a good match for a compiled C/C++
plugin, it may still be useful to see what you're doing so we can
give you the best advice on how to get it done.

Lastly: if you're doing something that's of broad interest, we
can also consider adding new "measure" commands that provide new
built-in analysis features. We're doing a lot of this currently,
so I'm always open to new suggestions.

Cheers,
  John Stone
  vmd_at_ks.uiuc.edu

On Sat, Nov 16, 2013 at 05:14:21PM -0500, Charles McAnany wrote:
> Friends,
> I want to get comfortable developing for VMD. I'm interested in getting
> rid of "three-minute steps", which are the most irritating part of
> analysis. It's almost time to get coffee, but not quite enough; it's
> almost time to respond to an e-mail; but I can't make the mental context
> switch.
> So, as a starting project, I was going to replace the RMSD heatmap tool
> with an equivalent in C that is multithreaded (or MPI-aware). The issue
> is, I'm just not getting how plugins (in C) get vmd's data. I've read
> the programmers' guide and the plugin development guide, and I'm still
> not clear how all the executables link to each other.
> For example, if I compile vmd with MPI, how do the plugins take
> advantage of that? How do I get access to atom positions at a given
> timestep (in a thread-safe manner) from a plugin? I looked at the
> pmepot, but the C files there don't seem to #include <vmd.h> or anything
> related.
>
> I feel that asking all my questions to this list wouldn't be very
> productive (I'll have so many); does anyone have some references they
> can point me to?
>
> Oh, as an aside, if I alter the surf source so that it doesn't require
> makedepend (or sgidefs.h), who do I send the new version to?
>
> Cheers,
> Charles McAnany,
> Graduate Student, Mura Lab, University of Virginia.
>

-- 
NIH Center for Macromolecular Modeling and Bioinformatics
Beckman Institute for Advanced Science and Technology
University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
http://www.ks.uiuc.edu/~johns/           Phone: 217-244-3349
http://www.ks.uiuc.edu/Research/vmd/