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

Build error on MPAS-LI with PGI compiler on Summit #2862

Closed
minxu74 opened this issue Apr 16, 2019 · 8 comments · Fixed by #3498
Closed

Build error on MPAS-LI with PGI compiler on Summit #2862

minxu74 opened this issue Apr 16, 2019 · 8 comments · Fixed by #3498

Comments

@minxu74
Copy link
Contributor

minxu74 commented Apr 16, 2019

There is a build error when comping MPAS-LI on Summit, The error message is as follows:

PGF90-S-0000-Internal compiler error. items were added to sem.p_dealloc but not freed       0  (mpas_li_subglacial_hydro.f90: 1288)

The test name is SMS.T62_oQU120_ais20.MPAS_LISIO_TEST.summit_pgi. I have tried PGI/18.7, 18.10 and 19.1 on Summit and got the same error.

@singhbalwinder
Copy link
Contributor

@minxu74 : I confirmed that I get the same build error on Compy with PGI 18.10. It works fine with the Intel compiler.

@minxu74
Copy link
Contributor Author

minxu74 commented Apr 18, 2019

@singhbalwinder Cool! Thanks a lot for the confirmation.

@matthewhoffman
Copy link
Contributor

@minxu74 or @singhbalwinder , are you able to report what line 1288 of mpas_li_subglacial_hydro.f90 is? The .f90 files are preprocessed versions of the .F files in the repo, so it's not clear exactly what line I should be looking at. I don't have access to Summit or Compy yet, so I'm not able to try to reproduce this error myself yet.

@minxu74
Copy link
Contributor Author

minxu74 commented Jul 31, 2019

@matthewhoffman The 1288 is the line of "end subroutine", it seems not very useful.

1274       waterPressure = max(0.0_RKIND, waterPressure)
1275       waterPressure = min(waterPressure, rhoi * gravity * thickness)
1276       ! set pressure correctly under floating ice and open ocean
1277       where ( (li_mask_is_floating_ice(cellMask)) .or. &
1278               ((.not. li_mask_is_ice(cellMask)) .and. (bedTopography < config_sea_level) ) )
1279          waterPressure = rhoo * gravity * (config_sea_level - bedTopography)
1280       end where
1281 
1282       waterPressureTendency = (waterPressure - waterPressureOld) / deltatSGH
1283 
1284       call calc_pressure_diag_vars(block, err_tmp)
1285       err = ior(err, err_tmp)
1286 
1287    !--------------------------------------------------------------------
1288    end subroutine calc_pressure

@matthewhoffman
Copy link
Contributor

@minxu74 , thanks for posting that. That's what I was afraid of! :)

@matthewhoffman
Copy link
Contributor

I can't find anything obviously wrong with that subroutine or the code that calls it. My understanding is that an internal compiler error is most likely a bug in the compiler, and sem.p_dealloc is most likely an internal data structure used by the compiler. I'm not sure how to proceed in trying to debug this without input from a PGI developer. @minxu74 , @singhbalwinder , @rljacob , do we have any PGI developer contacts (e.g. supporting roll-out on Summit) that we could ask for help with this?

matthewhoffman added a commit to MPAS-Dev/MPAS-Model that referenced this issue Feb 25, 2020
…e/develop

Replace WHERE with DO loops in landice for PGI v19.10.

Fixes E3SM-Project/E3SM#2862

[BFB]

* amametjanov/azamat/landice/replace-where-with-do-loops:
  Replace WHERE with DO loops in landice for PGI
matthewhoffman added a commit to MPAS-Dev/MPAS-Model that referenced this issue Mar 13, 2020
Replace WHERE with DO loops in landice for PGI v19.10.

Fixes E3SM-Project/E3SM#2862

[BFB]

* commit '85494bca':
  Replace WHERE with DO loops in landice for PGI
jonbob added a commit that referenced this issue Mar 16, 2020
#3498)

Replace WHERE with DO loops in landice for PGI v19.10

This PR brings in a new mpas-source submodule that has changes only in
the landice core that replaces WHEREs with DO loops for PGI v19.10.

Fixes #2862

[BFB]
@jonbob jonbob closed this as completed in 477faf4 Mar 18, 2020
@matthewhoffman
Copy link
Contributor

@amametjanov , does this mean that we should not use where-constructs from now on? I'm guessing that is not the case, because I still see quite a few where-constructs in the code. How were these specific where-constructs identified as problematic? I just want to make sure we don't add new code that triggers this same problem.

@philipwjones
Copy link
Contributor

@matthewhoffman - @amametjanov can comment on the specifics for these loops, but as a general practice, explicit loops are both safer and more performant. You might think the compiler would translate into identical code behind the scenes and that should be the case in many situations, but sometimes when attempting to optimize a where construct, the compiler might calculate both true/false branches or precompute array masks that lead to computations on garbage data and create problems. In the older POP model, we eventually had to replace all where's with explicit loops. Not something you need to do right away, but when opportunities present, you might think about the same.

mark-petersen pushed a commit to mark-petersen/MPAS-Model that referenced this issue Jan 16, 2021
…e/develop

Replace WHERE with DO loops in landice for PGI v19.10.

Fixes E3SM-Project/E3SM#2862

[BFB]

* amametjanov/azamat/landice/replace-where-with-do-loops:
  Replace WHERE with DO loops in landice for PGI
jgfouca pushed a commit that referenced this issue Jun 26, 2024
…o-submodules

Update haero/mam4xx submodules
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants