|
[Sponsors] |
September 14, 2013, 13:19 |
Optimal OF compilation
|
#1 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Dear all,
like in this thread: http://www.cfd-online.com/Forums/har...ec-memory.html Bruno mentioned that you will have a very nice performance if you set up OpenFOAM in an optimal way. I always build OpenFOAM out of git repository and with ./Allwmake So my question is, if that is a optimal way or do I have to make changes in some files to build it optimal? Or do I just have to use the actual (here mentioned the gcc 4.7 version) versions of compiler and other packages? Thanks in advance Tobi |
|
September 14, 2013, 13:52 |
|
#2 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi Tobi,
The quick instructions are (after you've cloned the repo and have the ThirdParty folder in place):
And yes, you'll have to do a lot of testing, as to ascertain which flags work the best for you, specially when running in parallel! By the way, I specified in the aliases to use the system's Open-MPI, because allegedly it's the one properly built for the system... assuming of course you've already installed the one for your system Best regards, Bruno
__________________
|
|
September 14, 2013, 14:50 |
|
#3 | ||
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Quote:
Quote:
So I think a good option to know which flag options are the best is to test it with snappyHexMesh like you did or would it be better to make a calculation? Flags for compiler are new for me but I realize that with the best settings it would be a very greate deal. At least, where do you know the correct flags like: Code:
cOPT = -O2 -march=bdver1 -mtune=bdver1 c++OPT = -O2 -march=bdver1 -mtune=bdver1 |
|||
September 14, 2013, 14:59 |
|
#4 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Additionally - I think you have the gcc flags find out here: http://developer.amd.com/wordpress/m...f-62004200.pdf
Do you know if I need OpenMPI? Or vectorization, maybe -ffast-math? Or do I have to figure it out by my self? Thanks bruno! |
|
September 14, 2013, 15:09 |
|
#5 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi Tobi,
The flags I mentioned are from this blog post: http://developer.amd.com/community/b...es-processors/ I had mentioned this at the end of this post: http://www.cfd-online.com/Forums/har...tml#post451659 Personally, I do not advise you to use the "-ffast-math". You should only use it if you are sure about what you're simulating, namely what numeric sensitivity it has got. Beyond that, you'll have to try yourself. You can load all of the flags mentioned on that other optimizing document and then start pruning out the ones that might not matter. Open-MPI is the usual MPI toolbox people are using on Linux Distributions and that those Distributions usually offer without the need for building one yourself. And you'll need an MPI for running in parallel, because OpenFOAM doesn't use OpenMP. As for benchmarking: snappyHexMesh is only one example. You should try with all of the kinds of simulations you'll be doing. Meshing and simulation are both essential. Best regards, Bruno edit: As for MPI tuning (not building), check my blog post Notes about running OpenFOAM in parallel
__________________
Last edited by wyldckat; September 14, 2013 at 15:10. Reason: see "edit:" |
|
September 14, 2013, 16:13 |
|
#6 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Further more, if I compile I get the following lines:
Code:
SOURCE=fields/fvPatchFields/derived/phaseHydrostaticPressure/phaseHydrostaticPressureFvPatchScalarField.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-100 -I/home/shor-ty/OpenFOAM/OpenFOAM-2.2.x/src/triSurface/lnInclude -I/home/shor-ty/OpenFOAM/OpenFOAM-2.2.x/src/meshTools/lnInclude -IlnInclude -I. -I/home/shor-ty/OpenFOAM/OpenFOAM-2.2.x/src/OpenFOAM/lnInclude -I/home/shor-ty/OpenFOAM/OpenFOAM-2.2.x/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64Gcc47DPOpt/phaseHydrostaticPressureFvPatchScalarField.o Tobi |
|
September 14, 2013, 16:25 |
|
#7 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi Tobi,
Did you modify any of the "wmake" rule files? And if you did, what exactly did you do? Best regards, Bruno
__________________
|
|
September 14, 2013, 17:01 |
|
#8 | |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Quote:
Problem solved. In the bashrc I used in v2 the Gcc47 instead of the Gcc47_v2. Now its working! I see the flags in the compilation lines! Thanks for all your support bruno. |
||
September 15, 2013, 15:30 |
Gnu compiler 4.7.2
|
#9 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Hi bruno,
Code:
~: gcc --version gcc (OpenFOAM) 4.7.2 Copyright (C) 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Now I am going to test it out. |
|
September 15, 2013, 16:16 |
|
#10 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Okay - OpenFOAM is now compiled with the normal standard settings!
Now I made the changes you told befor and I get the following message: Code:
shor-ty@cfd:~$ of22_v3 Warning in /home/shor-ty/OpenFOAM/OpenFOAM-2.2.x/etc/config/settings.sh: Unknown OpenFOAM compiler type 'Gcc47_v3' Please check your settings I think it depend on the fact, that I am using 4.7.2 now instead of the standard compiler of ubuntu. |
|
September 15, 2013, 16:22 |
|
#11 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Ooops! I forgot about this line of code in "etc/config/settings.sh": https://github.com/OpenFOAM/OpenFOAM...ttings.sh#L249
Code:
Gcc47 | Gcc47++0x) Code:
Gcc47* | Gcc47++0x)
__________________
|
|
September 15, 2013, 16:30 |
|
#12 | |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Quote:
Everything is working now ... Sometimes I should use my head but in that topic its hard for me to be sure that everything is correct then. . . |
||
September 15, 2013, 16:34 |
|
#13 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
So now I think its working good.
Still one question is remaining: MPI is compiled with other flags: Code:
gcc -O3 -DCOMMON_FILE_COMPRESS_GZ -DCOMMON_RANDOM_FIXED_SEED -DSCOTCH_RENAME -Drestrict=__restrict -I../../include -I../libscotch acpl.c -o acpl -L../../lib -lscotch -lscotch -lscotcherrexit -lz -lm -lrt gcc -O3 -DCOMMON_FILE_COMPRESS_GZ -DCOMMON_RANDOM_FIXED_SEED -DSCOTCH_RENAME -Drestrict=__restrict -I../../include -I../libscotch amk_ccc.c -o amk_ccc -L../../lib -lscotch -lscotch -lscotcherrexit -lz -lm -lrt gcc -O3 -DCOMMON_FILE_COMPRESS_GZ -DCOMMON_RANDOM_FIXED_SEED -DSCOTCH_RENAME -Drestrict=__restrict -I../../include -I../libscotch amk_fft2.c -o amk_fft2 -L../../lib -lscotch -lscotch -lscotcherrexit -lz -lm -lrt gcc -O3 -DCOMMON_FILE_COMPRESS_GZ -DCOMMON_RANDOM_FIXED_SEED -DSCOTCH_RENAME -Drestrict=__restrict -I../../include -I../libscotch amk_grf.c -o amk_grf -L../../lib -lscotch -lscotch -lscotcherrexit -lz -lm -lrt Code:
SOURCE=meshes/polyMesh/globalMeshData/globalPoints.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -O2 -march=bdver1 -pipe -mtune=bdver1 -DNoRepository -ftemplate-depth-100 -IMake/linux64Gcc47_v3DPOpt -IlnInclude -I. -I/home/shor-ty/OpenFOAM/OpenFOAM-2.2.x/src/OpenFOAM/lnInclude -I/home/shor-ty/OpenFOAM/OpenFOAM-2.2.x/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64Gcc47_v3DPOpt/globalPoints.o Thanks in advance Tobi |
|
September 15, 2013, 16:40 |
|
#14 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi Tobi,
Actually, the first block of output is regarding the build of the Scotch libraries and applications. Honestly, I don't think you need to bother much about the Scotch libraries, since it's only used in the decomposition processes. Best regards, Bruno
__________________
|
|
September 15, 2013, 16:45 |
|
#15 | |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Quote:
Code:
Note: ignore spurious warnings about missing mpicxx.h headers wclean mpi wmake libso mpi wmakeLnInclude: linking include files to ./lnInclude Making dependency list for source file UOPwrite.C Making dependency list for source file UIPread.C could not open file ompi/mpi/cxx/pmpicxx.h for source file UOPwrite.C Making dependency list for source file UPstream.C could not open file ompi/mpi/cxx/pop_inln.h for source file UOPwrite.C could not open file ompi/mpi/cxx/pgroup_inln.h for source file UOPwrite.C could not open file ompi/mpi/cxx/pstatus_inln.h for source file UOPwrite.C could not open file ompi/mpi/cxx/prequest_inln.h for source file UOPwrite.C could not open file ompi/mpi/cxx/pmpicxx.h for source file UIPread.C Making dependency list for source file PstreamGlobals.C could not open file ompi/mpi/cxx/pmpicxx.h for source file PstreamGlobals.C could not open file ompi/mpi/cxx/pmpicxx.h for source file UPstream.C could not open file ompi/mpi/cxx/pop_inln.h for source file UIPread.C could not open file ompi/mpi/cxx/pgroup_inln.h for source file UIPread.C could not open file ompi/mpi/cxx/pstatus_inln.h for source file UIPread.C could not open file ompi/mpi/cxx/prequest_inln.h for source file UIPread.C could not open file ompi/mpi/cxx/pop_inln.h for source file PstreamGlobals.C could not open file ompi/mpi/cxx/pgroup_inln.h for source file PstreamGlobals.C could not open file ompi/mpi/cxx/pstatus_inln.h for source file PstreamGlobals.C could not open file ompi/mpi/cxx/prequest_inln.h for source file PstreamGlobals.C could not open file ompi/mpi/cxx/pop_inln.h for source file UPstream.C could not open file ompi/mpi/cxx/pgroup_inln.h for source file UPstream.C could not open file ompi/mpi/cxx/pstatus_inln.h for source file UPstream.C could not open file ompi/mpi/cxx/prequest_inln.h for source file UPstream.C SOURCE=UOPwrite.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -O2 -march=bdver1 -pipe -mtune=bdver1 -DNoRepository -ftemplate-depth-100 -DOMPI_SKIP_MPICXX -I/usr/lib/openmpi/include -I/usr/lib/openmpi/include/openmpi -pthread -IlnInclude -I. -I/home/shor-ty/OpenFOAM/OpenFOAM-2.2.x/src/OpenFOAM/lnInclude -I/home/shor-ty/OpenFOAM/OpenFOAM-2.2.x/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64Gcc47_v3DPOptSYSTEMOPENMPI/UOPwrite.o SOURCE=UIPread.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -O2 -march=bdver1 -pipe -mtune=bdver1 -DNoRepository -ftemplate-depth-100 -DOMPI_SKIP_MPICXX -I/usr/lib/openmpi/include -I/usr/lib/openmpi/include/openmpi -pthread -IlnInclude -I. -I/home/shor-ty/OpenFOAM/OpenFOAM-2.2.x/src/OpenFOAM/lnInclude -I/home/shor-ty/OpenFOAM/OpenFOAM-2.2.x/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64Gcc47_v3DPOptSYSTEMOPENMPI/UIPread.o SOURCE=UPstream.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -O2 -march=bdver1 -pipe -mtune=bdver1 -DNoRepository -ftemplate-depth-100 -DOMPI_SKIP_MPICXX -I/usr/lib/openmpi/include -I/usr/lib/openmpi/include/openmpi -pthread -IlnInclude -I. -I/home/shor-ty/OpenFOAM/OpenFOAM-2.2.x/src/OpenFOAM/lnInclude -I/home/shor-ty/OpenFOAM/OpenFOAM-2.2.x/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64Gcc47_v3DPOptSYSTEMOPENMPI/UPstream.o SOURCE=PstreamGlobals.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -O2 -march=bdver1 -pipe -mtune=bdver1 -DNoRepository -ftemplate-depth-100 -DOMPI_SKIP_MPICXX -I/usr/lib/openmpi/include -I/usr/lib/openmpi/include/openmpi -pthread -IlnInclude -I. -I/home/shor-ty/OpenFOAM/OpenFOAM-2.2.x/src/OpenFOAM/lnInclude -I/home/shor-ty/OpenFOAM/OpenFOAM-2.2.x/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64Gcc47_v3DPOptSYSTEMOPENMPI/PstreamGlobals.o |
||
September 15, 2013, 17:44 |
|
#16 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Just a feedback:
FX-8150 (Normal tuning - not overclocked) and OpenFOAM-2.2.x: - Tutorial motorbike with 1 core: 292s 290s 290s | gcc 4.7.2 -O3 (standard) - Tutorial motorbike with 1 core: 271s 270s 270s | gcc 4.7.2 -O2 -march=bd1ver -mtune=bd1ver - Tutorial motorbike with 6 cores: 113s 111s | gcc 4.7.2 -O3 (standard) - Tutorial motorbike with 6 cores: 108s 108s | gcc 4.7.2 -O2 -march=bd1ver -mtune=bd1ver Bruno - at the end! Thanks a lot for your common help. Without you I would never think about the option of a other compilation Next week I will get my new server. After I set up everything I will build a more complex test case as the motorbike and make some test with different settings and give a feedback. |
|
September 25, 2013, 14:39 |
|
#17 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Hi all,
I just want let you know that my test benchmark geometry is ready for meshing In the attachment you find the geometry... I keep you posted. Tobi |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Compilation error for OpenFOAM-ext on Ubantu 10.04 32 bit | Sargam05 | OpenFOAM Installation | 13 | March 22, 2014 06:21 |
Compilation error with OF 2.1.x | GerhardHolzinger | OpenFOAM Installation | 5 | September 18, 2012 10:04 |
Compilation Error (V 1.7.1; Icc 12.1.0, OpenMPI 1.4.3) | floydfan | OpenFOAM Installation | 7 | December 20, 2011 06:56 |
errors during compilation and installation of OpenFOAM-1.7.x on Ubuntu 10.04 | ftec | OpenFOAM Installation | 7 | February 23, 2011 07:07 |
Compilation Error.... | Arnab | Siemens | 4 | September 12, 2004 16:54 |