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

Insert OpenMP directive, single, around allocation region of module level variables #1109

Merged
merged 12 commits into from
Mar 9, 2023

Conversation

ganganoaa
Copy link
Contributor

@ganganoaa ganganoaa commented Jan 18, 2023

Description
This update relates to race condition due to multiple threads accessing module level variables, 'e', 'g', 'cc', and 'bb' at the same time. The OpenMP directive, 'single', is inserted around the deallocation/allocation regions to avoid the race condition.

Fixes #1108

How Has This Been Tested?
The update was tested with 'make check' and 'make distcheck' without any issues on OS, 'CentOS Stream 8'. The following setup was used for compiler, MPI wrapper, and required packages:

  • oneapi v2022.2
  • hdf5 v1.12.0
  • tbb v2021.6.0
  • oclfpga v2022.1.0
  • netcdf v4.8.0
  • mpi v2021.6.0 (Intel(R) MPI Library 2021.6)
  • compiler-rt v2022.1.0
  • compiler v2022.1.0

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • New check tests, if applicable, are included
  • make distcheck passes

@ganganoaa ganganoaa changed the title Updated module level variables to local variables to the subroutine Insert OpenMP directives around allocation region of module level variables Feb 10, 2023
@ganganoaa ganganoaa changed the title Insert OpenMP directives around allocation region of module level variables Insert OpenMP directive, _single_, around allocation region of module level variables Feb 10, 2023
@ganganoaa ganganoaa changed the title Insert OpenMP directive, _single_, around allocation region of module level variables Insert OpenMP directive, single, around allocation region of module level variables Feb 10, 2023
@rem1776 rem1776 merged commit 0ff254e into NOAA-GFDL:main Mar 9, 2023
uramirez8707 added a commit to uramirez8707/FMS that referenced this pull request Apr 6, 2023
* fix - gnu and pgi issue with class(*) in send_data3d (NOAA-GFDL#1149)

* feat: extend `string` interface in `fms_string_utils_mod` (NOAA-GFDL#1142)

* fix: add omp directives for race condition in tridiagonal (NOAA-GFDL#1109)

* fix: missing if statement in PR NOAA-GFDL#1149 (NOAA-GFDL#1155)

* fix: time_manager missing changes from year to yr, month to mo, day to dy (NOAA-GFDL#1169)

* chore: update changelog and version numbers for release (NOAA-GFDL#1167)

* chore: append dev to version number post-release (NOAA-GFDL#1179)

---------

Co-authored-by: Niki Zadeh <niki.zadeh@noaa.gov>
Co-authored-by: Jesse Lentz <42011922+J-Lentz@users.noreply.github.com>
Co-authored-by: ganganoaa <121043264+ganganoaa@users.noreply.github.com>
Co-authored-by: MiKyung Lee <58964324+mlee03@users.noreply.github.com>
Co-authored-by: Ryan Mulhall <35538242+rem1776@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

Race condition in tridiagonal
2 participants