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

Scripts for evaluating code performance #57

Draft
wants to merge 19 commits into
base: main
Choose a base branch
from
Draft

Conversation

odiazib
Copy link
Collaborator

@odiazib odiazib commented Sep 9, 2024

No description provided.

@odiazib odiazib marked this pull request as draft September 23, 2024 23:27
@odiazib odiazib assigned odiazib and unassigned odiazib Sep 23, 2024
@jcurtis2 jcurtis2 changed the title Oscar/wall times Scripts for evaluating code performance Oct 9, 2024
Copy link
Collaborator

@samfrederick samfrederick left a comment

Choose a reason for hiding this comment

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

Just a few non-critical suggestions that you could incorporate if you feel they are useful. There were also some Kokkos sections that I had a few questions on - particularly use of thread vector range and separating statements for creating mirror views and deep copies.

@@ -225,6 +225,17 @@ int AerosolModelData::initChem(YAML::Node &root,
return 0;
}

void AerosolModelData::setNumberofParticles(const ordinal_type number_of_particles)
{
printf("-------------------------------------------------------\n");
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should consider using some sort of preprocessor directive for debug print statements

// For scaling studies, we must execute this example many times.
// Thus, we do not want to write the solution to a file.
// In those cases, we pass write_time_profiles false.
bool write_time_profiles(true);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Perhaps we could include a preprocessor directive here as well so we only need to modify directives instead of inline code for timing runs?

using SIMPOL_single_particle_type = TChem::Impl::SIMPOL_single_particle<real_type, device_type >;
Kokkos::parallel_for(
Kokkos::TeamThreadRange(member, amcd.nParticles),
Kokkos::ThreadVectorRange(member, amcd.nParticles),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not suggesting this needs to change, but I am curious what the range policy thread vector range does instead of using team thread range in this parallel for?

// For scaling studies, we must execute this example many times.
// Thus, we do not want to write the solution to a file.
// In those cases, we pass write_time_profiles false.
bool write_time_profiles(true);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same suggestion for preprocessor directives as before

i = amd.aerosol_sp_name_idx_.begin();
i != amd.aerosol_sp_name_idx_.end(); ++i)
aero_idx_sp_name[i->second] = i->first;
for (ordinal_type k = 0; k < kmcd.nSpec; k++)
Copy link
Collaborator

Choose a reason for hiding this comment

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

For clarity I think these two for loops should use brackets to encapsulate the iterated statements

for (ordinal_type ipart = 0; ipart < amd.nParticles_; ipart++)
{
for (ordinal_type isp = 0; isp < amd.nSpec_; isp++)
for (ordinal_type k = 0; k < kmcd.nSpec; k++)
Copy link
Collaborator

Choose a reason for hiding this comment

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

For clarity I think these two for loops should use brackets to encapsulate the iterated statements

const ordinal_type stateVecDim =
TChem::Impl::getStateVectorSize(total_n_species);
const auto speciesNamesHost = Kokkos::create_mirror_view(kmcd.speciesNames);
Kokkos::deep_copy(speciesNamesHost, kmcd.speciesNames);
Copy link
Collaborator

Choose a reason for hiding this comment

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

More of a conceptual question, but why do we create the mirror view and copy data in two separate steps instead of using Kokkos::create_mirror_view_and_copy?

src/examples/TChem_AerosolChemistry_RHSs.cpp Outdated Show resolved Hide resolved
Copy link

codecov bot commented Oct 16, 2024

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