Optimal OF compilation
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 |
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 |
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 |
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! |
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 |
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 |
Hi Tobi,
Did you modify any of the "wmake" rule files? And if you did, what exactly did you do? Best regards, Bruno |
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. |
Gnu compiler 4.7.2
Hi bruno,
Code:
~: gcc --version Now I am going to test it out. |
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 I think it depend on the fact, that I am using 4.7.2 now instead of the standard compiler of ubuntu. |
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) |
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. . . |
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 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 |
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 |
Quote:
Code:
Note: ignore spurious warnings about missing mpicxx.h headers |
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. |
1 Attachment(s)
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 |
All times are GMT -4. The time now is 05:54. |