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

Add communication region annotations #565

Merged
merged 1 commit into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions include/caliper/cali.h
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,23 @@ cali_begin_phase(const char* name);
void
cali_end_phase(const char* name);

/**
* \brief Begin communication region \a name
*
* A communication region can be used to mark communication operations (e.g.,
* MPI calls) that belong to a single communication pattern. They can be used
* to summarize communication pattern statistics. Otherwise they behave
* identical to regular Caliper regions.
*/
void
cali_begin_comm_region(const char* name);

/**
* \brief End phase region \a name
*/
void
cali_end_comm_region(const char* name);

/**
* \brief Begin region where the value for \a attr is `true` on the blackboard.
*/
Expand Down
11 changes: 11 additions & 0 deletions include/caliper/cali_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,17 @@ extern cali_id_t cali_annotation_attr_id;
/// \brief Mark end of a phase region
#define CALI_MARK_PHASE_END(name) \
cali_end_phase(name)

/// \brief Mark begin of a communication region
///
/// A communication region marks communication operations (e.g., MPI calls)
/// that belong to a single communication pattern.
#define CALI_MARK_COMM_REGION_BEGIN(name) \
cali_begin_comm_region(name)

/// \brief Mark end of a communication region
#define CALI_MARK_COMM_REGION_END(name) \
cali_end_comm_region(name)
/**
* \} (group)
*/
Expand Down
2 changes: 1 addition & 1 deletion scripts/radiuss-spack-configs
Submodule radiuss-spack-configs updated 41 files
+3 −4 README.md
+586 −0 blueos_3_ppc64le_ib/compilers.yaml
+99 −0 blueos_3_ppc64le_ib/packages.yaml
+0 −762 blueos_3_ppc64le_ib/spack.yaml
+220 −0 config.yaml
+93 −0 darwin/compilers.yaml
+25 −0 darwin/packages.yaml
+0 −131 darwin/spack.yaml
+5 −18 docs/sphinx/user_guide/how_to.rst
+1 −1 docs/sphinx/user_guide/index.rst
+3 −12 docs/sphinx/user_guide/use_spack.rst
+2 −2 gitlab/radiuss-jobs/corona.yml
+5 −6 gitlab/radiuss-jobs/lassen.yml
+0 −27 gitlab/radiuss-jobs/poodle.yml
+4 −4 gitlab/radiuss-jobs/ruby.yml
+4 −4 gitlab/radiuss-jobs/tioga.yml
+1 −54 packages/blt/package.py
+27 −65 packages/caliper/package.py
+0 −24 packages/camp/libstdc++-13-missing-header.patch
+102 −75 packages/camp/package.py
+0 −244 packages/care/package.py
+0 −13 packages/chai/change_mpi_target_name_umpire_patch.patch
+101 −128 packages/chai/package.py
+0 −13 packages/fmt/fmt-attributes-cpp11_4.1.0.patch
+0 −13 packages/fmt/fmt-no-export-cpp11flag_3.0.0.patch
+0 −22 packages/fmt/fmt-no-variable-initialize_10.0.0.patch
+0 −15 packages/fmt/fmt-use-cmake-cxx-standard_3.0.0.patch
+0 −131 packages/fmt/package.py
+80 −219 packages/raja/package.py
+4 −21 packages/raja_perf/package.py
+0 −106 packages/umpire/dual_blt_import_umpire_2022.10_2023.06.patch
+125 −242 packages/umpire/package.py
+560 −0 toss_3_x86_64_ib/compilers.yaml
+139 −0 toss_3_x86_64_ib/packages.yaml
+0 −729 toss_3_x86_64_ib/spack.yaml
+231 −0 toss_4_x86_64_ib/compilers.yaml
+164 −0 toss_4_x86_64_ib/packages.yaml
+0 −544 toss_4_x86_64_ib/spack.yaml
+209 −0 toss_4_x86_64_ib_cray/compilers.yaml
+163 −0 toss_4_x86_64_ib_cray/packages.yaml
+0 −498 toss_4_x86_64_ib_cray/spack.yaml
3 changes: 3 additions & 0 deletions src/caliper/api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ namespace cali
Attribute region_attr;
Attribute phase_attr;
Attribute loop_attr;
Attribute comm_region_attr;

void init_attribute_classes(Caliper* c) {
class_aggregatable_attr =
Expand All @@ -65,6 +66,8 @@ namespace cali
c->create_attribute("region", CALI_TYPE_STRING, CALI_ATTR_NESTED);
phase_attr =
c->create_attribute("phase", CALI_TYPE_STRING, CALI_ATTR_NESTED | CALI_ATTR_LEVEL_4);
comm_region_attr =
c->create_attribute("comm.region", CALI_TYPE_STRING, CALI_ATTR_NESTED | CALI_ATTR_LEVEL_1);

cali_region_attr_id = region_attr.id();
cali_phase_attr_id = phase_attr.id();
Expand Down
15 changes: 15 additions & 0 deletions src/caliper/cali.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ namespace cali

extern Attribute region_attr;
extern Attribute phase_attr;
extern Attribute comm_region_attr;

}

Expand Down Expand Up @@ -404,6 +405,20 @@ cali_end_phase(const char* name)
c.end_with_value_check(cali::phase_attr, Variant(name));
}

void
cali_begin_comm_region(const char* name)
{
Caliper c;
c.begin(cali::comm_region_attr, Variant(name));
}

void
cali_end_comm_region(const char* name)
{
Caliper c;
c.end_with_value_check(cali::comm_region_attr, Variant(name));
}

void
cali_begin(cali_id_t attr_id)
{
Expand Down
4 changes: 2 additions & 2 deletions test/ci_app_tests/ci_test_mpi_before_cali.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ int main(int argc, char* argv[])
MPI_Bcast(&val, 1, MPI_INT, 0, MPI_COMM_WORLD);

int in = val, out;

CALI_MARK_COMM_REGION_BEGIN("reduction");
MPI_Reduce(&in, &out, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD);

MPI_Barrier(MPI_COMM_WORLD);
CALI_MARK_COMM_REGION_END("reduction");
}

mgr.flush();
Expand Down
Loading