Skip to content

Commit 6206d0e

Browse files
Shane Snydertylerjereddy
authored andcommitted
fix pydarshan defs for darshan-util accumulators
1 parent 8b83e0e commit 6206d0e

File tree

2 files changed

+12
-23
lines changed

2 files changed

+12
-23
lines changed

darshan-util/pydarshan/darshan/backend/api_def_c.py

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,6 @@
2121
struct darshan_file_category_counters;
2222
};
2323
24-
25-
26-
struct darshan_accumulator {
27-
int64_t module_id;
28-
int64_t job_nprocs;
29-
void* agg_record;
30-
int num_records;
31-
void *file_hash_table;
32-
double shared_io_total_time_by_slowest;
33-
int64_t total_bytes;
34-
double *rank_cumul_io_total_time;
35-
double *rank_cumul_rw_only_time;
36-
double *rank_cumul_md_only_time;
37-
};
38-
3924
struct darshan_mnt_info
4025
{
4126
char mnt_type[3031];
@@ -51,10 +36,14 @@
5136
int partial_flag;
5237
};
5338
54-
int darshan_accumulator_emit(struct darshan_accumulator, struct darshan_derived_metrics*, void* aggregation_record);
55-
int darshan_accumulator_destroy(struct darshan_accumulator);
56-
int darshan_accumulator_create(enum darshan_module_id, int64_t, struct darshan_accumulator*);
57-
int darshan_accumulator_inject(struct darshan_accumulator, void*, int);
39+
/* opaque accumulator reference */
40+
struct darshan_accumulator_st;
41+
typedef struct darshan_accumulator_st* darshan_accumulator;
42+
43+
int darshan_accumulator_create(enum darshan_module_id, int64_t, darshan_accumulator*);
44+
int darshan_accumulator_inject(darshan_accumulator, void*, int);
45+
int darshan_accumulator_emit(darshan_accumulator, struct darshan_derived_metrics*, void* aggregation_record);
46+
int darshan_accumulator_destroy(darshan_accumulator);
5847
5948
/* from darshan-log-format.h */
6049
typedef uint64_t darshan_record_id;

darshan-util/pydarshan/darshan/backend/cffi_backend.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -662,14 +662,14 @@ def log_get_accumulator(log, mod_name: str):
662662
return None
663663
mod_type = _structdefs[mod_name]
664664

665-
darshan_accumulator = ffi.new("struct darshan_accumulator *")
666665
buf = ffi.new("void **")
667666
r = libdutil.darshan_log_get_record(log['handle'], modules[mod_name]['idx'], buf)
668667
rbuf = ffi.cast(mod_type, buf)
669668

670-
libdutil.darshan_accumulator_create(modules[mod_name]['idx'],
671-
jobrec[0].nprocs,
672-
darshan_accumulator)
669+
darshan_accumulator = ffi.new("darshan_accumulator *")
670+
r = libdutil.darshan_accumulator_create(modules[mod_name]['idx'],
671+
jobrec[0].nprocs,
672+
darshan_accumulator)
673673

674674
# TODO: fix the segfault on the inject call below
675675
r = libdutil.darshan_accumulator_inject(darshan_accumulator[0], rbuf[0], 1)

0 commit comments

Comments
 (0)