handle Fujitsu compiler
Issue raised as a github spack issue.
From the changes, the Fujitsu compiler seems to be a pure clang derivative. If so, we might try something like the following:
WM_COMPILER=Clang10Fujitsu
Within the rules setup, the compiler-family is determined by stripping out numbers etc (this could be modified to look nicer).
COMPILER_FAMILY = $(shell echo "$(WM_COMPILER)" | sed -e 's/[0-9].*//')
Within the rules/linuxARM64Clang/general
we could then add in some custom handling. For example,
# Override compiler calls for fujitsu compiler
ifneq (,$(findstring jitsu,$(WM_COMPILER)))
cc = fjclang
CC = fjclang++-10 -std=c++11
endif
Activity
- Author Maintainer
Note that the include for the specialised rules should be conditional - only include if the compiler is not identical to the compiler-family
- Mark OLESEN changed title from handle Fujistu compiler to handle Fujitsu compiler
changed title from handle Fujistu compiler to handle Fujitsu compiler
Thanks @mark for considering this fix. It is necessary to replace the compiler name in Spack, but I think this is a realistic fix.
I correct some compiler command names.
# Override compiler calls for fujitsu compiler ifneq (,$(findstring Fujitsu,$(WM_COMPILER))) cc = fcc CC = FCC -std=c++11 endif
- Author Maintainer
Discussed internally, will add in
linuxARM64Fujitsu
rules. - Author Maintainer
Hi @t-karatsu
Sorry if the last note sounded impolite. There was a slight overlap in messages. I posted my comment on an old window (multi-tasking) and didn't see your note. In the meantime I've also updated your spack patch on github.
With the modifications, I think that your patch for spack is good for merging (after testing) and will not collide with what we are doing here. I would then make the Fujitsu modifications in the develop branch instead of as a bugfix for 1912. I would still like to work together with you getting any optimization settings done properly. For example, is there a fast-math or performance libraries (like the armclang compiler)? How about openmp support? Do we need to use
-lomp
(like darwin) or is-lgomp
fine?Edited by Mark OLESEN - Mark OLESEN mentioned in commit 4200774d
mentioned in commit 4200774d
- Mark OLESEN mentioned in commit e1586bda
mentioned in commit e1586bda
Hi @mark I commented on the Spack pull request. There was no problem in checking the installation openfoam, thank you.
I would still like to work together with you getting any optimization settings done properly.
About the options for optimization, we would like to get the formal opinion from the members who are responsible for the compiler development. So I'm sorry, but please give me some more time for this answer.
- Author Maintainer
Hi @t-karatsu - no worries. The compiler configurations do not affect much of the code core (usually), so we can put them in later. However, it would be good to get them done in the next month so that they are in the June release.
Hello, @mark. I confirmed opinions about the build optimization from the compiler development members.
First, the Fujitsu compiler supports openmp. You can specify the
-fopenmp
option.Next, The fast-math or performance libraries are as follows.
- The following options are available to use the Fujitsu math library.
-SSL2
: Fujitsu math library + BLAS/LAPACK (sequential)
-SSL2BLAMP
: Fujitsu math library + BLAS/LAPACK (multithread parallel version: like-mp
option)
Any option suitable for OpenFOAM is available. Any thoughts on which one is right for OpenFOAM? - Besides, you can use the
-ffp-contract=fast
and-ffast-math
options that are also used by the Arm compiler.
However, there was also an opinion from the developer that there was concern about calculation accuracy errors. Is the effect of specifying these options on the calculation results of OpenFOAM acceptable? Please let me know if you have any opinions.
As a result,
Safe options:-O3 -SSL2(or -SSL2BLAMP)
More optimizable options:-O3 -SSL2(or -SSL2BLAMP) -ffp-contract=fast -ffast-math
- The following options are available to use the Fujitsu math library.
- Author Maintainer
- Is the Fujitsu math library always shipped with the compiler installation? Or is this an additional add-on that might be missing on some systems?
- does the openmp link with omp, or gomp?
For fast-math, probably makes sense to use whatever the armclang compiler uses.
Edited by Mark OLESEN - Author Maintainer
@t-karatsu - Any updated information?
In case I wasn't clear enough about the openmp, there is a
-fopenmp
switch but in some cases (all cases?) it is also necessary to define the library linkage. This is either-lomp
or GNU-compatible-lgomp
.Edited by Mark OLESEN @mark
I'm sorry for the late reply. Could you please give me a little more time as I check with the compiler development team? I'm checking with compiler development team because there are some questions I can't answer right away.- Author Maintainer
@t-karatsu - thanks!
Was off for a few days, but back now.
Edited by Mark OLESEN - Author Maintainer
Hi @t-karatsu - any last minute updates? Will be releasing next week.
@mark
I am very sorry for the late reply...
We have answers from the compiler development team so we'll answer your questions.Is the Fujitsu math library always shipped with the compiler installation? Or is this an additional add-on that might be missing on some systems?
Yes, the Fujitsu compiler and the Fujitsu math library are provided together.
does the openmp link with omp, or gomp?
No. Fujitsu's own library "libfjomp" is linked.
For fast-math, probably makes sense to use whatever the armclang compiler uses.
I understand. Select the options that the Fujitsu compiler can use from the options used by armclang, and the result is as follows.
C++: -ffp-contract=fast -ffast-math -O3 -funsafe-math-optimizations
C : -ffp-contract=fast -ffast-math -O3Edited by Tomoki, Karatsu- Mark OLESEN mentioned in commit 3c2726ac
mentioned in commit 3c2726ac
- Author Maintainer
Hi @t-karatsu, No worries about the delay, I know that things take longer than anyone expects. Probably not as easy to get in contact with the right people during Corona times either.
I made the changes (commit 3c2726ac). You should be able to simply copy across and test. It would be good if you could do that. I am wary of making changes when I cannot properly test things.
Thank you very much,
/mark
I tested the build with the following minimal steps using the upstream source code.
And I was able to build with the expected compile command and options.-
Modified ./etc/bashrc
68 # [WM_COMPILER] - Compiler:
69 # = Gcc | Clang | Icc | Cray | Amd | Arm | Pgi | Fujitsu |
70 # Gcc | Clang
71 export WM_COMPILER=Fujitsu
~
86 # [WM_MPLIB] - MPI implementation:
87 # = SYSTEMOPENMPI | OPENMPI | SYSTEMMPI | MPI | MPICH | MPICH-GM |
88 # HPMPI | CRAY-MPICH | FJMPI | QSMPI | SGIMPI | INTELMPI | USERMPI
89 # Also possible to use INTELMPI-xyz etc and define your own wmake rule
90 export WM_MPLIB=USERMPI -
Make following files.
./etc/config.sh/mpi-user
./wmake/rules/linuxARM64Fujitsu/mplibUSER
./wmake/rules/linuxARM64Fujitsu/mplibUSERMPI -
Execute following commands.
$ source ./etc/bashrc
$ ./Allwmake
Thank you very much @mark!
-
- Mark OLESEN mentioned in commit 01f8ea9d
mentioned in commit 01f8ea9d