darshan-core.h 1.48 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"

Shane Snyder's avatar
Shane Snyder committed
15 16 17 18
/* TODO: this goes where ? -- shared libs */
#define DARSHAN_MPI_CALL(func) func


19 20
#define DARSHAN_CORE_MAX_RECORDS 1024

21
/* TODO: revisit this default size if we change memory per module */
Shane Snyder's avatar
Shane Snyder committed
22
#define DARSHAN_CORE_COMP_BUF_SIZE (2 * 1024 * 1024)
23

Shane Snyder's avatar
Shane Snyder committed
24 25 26 27 28
#define DARSHAN_CORE_MOD_SET(flags, id) (flags | (1 << id))

#define DARSHAN_CORE_MOD_UNSET(flags, id) (flags & ~(1 << id))

#define DARSHAN_CORE_MOD_ISSET(flags, id) (flags & (1 << id))
29

30
/* in memory structure to keep up with job level data */
31
struct darshan_core_runtime
32 33
{
    struct darshan_job log_job;
34
    char exe[DARSHAN_EXE_LEN+1];
35
    struct darshan_core_record_ref *rec_hash;
Shane Snyder's avatar
Shane Snyder committed
36
    int rec_count;
37
    struct darshan_core_module* mod_array[DARSHAN_MAX_MODS];
Shane Snyder's avatar
Shane Snyder committed
38
    char comp_buf[DARSHAN_CORE_COMP_BUF_SIZE];
39 40
    double wtime_offset;
    char *trailing_data;
41 42
};

Shane Snyder's avatar
Shane Snyder committed
43 44 45 46 47 48
struct darshan_core_module
{
    darshan_module_id id;
    struct darshan_module_funcs mod_funcs;
};

49 50
struct darshan_core_record_ref
{
51
    struct darshan_record rec;
52 53
    uint64_t mod_flags;
    uint64_t global_mod_flags;
54
    UT_hash_handle hlink;
55
};
56

57 58 59
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);

60
#endif /* __DARSHAN_CORE_H */