Skip to content

Commit

Permalink
Add output.append option in report configs
Browse files Browse the repository at this point in the history
  • Loading branch information
daboehme committed Apr 22, 2024
1 parent 79d6144 commit 2d73a90
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 4 deletions.
9 changes: 8 additions & 1 deletion src/caliper/controllers/CudaActivityReportController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class CudaActivityReportController : public cali::ChannelController
if (use_mpi) {
config()["CALI_SERVICES_ENABLE" ].append(",mpi,mpireport");
config()["CALI_MPIREPORT_FILENAME"] = opts.get("output", "stderr").to_string();
config()["CALI_MPIREPORT_APPEND" ] = opts.get("output.append").to_string();
config()["CALI_MPIREPORT_WRITE_ON_FINALIZE"] = "false";
config()["CALI_MPIREPORT_LOCAL_CONFIG"] =
opts.build_query("local", {
Expand All @@ -74,6 +75,7 @@ class CudaActivityReportController : public cali::ChannelController
} else {
config()["CALI_SERVICES_ENABLE" ].append(",report");
config()["CALI_REPORT_FILENAME" ] = opts.get("output", "stderr").to_string();
config()["CALI_REPORT_APPEND" ] = opts.get("output.append").to_string();
config()["CALI_REPORT_CONFIG" ] =
opts.build_query("local", {
{ "select", serial_select },
Expand Down Expand Up @@ -127,7 +129,7 @@ const char* controller_spec = R"json(
"CALI_EVENT_ENABLE_SNAPSHOT_INFO" : "false",
"CALI_CUPTITRACE_SNAPSHOT_DURATION" : "true"
},
"defaults" : { "order_as_visited": "true" },
"defaults" : { "order_as_visited": "true", "output.append": "true" },
"options":
[
{
Expand All @@ -139,6 +141,11 @@ const char* controller_spec = R"json(
"name": "show_kernels",
"type": "bool",
"description": "Show kernel names"
},
{
"name": "output.append",
"type": "bool",
"description": "Use append mode when writing to files"
}
]
}
Expand Down
9 changes: 8 additions & 1 deletion src/caliper/controllers/ROCmActivityReportController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class RocmActivityReportController : public cali::ChannelController
if (use_mpi) {
config()["CALI_SERVICES_ENABLE" ].append(",mpi,mpireport");
config()["CALI_MPIREPORT_FILENAME"] = opts.get("output", "stderr").to_string();
config()["CALI_MPIREPORT_APPEND" ] = opts.get("output.append").to_string();
config()["CALI_MPIREPORT_WRITE_ON_FINALIZE"] = "false";
config()["CALI_MPIREPORT_LOCAL_CONFIG"] =
opts.build_query("local", {
Expand All @@ -74,6 +75,7 @@ class RocmActivityReportController : public cali::ChannelController
} else {
config()["CALI_SERVICES_ENABLE" ].append(",report");
config()["CALI_REPORT_FILENAME" ] = opts.get("output", "stderr").to_string();
config()["CALI_REPORT_APPEND" ] = opts.get("output.append").to_string();
config()["CALI_REPORT_CONFIG" ] =
opts.build_query("local", {
{ "select", serial_select },
Expand Down Expand Up @@ -127,7 +129,7 @@ const char* controller_spec = R"json(
"CALI_EVENT_ENABLE_SNAPSHOT_INFO" : "false",
"CALI_ROCTRACER_TRACE_ACTIVITIES" : "true"
},
"defaults" : { "order_as_visited": "true" },
"defaults" : { "order_as_visited": "true", "output.append": "true" },
"options":
[
{
Expand All @@ -140,6 +142,11 @@ const char* controller_spec = R"json(
"type": "bool",
"config": { "CALI_ROCTRACER_RECORD_KERNEL_NAMES": "true" },
"description": "Show kernel names"
},
{
"name": "output.append",
"type": "bool",
"description": "Use append mode when writing to files"
}
]
}
Expand Down
9 changes: 8 additions & 1 deletion src/caliper/controllers/RuntimeReportController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class RuntimeReportController : public cali::ChannelController
if (use_mpi) {
config()["CALI_SERVICES_ENABLE" ].append(",mpi,mpireport");
config()["CALI_MPIREPORT_FILENAME"] = opts.get("output", "stderr").to_string();
config()["CALI_MPIREPORT_APPEND"] = opts.get("output.append").to_string();
config()["CALI_MPIREPORT_WRITE_ON_FINALIZE"] = "false";
config()["CALI_MPIREPORT_LOCAL_CONFIG"] =
opts.build_query("local", {
Expand All @@ -76,6 +77,7 @@ class RuntimeReportController : public cali::ChannelController
} else {
config()["CALI_SERVICES_ENABLE" ].append(",report");
config()["CALI_REPORT_FILENAME" ] = opts.get("output", "stderr").to_string();
config()["CALI_REPORT_APPEND" ] = opts.get("output.append").to_string();
config()["CALI_REPORT_CONFIG" ] =
opts.build_query("local", {
{ "let", local_let },
Expand Down Expand Up @@ -131,7 +133,7 @@ const char* runtime_report_spec = R"json(
"CALI_EVENT_ENABLE_SNAPSHOT_INFO" : "false",
"CALI_TIMER_UNIT" : "sec"
},
"defaults" : { "order_as_visited": "true" },
"defaults" : { "order_as_visited": "true", "output.append": "true" },
"options":
[
{
Expand Down Expand Up @@ -160,6 +162,11 @@ const char* runtime_report_spec = R"json(
"order by" : [ "sum#sum#sum#time.duration\ desc" ]
}
]
},
{
"name": "output.append",
"type": "bool",
"description": "Use append mode when writing to files"
}
]
};
Expand Down
9 changes: 8 additions & 1 deletion src/caliper/controllers/SampleReportController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class SampleReportController : public cali::ChannelController
if (use_mpi) {
config()["CALI_SERVICES_ENABLE" ].append(",mpi,mpireport");
config()["CALI_MPIREPORT_FILENAME"] = opts.get("output", "stderr").to_string();
config()["CALI_MPIREPORT_APPEND" ] = opts.get("output.append").to_string();
config()["CALI_MPIREPORT_WRITE_ON_FINALIZE"] = "false";
config()["CALI_MPIREPORT_LOCAL_CONFIG"] =
opts.build_query("local", {
Expand All @@ -80,6 +81,7 @@ class SampleReportController : public cali::ChannelController
} else {
config()["CALI_SERVICES_ENABLE" ].append(",report");
config()["CALI_REPORT_FILENAME" ] = opts.get("output", "stderr").to_string();
config()["CALI_REPORT_APPEND" ] = opts.get("output.append").to_string();
config()["CALI_REPORT_CONFIG" ] =
opts.build_query("local", {
{ "select", local_select },
Expand Down Expand Up @@ -130,7 +132,7 @@ const char* sample_report_spec = R"json(
"categories" : [ "output", "sampling", "treeformatter", "region" ],
"services" : [ "sampler", "trace" ],
"config" : { "CALI_CHANNEL_FLUSH_ON_EXIT": "false" },
"defaults" : { "source.function": "true" },
"defaults" : { "source.function": "true", "output.append": "true" },
"options":
[
{
Expand All @@ -148,6 +150,11 @@ const char* sample_report_spec = R"json(
"name": "aggregate_across_ranks",
"type": "bool",
"description": "Aggregate results across MPI ranks"
},
{
"name": "output.append",
"type": "bool",
"description": "Use append mode when writing to files"
}
]
}
Expand Down

0 comments on commit 2d73a90

Please sign in to comment.