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
7a53c394
Commit
7a53c394
authored
Dec 19, 2013
by
Philip Carns
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add ability to find lp id for local net device
parent
9c2e5cb3
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
74 additions
and
0 deletions
+74
-0
codes/dragonfly.h
codes/dragonfly.h
+3
-0
codes/model-net-method.h
codes/model-net-method.h
+1
-0
codes/model-net.h
codes/model-net.h
+6
-0
codes/torus.h
codes/torus.h
+3
-0
src/models/networks/model-net/dragonfly.c
src/models/networks/model-net/dragonfly.c
+11
-0
src/models/networks/model-net/loggp.c
src/models/networks/model-net/loggp.c
+16
-0
src/models/networks/model-net/model-net.c
src/models/networks/model-net/model-net.c
+6
-0
src/models/networks/model-net/simplenet-upd.c
src/models/networks/model-net/simplenet-upd.c
+16
-0
src/models/networks/model-net/torus.c
src/models/networks/model-net/torus.c
+12
-0
No files found.
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
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