Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intl fortran compilation #1

Open
XavierGarcia-pfk opened this issue May 30, 2024 · 4 comments
Open

Intl fortran compilation #1

XavierGarcia-pfk opened this issue May 30, 2024 · 4 comments
Assignees

Comments

@XavierGarcia-pfk
Copy link

Hi. I managed to compile the code with gcc but with the intel version I get the following error:
MPI/Main_MPI.f90(2414): error #6405: The same named entity from different modules and/or program units cannot be referenced. [KERNELC_GETDEVNUM]
size_gpu = kernelc_getDevNum()
------------------------^
compilation aborted for MPI/Main_MPI.f90 (code 1)

I don't know if you have seen it before. A variable that you use has the same name as a variable that gets loaded from a include. Doesn't seem to bother GCC thou.
Let me know if you need help with this. I don't mind getting my hands "dirty".
Xavi

@dong-hao
Copy link
Owner

dong-hao commented Jun 3, 2024

Hi Xavier!

Great to hear from you again. Glad to know that you managed to make things work with the GPU version! Yes, those NVIDIA libs and modules can be quite a hassle to setup.

And thanks a lot for raising the issue - yes, Anna (Kelbert) has experienced a same, or at least similar problem, which I have addressed in the original SVN repo of ModEM:

...to deal with this, one should simply (and completely) remove the cuda-c reference of getDevNum
in cudaFortMap.f90, as we already defined that at Declarition_MPI.f90 because currently the GPU
is bind to the MPI version of ModEM - still, I will need to think carefully about this and decide
where I should put it - as I believe the GPU can be used without MPI in ModEM (there is no direct
dependency on any MPI lib for the GPU calculations)...

I hesitated to apply this fix to the GitHub as I described that repo as a “snapshot”, which is expected to be “as is” when we submit the manuscript. But I guess maybe I should at least point people to the right direction.

So yes, if one wants to suppress this problem, just delete the lines from 1391 to 1397 for the fortran-c binding:

! kernelc_getDevNum
integer(c_int) function kernelc_getDevNum() &
& bind (C, name="kernelc_getDevNum" )
use iso_c_binding
implicit none
! get the number of GPU devices
end function kernelc_getDevNum

Cheers,
Hao

@dong-hao dong-hao self-assigned this Jun 3, 2024
@akelbert
Copy link
Collaborator

akelbert commented Jun 3, 2024

Hi Hao - thank you for responding to Xavier's question!

I'll be working to get our internal ModEM version to an open-source repository, but it may take another six months to a year for various reasons. Primarily, I will need to integrate Naser's latest version with ours so that I only need to maintain one code, not multiple. In the meantime, maybe it makes sense to incorporate fixes to this release to ensure that it is usable. Any improvements can later be included into the centralized version.

Best wishes,
Anna

@dong-hao
Copy link
Owner

dong-hao commented Jun 5, 2024

Hi Anna,

Good to know that you are working on an integrated version - yes, It will be the best if we can work from a single version, which probably also reduces your efforts for the maintenance, in the long run. It's no hurry to do it "now", but we may want to discuss a sort of "roadmap" thingy for future plans on the code, licenses, etc.

OK, I can try to incorporate the basic fix. But note that the SVN version is still the most tested and patched one, for now. As ModEM is by far the most popular 3D code in EM geophysics, I would be happy to see more community inputs, from user/developers like Xavier.

Cheers,
Hao

@pankajkmishra
Copy link

Hi Xavi,
I have compiled this with cuda-12.2 and intel and I remember some compilation error with an older cuda. Not sure if it helps but just in case

Cheers,
Pankaj

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants