darshan-core.h 1.22 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
/*
 *  (C) 2014 by Argonne National Laboratory.
 *      See COPYRIGHT in top-level directory.
 */

#ifndef __DARSHAN_CORE_H
#define __DARSHAN_CORE_H

#include <unistd.h>
#include <sys/types.h>
#include <stdint.h>

13 14
#include "darshan.h"

15 16 17
/* TODO: enforce this when handing out ids */
#define DARSHAN_CORE_MAX_RECORDS 1024

18 19 20 21
/* default compression buffer size of 2 MiB */
/* TODO: revisit this default size if we change memory per module */
#define DARSHAN_COMP_BUF_SIZE (2 * 1024 * 1024)

22
struct darshan_core_module
23
{
24
    darshan_module_id id;
25 26 27
    struct darshan_module_funcs mod_funcs;
};

28
/* in memory structure to keep up with job level data */
29
struct darshan_core_runtime
30 31
{
    struct darshan_job log_job;
32
    char exe[DARSHAN_EXE_LEN+1];
33 34
    struct darshan_core_record_ref *rec_hash;
    struct darshan_core_module* mod_array[DARSHAN_MAX_MODS];
35
    char comp_buf[DARSHAN_COMP_BUF_SIZE];
36 37
    double wtime_offset;
    char *trailing_data;
38 39 40 41
};

struct darshan_core_record_ref
{
42
    struct darshan_record rec;
43
    UT_hash_handle hlink;
44
};
45

46 47 48
uint32_t darshan_hashlittle(const void *key, size_t length, uint32_t initval);
uint64_t darshan_hash(const register unsigned char *k, register uint64_t length, register uint64_t level);

49
#endif /* __DARSHAN_CORE_H */