darshan.h 2.13 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
struct darshan_module_funcs
29
{
30
    /* disable futher instrumentation within a module */
Shane Snyder's avatar
Shane Snyder committed
31
    void (*disable_instrumentation)(void);
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
    /* TODO: */
    void (*prepare_for_reduction)(
        darshan_record_id *shared_recs,
        int *shared_rec_count, /* in/out shared record count */
        void **send_buf,
        void **recv_buf,
        int *rec_size
    );
    /* TODO: */
    void (*reduce_record)(
        void* infile_v,
        void* inoutfile_v,
        int *len,
        MPI_Datatype *datatype
    );
    /* retrieve module data to write to log file */
48 49 50 51
    void (*get_output_data)(
        void** buf, /* output parameter to save module buffer address */
        int* size /* output parameter to save module buffer size */
    );
52
    /* shutdown module data structures */
53
    void (*shutdown)(void);
54 55
};

56 57 58
/*****************************************************
* darshan-core functions exported to darshan modules *
*****************************************************/
59

60
void darshan_core_register_module(
61
    darshan_module_id mod_id,
62 63
    struct darshan_module_funcs *funcs,
    int *runtime_mem_limit);
64

65
void darshan_core_lookup_record_id(
66 67 68
    void *name,
    int len,
    int printable_flag,
69
    darshan_module_id mod_id,
70
    darshan_record_id *id);
71

72
double darshan_core_wtime(void);
73

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

char* darshan_clean_file_path(const char* path);

80
#endif /* __DARSHAN_H */