From: Goedde, Chris (CGOEDDE_at_depaul.edu)
Date: Mon May 07 2018 - 11:29:36 CDT

Hi all,

I’ve been dealing with a weird vmd startup problem, and I’m looking for tips on diagnosing these sorts of things going forward.

I’m calling vmd in text mode from python. For testing purposes I was using the following code:

######

import subprocess
def vmdtest():

    outlogFile = open("./Test-out.log", "w")
    errlogFile = open("./Test-err.log", "w")
    
    VMDin=subprocess.run([ 'vmd', '-dispdev', 'none', '-startup', '/Users/goedde/.vmdrc-test', '-e', 'Test.vmd' ], \
            stdout=outlogFile, stderr=errlogFile)

######

This runs vmd in text mode with a specific .vmdrc test file and a simple file of tcl commands in Test.vmd, and pipes stdout to Test-out.log and stderr to Test-err.log. For testing, Test.vmd was simply:

puts stdout "Executing Test.vmd"
exit

The weird thing was, everything worked fine in the python interpreter when started in the terminal, but failed when run in a jupyter notebook. (Using python 3 via anaconda.) The further problem was that vmd did not give any messages when failing. No error messages were written to stdout or stderr. The stderr log was always empty, and the stdout log just had the usual vmd startup message and an “Exiting normally” at the end.

I finally traced things down to the following lines in my .vmdrc file:

display reposition 10 800
display resize 1600 800

Obviously, these aren’t needed when running in text mode, but I don’t understand why they were only a problem when vmd was started from python via a jupyter notebook.

My questions are:

(1) Is there some other log file I should be looking at for error messages from vmd upon startup?

(2) What could be different about the jupyter notebook environment that causes vmd to choke on display setting lines upon startup?

Now that I know what the problem is I can work around it by always using a custom .vmdrc file when starting vmd from python, but I would like to know more about what’s going on and where to look for error messages in the future.

This is on a Mac running 10.12.6 and VMD for MACOSXX86, version 1.9.3a6 (October 9, 2015).

Thanks for any insight!

Chris Goedde