Neuron refuse to run if the DISPLAY is wrongly set

Post Reply
mattions
Posts: 65
Joined: Tue Jul 15, 2008 11:21 am
Location: EMBL-EBI Cambridge UK

Neuron refuse to run if the DISPLAY is wrongly set

Post 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?
hines
Site Admin
Posts: 1682
Joined: Wed May 18, 2005 3:32 pm

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

Post 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);
hines
Site Admin
Posts: 1682
Joined: Wed May 18, 2005 3:32 pm

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

Post 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
mattions
Posts: 65
Joined: Tue Jul 15, 2008 11:21 am
Location: EMBL-EBI Cambridge UK

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

Post 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']
Post Reply