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

Spack package to add build options for CICE5 in esm1.6 #173

Merged
merged 2 commits into from
Dec 16, 2024

Conversation

anton-seaice
Copy link
Contributor

@harshula

When I try to use this package, it builds the wrong executable

I run

spack install [email protected]=access-esm1.6%[email protected]

and it builds the executable for access-cm2 ?

From the spack-build-out.txt file, I can see that spack is sending the wrong arguments to spack-build.sh :

==> cice5: Executing phase: 'build'
==> [2024-11-29-11:34:55.729889] '/g/data/tm70/as2285/spack0.22/spack/var/spack/environments/esm1_5/cice5/bld/spack-build.sh' 'access-cm2' '360x300' '12x1' '12'

Any ideas ?

@anton-seaice
Copy link
Contributor Author

I think the issue is the use of strings as versions ...

Reading the spack docs, on version comparison, I think 'access-esm1.6' is > 'access-cm2' because e>c ... Which is pretty confusing.

Reording the with statements could fix the problem, but is pretty confusing ... I am inclined to use variants instead ?

packages/cice5/package.py Outdated Show resolved Hide resolved
packages/cice5/package.py Outdated Show resolved Hide resolved
packages/cice5/package.py Outdated Show resolved Hide resolved
packages/cice5/package.py Outdated Show resolved Hide resolved
packages/cice5/package.py Outdated Show resolved Hide resolved
@anton-seaice
Copy link
Contributor Author

anton-seaice commented Dec 5, 2024

@harshula - I made the suggested changes, but it didn't generate the __targets correctly

I moved the __targets to the build() step and now it works

For access-om2, see the pre-release for this version of spack-packages:
ACCESS-NRI/ACCESS-OM2#88

The pre-release folder contains the 4 expected cice5 executables for access-om2. The repro test for this is running.

For the future access-esm1.6, in my local instance this works.

It solves correctly (i.e. doesn't try to include libaccessom2 which is only needed for the master version ) :

Input spec
--------------------------------
 -   [email protected]

Concretized
--------------------------------
 -   [email protected]=access-esm1.6%[email protected]~deterministic~optimisation_report build_system=makefile dev_path=/g/data/tm70/as2285/spack0.22/environments/esm1_5/cice5 arch=linux-rocky8-x86_64_v4
[+]      ^[email protected]%[email protected] build_system=autotools patches=80b9577 arch=linux-rocky8-x86_64_v4
[e]      ^[email protected]%[email protected] build_system=autotools arch=linux-rocky8-x86_64_v4
[+]      ^[email protected]%[email protected]~guile build_system=generic arch=linux-rocky8-x86_64_v4
[+]      ^[email protected]%[email protected]~blosc~byterange~dap~fsync~hdf4~jna+mpi~nczarr_zip+optimize~parallel-netcdf+pic+shared~szip~zstd build_system=autotools arch=linux-rocky8-x86_64_v4
[+]          ^[email protected]%[email protected]~cxx~fortran+hl~ipo~java+mpi+shared~szip~threadsafe+tools api=default build_system=cmake build_type=Release generator=make arch=linux-rocky8-x86_64_v4
[e]              ^[email protected]%[email protected]~doc+ncurses+ownlibs build_system=generic build_type=Release arch=linux-rocky8-x86_64_v4
[+]              ^[email protected]%[email protected] build_system=autotools arch=linux-rocky8-x86_64_v4
[+]              ^[email protected]%[email protected]+compat+new_strategies+opt+pic+shared build_system=autotools arch=linux-rocky8-x86_64_v4
[+]      ^[email protected]%[email protected]~doc+pic+shared build_system=autotools patches=b050dbd arch=linux-rocky8-x86_64_v4
[+]      ^[email protected]_2024.05.24=access-esm1.5%[email protected]~deterministic~optimisation_report build_system=makefile arch=linux-rocky8-x86_64_v4
[e]      ^[email protected]%[email protected]~atomics~cuda~cxx~cxx_exceptions~gpfs~internal-hwloc~internal-libevent~internal-pmix~java~legacylaunchers~lustre~memchecker~openshmem~orterunprefix~romio+rsh~singularity~static+vt+wrapper-rpath build_system=autotools fabrics=none patches=073477a,60ce20b romio-filesystem=none schedulers=none arch=linux-rocky8-x86_64_v4

and generates the one expected executable:

cice_access-esm1.6_360x300_12x1_12p.exe

@anton-seaice
Copy link
Contributor Author

New build is bitwise reproducible with the old, see ACCESS-NRI/access-om2-configs#151 (comment)

@anton-seaice anton-seaice marked this pull request as ready for review December 5, 2024 00:51
@anton-seaice
Copy link
Contributor Author

Closes #156

@harshula
Copy link
Collaborator

harshula commented Dec 5, 2024

@harshula - I made the suggested changes, but it didn't generate the __targets correctly
I moved the __targets to the build() step and now it works

Did it generate the targets correctly before you made the suggested changes?

@anton-seaice
Copy link
Contributor Author

@harshula - I made the suggested changes, but it didn't generate the __targets correctly
I moved the __targets to the build() step and now it works

Did it generate the targets correctly before you made the suggested changes?

No - see first comment in the PR.

@harshula
Copy link
Collaborator

harshula commented Dec 5, 2024

Thanks for the clarification. It is best to avoid declaring member variables (self.__targets = __targets) from a member function. Ideally, the targets data structure should be declared after the class declaration. I'll look into whether with when() allows variable declaration/definition. This might be a with when() limitation.

@anton-seaice
Copy link
Contributor Author

Ok thanks. The targets are only used in the build function, so it could just me a local
Variable instead of a member variable

@harshula
Copy link
Collaborator

harshula commented Dec 5, 2024

No, it is also used in the install member function.

@anton-seaice anton-seaice changed the title Cice5 esm1p6 Spack package to add build options for CICE5 in esm1.6 Dec 13, 2024
@anton-seaice
Copy link
Contributor Author

Hi @ofa001 - just confirming a couple of science build settings for CICE5 in access-esm1.6

I have set these two lines:

Zero layer ice:
setenv NICELYR 1 #1 for ktherm=0, zero-layer thermodynamics

No BGC tracers:
setenv TRBGCS 0

Is 5 thickness categories and 1 snow layer correct ? Do these two lines need changing?:

setenv NSNWLYR    1       # number of vertical layers in the snow
setenv NICECAT    5       # number of ice thickness categories

This is set to build with 12 tasks (to match esm1.5) but also will build a version with 16 tasks if needed. (Obviously these can be refined in the future).

@anton-seaice
Copy link
Contributor Author

@harshula this is ready for review.

Produced two binaries expected:

$ ls /g/data/tm70/as2285/spack0.22/restricted/ukmo/release/linux-rocky8-x86_64_v4/intel-19.0.3.199/cice5-git.access-esm1.6_access-esm1.6-nipftaviflymvjbwuxhzqycxpfucyexn/bin/
cice_access-esm1.6_360x300_12x1_12p.exe  cice_access-esm1.6_360x300_8x2_16p.exe

@ofa001
Copy link

ofa001 commented Dec 15, 2024

HI @anton-seaice @harshula, @DaveBi is holding off finishing the coupling the work as I understand to the New Year whilst he gets the cice4 version with the icebergs linked up with Pearce's Generic tracer for the test run's in Rachel's table. So whilst your settings for cice5 ice thickness categoriex and snow ice layers are thin Anton, it wont run, not sure it can pick tha tit doesnt have the correct links in to the UM in this spack set up as I am not sure how sophisticated it is. We can talk about it at the mini-hackathon tomorrow if you are around.

@anton-seaice
Copy link
Contributor Author

Thanks @ofa001 - this is just build infrastructure, I am just making sure its ready / available so we can build the model so the cice code can be updated.

So whilst your settings for cice5 ice thickness categoriex and snow ice layers are thin Anton

What did you mean here ? We can change these compile time options later ofcourse, but its good if they are close now.

@ofa001
Copy link

ofa001 commented Dec 16, 2024

Sorry @anton-seaice, I was distracted, I had someone here fixing my aircon, I meant "fine"

@harshula harshula added the enhancement New feature or request label Dec 16, 2024
@anton-seaice anton-seaice merged commit aacb3f1 into main Dec 16, 2024
1 check failed
@anton-seaice anton-seaice deleted the cice5_esm1p6 branch December 16, 2024 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants