Commit d6dad7f3 authored by Shane Snyder's avatar Shane Snyder

add variable-length definition of name records

also some code clean up to change references of record hash
to name hash to be more clear about what it is actually storing.
parent 94430f41
......@@ -69,7 +69,7 @@ struct darshan_header
int64_t magic_nr;
unsigned char comp_type;
uint32_t partial_flag;
struct darshan_log_map rec_map;
struct darshan_log_map name_map;
struct darshan_log_map mod_map[DARSHAN_MAX_MODS];
uint32_t mod_ver[DARSHAN_MAX_MODS];
};
......@@ -86,6 +86,14 @@ struct darshan_job
char metadata[DARSHAN_JOB_METADATA_LEN];
};
/* record to store name->darshan_id mapping for each registered record */
struct darshan_name_record
{
darshan_record_id id;
char name[1];
};
/* base record definition that can be used by modules */
struct darshan_base_record
{
darshan_record_id id;
......
......@@ -43,12 +43,27 @@
/* default path for storing mmap log files is '/tmp' */
#define DARSHAN_DEF_MMAP_LOG_PATH "/tmp"
/* default record buf can store 2048 records of size 100 bytes */
#define DARSHAN_RECORD_BUF_SIZE (2048 * 100)
/* default name record buf can store 2048 records of size 100 bytes */
#define DARSHAN_NAME_RECORD_BUF_SIZE (2048 * 100)
/* Default runtime compression buffer size */
#define DARSHAN_COMP_BUF_SIZE DARSHAN_MOD_MEM_MAX
/* structure to track registered modules */
struct darshan_core_module
{
struct darshan_module_funcs mod_funcs;
int mem_avail;
};
struct darshan_core_name_record_ref
{
struct darshan_name_record *name_record;
uint64_t mod_flags;
uint64_t global_mod_flags;
UT_hash_handle hlink;
};
/* in memory structure to keep up with job level data */
struct darshan_core_runtime
{
......@@ -56,35 +71,21 @@ struct darshan_core_runtime
struct darshan_header *log_hdr_p;
struct darshan_job *log_job_p;
char *log_exemnt_p;
void *log_rec_p;
void *log_name_p;
void *log_mod_p;
/* darshan-core internal data structures */
struct darshan_core_record_ref *rec_hash;
int rec_hash_cnt;
struct darshan_core_module* mod_array[DARSHAN_MAX_MODS];
int mod_mem_used;
char *comp_buf;
struct darshan_core_name_record_ref *name_hash;
int name_hash_cnt;
double wtime_offset;
char *comp_buf;
#ifdef __DARSHAN_ENABLE_MMAP_LOGS
char mmap_log_name[PATH_MAX];
#endif
};
struct darshan_core_module
{
struct darshan_module_funcs mod_funcs;
int mem_avail;
};
struct darshan_core_record_ref
{
void *rec_p; /* id & name buffer */
uint64_t mod_flags;
uint64_t global_mod_flags;
UT_hash_handle hlink;
};
void darshan_core_initialize(int argc, char **argv);
void darshan_core_shutdown(void);
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment