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

P3 lookup text file being read by all MPI ranks #3023

Open
ndkeen opened this issue Oct 1, 2024 · 1 comment
Open

P3 lookup text file being read by all MPI ranks #3023

ndkeen opened this issue Oct 1, 2024 · 1 comment
Labels
p3 regarding p3 microphysics performance

Comments

@ndkeen
Copy link
Contributor

ndkeen commented Oct 1, 2024

I don't think we should be letting all MPI rank try to read the same P3 lookup text file as it can cause some issues on the filesystems esp at scale (and slow us down).

I implemented a read-on-rank0, broadcast solution to test for E3SM components/eam/src/physics/p3/eam/micro_p3.F90, but having trouble in scream components/eam/src/physics/p3/scream/micro_p3.F90 as I don't have access to same modules. So I wanted to test it was ok before making issue, but might need more attention.

For example, don't immediately have access to:

   use mpishorthand, only: mpir8
   use spmd_utils,   only: mpicom

Perhaps someone has already thought of a better solution anyway?

@ambrad
Copy link
Member

ambrad commented Oct 1, 2024

This approach might work:

Move this line:

p3::p3_init(/* write_tables = */ false,
down to just above here:
P3F::init_kokkos_ice_lookup_tables(lookup_tables.ice_table_vals, lookup_tables.collect_table_vals);
Then call that whole block only on the master rank. Finally, broadcast the table data to the other ranks.

However, the approach will fail if there are C++-affecting side effects in p3_init.

@bartgol bartgol added p3 regarding p3 microphysics performance labels Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p3 regarding p3 microphysics performance
Projects
None yet
Development

No branches or pull requests

3 participants