Commit d8f3575a authored by Shane Snyder's avatar Shane Snyder
Browse files

darshan-core code and documentation cleanup

Cleanup the structure and documenation of the code to be in sync
with the new mmap version of Darshan. In particular, I made sure
all extra mmap logic was properly ifdef wrapped so it's more clear
which portions of the code are responsible for implementing that
feature.
parent 9bfc7b65
...@@ -58,6 +58,7 @@ struct darshan_core_module ...@@ -58,6 +58,7 @@ struct darshan_core_module
struct darshan_module_funcs funcs; struct darshan_module_funcs funcs;
}; };
/* strucutre for keeping a reference to registered name records */
struct darshan_core_name_record_ref struct darshan_core_name_record_ref
{ {
struct darshan_name_record *name_record; struct darshan_name_record *name_record;
...@@ -80,6 +81,7 @@ struct darshan_core_runtime ...@@ -80,6 +81,7 @@ struct darshan_core_runtime
struct darshan_core_module* mod_array[DARSHAN_MAX_MODS]; struct darshan_core_module* mod_array[DARSHAN_MAX_MODS];
int mod_mem_used; int mod_mem_used;
struct darshan_core_name_record_ref *name_hash; struct darshan_core_name_record_ref *name_hash;
int name_mem_used;
double wtime_offset; double wtime_offset;
char *comp_buf; char *comp_buf;
#ifdef __DARSHAN_ENABLE_MMAP_LOGS #ifdef __DARSHAN_ENABLE_MMAP_LOGS
......
...@@ -92,11 +92,14 @@ struct darshan_module_funcs ...@@ -92,11 +92,14 @@ struct darshan_module_funcs
* Register module identifier 'mod_id' with the darshan-core runtime * Register module identifier 'mod_id' with the darshan-core runtime
* environment, allowing the module to store I/O characterization data. * environment, allowing the module to store I/O characterization data.
* 'funcs' is a pointer to a structure containing each of the function * 'funcs' is a pointer to a structure containing each of the function
* pointers required by darshan-core to shut down the module. The function * pointers required by darshan-core to shut down the module.
* returns the following integers passed in as pointers: 'rank' is the * 'inout_mod_buf_size' is an input/output argument, with it being
* MPI rank of the calling process, 'mod_mem_limit' is the maximum amount * set to the requested amount of module memory on input, and set to
* of memory the module may use, and 'sys_mem_alignment' is the configured * the amount allocated by darshan-core on output. If given, 'rank' is
* memory alignment value Darshan was configured with. * a pointer to an integer which will contain the calling process's
* MPI rank on return. If given, 'sys_mem_alignment' is a pointer to
* an integer which will contain the memory alignment value Darshan
* was configured with on return.
*/ */
void darshan_core_register_module( void darshan_core_register_module(
darshan_module_id mod_id, darshan_module_id mod_id,
...@@ -115,7 +118,7 @@ void darshan_core_unregister_module( ...@@ -115,7 +118,7 @@ void darshan_core_unregister_module(
/* darshan_core_gen_record_id() /* darshan_core_gen_record_id()
* *
* * Returns the Darshan record ID correpsonding to input string 'name'.
*/ */
darshan_record_id darshan_core_gen_record_id( darshan_record_id darshan_core_gen_record_id(
const char *name); const char *name);
...@@ -124,15 +127,14 @@ darshan_record_id darshan_core_gen_record_id( ...@@ -124,15 +127,14 @@ darshan_record_id darshan_core_gen_record_id(
* *
* Register a record with the darshan-core runtime, allowing it to be * Register a record with the darshan-core runtime, allowing it to be
* properly tracked and (potentially) correlated with records from other * properly tracked and (potentially) correlated with records from other
* modules. 'name' is the the name of the Darshan record (e.g., the full * modules. 'rec_id' is the Darshan record id as given by the
* file path) and 'len' is the size of the name pointer (string length * `darshan_core_gen_record_id` function. 'name' is the the name of the
* for string names). 'mod_id' is the identifier of the calling module, * Darshan record (e.g., the full file path), which for now is just a
* 'printable_flag' indicates whether the name is a string, and * string. 'mod_id' is the identifier of the calling module. 'rec_len'
* 'mod_limit_flag' is set if the calling module is out of memory (to * is the size of the record being registered with Darshan. If given,
* prevent darshan-core from creating new records and to just search * 'file_alignment' is a pointer to an integer which on return will
* through existing records). 'rec_id' is an output pointer storing the * contain the corresponding file system alignment of the file system
* correspoing Darshan record identifier and 'file_alignment' is an output * path 'name' resides on.
* pointer storing the file system alignment value for the given record.
*/ */
void *darshan_core_register_record( void *darshan_core_register_record(
darshan_record_id rec_id, darshan_record_id rec_id,
...@@ -150,8 +152,8 @@ double darshan_core_wtime(void); ...@@ -150,8 +152,8 @@ double darshan_core_wtime(void);
/* darshan_core_excluded_path() /* darshan_core_excluded_path()
* *
* Returns true (1) if the given file path is in Darshan's list of * Returns true (1) if the given file path 'path' is in Darshan's
* excluded file paths, false (0) otherwise. * list of excluded file paths, false (0) otherwise.
*/ */
int darshan_core_excluded_path( int darshan_core_excluded_path(
const char * path); const char * path);
......
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