Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
darshan
darshan
Commits
3b0dacf7
Commit
3b0dacf7
authored
Aug 06, 2015
by
Shane Snyder
Browse files
logutil definitions for hdf5 module
parent
3a362ed5
Changes
5
Hide whitespace changes
Inline
Side-by-side
darshan-util/Makefile.in
View file @
3b0dacf7
...
...
@@ -56,10 +56,15 @@ darshan-mpiio-logutils.o: darshan-mpiio-logutils.c darshan-logutils.h darshan-mp
darshan-mpiio-logutils.po
:
darshan-mpiio-logutils.c darshan-logutils.h darshan-mpiio-logutils.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-mpiio-log-format.h | uthash-1.9.2
$(CC)
$(CFLAGS_SHARED)
-c
$<
-o
$@
libdarshan-util.so
:
darshan-logutils.po darshan-posix-logutils.po darshan-mpiio-logutils.po
darshan-hdf5-logutils.o
:
darshan-hdf5-logutils.c darshan-logutils.h darshan-hdf5-logutils.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-hdf5-log-format.h | uthash-1.9.2
$(CC)
$(CFLAGS)
-c
$<
-o
$@
darshan-hdf5-logutils.po
:
darshan-hdf5-logutils.c darshan-logutils.h darshan-hdf5-logutils.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-hdf5-log-format.h | uthash-1.9.2
$(CC)
$(CFLAGS_SHARED)
-c
$<
-o
$@
libdarshan-util.so
:
darshan-logutils.po darshan-posix-logutils.po darshan-mpiio-logutils.po darshan-hdf5-logutils.po
$(CC)
$(CFLAGS_SHARED)
$(LDFLAGS)
-o
$@
$^
$(LIBS)
libdarshan-util.a
:
darshan-logutils.o darshan-posix-logutils.o darshan-mpiio-logutils.o
libdarshan-util.a
:
darshan-logutils.o darshan-posix-logutils.o darshan-mpiio-logutils.o
darshan-hdf5-logutils.o
ar rcs libdarshan-util.a
$^
jenkins
:
util/bin/jenkins.o lookup3.o
...
...
darshan-util/darshan-hdf5-logutils.c
0 → 100644
View file @
3b0dacf7
/*
* Copyright (C) 2015 University of Chicago.
* See COPYRIGHT notice in top-level directory.
*
*/
#define _GNU_SOURCE
#include
"darshan-util-config.h"
#include
<stdio.h>
#include
<string.h>
#include
<assert.h>
#include
<stdlib.h>
#include
<unistd.h>
#include
<inttypes.h>
#include
<sys/types.h>
#include
<sys/stat.h>
#include
<fcntl.h>
#include
<errno.h>
#include
"darshan-hdf5-logutils.h"
/* counter name strings for the HDF5 module */
#define X(a) #a,
char
*
hdf5_counter_names
[]
=
{
HDF5_COUNTERS
};
char
*
hdf5_f_counter_names
[]
=
{
HDF5_F_COUNTERS
};
#undef X
struct
darshan_mod_logutil_funcs
hdf5_logutils
=
{
.
log_get_record
=
&
darshan_log_get_hdf5_file
,
.
log_print_record
=
&
darshan_log_print_hdf5_file
,
};
int
darshan_log_get_hdf5_file
(
darshan_fd
fd
,
void
**
file_rec
,
darshan_record_id
*
rec_id
)
{
int
i
;
int
ret
;
struct
darshan_hdf5_file
*
file
=
NULL
;
file
=
malloc
(
sizeof
(
*
file
));
if
(
!
file
)
return
(
-
1
);
memset
(
file
,
0
,
sizeof
(
*
file
));
ret
=
darshan_log_get_moddat
(
fd
,
DARSHAN_HDF5_MOD
,
(
void
*
)
file
,
sizeof
(
*
file
));
if
(
ret
==
1
)
{
if
(
fd
->
swap_flag
)
{
/* swap bytes if necessary */
DARSHAN_BSWAP64
(
&
file
->
f_id
);
DARSHAN_BSWAP64
(
&
file
->
rank
);
for
(
i
=
0
;
i
<
HDF5_NUM_INDICES
;
i
++
)
DARSHAN_BSWAP64
(
&
file
->
counters
[
i
]);
for
(
i
=
0
;
i
<
HDF5_F_NUM_INDICES
;
i
++
)
DARSHAN_BSWAP64
(
&
file
->
fcounters
[
i
]);
}
}
/* pass the file record back */
*
file_rec
=
(
void
*
)
file
;
*
rec_id
=
file
->
f_id
;
return
(
ret
);
}
void
darshan_log_print_hdf5_file
(
void
*
file_rec
,
char
*
file_name
,
char
*
mnt_pt
,
char
*
fs_type
)
{
int
i
;
struct
darshan_hdf5_file
*
hdf5_file_rec
=
(
struct
darshan_hdf5_file
*
)
file_rec
;
for
(
i
=
0
;
i
<
HDF5_NUM_INDICES
;
i
++
)
{
DARSHAN_COUNTER_PRINT
(
darshan_module_names
[
DARSHAN_HDF5_MOD
],
hdf5_file_rec
->
rank
,
hdf5_file_rec
->
f_id
,
hdf5_counter_names
[
i
],
hdf5_file_rec
->
counters
[
i
],
file_name
,
mnt_pt
,
fs_type
);
}
for
(
i
=
0
;
i
<
HDF5_F_NUM_INDICES
;
i
++
)
{
DARSHAN_F_COUNTER_PRINT
(
darshan_module_names
[
DARSHAN_HDF5_MOD
],
hdf5_file_rec
->
rank
,
hdf5_file_rec
->
f_id
,
hdf5_f_counter_names
[
i
],
hdf5_file_rec
->
fcounters
[
i
],
file_name
,
mnt_pt
,
fs_type
);
}
return
;
}
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* End:
*
* vim: ts=8 sts=4 sw=4 expandtab
*/
darshan-util/darshan-hdf5-logutils.h
0 → 100644
View file @
3b0dacf7
/*
* Copyright (C) 2015 University of Chicago.
* See COPYRIGHT notice in top-level directory.
*
*/
#ifndef __DARSHAN_HDF5_LOG_UTILS_H
#define __DARSHAN_HDF5_LOG_UTILS_H
#include
"darshan-logutils.h"
#include
"darshan-hdf5-log-format.h"
extern
char
*
hdf5_counter_names
[];
extern
char
*
hdf5_f_counter_names
[];
extern
struct
darshan_mod_logutil_funcs
hdf5_logutils
;
int
darshan_log_get_hdf5_file
(
darshan_fd
fd
,
void
**
file_rec
,
darshan_record_id
*
rec_id
);
void
darshan_log_print_hdf5_file
(
void
*
file_rec
,
char
*
file_name
,
char
*
mnt_pt
,
char
*
fs_type
);
#endif
darshan-util/darshan-logutils.c
View file @
3b0dacf7
...
...
@@ -29,7 +29,7 @@ struct darshan_mod_logutil_funcs *mod_logutils[DARSHAN_MAX_MODS] =
NULL
,
/* NULL */
&
posix_logutils
,
/* POSIX */
&
mpiio_logutils
,
/* MPI-IO */
NULL
,
/* HDF5 */
&
hdf5_logutils
,
/* HDF5 */
NULL
,
/* PNETCDF */
NULL
,
NULL
,
...
...
darshan-util/darshan-logutils.h
View file @
3b0dacf7
...
...
@@ -55,6 +55,7 @@ extern struct darshan_mod_logutil_funcs *mod_logutils[DARSHAN_MAX_MODS];
#include
"darshan-posix-logutils.h"
#include
"darshan-mpiio-logutils.h"
#include
"darshan-hdf5-logutils.h"
darshan_fd
darshan_log_open
(
const
char
*
name
,
const
char
*
mode
);
int
darshan_log_getheader
(
darshan_fd
fd
,
struct
darshan_header
*
header
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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