@@ -67,12 +67,17 @@ void kokkosp_finalize_library() {
6767 int pid = getpid ();
6868
6969 for (int s = 0 ; s < num_spaces; s++) {
70- char * fileOutput = (char *)malloc (sizeof (char ) * 256 );
70+ char * fileOutput = (char *)malloc (sizeof (char ) * 256 );
71+ char * fileOutputxfers = (char *)malloc (sizeof (char ) * 256 );
72+
7173 snprintf (fileOutput, 256 , " %s-%d-%s.memspace_usage" , hostname, pid,
7274 space_name[s]);
7375
74- FILE* ofile = fopen (fileOutput, " wb" );
76+ snprintf (fileOutputxfers, 256 , " %s-%d.memspace_transfers" , hostname, pid);
77+ FILE* ofile = fopen (fileOutput, " wb" );
78+ FILE* ofilexf = fopen (fileOutputxfers, " wb" );
7579 free (fileOutput);
80+ free (fileOutputxfers);
7681
7782 fprintf (ofile, " # Space %s\n " , space_name[s]);
7883 fprintf (ofile,
@@ -89,10 +94,9 @@ void kokkosp_finalize_library() {
8994 }
9095
9196 fprintf (ofile, " # Data transferred between Kokkos Memory Spaces --- \n " );
92- for (unsigned int dst = 0 ; dst < (unsigned int ) num_spaces; dst++) {
93- for (unsigned int src = 0 ; src < (unsigned int ) num_spaces; src++) {
97+ for (unsigned int dst = 0 ; (unsigned int ) dst < num_spaces; dst++) {
98+ for (unsigned int src = 0 ; (unsigned int ) src < num_spaces; src++) {
9499 fprintf (ofile, " # Dst Mem Space Src Mem Space Total Data-Transferred(MB)\n " );
95-
96100 fprintf (ofile, " %s %s %.1lf \n " , space_name[dst], space_name[src],
97101 1.0 * totalMemoryTransferred[dst][src] / 1024 / 1024 );
98102 }
@@ -169,7 +173,7 @@ void kokkosp_begin_deep_copy(SpaceHandle dst_handle, const char* /* dst_name */,
169173 totalMemoryTransferred[space_dst][space_src] += size;
170174}
171175
172- void kokkosp_end_deep_copy () { std::lock_guard<std::mutex> lock (m); }
176+ void kokkosp_end_deep_copy () {}
173177
174178Kokkos::Tools::Experimental::EventSet get_event_set () {
175179 Kokkos::Tools::Experimental::EventSet my_event_set;
0 commit comments