Skip to content

Commit

Permalink
kp_memory_usage.cpp: remove totals and apply clang format
Browse files Browse the repository at this point in the history
  • Loading branch information
vlkale committed Sep 19, 2024
1 parent 46cdb4d commit 6b9ea66
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions profiling/memory-usage/kp_memory_usage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ void kokkosp_init_library(const int /*loadSeq*/,
}

void kokkosp_finalize_library() {
uint64_t totalMemorySpaceDataTransfer = 0;
char* hostname = (char*)malloc(sizeof(char) * 256);
char* hostname = (char*)malloc(sizeof(char) * 256);
gethostname(hostname, 256);
int pid = getpid();

Expand Down Expand Up @@ -95,14 +94,9 @@ void kokkosp_finalize_library() {
for (unsigned int src = 0; src < num_spaces; src++) {
fprintf(ofile, "%s %s %.1lf \n", space_name[dst], space_name[src],
1.0 * totalMemoryTransferred[dst][src] / 1024 / 1024);
totalMemorySpaceDataTransfer += totalMemoryTransferred[dst][src];
}
}

fprintf(ofile,
"Total Memory Transferred across all Kokkos Memory Spaces (MB): %.1lf \n",
1.0 * totalMemorySpaceDataTransfer / 1024 / 1024);

fclose(ofile);
}
free(hostname);
Expand Down

0 comments on commit 6b9ea66

Please sign in to comment.