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

[Fortran] Use mpi_f08 module to fix Intel compiler warnings #539

Merged
merged 1 commit into from
Nov 24, 2021

Conversation

SFrijters
Copy link
Contributor

Description

Intel compiler version 19.1.0.20200306 (and above, presumably) complains:

error #8889: Explicit declaration of the EXTERNAL attribute is required

This can be solved by using the newer mpi_f08 module and accompanying newer datatypes.

Open question: if this change is acceptable, should https://github.com/libocca/occa/blob/main/scripts/compiler/fortranCompilerSupportsMPI.f90 also use mpi_f08?

Alternative: add -warn noexternal to compiler flags to suppress the warning (this was the 'fix' I had in place locally before trying to actually fix it).

@codecov
Copy link

codecov bot commented Nov 22, 2021

Codecov Report

Merging #539 (9a61ea6) into main (88e30e0) will decrease coverage by 0.03%.
The diff coverage is 0.00%.

❗ Current head 9a61ea6 differs from pull request most recent head 9501c78. Consider uploading reports for the commit 9501c78 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main     #539      +/-   ##
==========================================
- Coverage   76.59%   76.56%   -0.04%     
==========================================
  Files         263      263              
  Lines       19472    19480       +8     
==========================================
  Hits        14915    14915              
- Misses       4557     4565       +8     
Impacted Files Coverage Δ
src/c/base.cpp 85.22% <0.00%> (-1.99%) ⬇️
src/core/device.cpp 90.40% <0.00%> (-2.23%) ⬇️

@SFrijters SFrijters force-pushed the bugfix-f90-mpi-test-intel branch from 42f014c to 04420ba Compare November 23, 2021 17:03
@kris-rowe
Copy link
Member

Looks good.

Open question: if this change is acceptable, should https://github.com/libocca/occa/blob/main/scripts/compiler/fortranCompilerSupportsMPI.f90 also use mpi_f08?

Using the mpi_f08 module is safer anyway since it uses explicit interfaces, allowing for type checking. One possible caution against blanket changing this could be if someone is using an older version of OpenMPI or MPICH that doesn't include the mpi_f08 module.

It would probably be safest to have a second fortranCompilerSupportsMPIF08.f90 file for shellTools.sh to use. That being said, after a quick grep through the code it doesn't appear that fCompilerSupportsMPI in shellTools.sh is called anywhere currently— so maybe that can go on the backburner for now.

@SFrijters
Copy link
Contributor Author

SFrijters commented Nov 23, 2021

That pretty much follows my thought process exactly.
Do you know what the intended use of fCompilerSupportsMPI is? I mean, apart from the obvious blanket 'checking if the fortran compiler supports MPI'.

@kris-rowe
Copy link
Member

Most of the functions in shellTools.sh are used by the Makefile build system.

@SFrijters SFrijters force-pushed the bugfix-f90-mpi-test-intel branch from 04420ba to 9a61ea6 Compare November 24, 2021 16:37
Intel compiler version 19.1.0.20200306 (and above, presumably) complains:

error #8889: Explicit declaration of the EXTERNAL attribute is required

This can be solved by using the newer mpi_f08 module and accompanying
newer datatypes.
@SFrijters SFrijters force-pushed the bugfix-f90-mpi-test-intel branch from 9a61ea6 to 9501c78 Compare November 24, 2021 16:39
@kris-rowe kris-rowe merged commit b07ec0b into libocca:main Nov 24, 2021
@SFrijters SFrijters deleted the bugfix-f90-mpi-test-intel branch June 8, 2022 10:27
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

Successfully merging this pull request may close these issues.

2 participants