Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Cristian Simarro
darshan
Commits
7d35c45a
Commit
7d35c45a
authored
May 27, 2016
by
Shane Snyder
Browse files
register/lookup_record now use strings explicitly
parent
8f463e51
Changes
6
Hide whitespace changes
Inline
Side-by-side
darshan-runtime/darshan.h
View file @
7d35c45a
...
...
@@ -119,8 +119,7 @@ void darshan_core_unregister_module(
*
*/
void
darshan_core_lookup_record
(
void
*
name
,
int
name_len
,
char
*
name
,
darshan_record_id
*
rec_id
);
/* darshan_core_register_record()
...
...
@@ -139,7 +138,7 @@ void darshan_core_lookup_record(
*/
int
darshan_core_register_record
(
darshan_record_id
rec_id
,
void
*
name
,
char
*
name
,
darshan_module_id
mod_id
,
int
rec_size
,
int
*
file_alignment
);
...
...
darshan-runtime/lib/darshan-core.c
View file @
7d35c45a
...
...
@@ -1772,16 +1772,14 @@ void darshan_core_unregister_module(
}
void
darshan_core_lookup_record
(
void
*
name
,
int
name_len
,
char
*
name
,
darshan_record_id
*
rec_id
)
{
darshan_record_id
tmp_rec_id
;
/* TODO: how do we handle potentially non-ascii record names? */
int
name_len
=
strlen
(
name
);
/* hash the input name to get a unique id for this record */
tmp_rec_id
=
darshan_hash
(
name
,
name_len
,
0
);
tmp_rec_id
=
darshan_hash
(
(
unsigned
char
*
)
name
,
name_len
,
0
);
*
rec_id
=
tmp_rec_id
;
return
;
...
...
@@ -1789,7 +1787,7 @@ void darshan_core_lookup_record(
int
darshan_core_register_record
(
darshan_record_id
rec_id
,
void
*
name
,
char
*
name
,
darshan_module_id
mod_id
,
int
rec_size
,
int
*
file_alignment
)
...
...
darshan-runtime/lib/darshan-hdf5.c
View file @
7d35c45a
...
...
@@ -279,8 +279,7 @@ static struct hdf5_file_runtime* hdf5_file_by_name(const char *name)
/* lookup the unique id for this filename */
darshan_core_lookup_record
(
(
void
*
)
newname
,
strlen
(
newname
),
newname
,
&
file_id
);
/* search the hash table for this file record, and return if found */
...
...
@@ -288,7 +287,7 @@ static struct hdf5_file_runtime* hdf5_file_by_name(const char *name)
if
(
!
file
)
{
/* register the record with the darshan core component */
ret
=
darshan_core_register_record
(
file_id
,
(
void
*
)
newname
,
DARSHAN_HDF5_MOD
,
ret
=
darshan_core_register_record
(
file_id
,
newname
,
DARSHAN_HDF5_MOD
,
sizeof
(
struct
darshan_hdf5_file
),
NULL
);
if
(
ret
==
1
)
{
...
...
darshan-runtime/lib/darshan-mpiio.c
View file @
7d35c45a
...
...
@@ -910,8 +910,7 @@ static struct mpiio_file_runtime* mpiio_file_by_name(const char *name)
/* lookup the unique id for this filename */
darshan_core_lookup_record
(
(
void
*
)
newname
,
strlen
(
newname
),
newname
,
&
file_id
);
/* search the hash table for this file record, and return if found */
...
...
@@ -919,7 +918,7 @@ static struct mpiio_file_runtime* mpiio_file_by_name(const char *name)
if
(
!
file
)
{
/* register the record with the darshan core component */
ret
=
darshan_core_register_record
(
file_id
,
(
void
*
)
newname
,
DARSHAN_MPIIO_MOD
,
ret
=
darshan_core_register_record
(
file_id
,
newname
,
DARSHAN_MPIIO_MOD
,
sizeof
(
struct
darshan_mpiio_file
),
NULL
);
if
(
ret
==
1
)
{
...
...
darshan-runtime/lib/darshan-pnetcdf.c
View file @
7d35c45a
...
...
@@ -291,8 +291,7 @@ static struct pnetcdf_file_runtime* pnetcdf_file_by_name(const char *name)
/* lookup the unique id for this filename */
darshan_core_lookup_record
(
(
void
*
)
newname
,
strlen
(
newname
),
newname
,
&
file_id
);
/* search the hash table for this file record, and return if found */
...
...
@@ -300,7 +299,7 @@ static struct pnetcdf_file_runtime* pnetcdf_file_by_name(const char *name)
if
(
!
file
)
{
/* register the record with the darshan core component */
ret
=
darshan_core_register_record
(
file_id
,
(
void
*
)
newname
,
DARSHAN_PNETCDF_MOD
,
ret
=
darshan_core_register_record
(
file_id
,
newname
,
DARSHAN_PNETCDF_MOD
,
sizeof
(
struct
darshan_pnetcdf_file
),
NULL
);
if
(
ret
==
1
)
{
...
...
darshan-runtime/lib/darshan-posix.c
View file @
7d35c45a
...
...
@@ -1529,8 +1529,7 @@ static struct posix_file_runtime* posix_file_by_name(const char *name)
/* lookup the unique id for this filename */
darshan_core_lookup_record
(
(
void
*
)
newname
,
strlen
(
newname
),
newname
,
&
file_id
);
/* search the hash table for this file record, and return if found */
...
...
@@ -1538,7 +1537,7 @@ static struct posix_file_runtime* posix_file_by_name(const char *name)
if
(
!
file
)
{
/* register the record with the darshan core component */
ret
=
darshan_core_register_record
(
file_id
,
(
void
*
)
newname
,
DARSHAN_POSIX_MOD
,
ret
=
darshan_core_register_record
(
file_id
,
newname
,
DARSHAN_POSIX_MOD
,
sizeof
(
struct
darshan_posix_file
),
&
file_alignment
);
if
(
ret
==
1
)
{
...
...
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