From: Bogdan Costescu (bcostescu_at_gmail.com)
Date: Sat Sep 04 2010 - 05:26:52 CDT

On Fri, Sep 3, 2010 at 8:18 PM, Thomas C. Bishop <bishop_at_tulane.edu> wrote:
> mkfifo "fifo.pdb"

You should create 2 pipes, one for VMD to analysis script and another
one for analysis script to VMD.

> set sel [atomselect top all ]
> $sel writepdb "fifo.pdb"
>
> myanalysis "fifo.pdb"

For me the following works:

create (in shell or TCL) the 2 fifos:

mkfifo fifo.pdb
mkfifo fifo2.pdb

in a separate shell run:

cat < fifo.pdb > fifo2.pdb

and then in VMD:

set fp [open "fifo2.pdb"]
$sel writepdb "fifo.pdb"
while { [gets $fp data] >= 0 } {
  puts $data
}

Please mind what I wrote earlier: you can get a deadlock if the data
quantities to be exchanged are larger than the pipe buffers. Even in
the above example this could happen if VMD would try to write too much
(in the writepdb phase) and block waiting for more space to become
available in the buffer, while cat will read the data, write it to
fifo2.pdb, but block as well because there is no reader; a reader will
exist only once VMD finishes writing and starts executing gets().

> 2) if I remember correctly once you mount a ramdisk you cannot release the ram by simply unmounting the ramdisk.
> In whatever kernel I was using when I first tried this you had to reboot the machine and I thought that was too big a price to pay... maybe things have changed

Yes, they've changed, that's why I mentioned tmpfs :-) Check out a
short description (including a way of creating the FS) at:

http://en.wikipedia.org/wiki/Tmpfs#Linux

Cheers,
Bogdan