Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
codes
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
38
Issues
38
List
Boards
Labels
Milestones
Merge Requests
8
Merge Requests
8
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
codes
codes
Commits
9497a9c7
Commit
9497a9c7
authored
Sep 26, 2013
by
Philip Carns
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add queueing and fix time calculation
parent
35cc7c1f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
5 deletions
+21
-5
tests/workload/codes-workload-test-cn-lp.c
tests/workload/codes-workload-test-cn-lp.c
+3
-1
tests/workload/codes-workload-test-svr-lp.c
tests/workload/codes-workload-test-svr-lp.c
+18
-4
No files found.
tests/workload/codes-workload-test-cn-lp.c
View file @
9497a9c7
...
...
@@ -34,6 +34,7 @@ struct client_state
int
wkld_id
;
/* identifier returned by workload load fn */
int
target_barrier_count
;
/* state information for handling barriers */
int
current_barrier_count
;
tw_stime
completion_time
;
};
struct
client_msg
...
...
@@ -178,7 +179,7 @@ static void client_finalize(
/* write out some statistics (the current time of each cn as it
* shuts down)
*/
sprintf
(
buffer
,
"cn_lp:%ld
\t
finalize_time:%f
\n
"
,
(
long
)
lp
->
gid
,
tw_now
(
lp
)
);
sprintf
(
buffer
,
"cn_lp:%ld
\t
completion_time:%f
\n
"
,
(
long
)
lp
->
gid
,
ns
->
completion_time
);
ret
=
lp_io_write
(
lp
->
gid
,
"compute_nodes"
,
strlen
(
buffer
)
+
1
,
buffer
);
assert
(
ret
==
0
);
...
...
@@ -302,6 +303,7 @@ static void handle_client_op_loop_event(
switch
(
m
->
op_rc
.
op_type
)
{
case
CODES_WK_END
:
ns
->
completion_time
=
tw_now
(
lp
);
printf
(
"Client rank %d completed workload.
\n
"
,
ns
->
my_rank
);
/* stop issuing events; we are done */
return
;
...
...
tests/workload/codes-workload-test-svr-lp.c
View file @
9497a9c7
...
...
@@ -26,6 +26,7 @@ enum svr_event_type
struct
svr_state
{
tw_stime
next_idle
;
};
struct
svr_msg
...
...
@@ -33,6 +34,7 @@ struct svr_msg
enum
svr_event_type
event_type
;
struct
codes_workload_op
op
;
tw_lpid
src
;
/* source of this request or ack */
tw_stime
next_idle_rc
;
};
static
void
svr_init
(
...
...
@@ -81,6 +83,8 @@ static void svr_init(
{
memset
(
ns
,
0
,
sizeof
(
*
ns
));
ns
->
next_idle
=
tw_now
(
lp
);
return
;
}
...
...
@@ -131,7 +135,7 @@ static void svr_finalize(
/* write out some statistics (the current time of each server as it
* shuts down)
*/
sprintf
(
buffer
,
"svr_lp:%ld
\t
finalize_time:%f
\n
"
,
(
long
)
lp
->
gid
,
tw_now
(
lp
)
);
sprintf
(
buffer
,
"svr_lp:%ld
\t
completion_time:%f
\n
"
,
(
long
)
lp
->
gid
,
ns
->
next_idle
);
ret
=
lp_io_write
(
lp
->
gid
,
"servers"
,
strlen
(
buffer
)
+
1
,
buffer
);
assert
(
ret
==
0
);
...
...
@@ -169,13 +173,22 @@ static void handle_svr_op_event(
svr_msg
*
m
,
tw_lp
*
lp
)
{
printf
(
"handle_svr_op_event at lp %ld, type %d
\n
"
,
lp
->
gid
,
m
->
op
.
op_type
);
m
->
next_idle_rc
=
ns
->
next_idle
;
/* NOTE: this isn't a real server simulator, but we do want time to
* elapse so that we can do correctness/regression testing. We pick the
* service time by using the op type as the elapsed time.
* elapse so that we can do correctness/regression testing. For testing
* purposes we use the value of the op_type field as the amount of
* elapsed time for the operation to consume.
*/
if
(
ns
->
next_idle
>
tw_now
(
lp
))
ns
->
next_idle
+=
m
->
op
.
op_type
;
else
ns
->
next_idle
=
tw_now
(
lp
)
+
m
->
op
.
op_type
;
/* send event back to cn to let it know the operation is done */
cn_op_complete
(
lp
,
m
->
op
.
op_type
,
m
->
src
);
cn_op_complete
(
lp
,
ns
->
next_idle
-
tw_now
(
lp
)
,
m
->
src
);
return
;
}
...
...
@@ -186,6 +199,7 @@ static void handle_svr_op_event_rc(
svr_msg
*
m
,
tw_lp
*
lp
)
{
ns
->
next_idle
=
m
->
next_idle_rc
;
cn_op_complete_rc
(
lp
);
return
;
}
...
...
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