From: David <dst...@cn...> - 2020-11-23 15:06:06
|
Hi Wolfgang, you can drop the '-m3dnow', as this technology has been dropped 10 years ago (AFAIK). If you are willing to / can generate non-portable code [which is also in theory the case with using fma and avx2 instructions, but majority of CPUs do support it], but at the same time get all possible optimizations, have a look at the '-march=cpu-type' optimization flag here https://gcc.gnu.org/onlinedocs/gcc-6.3.0/gcc/x86-Options.html If you use -march=your_cpu_family flag, all/majority (of the compliant) optimization flags for that specific architecture should be enabled by default. To see which flags are on, you can use '-v' with any compilation command we use. See the example below (in bold are the important flags, and in italics optimization flags that were automatically enabled). I recommend you to do these optimization if you can, as the performance gains outweigh the extra time spent on compilation (especially for the devel branch of xmipp, where we significantly improved the compilation time). If you need a code which is portable between several different families, use the '-v' to expand the flags for each architecture, and then set the intersection of those flags in the xmipp.conf file. Hope this helps. KR, David S. $ g++ *-v* -o libraries/reconstruction/aalign_significant.os -c *-march=native* -std=c++11 -O0 -I../ -I/usr/include -I/usr/include/hdf5/serial -fPIC -I/usr/include/python3.5m -I/usr/lib/python3/dist-packages/numpy/core/include -Iexternal -Ilibraries -I/home/david/git/xmipp_devel/src/xmippCore libraries/reconstruction/aalign_significant.cpp Using built-in specs. COLLECT_GCC=g++ Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.5.0-12ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 5.5.0 20171010 (Ubuntu 5.5.0-12ubuntu1) COLLECT_GCC_OPTIONS='-v' '-o' 'libraries/reconstruction/aalign_significant.os' '-c' '-march=native' '-std=c++11' '-O0' '-I' '../' '-I' '/usr/include' '-I' '/usr/include/hdf5/serial' '-fPIC' '-I' '/usr/include/python3.5m' '-I' '/usr/lib/python3/dist-packages/numpy/core/include' '-I' 'external' '-I' 'libraries' '-I' '/home/david/git/xmipp_devel/src/xmippCore' '-shared-libgcc' /usr/lib/gcc/x86_64-linux-gnu/5/cc1plus -quiet -v -I ../ -I /usr/include -I /usr/include/hdf5/serial -I /usr/include/python3.5m -I /usr/lib/python3/dist-packages/numpy/core/include -I external -I libraries -I /home/david/git/xmipp_devel/src/xmippCore -imultiarch x86_64-linux-gnu -D_GNU_SOURCE libraries/reconstruction/aalign_significant.cpp *-march=broadwell* /-mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -mno-sse4a -mcx16 -msahf -mmovbe -maes -mno-sha -mpclmul -mpopcnt -mabm -mno-lwp -mfma -mno-fma4 -mno-xop -mbmi -mbmi2 -mno-tbm -mavx -mavx2 -msse4.2 -msse4.1 -mlzcnt -mno-rtm -mno-hle -mrdrnd -mf16c -mfsgsbase -mrdseed -mprfchw -madx -mfxsr -mxsave -mxsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 -mclflushopt -mxsavec -mxsaves -mno-avx512dq -mno-avx512bw -mno-avx512vl -mno-avx512ifma -mno-avx512vbmi -mno-clwb -mno-mwaitx --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=6144 -mtune=generic/ -quiet -dumpbase aalign_significant.cpp -auxbase-strip libraries/reconstruction/aalign_significant.os -O0 -std=c++11 -version .... (skipped) On 19/11/20 12:05, Lugmayr, Wolfgang wrote: > dear all, > > just for documentation of the scipion 3.0.6 official release. > > i changed in xmipp.conf the line: > CXXFLAGS= -mtune=native -march=native -std=c++11 -O3 > to > CXXFLAGS= -mfma -mavx2 -m3dnow -fomit-frame-pointer -std=c++11 -O3 > and rebuild xmipp. > now the exes run fine on intel and amd epyc processors. > > the flags come from recommended for gcc: > https://prace-ri.eu/wp-content/uploads/Best-Practice-Guide_AMD.pdf > > cheers and thanks for the help, > wolfgang > > > ------------------------------------------------------------------------ > *From: *"Carlos Oscar Sorzano" <co...@cn...> > *To: *"Pablo Conesa" <pc...@cn...>, "David" > <dst...@cn...>, dma...@cn..., "w lugmayr" > <w.l...@uk...>, "Mailing list for Scipion users" > <sci...@li...> > *Sent: *Thursday, 29 October, 2020 16:11:16 > *Subject: *Re: Fwd: [scipion-users] scipion-installer - how do i > change compiler optimization flags? > > Dear Wolfgang, > > in the compilation of Xmipp, you can set the environment variable > CXXFLAGS before calling the xmipp script. From the Scipion > installation I am not sure how to pass it to the xmipp script. It may > be that setting it in the shell before calling scipion suffices. But I > have never tried. > > Kind regards, Carlos Oscar > > El 29/10/2020 a las 11:13, Pablo Conesa escribió: > > ? > > > > -------- Forwarded Message -------- > Subject: [scipion-users] scipion-installer - how do i change > compiler optimization flags? > Date: Wed, 28 Oct 2020 14:19:29 +0100 (CET) > From: Lugmayr, Wolfgang <w.l...@uk...> <mailto:w.l...@uk...> > Reply-To: Mailing list for Scipion users > <sci...@li...> > <mailto:sci...@li...> > To: Mailing list for Scipion users > <sci...@li...> > <mailto:sci...@li...> > > > > hi, > > i installed and compiled scipion 3.0.5-devel on a system with > intel cpus. > > when i run now scipion on new nodes with "AMD EPYC 7402" > processors the executable fails with: > $ scipion3 last Scipion v3.0.5 () devel > sh: line 1: 45875 Illegal instruction python -m scipion last > > so i do not want to have 2 versions of scipion3 but maybe compile > it with intel and amd compatibility flags. > how do i set these flags? > > cheers, > wolfgang > > -- > Universitätsklinikum Hamburg-Eppendorf (UKE) > @ Centre for Structral Systems Biology (CSSB) > @ Deutsches Elektronen-Synchrotron (DESY) > Notkestrasse 85 Gebäude 15 > 22607 Hamburg, Germany > Tel.: +49 40 8998-87652 > Email:wol...@cs... <mailto:wol...@cs...> > http://www.cssb-hamburg.de/ > > > _______________________________________________ > scipion-users mailing list > sci...@li... <mailto:sci...@li...> > https://lists.sourceforge.net/lists/listinfo/scipion-users > > |