Commit 347a0744 authored by Shane Snyder's avatar Shane Snyder

small edits to posix mod and docs

parent 3a01d053
......@@ -1710,13 +1710,12 @@ static void posix_setup_reduction(
*recv_buf = malloc(*shared_rec_count * sizeof(struct darshan_posix_file));
if(!(*recv_buf))
return;
}
*rec_size = sizeof(struct darshan_posix_file);
/* TODO: cleaner way to do this? */
if(my_rank == 0)
posix_runtime->red_buf = *recv_buf;
}
*rec_size = sizeof(struct darshan_posix_file);
posix_runtime->shared_rec_count = *shared_rec_count;
return;
......@@ -1967,7 +1966,6 @@ static void posix_get_output_data(
int tmp_ndx = posix_runtime->file_array_ndx - posix_runtime->shared_rec_count;
memcpy(&(posix_runtime->file_record_array[tmp_ndx]), posix_runtime->red_buf,
posix_runtime->shared_rec_count * sizeof(struct darshan_posix_file));
free(posix_runtime->red_buf);
}
else
{
......@@ -1994,6 +1992,9 @@ static void posix_shutdown()
HASH_CLEAR(hlink, posix_runtime->file_hash); /* these entries are freed all at once below */
if(my_rank == 0 && posix_runtime->red_buf)
free(posix_runtime->red_buf);
free(posix_runtime->file_runtime_array);
free(posix_runtime->file_record_array);
free(posix_runtime);
......
......@@ -159,19 +159,6 @@ to ensure data consistency and avoid other race conditions. This function also s
opportunity for a module to modify internal data structures prior to a possible reduction of shared
data.
`setup_reduction()`
An optional feature provided to instrumentation modules it the ability to run reduction operations
on I/O data records which are shared across all application processes (e.g., data records for a
shared file). This reduction is done to minimize the size of the resulting I/O characterization,
by aggregating shared records into a single data record.
This function allows modules to setup internal data structures to run a reduction operation
on data records which are shared across all application processes. Module developers can bypass
the shared record reduction mechanism by setting the `setup_reduction` function pointer equal to `NULL`.
This is helpful in initial prototyping of a module, or in the case where a module would not maintain
I/O data which is shared across all processes.
`get_output_data()`
This function is responsible for passing back a single buffer storing all data this module is
......@@ -495,8 +482,8 @@ Since Darshan perfers to aggregate data records which are shared across all proc
data record, module developers should consider implementing this functionality eventually, though it
is not strictly required.
As mentioned previously, module developers must provide implementations for the `begin_reduction()`
and `record_reduction_op` functions in the darshan_module_funcs structure to leverage Darshan's
As mentioned previously, module developers must provide implementations for the `setup_reduction()`
and `record_reduction_op()` functions in the darshan_module_funcs structure to leverage Darshan's
shared record reduction mechanism. These functions are described in detail as follows:
[source,c]
......
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