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
7a53c394
Commit
7a53c394
authored
Dec 19, 2013
by
Philip Carns
Browse files
add ability to find lp id for local net device
parent
9c2e5cb3
Changes
9
Hide whitespace changes
Inline
Side-by-side
codes/dragonfly.h
View file @
7a53c394
...
...
@@ -60,6 +60,8 @@ static void dragonfly_setup(const void* net_params);
* traversed and maximum packet latency */
static
void
dragonfly_report_stats
();
static
tw_lpid
dragonfly_find_local_device
(
tw_lp
*
sender
);
/* dragonfly packet event method called by modelnet, this method triggers the packet
* generate event of dragonfly and attached remote and local events to the last packet
* of the message */
...
...
@@ -87,6 +89,7 @@ struct model_net_method dragonfly_method =
.
mn_get_lp_type
=
dragonfly_get_cn_lp_type
,
.
mn_get_msg_sz
=
dragonfly_get_msg_sz
,
.
mn_report_stats
=
dragonfly_report_stats
,
.
model_net_method_find_local_device
=
dragonfly_find_local_device
,
};
/* handles terminal and router events like packet generate/send/receive/buffer */
...
...
codes/model-net-method.h
View file @
7a53c394
...
...
@@ -28,6 +28,7 @@ struct model_net_method
const
tw_lptype
*
(
*
mn_get_lp_type
)();
int
(
*
mn_get_msg_sz
)();
void
(
*
mn_report_stats
)();
tw_lpid
(
*
model_net_method_find_local_device
)(
tw_lp
*
sender
);
};
#endif
/* MODELNET_METHOD_H */
...
...
codes/model-net.h
View file @
7a53c394
...
...
@@ -133,6 +133,12 @@ void model_net_event(
const
void
*
self_event
,
tw_lp
*
sender
);
/* model_net_find_local_device()
*
* returns the LP id of the network card attached to the calling LP
*/
tw_lpid
model_net_find_local_device
(
int
net_id
,
tw_lp
*
sender
);
/* model_net_event_rc()
*
* This function does reverse computation for the model_net_event_new()
...
...
codes/torus.h
View file @
7a53c394
...
...
@@ -79,6 +79,8 @@ static const tw_lptype* torus_get_lp_type(void);
/* reports torus statistics */
static
void
torus_report_stats
(
void
);
static
tw_lpid
torus_find_local_device
(
tw_lp
*
sender
);
/* data structure for torus statistics */
struct
model_net_method
torus_method
=
{
...
...
@@ -89,6 +91,7 @@ struct model_net_method torus_method =
.
mn_get_lp_type
=
torus_get_lp_type
,
.
mn_get_msg_sz
=
torus_get_msg_sz
,
.
mn_report_stats
=
torus_report_stats
,
.
model_net_method_find_local_device
=
torus_find_local_device
,
};
/* event type of each torus message, can be packet generate, flit arrival, flit send or credit */
...
...
src/models/networks/model-net/dragonfly.c
View file @
7a53c394
...
...
@@ -954,6 +954,17 @@ static const tw_lptype* dragonfly_get_router_lp_type(void)
return
(
&
dragonfly_lps
[
1
]);
}
static
tw_lpid
dragonfly_find_local_device
(
tw_lp
*
sender
)
{
char
lp_type_name
[
MAX_NAME_LENGTH
],
lp_group_name
[
MAX_NAME_LENGTH
];
int
mapping_grp_id
,
mapping_rep_id
,
mapping_type_id
,
mapping_offset
;
tw_lpid
dest_id
;
codes_mapping_get_lp_info
(
sender
->
gid
,
lp_group_name
,
&
mapping_grp_id
,
&
mapping_type_id
,
lp_type_name
,
&
mapping_rep_id
,
&
mapping_offset
);
codes_mapping_get_lp_id
(
lp_group_name
,
"modelnet_dragonfly"
,
mapping_rep_id
,
mapping_offset
,
&
dest_id
);
return
(
dest_id
);
}
/*
...
...
src/models/networks/model-net/loggp.c
View file @
7a53c394
...
...
@@ -121,6 +121,8 @@ static void loggp_packet_event_rc(tw_lp *sender);
static
void
loggp_report_stats
();
static
tw_lpid
loggp_find_local_device
(
tw_lp
*
sender
);
static
struct
param_table_entry
*
find_params
(
int
msg_size
);
/* data structure for model-net statistics */
...
...
@@ -133,6 +135,7 @@ struct model_net_method loggp_method =
.
mn_get_lp_type
=
loggp_get_lp_type
,
.
mn_get_msg_sz
=
loggp_get_msg_sz
,
.
mn_report_stats
=
loggp_report_stats
,
.
model_net_method_find_local_device
=
loggp_find_local_device
,
};
static
void
loggp_init
(
...
...
@@ -615,6 +618,19 @@ static struct param_table_entry* find_params(int msg_size)
return
(
&
param_table
[
i
]);
}
static
tw_lpid
loggp_find_local_device
(
tw_lp
*
sender
)
{
char
lp_type_name
[
MAX_NAME_LENGTH
],
lp_group_name
[
MAX_NAME_LENGTH
];
int
mapping_grp_id
,
mapping_rep_id
,
mapping_type_id
,
mapping_offset
;
tw_lpid
dest_id
;
codes_mapping_get_lp_info
(
sender
->
gid
,
lp_group_name
,
&
mapping_grp_id
,
&
mapping_type_id
,
lp_type_name
,
&
mapping_rep_id
,
&
mapping_offset
);
codes_mapping_get_lp_id
(
lp_group_name
,
"modelnet_loggp"
,
mapping_rep_id
,
mapping_offset
,
&
dest_id
);
return
(
dest_id
);
}
/*
* Local variables:
* c-indent-level: 4
...
...
src/models/networks/model-net/model-net.c
View file @
7a53c394
...
...
@@ -478,6 +478,12 @@ void model_net_add_lp_type(int net_id)
}
}
}
tw_lpid
model_net_find_local_device
(
int
net_id
,
tw_lp
*
sender
)
{
return
(
method_array
[
net_id
]
->
model_net_method_find_local_device
(
sender
));
}
/*
* Local variables:
* c-indent-level: 4
...
...
src/models/networks/model-net/simplenet-upd.c
View file @
7a53c394
...
...
@@ -112,6 +112,8 @@ static void simplenet_packet_event_rc(tw_lp *sender);
static
void
sn_report_stats
();
static
tw_lpid
sn_find_local_device
(
tw_lp
*
sender
);
/* data structure for model-net statistics */
struct
model_net_method
simplenet_method
=
{
...
...
@@ -122,6 +124,7 @@ struct model_net_method simplenet_method =
.
mn_get_lp_type
=
sn_get_lp_type
,
.
mn_get_msg_sz
=
sn_get_msg_sz
,
.
mn_report_stats
=
sn_report_stats
,
.
model_net_method_find_local_device
=
sn_find_local_device
,
};
static
void
sn_init
(
...
...
@@ -540,6 +543,19 @@ static void simplenet_packet_event_rc(tw_lp *sender)
return
;
}
static
tw_lpid
sn_find_local_device
(
tw_lp
*
sender
)
{
char
lp_type_name
[
MAX_NAME_LENGTH
],
lp_group_name
[
MAX_NAME_LENGTH
];
int
mapping_grp_id
,
mapping_rep_id
,
mapping_type_id
,
mapping_offset
;
tw_lpid
dest_id
;
codes_mapping_get_lp_info
(
sender
->
gid
,
lp_group_name
,
&
mapping_grp_id
,
&
mapping_type_id
,
lp_type_name
,
&
mapping_rep_id
,
&
mapping_offset
);
codes_mapping_get_lp_id
(
lp_group_name
,
"modelnet_simplenet"
,
mapping_rep_id
,
mapping_offset
,
&
dest_id
);
return
(
dest_id
);
}
/*
* Local variables:
* c-indent-level: 4
...
...
src/models/networks/model-net/torus.c
View file @
7a53c394
...
...
@@ -625,6 +625,18 @@ static const tw_lptype* torus_get_lp_type(void)
return
(
&
torus_lp
);
}
static
tw_lpid
torus_find_local_device
(
tw_lp
*
sender
)
{
char
lp_type_name
[
MAX_NAME_LENGTH
],
lp_group_name
[
MAX_NAME_LENGTH
];
int
mapping_grp_id
,
mapping_rep_id
,
mapping_type_id
,
mapping_offset
;
tw_lpid
dest_id
;
codes_mapping_get_lp_info
(
sender
->
gid
,
lp_group_name
,
&
mapping_grp_id
,
&
mapping_type_id
,
lp_type_name
,
&
mapping_rep_id
,
&
mapping_offset
);
codes_mapping_get_lp_id
(
lp_group_name
,
"modelnet_torus"
,
mapping_rep_id
,
mapping_offset
,
&
dest_id
);
return
(
dest_id
);
}
/*
* Local variables:
...
...
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