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

Katec/derecho update #58

Merged
merged 18 commits into from
Nov 28, 2023
Merged

Katec/derecho update #58

merged 18 commits into from
Nov 28, 2023

Conversation

Katetc
Copy link
Contributor

@Katetc Katetc commented Oct 18, 2023

Adding build for Derecho, adding Gunter's changes to the python scripts.
Updates to old SLAP code to close issue #47 and issue #26 . Fixed missing use statement. Updated all tests to python 3.

Katetc and others added 18 commits November 19, 2021 16:42
This commit updates CISM to be python3 compatible and the test cases be bit for bit with the "python2" version of CISM with the exception of the ross test case which is not bit for bit for the creation in the netCDF input file. This is the last commit that will ensure bit for bit with code using python2.
The reason the ross case is not bit for bit depends on how some computation is now performed in Python3 and updated package version. In particular, for this test I did the following:
A. I made the number of decimal points be trimmed to 3 for the velocity variable in the python3 version
B. I manually specified the option dtype=float to the call to numpy.sin in the python3 version
Doing A and B lead to bit for bit results with python2 counterpart. However, doing the multiplication of the corrected instances in A and B (i.e., velocity*numpy.sin(azimuth, dtype=float)) did not lead to bit for bit results with the python2 counterpart.
This commit removes the bit-for-bit compatibility with python2. The reason is due to the
precision python3 writes to the config file which now contains more digits than python2.
This led to minor differences in the outputs.

This commit should be used as a new baseline for future code development comparison.
This commit contains additional changes towards adding flexibility for future
python release. In particular the option parser (which is deprecated since version 3.2)
is replaced by argument parser.
In the ISMIP-HOM test case, the plotISMIP_HOM.py had to be slightly modified:
a. The "reduce" function now needs to be imported from the "functools" module.
b. The "map" function now returns an object as opposed to a list. While this
had no big influences in this code, it did in the "read" function defined in this
script and it had to be replaced by a list comprehension on line 222. In addition
it seems that the map function in python2 could skip empty lines when reading through
a text file. It's no longer the case in python3 and I had to add a check on line 219
to avoid an error.
The Intel compiler has been taking a long time to build glide_io.F90.
Some testing showed that this is because 'use glide_types' and three other use statements
were repeated in each of a large number of accessor subroutines.
For some reason, this hasn't been an issue on the Gnu compiler.

I modified ../utils/generate_ncvars.py and ../libglimmer/ncdf_template.in
so that these 'use' statements appear only at the top of the glide_io module.

With this change, the Intel build time on derecho with 8 cores ('make -j 8')
decreases from about 4:40 to 1:10, a welcome improvement.
Removed redundant 'use' statements that slowed the Intel build
@Katetc Katetc merged commit ab9de2c into main Nov 28, 2023
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.

None yet

3 participants