darshan.h 2 KB
Newer Older
1 2 3 4 5
/*
 *  (C) 2009 by Argonne National Laboratory.
 *      See COPYRIGHT in top-level directory.
 */

6 7 8 9 10 11 12
#ifndef __DARSHAN_H
#define __DARSHAN_H

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

14 15
#include "darshan-log-format.h"

16 17 18 19 20 21 22 23 24 25 26 27
/* Environment variable to override CP_JOBID */
#define CP_JOBID_OVERRIDE "DARSHAN_JOBID"

/* Environment variable to override __CP_LOG_PATH */
#define CP_LOG_PATH_OVERRIDE "DARSHAN_LOGPATH"

/* Environment variable to override __CP_LOG_PATH */
#define CP_LOG_HINTS_OVERRIDE "DARSHAN_LOGHINTS"

/* Environment variable to override __CP_MEM_ALIGNMENT */
#define CP_MEM_ALIGNMENT_OVERRIDE "DARSHAN_MEMALIGN"

28
/* TODO where do each of the following macros make most sense ? */
29 30
#define DARSHAN_MPI_CALL(func) func

31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
/* max length of module name string (not counting \0) */
#define DARSHAN_MOD_NAME_LEN 31

/* unique identifiers to distinguish between available darshan modules */
/* NOTES: - valid ids range from [0...DARSHAN_MAX_MODS-1]
 *        - order of ids control module shutdown order (first module shuts down first)
 */
#define DARSHAN_MAX_MODS 16
typedef enum
{
    DARSHAN_POSIX_MOD,
    DARSHAN_MPIIO_MOD,
    DARSHAN_HDF5_MOD,
    DARSHAN_PNETCDF_MOD,
} darshan_module_id;

47
typedef uint64_t darshan_file_id;
48

49
struct darshan_module_funcs
50
{
51 52
    void (*prepare_for_shutdown)(void);
    void (*get_output_data)(void **, int);
53 54
};

55 56 57 58
/*********************************************
* darshan-core functions for darshan modules *
*********************************************/

59
void darshan_core_register_module(
60
    darshan_module_id id,
61 62 63
    char *name,
    struct darshan_module_funcs *funcs,
    int *runtime_mem_limit);
64

65 66 67 68 69
void darshan_core_lookup_id(
    void *name,
    int len,
    int printable_flag,
    darshan_file_id *id);
70

71
double darshan_core_wtime(void);
72

73 74 75 76 77 78
/***********************************************
* darshan-common functions for darshan modules *
***********************************************/

char* darshan_clean_file_path(const char* path);

79
#endif /* __DARSHAN_H */