Page 1 of 1

Neuron refuse to run if the DISPLAY is wrongly set

Posted: Wed May 13, 2009 7:48 am
by mattions
Hello,

I want to run neuron only for a batch job, without using any DISPLAY but it seems it's not possible.
I'm going to use it on a cluster where the DISPLAY will be not available.

check this:

$ DISPLAY=""
$ ipython
In [1]: import neuron
can't open DISPLAY

Where that message come from? Where is the checking?

I looked into the source of the __init__(): of the neuron module but I didn't find the hoc module (that is imported)

The same if I do
from neuron import h

Any suggestions?

Re: Neuron refuse to run if the DISPLAY is wrongly set

Posted: Wed May 13, 2009 5:00 pm
by hines
When running NEURON on a cluster in parallel, typically the -mpi arg is used which avoids the DISPLAY. On a single workstation, the -nogui arg is used. The question then becomes how to effectively set the -mpi arg when dynamically loading as an extension after launching ipython. This will be accomplished when, during build time, NEURON is configured with the --with-paranrn arg (in addition to the --with-nrnpython arg) and ipython has previously initialized MPI before importing neuron. See the section titled "Starting Parallel Neuron" in
http://www.frontiersin.org/neuroinforma ... /391/html/

The only other thing I can think of off hand is to edit nrn/src/nrnpython/inithoc.cpp and add '-nogui' to the argv list of args that are used in the call to ivocmain(argc, argv, env);

Re: Neuron refuse to run if the DISPLAY is wrongly set

Posted: Thu May 14, 2009 7:42 am
by hines

Code: Select all

$ DISPLAY=""
That was the problem. If there is a DISPLAY then it must be valid. Try
eliminating it altogether.

Code: Select all

unset DISPLAY

Re: Neuron refuse to run if the DISPLAY is wrongly set

Posted: Sun May 17, 2009 7:05 am
by mattions
Thanks.

That did the trick.

in python, to unset is also possible to run:

Code: Select all

import os
if os.environ.has_key('DISPLAY')
    del os.environ['DISPLAY']