Skip to content

Commit 315310c

Browse files
committed
add collision counter
1 parent 9574892 commit 315310c

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

src/drivers/include/common.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ NCI_Free_fn(void *ptr, const int lineno, const char *func,
7474
#define NCI_Realloc(a,b) NCI_Realloc_fn(a,b,__LINE__,__func__,__FILE__)
7575
#define NCI_Free(a) NCI_Free_fn(a,__LINE__,__func__,__FILE__)
7676

77+
extern int cls_counter;
78+
7779
extern int
7880
ncmpii_inq_malloc_size(size_t *size);
7981

src/drivers/ncmpio/ncmpio_close.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#ifdef ENABLE_SUBFILING
3232
#include "ncmpio_subfile.h"
3333
#endif
34-
34+
int cls_counter = 0;
3535
/*----< ncmpio_free_NC() >----------------------------------------------------*/
3636
void
3737
ncmpio_free_NC(NC *ncp)
@@ -214,7 +214,13 @@ ncmpio_close(void *ncdp)
214214
}
215215

216216
/* free up space occupied by the header metadata */
217+
int rank;
218+
MPI_Comm_rank(ncp->comm, &rank);
219+
cls_counter = 0;
217220
ncmpio_free_NC(ncp);
221+
if (rank == 0){
222+
printf("cls_counter: %d\n", cls_counter);
223+
}
218224

219225
return status;
220226
}

src/drivers/ncmpio/ncmpio_hash_func.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ ncmpio_hash_table_free(NC_nametable *nameT, int hash_size)
318318
for (i=0; i<hash_size; i++) {
319319
if (nameT[i].num > 0)
320320
NCI_Free(nameT[i].list);
321+
cls_counter += nameT[i].num - 1;
321322
nameT[i].num = 0;
322323
}
323324
}

0 commit comments

Comments
 (0)