Skip to content

Commit 12fa940

Browse files
Shane SnyderShane Snyder
authored andcommitted
add heatmap support for DFS/DAOS modules
1 parent 9338b2b commit 12fa940

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

darshan-runtime/lib/darshan-daos.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include "uthash.h"
2626
#include "darshan.h"
2727
#include "darshan-dynamic.h"
28+
#include "darshan-heatmap.h"
2829

2930
#include <daos_types.h>
3031
#include <daos_prop.h>
@@ -119,6 +120,7 @@ struct daos_runtime
119120
void *rec_id_hash;
120121
void *oh_hash;
121122
int obj_rec_count;
123+
darshan_record_id heatmap_id;
122124
int frozen; /* flag to indicate that the counters should no longer be modified */
123125
};
124126

@@ -227,6 +229,8 @@ static int my_rank = -1;
227229
int64_t __tmp_sz = (int64_t)__sz; \
228230
struct darshan_common_val_counter *__cvc; \
229231
double __elapsed = __tm2-__tm1; \
232+
/* heatmap to record traffic summary */ \
233+
heatmap_update(daos_runtime->heatmap_id, HEATMAP_READ, __tmp_sz, __tm1, __tm2); \
230234
__rec_ref->object_rec->counters[__counter] += 1; \
231235
__rec_ref->object_rec->counters[DAOS_BYTES_READ] += __sz; \
232236
DARSHAN_BUCKET_INC(&(__rec_ref->object_rec->counters[DAOS_SIZE_READ_0_100]), __sz); \
@@ -255,6 +259,8 @@ static int my_rank = -1;
255259
int64_t __tmp_sz = (int64_t)__sz; \
256260
struct darshan_common_val_counter *__cvc; \
257261
double __elapsed = __tm2-__tm1; \
262+
/* heatmap to record traffic summary */ \
263+
heatmap_update(daos_runtime->heatmap_id, HEATMAP_WRITE, __tmp_sz, __tm1, __tm2); \
258264
__rec_ref->object_rec->counters[__counter] += 1; \
259265
__rec_ref->object_rec->counters[DAOS_BYTES_WRITTEN] += __sz; \
260266
DARSHAN_BUCKET_INC(&(__rec_ref->object_rec->counters[DAOS_SIZE_WRITE_0_100]), __sz); \
@@ -1145,6 +1151,9 @@ static void daos_runtime_initialize()
11451151
}
11461152
memset(daos_runtime, 0, sizeof(*daos_runtime));
11471153

1154+
/* register a heatmap */
1155+
daos_runtime->heatmap_id = heatmap_register("heatmap:DAOS");
1156+
11481157
return;
11491158
}
11501159

darshan-runtime/lib/darshan-dfs.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include "uthash.h"
2626
#include "darshan.h"
2727
#include "darshan-dynamic.h"
28+
#include "darshan-heatmap.h"
2829

2930
#include <daos_types.h>
3031
#include <daos_prop.h>
@@ -102,6 +103,7 @@ struct dfs_runtime
102103
void *rec_id_hash;
103104
void *file_obj_hash;
104105
int file_rec_count;
106+
darshan_record_id heatmap_id;
105107
int frozen; /* flag to indicate that the counters should no longer be modified */
106108
};
107109

@@ -245,6 +247,8 @@ static int my_rank = -1;
245247
daos_size_t __chunk_size; \
246248
__rec_ref = darshan_lookup_record_ref(dfs_runtime->file_obj_hash, &__obj, sizeof(obj)); \
247249
if(!__rec_ref) break; \
250+
/* heatmap to record traffic summary */ \
251+
heatmap_update(dfs_runtime->heatmap_id, HEATMAP_READ, __sz, __tm1, __tm2); \
248252
__rec_ref->file_rec->counters[__counter] += 1; \
249253
if(__ev) \
250254
__rec_ref->file_rec->counters[DFS_NB_READS] += 1; \
@@ -282,6 +286,8 @@ static int my_rank = -1;
282286
daos_size_t __chunk_size; \
283287
__rec_ref = darshan_lookup_record_ref(dfs_runtime->file_obj_hash, &__obj, sizeof(obj)); \
284288
if(!__rec_ref) break; \
289+
/* heatmap to record traffic summary */ \
290+
heatmap_update(dfs_runtime->heatmap_id, HEATMAP_WRITE, __sz, __tm1, __tm2); \
285291
__rec_ref->file_rec->counters[__counter] += 1; \
286292
if(__ev) \
287293
__rec_ref->file_rec->counters[DFS_NB_WRITES] += 1; \
@@ -841,6 +847,9 @@ static void dfs_runtime_initialize()
841847
}
842848
memset(dfs_runtime, 0, sizeof(*dfs_runtime));
843849

850+
/* register a heatmap */
851+
dfs_runtime->heatmap_id = heatmap_register("heatmap:DFS");
852+
844853
return;
845854
}
846855

0 commit comments

Comments
 (0)