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
sds
sds-tests
Commits
4c893265
Commit
4c893265
authored
Dec 11, 2018
by
Philip Carns
Browse files
only print usage errors on rank 0
parent
4c652521
Changes
1
Hide whitespace changes
Inline
Side-by-side
perf-regression/margo-p2p-latency.c
View file @
4c893265
...
...
@@ -26,7 +26,7 @@ struct options
char
*
na_transport
;
};
static
void
parse_args
(
int
argc
,
char
**
argv
,
struct
options
*
opts
);
static
int
parse_args
(
int
argc
,
char
**
argv
,
struct
options
*
opts
);
static
void
usage
(
void
);
static
int
run_benchmark
(
int
iterations
,
hg_id_t
id
,
ssg_member_id_t
target
,
ssg_group_id_t
gid
,
margo_instance_id
mid
,
double
*
measurement_array
);
...
...
@@ -84,7 +84,13 @@ int main(int argc, char **argv)
printf
(
"Process %d of %d is on %s
\n
"
,
rank
,
nranks
,
processor_name
);
parse_args
(
argc
,
argv
,
&
g_opts
);
ret
=
parse_args
(
argc
,
argv
,
&
g_opts
);
if
(
ret
<
0
)
{
if
(
rank
==
0
)
usage
();
exit
(
EXIT_FAILURE
);
}
/* boilerplate ABT initialization steps */
/****************************************/
...
...
@@ -228,7 +234,7 @@ int main(int argc, char **argv)
return
0
;
}
static
void
parse_args
(
int
argc
,
char
**
argv
,
struct
options
*
opts
)
static
int
parse_args
(
int
argc
,
char
**
argv
,
struct
options
*
opts
)
{
int
opt
;
int
ret
;
...
...
@@ -248,46 +254,36 @@ static void parse_args(int argc, char **argv, struct options *opts)
if
(
!
opts
->
diag_file_name
)
{
perror
(
"strdup"
);
exit
(
EXIT_FAILURE
);
return
(
-
1
);
}
break
;
case
'i'
:
ret
=
sscanf
(
optarg
,
"%d"
,
&
opts
->
iterations
);
if
(
ret
!=
1
)
{
usage
();
exit
(
EXIT_FAILURE
);
}
return
(
-
1
);
break
;
case
't'
:
ret
=
sscanf
(
optarg
,
"%u,%u"
,
&
opts
->
mercury_timeout_client
,
&
opts
->
mercury_timeout_server
);
if
(
ret
!=
2
)
{
usage
();
exit
(
EXIT_FAILURE
);
}
return
(
-
1
);
break
;
case
'n'
:
opts
->
na_transport
=
strdup
(
optarg
);
if
(
!
opts
->
na_transport
)
{
perror
(
"strdup"
);
exit
(
EXIT_FAILURE
);
return
(
-
1
);
}
break
;
default:
usage
();
exit
(
EXIT_FAILURE
);
return
(
-
1
);
}
}
if
(
opts
->
iterations
<
1
||
!
opts
->
na_transport
)
{
usage
();
exit
(
EXIT_FAILURE
);
}
return
(
-
1
);
return
;
return
(
0
)
;
}
static
void
usage
(
void
)
...
...
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