/* * (C) 2009 by Argonne National Laboratory. * See COPYRIGHT in top-level directory. */ #ifndef __DARSHAN_H #define __DARSHAN_H #include #include #include #include #include "darshan-log-format.h" /* 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" /* module developers provide the following functions to darshan-core */ struct darshan_module_funcs { /* disable futher instrumentation within a module */ void (*disable_instrumentation)(void); /* perform any necessary steps prior to reducing */ void (*prepare_for_reduction)( darshan_record_id *shared_recs, /* input list of shared records */ int *shared_rec_count, /* in/out shared record count */ void **send_buf, /* send buffer for shared file reduction */ void **recv_buf, /* recv buffer for shared file reduction (root only) */ int *rec_size /* size of records being stored for this module */ ); /* reduce records which are shared globally across this module */ void (*reduce_records)( void* infile_v, void* inoutfile_v, int *len, MPI_Datatype *datatype ); /* retrieve module data to write to log file */ void (*get_output_data)( void** buf, /* output parameter to save module buffer address */ int* size /* output parameter to save module buffer size */ ); /* shutdown module data structures */ void (*shutdown)(void); }; /***************************************************** * darshan-core functions exported to darshan modules * *****************************************************/ void darshan_core_register_module( darshan_module_id mod_id, struct darshan_module_funcs *funcs, int *runtime_mem_limit); void darshan_core_unregister_module( darshan_module_id mod_id); void darshan_core_register_record( void *name, int len, int printable_flag, darshan_module_id mod_id, darshan_record_id *rec_id); void darshan_core_unregister_record( darshan_record_id rec_id, darshan_module_id mod_id); double darshan_core_wtime(void); /*********************************************** * darshan-common functions for darshan modules * ***********************************************/ char* darshan_clean_file_path(const char* path); #endif /* __DARSHAN_H */