Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Decrease in computational speed:Gentoo is solwer than Debian
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
chi86
Apprentice
Apprentice


Joined: 30 Jul 2013
Posts: 164
Location: Austria

PostPosted: Thu Jun 16, 2016 11:46 am    Post subject: Decrease in computational speed:Gentoo is solwer than Debian Reply with quote

Hi,
I had an old server which was running on debian and I noticed, that the scalling was completly of when I ran my code in parallel! So I decided to setup gentoo and now the scalling is better again (2xNuber of CPU's = 0.55 time) but the absolut time of one simulation is now longer than before. On Debian one simulation, which run on 6 cores (physical ones) took 27.35min and now on Gentoo it takes 33.27min.
It would make more sense if the gentoo system would be faster ...
Anyone an idea what I did wrong or what I might forget to set/emerge? For the compiler I used that same for Debian as for gentoo (intel fortran compiler)!

Here is my emerge --info
Code:

Portage 2.2.28 (python 3.4.3-final-0, default/linux/amd64/13.0, gcc-4.9.3, glibc-2.22-r4, 4.4.6-gentoo x86_64)
=================================================================
System uname: Linux-4.4.6-gentoo-x86_64-Intel-R-_Xeon-R-_CPU_X5690_@_3.47GHz-with-gentoo-2.2
KiB Mem:    98944168 total,  42481312 free
KiB Swap:   11534332 total,  11534332 free
Timestamp of repository gentoo: Wed, 15 Jun 2016 08:30:01 +0000
sh bash 4.3_p42-r1
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
app-shells/bash:          4.3_p42-r1::gentoo
dev-lang/perl:            5.20.2::gentoo
dev-lang/python:          2.7.10-r1::gentoo, 3.4.3-r1::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.19.1::gentoo
sys-apps/sandbox:         2.10-r1::gentoo
sys-devel/autoconf:       2.69::gentoo
sys-devel/automake:       1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo
sys-devel/gcc:            4.9.3::gentoo
sys-devel/gcc-config:     1.7.3::gentoo
sys-devel/libtool:        2.4.6::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 4.3::gentoo (virtual/os-headers)
sys-libs/glibc:           2.22-r4::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.iso88591"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X acl amd64 berkdb bindist bzip2 cli cracklib crypt cxx dri fortran gdbm iconv ipv6 mmx mmxext modules mpi multilib ncurses nls nptl openmp pam pcre readline seccomp session sse sse2 ssl tcpd unicode xattr zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby20 ruby21" USERLAND="GNU" VIDEO_CARDS="mga" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, MAKEOPTS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON


Thx!
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43194
Location: 56N 3W

PostPosted: Thu Jun 16, 2016 12:15 pm    Post subject: Reply with quote

chi86,

Help us narrow it down a little.

What does lddtree <your_binary> show?
That's all the dynamically linked libraries that <your_binary> needs.

For each of those libraries, what USE flags are they built with?
What USE flags is <your_binary> built with?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
chi86
Apprentice
Apprentice


Joined: 30 Jul 2013
Posts: 164
Location: Austria

PostPosted: Thu Jun 16, 2016 12:33 pm    Post subject: Reply with quote

NeddySeagoon wrote:
What does lddtree <your_binary> show?


lddtree dns
Code:

dns => ./dns (interpreter => /lib64/ld-linux-x86-64.so.2)
    libmpi.so.12 => /opt/OpenMpi_intel/lib/libmpi.so.12
        libopen-rte.so.12 => /opt/OpenMpi_intel/lib/libopen-rte.so.12
        libopen-pal.so.13 => /opt/OpenMpi_intel/lib/libopen-pal.so.13
        libpciaccess.so.0 => /usr/lib64/libpciaccess.so.0
            libz.so.1 => /lib64/libz.so.1
        librt.so.1 => /lib64/librt.so.1
        libutil.so.1 => /lib64/libutil.so.1
        libimf.so => not found
        libsvml.so => not found
        libirng.so => not found
        libintlc.so.5 => not found
    libmpi_usempif08.so.11 => /opt/OpenMpi_intel/lib/libmpi_usempif08.so.11
        libifport.so.5 => not found
        libifcore.so.5 => not found
        libifcoremt.so.5 => not found
    libmpi_usempi_ignore_tkr.so.6 => /opt/OpenMpi_intel/lib/libmpi_usempi_ignore_tkr.so.6
    libmpi_mpifh.so.12 => /opt/OpenMpi_intel/lib/libmpi_mpifh.so.12
    libm.so.6 => /lib64/libm.so.6
    libpthread.so.0 => /lib64/libpthread.so.0
        ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2
    libc.so.6 => /lib64/libc.so.6
    libgcc_s.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/libgcc_s.so.1
    libdl.so.2 => /lib64/libdl.so.2


I use the Intel Fortran compiler and for MPI I compiles OpenMPI with the Intel compiler.

There are some "not found" but the code works without problems!

NeddySeagoon wrote:
For each of those libraries, what USE flags are they built with?


libpciaccess ->
Code:
x11-libs/libpciaccess-0.13.4::gentoo  USE="zlib -static-libs" ABI_X86="(64) -32 (-x32)" 0 KiB

libzip ->
Code:
dev-libs/libzip-1.0.1::gentoo  USE="-static-libs" 440 KiB


For the rest I can't find any information. How do I look up which USE flag was used for a lib?


NeddySeagoon wrote:
What USE flags is <your_binary> built with?


Code:

F90         = mpif90 -heap-arrays
FLINKER     = mpif90
OPTFLAGS    = -O3

$(F90) -O3 -c $*.f
$(FLINKER) $(OPTFLAGS) -o $@ zufall.o code.o


Thanks for the Help!

EDIT:
I installed now "sys-apps/mlocate" and initial database indexing. Now the "not found" library are found!
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43194
Location: 56N 3W

PostPosted: Thu Jun 16, 2016 1:24 pm    Post subject: Reply with quote

chi86,

make.conf:
FFLAGS FCFLAGS
    Use these variables to set the desired optimization/CPU instruction settings for applications that you compile with a FORTRAN compiler. FFLAGS is usually passed to the FORTRAN 77 compiler, and FCFLAGS to any FORTRAN compiler in more modern build systems.


[code="make.conf]FCFLAGS="-O2 -pipe"
FFLAGS="-O2 -pipe" [/code]

I don't know the Intel FORTRAN compiler but you don't have any CPU specific options there. That means the code will be generic and not take advantage of any useful CPU extensions. gcc has -march=native for this sort of thing.

It Intel compiler has its own. Choose a few you like and rebuild all your FORTRAN stuff.
If you do not use emerge to run Intel Fortran, make.conf will not be used.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
chi86
Apprentice
Apprentice


Joined: 30 Jul 2013
Posts: 164
Location: Austria

PostPosted: Thu Jun 16, 2016 1:28 pm    Post subject: Reply with quote

NeddySeagoon wrote:
I don't know the Intel FORTRAN compiler but you don't have any CPU specific options there. That means the code will be generic and not take advantage of any useful CPU extensions. gcc has -march=native for this sort of thing.


Thanks I had no idear I thought the make.conf options where used. I give it a try!!
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43194
Location: 56N 3W

PostPosted: Thu Jun 16, 2016 2:24 pm    Post subject: Reply with quote

chi86,

-O3 may be a bad idea too. In gcc, it enables optimisations that make the code bigger in an attempt to make the code run faster.
That's a double edged sword. Bigger may mean that the working set no longer fits in the CPU cache, so its actually slower because there are many more cache misses that result in fetches from the much slower main memory.

It all depends on the size of the working set and the size of the CPU cache. -O2 might actually be faster.
You need to test. Results vary by application and hardware.

If you really want to squeeze until the pips squeek (you probably don't) you may well find that some libraries benefit from -O2 and others from -O3.
That's a lot of testing. Worse, the working set size is probably related to the particular problem. e.g. more dynamically allocated memory makes for a bigger working set.

In short, add in the CPU flags the optimise things for your CPU. That's mostly harmless.
Build the entire codebase with -O3 and test the performance.
Build the entire codebase with -O2 and test the performance in the same way again.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
chi86
Apprentice
Apprentice


Joined: 30 Jul 2013
Posts: 164
Location: Austria

PostPosted: Thu Jun 16, 2016 2:26 pm    Post subject: Reply with quote

Thx!
I already started the testing with -O3 and I put here my results when I'm done!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum