Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
darshan
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
73
Issues
73
List
Boards
Labels
Milestones
Merge Requests
8
Merge Requests
8
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
darshan
darshan
Commits
4ac75905
Commit
4ac75905
authored
Dec 04, 2015
by
Shane Snyder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify hash write routine to use new serialization
parent
c9618c8a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
8 deletions
+4
-8
darshan-util/darshan-logutils.c
darshan-util/darshan-logutils.c
+4
-8
No files found.
darshan-util/darshan-logutils.c
View file @
4ac75905
...
...
@@ -638,13 +638,12 @@ int darshan_log_puthash(darshan_fd fd, struct darshan_record_ref *hash)
int
hash_buf_sz
;
struct
darshan_record_ref
*
ref
,
*
tmp
;
char
*
buf_ptr
;
int
path_len
;
int
wrote
;
assert
(
state
);
/* allocate memory for largest possible hash record */
hash_buf_sz
=
sizeof
(
darshan_record_id
)
+
sizeof
(
uint32_t
)
+
PATH_MAX
;
hash_buf_sz
=
sizeof
(
darshan_record_id
)
+
PATH_MAX
+
1
;
hash_buf
=
malloc
(
hash_buf_sz
);
if
(
!
hash_buf
)
return
(
-
1
);
...
...
@@ -654,18 +653,15 @@ int darshan_log_puthash(darshan_fd fd, struct darshan_record_ref *hash)
HASH_ITER
(
hlink
,
hash
,
ref
,
tmp
)
{
buf_ptr
=
hash_buf
;
path_len
=
strlen
(
ref
->
rec
.
name
);
/* the hash buffer has space to serialize this record
* NOTE: darshan record hash serialization method:
* ... darshan_record_id |
(uint32_t) path_len | path
...
* ... darshan_record_id |
path '\0'
...
*/
*
((
darshan_record_id
*
)
buf_ptr
)
=
ref
->
rec
.
id
;
buf_ptr
+=
sizeof
(
darshan_record_id
);
*
((
uint32_t
*
)
buf_ptr
)
=
path_len
;
buf_ptr
+=
sizeof
(
uint32_t
);
memcpy
(
buf_ptr
,
ref
->
rec
.
name
,
path_len
);
buf_ptr
+=
path_len
;
strcpy
(
buf_ptr
,
ref
->
rec
.
name
);
buf_ptr
+=
strlen
(
ref
->
rec
.
name
)
+
1
;
/* write this hash entry to log file */
wrote
=
darshan_log_dzwrite
(
fd
,
DARSHAN_REC_MAP_REGION_ID
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment