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
Xin Wang
codes-dev
Commits
b2c58067
Commit
b2c58067
authored
Apr 18, 2014
by
Shane Snyder
Browse files
Add bglockless opt to mpi replay tool
parent
04e554e8
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/workload/codes-workload-mpi-replay.c
View file @
b2c58067
...
...
@@ -40,6 +40,7 @@ int hash_file_compare(void *key, struct qlist_head *link);
/* command line options */
static
int
opt_verbose
=
0
;
static
int
opt_noop
=
0
;
static
int
opt_lockless
=
0
;
/* hash table for storing file descriptors of opened files */
static
struct
qhash_table
*
fd_table
=
NULL
;
...
...
@@ -55,6 +56,7 @@ void usage(char *exename)
fprintf
(
stderr
,
"
\t
<workload_test_dir> : the directory to replay the workload I/O in
\n
"
);
fprintf
(
stderr
,
"
\n\t
[OPTIONS] includes:
\n
"
);
fprintf
(
stderr
,
"
\t\t
--noop : do not perform i/o
\n
"
);
fprintf
(
stderr
,
"
\t\t
--lockless : use bgq lockless file i/o optimization
\n
"
);
fprintf
(
stderr
,
"
\t\t
-v : verbose (output i/o details)
\n
"
);
exit
(
1
);
...
...
@@ -68,6 +70,7 @@ void parse_args(int argc, char **argv, char **conf_path, char **test_dir)
{
"conf"
,
1
,
NULL
,
'c'
},
{
"test-dir"
,
1
,
NULL
,
'd'
},
{
"noop"
,
0
,
NULL
,
'n'
},
{
"lockless"
,
0
,
NULL
,
'l'
},
{
"help"
,
0
,
NULL
,
0
},
{
0
,
0
,
0
,
0
}
};
...
...
@@ -89,6 +92,9 @@ void parse_args(int argc, char **argv, char **conf_path, char **test_dir)
case
'n'
:
opt_noop
=
1
;
break
;
case
'l'
:
opt_lockless
=
1
;
break
;
case
'c'
:
*
conf_path
=
optarg
;
break
;
...
...
@@ -293,7 +299,7 @@ int replay_workload_op(struct codes_workload_op replay_op, int rank, long long i
unsigned
int
secs
;
unsigned
int
usecs
;
int
open_flags
=
O_RDWR
;
char
file_name
[
50
];
char
file_name
[
2
50
];
int
fildes
;
struct
file_info
*
tmp_list
=
NULL
;
struct
qlist_head
*
hash_link
=
NULL
;
...
...
@@ -360,7 +366,11 @@ int replay_workload_op(struct codes_workload_op replay_op, int rank, long long i
open_flags
|=
O_CREAT
;
/* write the file hash to string to be used as the actual file name */
snprintf
(
file_name
,
sizeof
(
file_name
),
"%"
PRIu64
,
replay_op
.
u
.
open
.
file_id
);
if
(
!
opt_lockless
)
snprintf
(
file_name
,
sizeof
(
file_name
),
"%"
PRIu64
,
replay_op
.
u
.
open
.
file_id
);
else
snprintf
(
file_name
,
sizeof
(
file_name
),
"bglockless:%"
PRIu64
,
replay_op
.
u
.
open
.
file_id
);
/* perform the open operation */
fildes
=
open
(
file_name
,
open_flags
,
0666
);
...
...
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