Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
codes
codes
Commits
2b5f713e
Commit
2b5f713e
authored
Feb 21, 2014
by
Jonathan Jenkins
Browse files
cleaned, made user-friendly the workload print util
parent
dc5519e2
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/workload/codes-workload-dump.c
View file @
2b5f713e
...
@@ -17,16 +17,25 @@ static struct option long_opts[] =
...
@@ -17,16 +17,25 @@ static struct option long_opts[] =
{
{
{
"type"
,
required_argument
,
NULL
,
't'
},
{
"type"
,
required_argument
,
NULL
,
't'
},
{
"num-ranks"
,
required_argument
,
NULL
,
'n'
},
{
"num-ranks"
,
required_argument
,
NULL
,
'n'
},
{
"d-log"
,
optional
_argument
,
NULL
,
'l'
},
{
"d-log"
,
required
_argument
,
NULL
,
'l'
},
{
"d-aggregator-cnt"
,
optional
_argument
,
NULL
,
'a'
},
{
"d-aggregator-cnt"
,
required
_argument
,
NULL
,
'a'
},
{
NULL
,
0
,
NULL
,
0
}
{
NULL
,
0
,
NULL
,
0
}
};
};
void
usage
(){
fprintf
(
stderr
,
"Usage: codes-workload-dump --type TYPE --num-ranks N "
"[--d-log LOG --d-aggregator-cnt CNT]
\n
"
"--type: type of workload (currently only
\"
darshan_io_workload
\"
)
\n
"
"--num-ranks: number of ranks to process
\n
"
"--d-log: darshan log file
\n
"
"--d-aggregator-cnt: number of aggregators for collective I/O in darshan
\n
"
);
}
int
main
(
int
argc
,
char
*
argv
[])
int
main
(
int
argc
,
char
*
argv
[])
{
{
char
ch
;
char
ch
;
while
((
ch
=
getopt_long
(
argc
,
argv
,
"t:l:a:"
,
long_opts
,
NULL
))
!=
-
1
){
while
((
ch
=
getopt_long
(
argc
,
argv
,
"t:
n:
l:a:"
,
long_opts
,
NULL
))
!=
-
1
){
switch
(
ch
){
switch
(
ch
){
case
't'
:
case
't'
:
strcpy
(
type
,
optarg
);
strcpy
(
type
,
optarg
);
...
@@ -44,13 +53,38 @@ int main(int argc, char *argv[])
...
@@ -44,13 +53,38 @@ int main(int argc, char *argv[])
}
}
}
}
if
(
type
[
0
]
==
'\0'
){
fprintf
(
stderr
,
"Expected
\"
--type
\"
argument
\n
"
);
usage
();
return
1
;
}
if
(
n
==
-
1
){
fprintf
(
stderr
,
"Expected
\"
--num-ranks
\"
argument
\n
"
);
usage
();
return
1
;
}
int
i
;
int
i
;
char
*
wparams
;
char
*
wparams
;
if
(
strcmp
(
type
,
"darshan_io_workload"
)
==
0
){
if
(
strcmp
(
type
,
"darshan_io_workload"
)
==
0
){
wparams
=
(
char
*
)
&
d_params
;
if
(
d_params
.
log_file_path
[
0
]
==
'\0'
){
fprintf
(
stderr
,
"Expected
\"
--d-log
\"
argument for darshan workload
\n
"
);
usage
();
return
1
;
}
else
if
(
d_params
.
aggregator_cnt
==
0
){
fprintf
(
stderr
,
"Expected
\"
--d-aggregator-cnt
\"
argument for darshan workload
\n
"
);
usage
();
return
1
;
}
else
{
wparams
=
(
char
*
)
&
d_params
;
}
}
}
else
{
else
{
wparams
=
NULL
;
fprintf
(
stderr
,
"Invalid type argument
\n
"
);
usage
();
return
1
;
}
}
for
(
i
=
0
;
i
<
n
;
i
++
){
for
(
i
=
0
;
i
<
n
;
i
++
){
struct
codes_workload_op
op
;
struct
codes_workload_op
op
;
...
...
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