sst-core icon indicating copy to clipboard operation
sst-core copied to clipboard

Event profiling issues

Open pdbj opened this issue 2 years ago • 4 comments

If a component event send or receive counter, or total run time, is not registered no output for that item is generated. It would be easier to use if the output was consistent, and showed `0' in these cases.

Print per-Component aggregate event handler profiling

pdbj avatar Apr 25 '22 22:04 pdbj

@pdbj, does this patch require an earlier commit? See:

Checking patch src/sst/core/simulation.cc...
error: while searching for:
#endif  // SST_CLOCK_PROFILING

#if SST_EVENT_PROFILING
    fprintf(fp, "Communication Counters\n");
    for ( auto it = eventHandlers.begin(); it != eventHandlers.end(); ++it ) {
        fprintf(fp, "Component %s\n", it->first.c_str());

        // Look up event send and receive counters
        auto eventSend = eventSendCounters.find(it->first.c_str());
        auto eventRecv = eventRecvCounters.find(it->first.c_str());
        if ( eventSend != eventSendCounters.end() ) {
            fprintf(fp, "Messages Sent within rank: %" PRIu64 "\n", eventSend->second);
        }
        if ( eventRecv != eventRecvCounters.end() ) { fprintf(fp, "Messages Recv: %" PRIu64 "\n", eventRecv->second); }

        // Look up runtimes for event handler
        auto eventTime = eventHandlers.find(it->first.c_str());
        if ( eventTime != eventHandlers.end() ) {
            fprintf(fp, "Time spent on message: %.6fs\n", (double)eventTime->second / clockDivisor);
            if ( it->second != 0 ) {
                fprintf(fp, "Average message time: %" PRIu64 "%s\n", eventTime->second / it->second, clockResolution.c_str());
            }
            else {
                fprintf(fp, "Average message time: 0%s\n", clockResolution.c_str());
            }
        }
    }

    // Rank only information
    fprintf(fp, "Rank Statistics\n");

error: patch failed: src/sst/core/simulation.cc:1155
error: src/sst/core/simulation.cc: patch does not apply

jleidel avatar May 19 '22 03:05 jleidel

I would hold off on this one. The event profiling is about to be superseded by the new Profiling Points API. The new event profiling will only print those items that have been enabled. This is an intentional feature since you can specify many different ways to collate the data. However, if you use the new command line options to turn profiling on, it will register every handler, so everything will print.

feldergast avatar May 19 '22 13:05 feldergast

#861 has been merged.

berquist avatar Jun 21 '23 15:06 berquist