-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Port to flang and F90 compliance of madgraph fortran codebase #804
Comments
valassi
added a commit
to valassi/madgraph4gpu
that referenced
this issue
Jan 27, 2024
…xe using $FC=gfortran on LUMI/HIP madgraph5#802 Otherwise the link was failing using gfortran /opt/cray/pe/gcc/12.2.0/snos/bin/gfortran -o runTest.exe ./CPPProcess.o ./MatrixElementKernels.o ./BridgeKernels.o ./CrossSectionKernels.o ./CommonRandomNumberKernel.o ./RamboSamplingKernels.o ./testxxx.o ./testmisc.o ./runTest.o ./gCPPProcess.o ./gMatrixElementKernels.o ./gBridgeKernels.o ./gCrossSectionKernels.o ./gCommonRandomNumberKernel.o ./gRamboSamplingKernels.o ./testxxx_cu.o ./testmisc_cu.o ./runTest_cu.o -ldl -L../../lib -lmg5amc_common -L../../../../../test/googletest/install_gcc12.2.0/lib64/ -lgtest -lgtest_main -Xlinker -rpath='$ORIGIN/../../lib' -lstdc++ -L/opt/rocm-5.2.3/llvm/bin/../../lib -lamdhip64 /usr/bin/ld: ../../../../../test/googletest/install_gcc12.2.0/lib64//libgtest.a(gtest-all.cc.o): undefined reference to symbol 'pthread_setspecific@@GLIBC_2.2.5' /usr/bin/ld: /lib64/libpthread.so.0: error adding symbols: DSO missing from command line I went back to gfortran because flang gives too many F90 errors on madevent madgraph5#804
valassi
added a commit
to valassi/madgraph4gpu
that referenced
this issue
Jan 27, 2024
…gtt.mad, after adding pthread in the link madgraph5#802 Note, the log was created with mad so there was no need to copy it LUMI setup is now the following, using again gcc and gfortran (I dropped flang because of f90 issues madgraph5#804 in madevent) module load cray-python module load gcc/12.2.0 export FC=`which gfortran` export PATH=~/CCACHE/ccache-4.8.2-INSTALL/bin:$PATH export CCACHE_DIR=~/CCACHE/ccache export USECCACHE=1 Note, as in previous tests, HIP_HOME is automatically determined as /usr (hipcc is in /usr/bin/hipcc)
valassi
added a commit
to valassi/madgraph4gpu
that referenced
this issue
Jan 27, 2024
…)... why? due to link issues madgraph5#802 again? LUMI setup is now the following, using again gcc and gfortran (I dropped flang because of f90 issues madgraph5#804 in madevent) module load cray-python module load gcc/12.2.0 export FC=`which gfortran` export PATH=~/CCACHE/ccache-4.8.2-INSTALL/bin:$PATH export CCACHE_DIR=~/CCACHE/ccache export USECCACHE=1
valassi
added a commit
to valassi/madgraph4gpu
that referenced
this issue
Jan 27, 2024
… when linking runTest.exe using $FC=gfortran on LUMI/HIP madgraph5#802 Otherwise the link was failing using gfortran /opt/cray/pe/gcc/12.2.0/snos/bin/gfortran -o runTest.exe ./CPPProcess.o ./MatrixElementKernels.o ./BridgeKernels.o ./CrossSectionKernels.o ./CommonRa> /usr/bin/ld: ../../../../../test/googletest/install_gcc12.2.0/lib64//libgtest.a(gtest-all.cc.o): undefined reference to symbol 'pthread_setspecific@@> /usr/bin/ld: /lib64/libpthread.so.0: error adding symbols: DSO missing from command line I went back to gfortran because flang gives too many F90 errors on madevent madgraph5#804
valassi
added a commit
to valassi/madgraph4gpu
that referenced
this issue
Sep 20, 2024
… hipcc to link fcheck_hip.exe Revert "[helas] in gg_tt.mad cudacpp.mk, temporarely go back and try to use hipcc instead of gfortran to link fcheck_hip.exe: this links but it fails at runtime, will revert" This reverts commit 988419b. NOTE: I tried to use FC=hipcc and this also compiles the fortran ok! Probably it internally uses flang from llvm madgraph5#804 The problem however is that there is no lowercase 'main' in fcheck_sa_fortran.o, only an uppercase 'MAIN_'. Summary of the status" HELINL=L "rdc" is not supported on our AMD GPUs for now.
valassi
added a commit
to valassi/madgraph4gpu
that referenced
this issue
Sep 21, 2024
… hipcc to link fcheck_hip.exe Revert "[helas] in gg_tt.mad cudacpp.mk, temporarely go back and try to use hipcc instead of gfortran to link fcheck_hip.exe: this links but it fails at runtime, will revert" This reverts commit 988419b. NOTE: I tried to use FC=hipcc and this also compiles the fortran ok! Probably it internally uses flang from llvm madgraph5#804 The problem however is that there is no lowercase 'main' in fcheck_sa_fortran.o, only an uppercase 'MAIN_'. Summary of the status" HELINL=L "rdc" is not supported on our AMD GPUs for now.
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Hi @oliviermattelaer , as part of PR #801 for porting to LUMI with AMD GPUs, I am experimenting with flang as a fortran compiler.
(I am using flang because I get several issues with gfortran... linking c++, fortran and hip code seems rather complex, see for instance #802).
I managed to use the /opt/rocm/llvm/bin/flang compiler for the standalone code, where there is very limited fortran. But the moment I try building madevent, it's just a catastrophe (see below*).
I guess that this flang does not support F77, or at least all the legacy f77 stuff in madevent. This is not a blocker per se, but something to keep in mind. I think flang looks like the future of fortran compilers. Maybe more features will be added, maybe not.
In my understanding (I may be wrong), the flang I am testing is the "new flang" aka f18, a rewrite from the grounds up of the flang compiler in c++. See https://github.com/llvm/llvm-project/blob/main/flang/README.md#getting-started. The features supported are here I think https://github.com/llvm/llvm-project/blob/main/flang/docs/Extensions.md. (For comparison, the "old flang" or "classic flang" is here https://github.com/flang-compiler/flang).
I am trying to check if I can do anything with it, but I guess on LUMI we need to go back to gfortran and massage all link issues. (@Jooorgen in case you read this, any suggestion on what combination to use? thanks)
Andrea
PS *One example, for myamp
The text was updated successfully, but these errors were encountered: