From: Olaf Lenz (olenz_at_Physik.Uni-Bielefeld.DE)
Date: Mon Jul 19 2004 - 06:14:29 CDT


John Stone wrote:
> As you've discovered though, it is easy to copy your plugin into the
> system directory.

It is, if you are root on the machine. Otherwise it isn't. I'd prefer if I would
not need to install a personal plugin as root.

As for the second issue of the file reader plugins, I'd like to specify my
problem more precisely.

The whole issue is not a problem, when I have a single plugin that reads both
the structure and coordinate files. For example. I've written a "movie" plugin
that gets the system parameter file as argument and finds all the timestep
coordinate files as they have a simple naming scheme, like "00100000.crd.gz" for
timestep 100000.

Sometimes, however, I'd like to read the system parameter file and a single
timestep coordinate file that I'd like to choose by hand. Therefore I've split
the plugin into two parts - a structure file reader plugin that reads the system
parameter file, and a coordinate file reader that reads one timestep coordinate
file (just like the "parm7" and "rst7" plugins do).
The problem with this is, that I can't pass the internal data structure from the
structure file reader to the coordinate file reader. This should normally not be
a problem, as the coordinate file reader only needs to fill in the coordinates
for the atoms. But in my system, I do have some atoms whose coordinates are not
saved in the coordinate file, but which are fixed in the system and saved in the
structure file. The question is now: how can I pass the coordinates of these
atoms to the coordinate file reader.
I can see two possible solutions:

1. I can parse the structure file once more when I read the coordinate file,
just to derive the needed data. This is not very nice, as opening/parsing a file
is relatively costly, and furthermore I'd need to be able to derive the
parameter filename from the coordinate filename, or something.

2. I could use a global datastructure that is filled in by the structure plugin
and read by the coordinate file plugin. Global datastructures are not really nice.

Or is there another way?


   The gaussian cubeplugin reader is an
> example of one that does a fair bit of calculation in the first
> open_cube_read() call. At the limit, you could do all of the file
> parsing work in the open_xxx_read() routine and have the structure,
> bonds, volume data, and other callbacks merely copy out the data
> the open_xxx_read() call has already processed. Most of the plugins
> do some of the reading/parsin in open_xxx_read() and some later on,
> but you're free to do it either way.
> Let me know if this explanation was helpful or not. I probably need
> to add more text about all of this to the plugin writing docs...