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

Remove dependence on the global modules from the cloudsc-fortran #35

Merged
merged 4 commits into from
Jan 25, 2023

Conversation

piotrows
Copy link
Contributor

This commit removes the dependence on the parameters from global modules from the clouds computation.

@piotrows piotrows marked this pull request as draft January 18, 2023 10:54
@piotrows piotrows changed the title Remove dependence on the global modules from the cloudsc Remove dependence on the global modules from the cloudsc-fortran Jan 18, 2023
@piotrows piotrows marked this pull request as ready for review January 18, 2023 12:25
Copy link
Collaborator

@mlange05 mlange05 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good, and gets us around a very big headache problem, and is in line with developments brought to us from Meteo-France.

I've marked to small cosmetic changes, one about the location of the additional loader code (not in the dwarf head program), and the additional integer flags that could also be wrapped, rather than extending the subroutine signature. After that, this should be GTG.

TYPE(TECLDP) ,INTENT(INOUT) :: YDECLDP
TYPE(TEPHLI) ,INTENT(INOUT) :: YDEPHLI

YDECLDP%RKCONV = YRECLDP%RKCONV
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these loader routines not live in the respective modules, like YOETHF, YOEMCST, etc.? We already have global loader functions in there, and we could probably add type-specific ones there (either YDETHF%INITIALIZE() or add something like YOETHF_LOAD_PARAMETERS(YDETHF) to the existing loader routine? This would avoid polluting the high-level entry routines with this.

! Call the driver to perform the parallel loop over our kernel
CALL CLOUDSC_DRIVER(NUMOMP, NPROMA, GLOBAL_STATE%KLEV, NGPTOT, NGPTOTG, &
CALL CLOUDSC_DRIVER( NUMOMP, NPROMA, GLOBAL_STATE%KLEV, NGPTOT, NGPTOTG, &
& NCLDQV, NCLDQL, NCLDQR, NCLDQI, NCLDQS, NCLV, &
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The global cloud vector indexes/sizes can probably also be wrapped in a derived type to avoid passing all of them down.

Copy link
Contributor Author

@piotrows piotrows Jan 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mlange05 Is derived type necessary or it could be just a vector ? Perhaps it could be hardcoded (e.g. called integer :: TNCLV(NCLV)) in MODULE YOECLDP ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are named integer indexes. Why would we want to create yet another pattern, instead of using the same as for the other module-level parameters? Passing them as a derived type object we can use associates in the subroutine body, following the existing convection, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mlange I understand that explicit declaration of NCLDQV, NCLDQL, NCLDQR, NCLDQI, NCLDQS, NCLV must stay as they are in the yoecldp, without putting them in the derived type envelope. So the information needs to be duplicated somewhere, what about putting them as members of TECLDP, so no extra type definition is need ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, adding them to TECLDP and setting them in the initialisation routine should work nicely I think.

…tialization of parameters in parameter containers (i.e. yrthf, yrecldp, yrcst) to the respective derived type modules.
@piotrows piotrows marked this pull request as draft January 23, 2023 16:53
@mlange05
Copy link
Collaborator

mlange05 commented Jan 24, 2023

[DO NOT MERGE UNTIL RESOLVED!] Not quite sure what's going on here, but this change seems to drop CPU performance of the changed variant significantly; I'm getting a drop from around 88GF/s to 58GF/s (Intel, single socket)! Please hold off on review/merge until this is understood.

@piotrows
Copy link
Contributor Author

piotrows commented Jan 24, 2023

This may due to the fact that cloud indexes are now unknown at the compile time, investigation in progress. Also I have converted it to draft, I think I extra minor change about passing on NCLV to driver is needed for the python driver.

@piotrows piotrows closed this Jan 24, 2023
@piotrows piotrows reopened this Jan 24, 2023
…CATED...) checks to the parameter derived type loaders, remove unused YREPHLI
@piotrows piotrows marked this pull request as ready for review January 24, 2023 22:08
@piotrows
Copy link
Contributor Author

I have checked that the performance on Mac+gfortran 12 doesn't depend significantly on the availability of cloud indices 1...5 at compile time. To be checked on ATOS.

@piotrows
Copy link
Contributor Author

I have checked that with Intel the current commit has matching performance to the 'Apple' commit. It seems that with gcc the performance is less dependent on the strategy of passing of indices.

Copy link
Collaborator

@mlange05 mlange05 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. With the latest modifications the change looks good and ready to go. I've verified performance impact is neutral on Atos/Intel.

@mlange05 mlange05 merged commit af89c7b into develop Jan 25, 2023
@mlange05 mlange05 deleted the nazp-no_globvars_in_cloudsc branch January 25, 2023 13:51
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