Commit abf424f2 authored by Shane Snyder's avatar Shane Snyder

More changes to support darshan_core shutdown

parent da477e42
......@@ -12,6 +12,9 @@
#include "darshan.h"
/* TODO: enforce this when handing out ids */
#define DARSHAN_CORE_MAX_RECORDS 1024
struct darshan_core_module
{
darshan_module_id id;
......@@ -21,12 +24,20 @@ struct darshan_core_module
/* in memory structure to keep up with job level data */
/* TODO: trailing data ? */
struct darshan_core_job_runtime
struct darshan_core_runtime
{
struct darshan_job log_job;
struct darshan_core_module* mod_array[DARSHAN_MAX_MODS];
char exe[CP_EXE_LEN+1];
double wtime_offset;
struct darshan_core_record_ref *rec_hash;
struct darshan_core_module* mod_array[DARSHAN_MAX_MODS];
};
struct darshan_core_record_ref
{
char* name;
darshan_record_id id;
UT_hash_handle hlink;
};
#endif /* __DARSHAN_CORE_H */
......@@ -44,7 +44,7 @@ typedef enum
DARSHAN_PNETCDF_MOD,
} darshan_module_id;
typedef uint64_t darshan_file_id;
typedef uint64_t darshan_record_id;
struct darshan_module_funcs
{
......@@ -56,9 +56,9 @@ struct darshan_module_funcs
void (*shutdown)(void);
};
/*********************************************
* darshan-core functions for darshan modules *
*********************************************/
/*****************************************************
* darshan-core functions exported to darshan modules *
*****************************************************/
void darshan_core_register_module(
darshan_module_id id,
......@@ -66,11 +66,11 @@ void darshan_core_register_module(
struct darshan_module_funcs *funcs,
int *runtime_mem_limit);
void darshan_core_lookup_id(
void darshan_core_lookup_record_id(
void *name,
int len,
int printable_flag,
darshan_file_id *id);
darshan_record_id *id);
double darshan_core_wtime(void);
......
This diff is collapsed.
......@@ -25,8 +25,8 @@
#include <aio.h>
#include <pthread.h>
#include "darshan.h"
#include "uthash.h"
#include "darshan.h"
#ifndef HAVE_OFF64_T
typedef int64_t off64_t;
......@@ -159,7 +159,7 @@ enum darshan_f_posix_indices
struct darshan_posix_file
{
darshan_file_id f_id;
darshan_record_id f_id;
int64_t rank;
int64_t counters[CP_NUM_INDICES];
double fcounters[CP_F_NUM_INDICES];
......@@ -433,7 +433,7 @@ static struct posix_runtime_file* posix_file_by_name(const char *name)
{
struct posix_runtime_file *file = NULL;
char *newname = NULL;
darshan_file_id file_id;
darshan_record_id file_id;
if(!posix_runtime)
return(NULL);
......@@ -443,14 +443,14 @@ static struct posix_runtime_file* posix_file_by_name(const char *name)
newname = (char*)name;
/* get a unique id for this file from darshan core */
darshan_core_lookup_id(
darshan_core_lookup_record_id(
(void*)newname,
strlen(newname),
1,
&file_id);
/* search the hash table for this file record, and return if found */
HASH_FIND(hlink, posix_runtime->file_hash, &file_id, sizeof(darshan_file_id), file);
HASH_FIND(hlink, posix_runtime->file_hash, &file_id, sizeof(darshan_record_id), file);
if(file)
{
if(newname != name)
......@@ -466,7 +466,7 @@ static struct posix_runtime_file* posix_file_by_name(const char *name)
file->file_record->f_id = file_id;
/* add new record to file hash table */
HASH_ADD(hlink, posix_runtime->file_hash, file_record->f_id, sizeof(darshan_file_id), file);
HASH_ADD(hlink, posix_runtime->file_hash, file_record->f_id, sizeof(darshan_record_id), file);
posix_runtime->file_array_ndx++;
}
......@@ -518,7 +518,7 @@ static struct posix_runtime_file* posix_file_by_name_setfd(const char* name, int
static void posix_file_close_fd(int fd)
{
struct posix_runtime_file_ref *ref;
struct posix_runtime_file_ref* ref;
if(!posix_runtime)
return;
......
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