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
Shane Snyder
darshan
Commits
86d17440
Commit
86d17440
authored
Sep 10, 2015
by
Shane Snyder
Browse files
cleanup code in utility component
parent
ae15d896
Changes
7
Hide whitespace changes
Inline
Side-by-side
darshan-util/Makefile.in
View file @
86d17440
...
...
@@ -23,8 +23,8 @@ VPATH = $(srcdir)
ifeq
($(DARSHAN_ENABLE_SHARED),1)
all
:
libdarshan-util.so
endif
cp_zlib_link_flags
=
@__
CP
_ZLIB_LINK_FLAGS@
cp_zlib_include_flags
=
@__
CP
_ZLIB_INCLUDE_FLAGS@
cp_zlib_link_flags
=
@__
DARSHAN
_ZLIB_LINK_FLAGS@
cp_zlib_include_flags
=
@__
DARSHAN
_ZLIB_INCLUDE_FLAGS@
# deliberately avoid large file support for host side utilities to avoid
# potentially buggy libz 64 bit offset support
...
...
darshan-util/configure
View file @
86d17440
...
...
@@ -623,9 +623,9 @@ ac_subst_vars='LTLIBOBJS
LIBOBJS
DARSHAN_UTIL_VERSION
DARSHAN_ENABLE_SHARED
__
CP
_PDFLATEX_HALT_ON_ERROR
__
CP
_ZLIB_INCLUDE_FLAGS
__
CP
_ZLIB_LINK_FLAGS
__
DARSHAN
_PDFLATEX_HALT_ON_ERROR
__
DARSHAN
_ZLIB_INCLUDE_FLAGS
__
DARSHAN
_ZLIB_LINK_FLAGS
HAVE_PDFLATEX
PRI_MACROS_BROKEN
LIBBZ2
...
...
@@ -3431,8 +3431,8 @@ if test "${with_zlib+set}" = set; then :
ZLIB_HOME
=
"
$withval
"
LDFLAGS
=
"
$LDFLAGS
-L
${
ZLIB_HOME
}
/lib"
CPPFLAGS
=
"
$CPPFLAGS
-I
${
ZLIB_HOME
}
/include"
__
CP
_ZLIB_LINK_FLAGS
=
"-L
${
ZLIB_HOME
}
/lib"
__
CP
_ZLIB_INCLUDE_FLAGS
=
"-I
${
ZLIB_HOME
}
/include"
__
DARSHAN
_ZLIB_LINK_FLAGS
=
"-L
${
ZLIB_HOME
}
/lib"
__
DARSHAN
_ZLIB_INCLUDE_FLAGS
=
"-I
${
ZLIB_HOME
}
/include"
else
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: WARNING: Sorry,
$withval
does not exist, checking usual places"
>
&5
$as_echo
"
$as_me
: WARNING: Sorry,
$withval
does not exist, checking usual places"
>
&2
;
}
...
...
@@ -3805,9 +3805,9 @@ $as_echo_n "checking for -halt-on-error argument to pdflatex... " >&6; }
if
test
"x
$PDFLATEX_GREP
"
!=
"x"
;
then
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result: yes"
>
&5
$as_echo
"yes"
>
&6
;
}
__
CP
_PDFLATEX_HALT_ON_ERROR
=
"-halt-on-error"
__
DARSHAN
_PDFLATEX_HALT_ON_ERROR
=
"-halt-on-error"
else
__
CP
_PDFLATEX_HALT_ON_ERROR
=
""
__
DARSHAN
_PDFLATEX_HALT_ON_ERROR
=
""
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result: no"
>
&5
$as_echo
"no"
>
&6
;
}
fi
...
...
darshan-util/configure.in
View file @
86d17440
...
...
@@ -30,9 +30,9 @@ if test x$HAVE_PDFLATEX == xyes; then
PDFLATEX_GREP=`pdflatex --help |grep halt-on-error`
if test "x$PDFLATEX_GREP" != "x"; then
AC_MSG_RESULT(yes)
__
CP
_PDFLATEX_HALT_ON_ERROR="-halt-on-error"
__
DARSHAN
_PDFLATEX_HALT_ON_ERROR="-halt-on-error"
else
__
CP
_PDFLATEX_HALT_ON_ERROR=""
__
DARSHAN
_PDFLATEX_HALT_ON_ERROR=""
AC_MSG_RESULT(no)
fi
fi
...
...
@@ -82,9 +82,9 @@ AC_CHECK_FUNCS([strndup])
DARSHAN_UTIL_VERSION="AC_PACKAGE_VERSION"
AC_SUBST(__
CP
_ZLIB_LINK_FLAGS)
AC_SUBST(__
CP
_ZLIB_INCLUDE_FLAGS)
AC_SUBST(__
CP
_PDFLATEX_HALT_ON_ERROR)
AC_SUBST(__
DARSHAN
_ZLIB_LINK_FLAGS)
AC_SUBST(__
DARSHAN
_ZLIB_INCLUDE_FLAGS)
AC_SUBST(__
DARSHAN
_PDFLATEX_HALT_ON_ERROR)
AC_SUBST(DARSHAN_ENABLE_SHARED)
AC_SUBST(DARSHAN_UTIL_VERSION)
AC_OUTPUT(Makefile
...
...
darshan-util/darshan-bgq-parser.c
deleted
100644 → 0
View file @
ae15d896
/*
* Copyright (C) 2015 University of Chicago.
* See COPYRIGHT notice in top-level directory.
*
*/
#include
<stdio.h>
#include
<sys/types.h>
#include
<sys/stat.h>
#include
<fcntl.h>
#include
<unistd.h>
#include
<string.h>
#include
<zlib.h>
#include
<time.h>
#include
<stdlib.h>
#include
<getopt.h>
#include
<assert.h>
#include
"darshan-logutils.h"
#include
"darshan-bgq-logutils.h"
#include
"uthash-1.9.2/src/uthash.h"
int
main
(
int
argc
,
char
**
argv
)
{
int
ret
;
int
i
;
char
*
filename
;
char
tmp_string
[
4096
];
darshan_fd
fd
;
struct
darshan_header
header
;
struct
darshan_job
job
;
struct
darshan_record_ref
*
rec_hash
=
NULL
;
struct
darshan_record_ref
*
ref
;
int
mount_count
;
char
**
mnt_pts
;
char
**
fs_types
;
time_t
tmp_time
=
0
;
char
*
token
;
char
*
save
;
char
buffer
[
DARSHAN_JOB_METADATA_LEN
];
struct
darshan_bgq_record
next_file
;
assert
(
argc
==
2
);
filename
=
argv
[
1
];
struct
stat
sbuf
;
stat
(
filename
,
&
sbuf
);
fd
=
darshan_log_open
(
filename
,
"r"
);
if
(
!
fd
)
{
fprintf
(
stderr
,
"darshan_log_open() failed to open %s
\n
."
,
filename
);
return
(
-
1
);
}
/* read darshan log header */
ret
=
darshan_log_getheader
(
fd
,
&
header
);
if
(
ret
<
0
)
{
fprintf
(
stderr
,
"darshan_log_getheader() failed to read log header.
\n
"
);
darshan_log_close
(
fd
);
return
(
-
1
);
}
/* read darshan job info */
ret
=
darshan_log_getjob
(
fd
,
&
job
);
if
(
ret
<
0
)
{
fprintf
(
stderr
,
"darshan_log_getjob() failed to read job data.
\n
"
);
darshan_log_close
(
fd
);
return
(
-
1
);
}
/* get the original command line for this job */
ret
=
darshan_log_getexe
(
fd
,
tmp_string
);
if
(
ret
<
0
)
{
fprintf
(
stderr
,
"Error: unable to read trailing job information.
\n
"
);
darshan_log_close
(
fd
);
return
(
-
1
);
}
/* print job summary */
printf
(
"# darshan log version: %s
\n
"
,
header
.
version_string
);
printf
(
"# size of BGQ file statistics: %zu bytes
\n
"
,
sizeof
(
struct
darshan_bgq_record
));
printf
(
"# size of job statistics: %zu bytes
\n
"
,
sizeof
(
struct
darshan_job
));
printf
(
"# exe: %s
\n
"
,
tmp_string
);
printf
(
"# uid: %"
PRId64
"
\n
"
,
job
.
uid
);
printf
(
"# jobid: %"
PRId64
"
\n
"
,
job
.
jobid
);
printf
(
"# start_time: %"
PRId64
"
\n
"
,
job
.
start_time
);
tmp_time
+=
job
.
start_time
;
printf
(
"# start_time_asci: %s"
,
ctime
(
&
tmp_time
));
printf
(
"# end_time: %"
PRId64
"
\n
"
,
job
.
end_time
);
tmp_time
=
0
;
tmp_time
+=
job
.
end_time
;
printf
(
"# end_time_asci: %s"
,
ctime
(
&
tmp_time
));
printf
(
"# nprocs: %"
PRId64
"
\n
"
,
job
.
nprocs
);
printf
(
"# run time: %"
PRId64
"
\n
"
,
job
.
end_time
-
job
.
start_time
+
1
);
for
(
token
=
strtok_r
(
job
.
metadata
,
"
\n
"
,
&
save
);
token
!=
NULL
;
token
=
strtok_r
(
NULL
,
"
\n
"
,
&
save
))
{
char
*
key
;
char
*
value
;
/* NOTE: we intentionally only split on the first = character.
* There may be additional = characters in the value portion
* (for example, when storing mpi-io hints).
*/
strcpy
(
buffer
,
token
);
key
=
buffer
;
value
=
index
(
buffer
,
'='
);
if
(
!
value
)
continue
;
/* convert = to a null terminator to split key and value */
value
[
0
]
=
'\0'
;
value
++
;
printf
(
"# metadata: %s = %s
\n
"
,
key
,
value
);
}
/* get the mount information for this log */
ret
=
darshan_log_getmounts
(
fd
,
&
mnt_pts
,
&
fs_types
,
&
mount_count
);
if
(
ret
<
0
)
{
fprintf
(
stderr
,
"darshan_log_getmounts() failed to read mount information.
\n
"
);
darshan_log_close
(
fd
);
return
(
-
1
);
}
/* print table of mounted file systems */
printf
(
"
\n
# mounted file systems (mount point and fs type)
\n
"
);
printf
(
"# -------------------------------------------------------
\n
"
);
for
(
i
=
0
;
i
<
mount_count
;
i
++
)
{
printf
(
"# mount entry:
\t
%s
\t
%s
\n
"
,
mnt_pts
[
i
],
fs_types
[
i
]);
}
/* read hash of darshan records */
ret
=
darshan_log_gethash
(
fd
,
&
rec_hash
);
if
(
ret
<
0
)
{
fprintf
(
stderr
,
"darshan_log_getmap() failed to read record map.
\n
"
);
darshan_log_close
(
fd
);
return
(
-
1
);
}
printf
(
"
\n
*** FILE RECORD DATA ***
\n
"
);
ret
=
darshan_log_get_bgq_file
(
fd
,
&
next_file
);
if
(
ret
<
0
)
{
fprintf
(
stderr
,
"darshan_log_get_posix_file() failed to read next record.
\n
"
);
darshan_log_close
(
fd
);
return
(
-
1
);
}
if
(
ret
==
0
)
{
printf
(
"# no files opened.
\n
"
);
darshan_log_close
(
fd
);
return
(
0
);
}
/* loop over each stored POSIX file record and print counters */
i
=
1
;
do
{
/* get the pathname for this record */
HASH_FIND
(
hlink
,
rec_hash
,
&
next_file
.
f_id
,
sizeof
(
darshan_record_id
),
ref
);
assert
(
ref
);
printf
(
"
\t
Record %d: id=%"
PRIu64
" (path=%s, rank=%"
PRId64
")
\n
"
,
i
,
next_file
.
f_id
,
ref
->
rec
.
name
,
next_file
.
rank
);
printf
(
"
\t\t
BGQ_CSJOBID:
\t
%"
PRIu64
"
\n
"
"
\t\t
BGQ_NNODES:
\t
%"
PRIu64
"
\n
"
"
\t\t
BGQ_RPN:
\t
%"
PRIu64
"
\n
"
"
\t\t
BGQ_DDRPERNODE:
\t
%"
PRIu64
"
\n
"
"
\t\t
BGQ_INODES:
\t
%"
PRIu64
"
\n
"
"
\t\t
BGQ_ANODES:
\t
%"
PRIu64
"
\n
"
"
\t\t
BGQ_BNODES:
\t
%"
PRIu64
"
\n
"
"
\t\t
BGQ_CNODES:
\t
%"
PRIu64
"
\n
"
"
\t\t
BGQ_DNODES:
\t
%"
PRIu64
"
\n
"
"
\t\t
BGQ_ENODES:
\t
%"
PRIu64
"
\n
"
"
\t\t
BGQ_TORUSEN:
\t
%"
PRIx64
"
\n
"
"
\t\t
BGQ_TIMESTAMP:
\t
%lf
\n
"
,
next_file
.
counters
[
BGQ_CSJOBID
],
next_file
.
counters
[
BGQ_NNODES
],
next_file
.
counters
[
BGQ_RANKSPERNODE
],
next_file
.
counters
[
BGQ_DDRPERNODE
],
next_file
.
counters
[
BGQ_INODES
],
next_file
.
counters
[
BGQ_ANODES
],
next_file
.
counters
[
BGQ_BNODES
],
next_file
.
counters
[
BGQ_CNODES
],
next_file
.
counters
[
BGQ_DNODES
],
next_file
.
counters
[
BGQ_ENODES
],
next_file
.
counters
[
BGQ_TORUSENABLED
],
next_file
.
fcounters
[
BGQ_F_TIMESTAMP
]);
i
++
;
}
while
((
ret
=
darshan_log_get_bgq_file
(
fd
,
&
next_file
))
==
1
);
/* free mount info */
for
(
i
=
0
;
i
<
mount_count
;
i
++
)
{
free
(
mnt_pts
[
i
]);
free
(
fs_types
[
i
]);
}
if
(
mount_count
>
0
)
{
free
(
mnt_pts
);
free
(
fs_types
);
}
darshan_log_close
(
fd
);
return
(
0
);
}
darshan-util/darshan-job-summary/bin/darshan-job-summary.pl.in
View file @
86d17440
...
...
@@ -928,7 +928,7 @@ system "$epstopdf pattern.eps";
# generate summary PDF
# NOTE: we pass arguments to the latex template using '\def' commands
# NOTE: an autoconf test determines if -halt-on-error is available and sets
# __
CP
_PDFLATEX_HALT_ON_ERROR accordingly
# __
DARSHAN
_PDFLATEX_HALT_ON_ERROR accordingly
my
$latex_cmd_line
=
"
\"\\
def
\\
titlecmd{
$cmd
}
\\
\\
def
\\
titlemon{
$mon
}
\\
\\
def
\\
titlemday{
$mday
}
\\
...
...
@@ -949,7 +949,7 @@ my $latex_cmd_line = "\"\\def\\titlecmd{$cmd} \\
\\
def
\\
filecmi{
$cmi
}
\\
\\
def
\\
filecms{
$cms
}
\\
\\
input{summary.tex}
\"
\\
@__
CP
_PDFLATEX_HALT_ON_ERROR
@
";
@__
DARSHAN
_PDFLATEX_HALT_ON_ERROR
@
";
if
(
defined
$summary
{
MPIIO_INDEP_OPENS
})
{
...
...
darshan-util/darshan-logutils.c
View file @
86d17440
...
...
@@ -602,7 +602,7 @@ int darshan_log_gethash(darshan_fd fd, struct darshan_record_ref **hash)
hash_buf
,
&
hash_buf_sz
,
fd
->
comp_type
);
if
(
ret
<
0
)
{
fprintf
(
stderr
,
"Error: unable to decompress darshan
job
data.
\n
"
);
fprintf
(
stderr
,
"Error: unable to decompress darshan
record map
data.
\n
"
);
free
(
comp_buf
);
free
(
hash_buf
);
return
(
-
1
);
...
...
darshan-util/maint/darshan-util.pc.in
View file @
86d17440
...
...
@@ -3,8 +3,8 @@ exec_prefix = @exec_prefix@
libdir = @libdir@
includedir = @includedir@
abs_top_builddir = @abs_top_builddir@
cp
_zlib_include_flags = @__
CP
_ZLIB_INCLUDE_FLAGS@
cp
_zlib_link_flags = @__
CP
_ZLIB_LINK_FLAGS@
darshan
_zlib_include_flags = @__
DARSHAN
_ZLIB_INCLUDE_FLAGS@
darshan
_zlib_link_flags = @__
DARSHAN
_ZLIB_LINK_FLAGS@
LIBBZ2 = @LIBBZ2@
Name: darshan-util
...
...
@@ -13,5 +13,5 @@ Version: @DARSHAN_UTIL_VERSION@
URL: http://trac.mcs.anl.gov/projects/darshan/
Requires:
Libs: -L${libdir} -ldarshan-util
Libs.private: ${
cp
_zlib_link_flags} -lz ${LIBBZ2}
Cflags: -I${includedir} ${
cp
_zlib_include_flags}
Libs.private: ${
darshan
_zlib_link_flags} -lz ${LIBBZ2}
Cflags: -I${includedir} ${
darshan
_zlib_include_flags}
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