Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions darshan-runtime/lib/darshan-stdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@ extern int __real_fileno(FILE *stream);
STDIO_UNLOCK(); \
} while(0)

/* 'darshan_clean_file_path' normally returns a newly allocated string, but it
* might return NULL if __path is a special case (e.g. '<STDIN>'). If we see
* that case, we'll make a copy of __path. Now we don't need any special
* checks and _newpath can always bedeallocated in cleanup */
#define STDIO_RECORD_OPEN(__ret, __path, __tm1, __tm2) do { \
darshan_record_id __rec_id; \
struct stdio_file_record_ref *__rec_ref; \
Expand All @@ -223,16 +227,16 @@ extern int __real_fileno(FILE *stream);
(void)__darshan_disabled; \
if(!__ret || !__path) break; \
__newpath = darshan_clean_file_path(__path); \
if(!__newpath) __newpath = (char*)__path; \
if(!__newpath) __newpath = strdup((__path)); \
__rec_id = darshan_core_gen_record_id(__newpath); \
__rec_ref = darshan_lookup_record_ref(stdio_runtime->rec_id_hash, &__rec_id, sizeof(darshan_record_id)); \
if(!__rec_ref) __rec_ref = stdio_track_new_file_record(__rec_id, __newpath); \
if(!__rec_ref) { \
if(__newpath != (char*)__path) free(__newpath); \
free(__newpath); \
break; \
} \
_STDIO_RECORD_OPEN(__ret, __rec_ref, __tm1, __tm2, 1, -1); \
if(__newpath != (char*)__path) free(__newpath); \
free(__newpath); \
/* LDMS to publish realtime open tracing information to daemon*/ \
if(dC.ldms_lib)\
if(dC.stdio_enable_ldms)\
Expand Down
13 changes: 9 additions & 4 deletions darshan-runtime/lib/lookup8.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,12 @@ Use for hash table lookup, or anything where one collision in 2^^64
is acceptable. Do NOT use for cryptographic purposes.
--------------------------------------------------------------------
*/

ub8 darshan_hash( k, length, level)
#if 0
const register ub1 *k; /* the key */
register ub8 length; /* the length of the key */
register ub8 level; /* the previous hash, or an arbitrary value */
#endif
ub8 darshan_hash( const register ub1 *k, register ub8 length, register ub8 level)
{
register ub8 a,b,c,len;

Expand Down Expand Up @@ -150,10 +151,12 @@ register ub8 level; /* the previous hash, or an arbitrary value */
-- that the length be the number of ub8's in the key
--------------------------------------------------------------------
*/
ub8 hash2( k, length, level)
#if 0
register ub8 *k; /* the key */
register ub8 length; /* the length of the key */
register ub8 level; /* the previous hash, or an arbitrary value */
#endif
ub8 hash2( register ub8 *k, register ub8 length, register ub8 level)
{
register ub8 a,b,c,len;

Expand Down Expand Up @@ -195,10 +198,12 @@ register ub8 level; /* the previous hash, or an arbitrary value */
--------------------------------------------------------------------
*/

ub8 hash3( k, length, level)
#if 0
register ub1 *k; /* the key */
register ub8 length; /* the length of the key */
register ub8 level; /* the previous hash, or an arbitrary value */
#endif
ub8 hash3( register ub1 *k, register ub8 length, register ub8 level)
{
register ub8 a,b,c,len;

Expand Down
2 changes: 1 addition & 1 deletion darshan-util/darshan-hdf5-logutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ static int darshan_log_get_hdf5_dataset(darshan_fd fd, void** hdf5_buf_p)
struct darshan_hdf5_dataset *ds = *((struct darshan_hdf5_dataset **)hdf5_buf_p);
int rec_len;
int i;
int ret;
int ret=0;

if(fd->mod_map[DARSHAN_H5D_MOD].len == 0)
return(0);
Expand Down
2 changes: 1 addition & 1 deletion darshan-util/darshan-pnetcdf-logutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ static int darshan_log_get_pnetcdf_var(darshan_fd fd, void** pnetcdf_buf_p)
struct darshan_pnetcdf_var *var = *((struct darshan_pnetcdf_var **)pnetcdf_buf_p);
int rec_len;
int i;
int ret;
int ret=0;

if(fd->mod_map[DARSHAN_PNETCDF_VAR_MOD].len == 0)
return(0);
Expand Down
2 changes: 1 addition & 1 deletion darshan-util/darshan-stdio-logutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ static int darshan_log_get_stdio_record(darshan_fd fd, void** stdio_buf_p)
struct darshan_stdio_file *file = *((struct darshan_stdio_file **)stdio_buf_p);
int rec_len;
int i;
int ret;
int ret=0;

if(fd->mod_map[DARSHAN_STDIO_MOD].len == 0)
return(0);
Expand Down
Loading