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
Xin Wang
codes-dev
Commits
98ab1d37
Commit
98ab1d37
authored
Sep 29, 2015
by
Jonathan Jenkins
Browse files
add msg start time to modelnet req, param for setting
parent
1005a6a4
Changes
2
Hide whitespace changes
Inline
Side-by-side
codes/model-net.h
View file @
98ab1d37
...
...
@@ -67,11 +67,20 @@ enum NETWORKS
// message parameter types
enum
msg_param_type
{
//
currently, scheduler parameters are the only type
//
parameters for modelnet-scheduler (priorities and such)
MN_MSG_PARAM_SCHED
,
// parameter allowing the explicit setting of a messages start time (needed
// to allow "pull messages" to propagate the message initiation time across
// multiple model-net events)
MN_MSG_PARAM_START_TIME
,
MAX_MN_MSG_PARAM_TYPES
};
// MN_MSG_PARAM_MSG_START_TIME parameter types (only one for the time being)
enum
msg_param_start_time
{
MN_MSG_PARAM_START_TIME_VAL
};
// return type for model_net_*event calls, to be passed into RC
// currently is just an int, but in the future may indicate whether lp-io was
// called etc.
...
...
@@ -88,6 +97,8 @@ typedef struct model_net_request {
tw_lpid
final_dest_lp
;
tw_lpid
dest_mn_lp
;
// destination modelnet lp
tw_lpid
src_lp
;
// time the source event was called
tw_stime
msg_start_time
;
uint64_t
msg_size
;
uint64_t
pull_size
;
uint64_t
packet_size
;
...
...
src/models/networks/model-net/model-net.c
View file @
98ab1d37
...
...
@@ -48,7 +48,8 @@ tw_stime mn_msg_offset = 0.0;
// message parameters for use via model_net_set_msg_param
static
int
is_msg_params_set
[
MAX_MN_MSG_PARAM_TYPES
];
static
mn_sched_params
sched_params
;
static
mn_sched_params
sched_params
;
// MN_MSG_PARAM_SCHED
static
tw_stime
start_time_param
;
// MN_MSG_PARAM_START_TIME
// global listing of lp types found by model_net_register
// - needs to be held between the register and configure calls
...
...
@@ -322,6 +323,11 @@ static model_net_event_return model_net_event_impl_base(
strncpy
(
r
->
category
,
category
,
CATEGORY_NAME_MAX
-
1
);
r
->
category
[
CATEGORY_NAME_MAX
-
1
]
=
'\0'
;
if
(
is_msg_params_set
[
MN_MSG_PARAM_START_TIME
])
r
->
msg_start_time
=
start_time_param
;
else
r
->
msg_start_time
=
tw_now
(
sender
);
// this is an outgoing message
m
->
msg
.
m_base
.
is_from_remote
=
0
;
...
...
@@ -496,6 +502,17 @@ void model_net_set_msg_param(
"MN_MSG_PARAM_SCHED parameter type"
);
}
break
;
case
MN_MSG_PARAM_START_TIME
:
is_msg_params_set
[
MN_MSG_PARAM_START_TIME
]
=
1
;
switch
(
sub_type
){
case
MN_MSG_PARAM_START_TIME_VAL
:
start_time_param
=
*
(
tw_stime
*
)
params
;
break
;
default:
tw_error
(
TW_LOC
,
"unknown or unsupported "
"MN_MSG_PARAM_START_TIME parameter type"
);
}
break
;
default:
tw_error
(
TW_LOC
,
"unknown or unsupported msg_param_type"
);
}
...
...
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