Csound Csound-dev Csound-tekno Search About

[Cs-dev] Compiler optimization flags

Date2013-04-14 20:06
FromOeyvind Brandtsegg
Subject[Cs-dev] Compiler optimization flags
AttachmentsNone  None  

I'm comparing  performance on Windows and Linux, and in so doing i need to figure out the optimal flags for compiling Csound. I've tried the gcc3 and the gcc4 optimization and also using both in combination. Setting it to 'pentium3' for both. Is there a way of determining the best setting ? (Other than trial and error).
I'm using Michael's Csound version on Windows and so far it seems to run a little bit faster than what i can get on Linux.  I found that a bit surprising so apparently i must be doing something wrong...
Best
Oeyvind


Date2013-04-14 21:32
FromMichael Gogins
SubjectRe: [Cs-dev] Compiler optimization flags
AttachmentsNone  None  
-march=native is supposed to select the optimum flags for your SPECIFIC computer.

My flags that I compile with are:

CMAKE_CXX_FLAGS:STRING=-std=gnu++0x -fopenmp -include cmath -march=nocona

CMAKE_C_FLAGS:STRING=-fopenmp -march=nocona -I/usr/local/include

nocona is an older chip architecture that already has mot of the vectorization stuff. Change it to native and see if it makes a difference.\

Hope this helps,
Mike








On Sun, Apr 14, 2013 at 3:06 PM, Oeyvind Brandtsegg <oyvind.brandtsegg@ntnu.no> wrote:

I'm comparing  performance on Windows and Linux, and in so doing i need to figure out the optimal flags for compiling Csound. I've tried the gcc3 and the gcc4 optimization and also using both in combination. Setting it to 'pentium3' for both. Is there a way of determining the best setting ? (Other than trial and error).
I'm using Michael's Csound version on Windows and so far it seems to run a little bit faster than what i can get on Linux.  I found that a bit surprising so apparently i must be doing something wrong...
Best
Oeyvind


------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel




--
Michael Gogins
Irreducible Productions
http://www.michael-gogins.com
Michael dot Gogins at gmail dot com

Date2013-04-15 10:17
FromOeyvind Brandtsegg
SubjectRe: [Cs-dev] Compiler optimization flags
Attachmentstest_multiosc.csd  None  None  
Thanks so much.

It seems 'pentium3' and 'native' gives similar optimization, but thanks a lot for the tip.
It also seems like the gcc3opt doe not make a difference when also using gcc4opt.
BUT, the rendering times vary a lot under Linux, so it is hard to really fine tune.
I render a 100-oscillator instrument for 100 seconds, writing to file (csd attached)
I measuer "Elapsed time at end of performance: real: XXs, CPU: XXs"

On Linux:
"real" varies between 27 and 39 seconds (with the same Csound build)
"cpu" varies between 17 and 22 seconds

On Windows (on the same computer, for comparision)
"real" and "cpu" is pretty much constant and between 15 and 16  seconds

I use Ubuntu 12, also installed Ubuntu Studio.
It seems there is room for improvement of the efficiency of my Linux system.
Any ideas of what to twek and what to check is greatly appreciated.
I tried running csound with different nice levels but the reported render times did not change much.

For reference, here are my Csound Scons options:
scons -j 2 buildDSSI=0 buildImageOpcodes=1 buildInterfaces=1 buildJavaWrapper=1 buildPythonOpcodes=1 buildUtilities=1 buildVirtual=1 Lib64=0 useDouble=1 usePortAudio=0 usePortMidi=1 useALSA=1 useJack=1 useFLTK=1 Word64=1 buildPythonWrapper=1 smoothSort=1 includeMP3=1 buildCsoundAC=0 buildStkOpcodes=1 buildBeats=1 dynamicCsoundLibrary=1 buildOSC=1 useOSC=1 useIpMIDI=1 buildRelease=1 noDebug=1 gcc3opt='native' gcc4opt='native'

Also tried useOpenMP=1 (as I thought perhaps that's what you did Michael?), but it did not significantly change the reported render times.


best
Oeyvind




2013/4/14 Michael Gogins <michael.gogins@gmail.com>
-march=native is supposed to select the optimum flags for your SPECIFIC computer.

My flags that I compile with are:

CMAKE_CXX_FLAGS:STRING=-std=gnu++0x -fopenmp -include cmath -march=nocona

CMAKE_C_FLAGS:STRING=-fopenmp -march=nocona -I/usr/local/include

nocona is an older chip architecture that already has mot of the vectorization stuff. Change it to native and see if it makes a difference.\

Hope this helps,
Mike








On Sun, Apr 14, 2013 at 3:06 PM, Oeyvind Brandtsegg <oyvind.brandtsegg@ntnu.no> wrote:

I'm comparing  performance on Windows and Linux, and in so doing i need to figure out the optimal flags for compiling Csound. I've tried the gcc3 and the gcc4 optimization and also using both in combination. Setting it to 'pentium3' for both. Is there a way of determining the best setting ? (Other than trial and error).
I'm using Michael's Csound version on Windows and so far it seems to run a little bit faster than what i can get on Linux.  I found that a bit surprising so apparently i must be doing something wrong...
Best
Oeyvind


------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel




--
Michael Gogins
Irreducible Productions
http://www.michael-gogins.com
Michael dot Gogins at gmail dot com

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel




--

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://flyndresang.no/
http://www.partikkelaudio.com/
http://soundcloud.com/brandtsegg
http://soundcloud.com/t-emp