From: Vermaas, Joshua (
Date: Tue Feb 07 2017 - 15:51:32 CST

Hi Karl,

It sounds like you want to interact with volume maps already loaded into VMD. When I needed to do this for my own purposes, I dug into VMD internals and wrote something to access volumetric datasets and make it accessible to VMD's python interface (this is now in the VMD CVS as molecule.get_volumetric). From there, you can access the data itself in python and do whatever you want. This does not expose a pointer to VMD's internal data structure directly (which isn't even useful, since its stored out of order as far as numpy is concerned), however since the copy never went to disk, it was fast enough to be efficient.


On 02/07/2017 02:15 PM, Karl Decker wrote:
Is it possible to share memory between two processes, one of which is VMD? I'm aware this is generally messy and dangerous, but it's one way to avoid writing large files to disk and slowing down the execution of the plugin we're designing. It would obviously take some effort to write the code for sharing the memory between two processes, but first I want to know: can VMD even be made to share its memory with another process?

Alternatively, we are considering implementing a python plugin to VMD. Can VMD be made to share memory with a plugin?

The memory we want to share is from VolMap, specifically a distance map generated in VolMap. The idea is to sidestep writing the map to disk because it takes too long.