compile neuron with intel compiler for linux?

Post Reply
ubartsch
Posts: 34
Joined: Thu May 19, 2005 11:02 am
Location: CTCN, University of Plymouth
Contact:

compile neuron with intel compiler for linux?

Post by ubartsch »

This is just a general question:

A friend told me that several benchmarks on 64bit machines are running much faster if you use the Intel compiler for linux instead of the gcc compiler.

Is it possible to compile Neuron with the Intel compiler?
And then use the Intel compiler in Neuron to compile the models?
Has anyone ever tried to compare different compiled versions of Neuron?

Many thanks for a few opinions!

UB
hines
Site Admin
Posts: 1600
Joined: Wed May 18, 2005 3:32 pm

Post by hines »

I suppose that is possible and there is certainly a lot of room for greater optimization by sophisticated compilers. But I have no experience with the intel compiler and so can't speak to any performance gains with respect to its use. That said, on linux it should be very easy to use that instead of gcc to build from the sources and in that case the mod files will also be compiled with it.
Thomas Wennekers
Posts: 5
Joined: Sun May 28, 2006 6:28 am
Location: Plymouth / UK
Contact:

Neuron and Intel compilers

Post by Thomas Wennekers »

Hi

Just for info :

compilation of Neuron with Intel compilers works, but without iv

compilation of iv with Intel fails.
I didn't try to figure out the reason

Neither did I try whether Intel-compiled Neuron can be linked agains gcc-compiled iv. That's not unlikely, but who knows.

Best wishes
T
Keivan
Posts: 127
Joined: Sat Apr 22, 2006 4:28 am

My Experience

Post by Keivan »

I have recently compiled neuron with Intel compiler suit. As Thomas said if interviews are compiled with Intel compilers neuron would not compile correctly. The speedup with Intel-compiled neuron 7 was more than 100% in the single thread mode and about 10% in threaded mode compared to GNU compilers.
My problem is that the very first time I could compile neuron with Intel compiler but I have failed repeatedly at later time. Neuron compiles without error but running nrngui following error appears:

Code: Select all

NEURON -- Release 7.0 (281:80827e3cd201) 2009-01-16
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2008
See http://www.neuron.yale.edu/credits.html

/home/keivan/neuron/nrn/x86_64/bin/nrniv: Segmentation violation
 in wingroup.hoc near line 172
 }
 ^
        xopen("wingroup.hoc")
      execute1("{xopen("wingroup.hoc")}")
    load_file("wingroup.hoc")
  xopen("stdgui.hoc")
and others
./compile-install.sh: line 54: 23129 Segmentation fault      nrngui
I found the following warning in my compile log

Code: Select all

checkpnt.cpp(741): warning #181: argument is incompatible with corresponding format string conversion
  printf("OcCheckpoint::instlist failed at i = %d\n", i);
I Know that newer GNU automake tools provide support with Intel compilers --> maybe using them solves the problem.
Last edited by Keivan on Mon Sep 07, 2009 11:24 am, edited 1 time in total.
Keivan
Posts: 127
Joined: Sat Apr 22, 2006 4:28 am

Partial Success Report

Post by Keivan »

finally I could compile neuron with interviews using Intel compilers. I used the latest 7.1 alpha version of neuron. The trick is to completely delete your previous compiled neuron and use a clean source and pass no flages to compilers.
note: It seems that the "make clean" command is very buggy and does not clean the source properly.
note: Also nrngui and neurondemo working fine but it seems that the some parts of the neuron does not work properly.

I DO NOT RECOMMEND USING INTEL-COMPILED NEURON FOR A SERIOUS PROJECT

I wish It would be possible some day to compile neuron with Intel performance primitives and gain the huge performance benefit.
hines
Site Admin
Posts: 1600
Joined: Wed May 18, 2005 3:32 pm

Re: compile neuron with intel compiler for linux?

Post by hines »

The speedup with Intel-compiled neuron 7 was more than 100% in the single thread mode and about 10% in threaded mode compared to GNU compilers.
Please tell us the relative speed up when you use

Code: Select all

cvode_cache_efficient(1)
after setting up the model. I was unsuccessful in installing I_cproc_p_11.1.046_intel64.tgz on my machine but if the performance gain holds
up I'll try again.
It seems that the "make clean" command is very buggy
Try 'make distclean'

When investigating multiple compilers, configuration flags, etc, it is helpful to build and install in a separate directories from the sources.
For example, (sources are in $HOME/neuron/nrn and Interview sources and installation is in $HOME/neuron/iv)
cd $HOME/neuron
mkdir nrnmpi
cd nrnmpi
../nrn/configure --prefix=`pwd` --srcdir=../nrn --with-paranrn --with-nrnpython

I use an alias
nrnenv nrnmpi
to switch between different versions.

Code: Select all

alias nrnenv='source ~/neuron/prefixenv'

$ cat ~/neuron/prefixenv
export IV=$HOME/neuron/iv
export N=$HOME/neuron/$1
export PATH=$IV/x86_64/bin:$N/x86_64/bin:$PATH:
Keivan
Posts: 127
Joined: Sat Apr 22, 2006 4:28 am

Re: compile neuron with intel compiler for linux?

Post by Keivan »

Please tell us the relative speed up when you use
cvode_cache_efficient(1)
Neuron runs faster when activating the cache efficacy, howere the relative speedup is about 10-15% in this case.

PS: I am using exactly the same version of icc.
hines
Site Admin
Posts: 1600
Joined: Wed May 18, 2005 3:32 pm

Re: compile neuron with intel compiler for linux?

Post by hines »

I meant (with cvode.cache_efficient(1)), what is the relative runtime of the gcc vs icc compiled versions.
Keivan
Posts: 127
Joined: Sat Apr 22, 2006 4:28 am

Re: compile neuron with intel compiler for linux?

Post by Keivan »

after working full-time for more than 4 days, trying to know what compilers with which kernel flags and configurations would provide best performance in neuron for me, I have tried intel compiler and the that time I found intel compilers more than 100% faster in single thread mode with cache effect off. Because I had deleted my intel-compiled neuron to reply your question I decided to work on this subject for more 2 days. These are the results:

These set of experiments performed on a dell laptop with a core 2 due cpu (2GHz 4MB cache), 2GB of ram, FSB=667. I have created a excessively detailed dendritic tree to reach the complexity of 8472. most of the experiments tested in single thread mode with and without the cache effect. I am running my model for 10000ms and the reported values are the real-time it takes.
note: experimentally I reached the conclusion that both iv and nrn should be compiled with the same compiler to work with each other but the compiler flags could be different during compile time.

Intel-compiled neuron without flags with intel shared libraries with iv--> cache off = 425.38s cache on = 214.99s
gnu-compiled neuron without flags with gnu shared libraries --> off = 418.93 on=199.24
gnu-compiled neuron without flags with intel shared libraries --> off=401.31 on=not tested

then I have tried various combinations of compiler flags including:
-march=core2 -parallel -openmp -axSSE3 -xHost -fno-builtin -no-prec-div -no-prec-sqrt -ipo -xP -xT
following flages lead to error:
-static -ipp -fast

the fastest combination was: -O3 -fno-builtin -march=core2

then I added ipp shared libs and mpich2 compiler to nrninv and compiled with the flags= -O3 -fno-builtin -march=core2:
intel-compiled neuron --> off = 391.97 on=214.48
gnu-compile neuron --> off=373.41 on=197.22

Then I have compiled iv the same way (with GNU compilers + ipp shared libs flags= -O3 -fno-builtin -march=core2) and also compiled the kernel with ipp shared libs --> off=360.3 on=196.82

Conclusion: It seems that the combination of gnu and mpich2 compilers with intel libraries including ipp leads to the most speedup. However, I could not repeat my 100% speedup experienced previously (I don't know why?!).

there are some benchmarks on the net show that p7zip which is a processor dependent software works 5% slower on 2.6.29 kernel and 10% slower on 2.6.30 compaired to 2.6.28 so as I was tested the reported results on a 2.6.29 kernel I have decided to test neuron on a ipp compiled 2.6.28 kernel --> off=348.82 (16.73 % faster)
Post Reply