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
Elsa Gonsiorowski
codes
Commits
f73cdd04
Commit
f73cdd04
authored
Jan 08, 2016
by
Jonathan Jenkins
Browse files
fix shadowing warnings
parent
4b8a865d
Changes
6
Hide whitespace changes
Inline
Side-by-side
doc/example/example.c
View file @
f73cdd04
...
...
@@ -400,16 +400,16 @@ tw_lpid get_next_server(tw_lpid sender_id)
* lookups */
char
grp_name
[
MAX_NAME_LENGTH
],
lp_type_name
[
MAX_NAME_LENGTH
],
annotation
[
MAX_NAME_LENGTH
];
int
lp_type_id
,
grp_id
,
grp_rep_id
,
off
set
,
num_reps
;
int
lp_type_id
,
grp_id
,
grp_rep_id
,
off
,
num_reps
;
int
dest_rep_id
;
codes_mapping_get_lp_info
(
sender_id
,
grp_name
,
&
grp_id
,
lp_type_name
,
&
lp_type_id
,
annotation
,
&
grp_rep_id
,
&
off
set
);
&
lp_type_id
,
annotation
,
&
grp_rep_id
,
&
off
);
/* in this example, we assume that, for our group of servers, each
* "repetition" consists of a single server/NIC pair. Hence, we grab the
* server ID for the next repetition, looping around if necessary */
num_reps
=
codes_mapping_get_group_reps
(
grp_name
);
dest_rep_id
=
(
grp_rep_id
+
1
)
%
num_reps
;
/* finally, get the server (exactly 1 server per rep -> off
set
w/in rep = 0 */
/* finally, get the server (exactly 1 server per rep -> off w/in rep = 0 */
codes_mapping_get_lp_id
(
grp_name
,
lp_type_name
,
NULL
,
1
,
dest_rep_id
,
0
,
&
rtn_id
);
return
rtn_id
;
...
...
src/modelconfig/configuration.c
View file @
f73cdd04
...
...
@@ -381,7 +381,6 @@ int configuration_get_lpgroups (ConfigHandle *handle,
SectionEntry
subse
[
10
];
size_t
se_count
=
10
;
size_t
subse_count
=
10
;
size_t
i
,
j
,
lpt
;
char
data
[
256
];
// buffer mgmt vars
int
num_uniq_group_names
=
0
;
...
...
@@ -433,7 +432,7 @@ int configuration_get_lpgroups (ConfigHandle *handle,
_val = _rd; \
}while(0);
for
(
i
=
0
;
i
<
se_count
;
i
++
)
for
(
size_t
i
=
0
;
i
<
se_count
;
i
++
)
{
//printf("section: %s type: %d\n", se[i].name, se[i].type);
if
(
se
[
i
].
type
==
SE_SECTION
)
...
...
@@ -452,7 +451,7 @@ int configuration_get_lpgroups (ConfigHandle *handle,
tw_error
(
TW_LOC
,
"config error: non-unique group names detected
\n
"
);
for
(
j
=
0
,
lpt
=
0
;
j
<
subse_count
;
j
++
)
for
(
size_t
j
=
0
,
lpt
=
0
;
j
<
subse_count
;
j
++
)
{
if
(
subse
[
j
].
type
==
SE_KEY
)
{
...
...
src/networks/model-net/dragonfly.c
View file @
f73cdd04
...
...
@@ -1254,9 +1254,8 @@ void packet_send(terminal_state * s, tw_bf * bf, terminal_message * msg,
if
(
cur_entry
!=
NULL
&&
s
->
vc_occupancy
[
0
]
+
s
->
params
->
chunk_size
<=
s
->
params
->
cn_vc_size
)
{
bf
->
c3
=
1
;
terminal_message
*
m
;
ts
=
g_tw_lookahead
+
s
->
params
->
cn_delay
+
tw_rand_unif
(
lp
->
rng
);
tw_event
*
e
=
model_net_method_event_new
(
lp
->
gid
,
ts
,
lp
,
DRAGONFLY
,
e
=
model_net_method_event_new
(
lp
->
gid
,
ts
,
lp
,
DRAGONFLY
,
(
void
**
)
&
m
,
NULL
);
m
->
type
=
T_SEND
;
m
->
magic
=
terminal_magic_num
;
...
...
@@ -2621,9 +2620,8 @@ router_packet_send( router_state * s,
if
(
cur_entry
==
NULL
)
cur_entry
=
s
->
pending_msgs
[
output_port
][
0
];
if
(
cur_entry
!=
NULL
)
{
bf
->
c3
=
1
;
terminal_message
*
m
;
ts
=
g_tw_lookahead
+
delay
+
tw_rand_unif
(
lp
->
rng
);
tw_event
*
e
=
tw_event_new
(
lp
->
gid
,
ts
,
lp
);
e
=
tw_event_new
(
lp
->
gid
,
ts
,
lp
);
m
=
tw_event_data
(
e
);
m
->
type
=
R_SEND
;
m
->
magic
=
router_magic_num
;
...
...
src/workload/methods/codes-iolang-wrkld.c
View file @
f73cdd04
...
...
@@ -39,7 +39,7 @@ static int hash_rank_compare(void *key, struct qhash_head *link);
typedef
struct
codes_iolang_wrkld_state_per_rank
codes_iolang_wrkld_state_per_rank
;
static
struct
qhash_table
*
rank_tbl
=
NULL
;
static
int
rank_tbl_pop
=
0
;
int
n
um_
ranks
=
-
1
;
static
int
nranks
=
-
1
;
/* implements the codes workload method */
struct
codes_workload_method
iolang_workload_method
=
...
...
@@ -97,8 +97,8 @@ int iolang_io_workload_load(const char* params, int app_id, int rank)
/* we have to get the number of compute nodes/ranks from the bg/p model parameters
* because the number of ranks are specified in the iolang config file not the
* workload files */
if
(
n
um_
ranks
==
-
1
)
n
um_
ranks
=
i_param
->
num_cns
;
if
(
nranks
==
-
1
)
nranks
=
i_param
->
num_cns
;
codes_iolang_wrkld_state_per_rank
*
wrkld_per_rank
=
NULL
;
if
(
!
rank_tbl
)
...
...
@@ -118,7 +118,7 @@ int iolang_io_workload_load(const char* params, int app_id, int rank)
t
=
codes_kernel_helper_bootstrap
(
i_param
->
io_kernel_path
,
i_param
->
io_kernel_meta_path
,
rank
,
n
um_
ranks
,
nranks
,
i_param
->
use_relpath
,
&
(
wrkld_per_rank
->
codes_context
),
&
(
wrkld_per_rank
->
codes_pstate
),
...
...
@@ -215,7 +215,7 @@ void iolang_io_workload_get_next(int app_id, int rank, struct codes_workload_op
break
;
case
CODES_WK_BARRIER
:
{
op
->
u
.
barrier
.
count
=
n
um_
ranks
;
op
->
u
.
barrier
.
count
=
nranks
;
op
->
u
.
barrier
.
root
=
0
;
}
break
;
...
...
tests/modelnet-p2p-bw.c
View file @
f73cdd04
...
...
@@ -200,14 +200,14 @@ static void svr_init(
tw_stime
kickoff_time
;
char
grp_name
[
MAX_NAME_LENGTH
];
char
lp_type_name
[
MAX_NAME_LENGTH
];
int
grp_id
,
lp_type_id
,
grp_rep_id
,
off
set
;
int
grp_id
,
lp_type_id
,
grp_rep_id
,
off
;
int
i
;
memset
(
ns
,
0
,
sizeof
(
*
ns
));
/* find my own server index */
codes_mapping_get_lp_info
(
lp
->
gid
,
grp_name
,
&
grp_id
,
lp_type_name
,
&
lp_type_id
,
NULL
,
&
grp_rep_id
,
&
off
set
);
lp_type_name
,
&
lp_type_id
,
NULL
,
&
grp_rep_id
,
&
off
);
ns
->
svr_idx
=
grp_rep_id
;
/* first server sends a dummy event to itself that will kick off the real
...
...
tests/resource-test.c
View file @
f73cdd04
...
...
@@ -56,9 +56,9 @@ static void s_finalize(s_state *ns, tw_lp *lp){
static
void
s_event
(
s_state
*
ns
,
tw_bf
*
bf
,
s_msg
*
m
,
tw_lp
*
lp
){
(
void
)
bf
;
assert
(
m
->
h
.
magic
==
s_magic
);
msg_header
h
;
switch
(
m
->
h
.
event_type
){
case
S_KICKOFF
:
;
msg_header
h
;
msg_set_header
(
s_magic
,
S_ALLOC_ACK
,
lp
->
gid
,
&
h
);
resource_lp_get
(
bsize
,
0
,
lp
,
CODES_MCTX_DEFAULT
,
0
,
&
h
,
&
ns
->
cb
);
break
;
...
...
@@ -67,7 +67,6 @@ static void s_event(s_state *ns, tw_bf *bf, s_msg *m, tw_lp *lp){
ns
->
mem
+=
bsize
;
m
->
mem_max_prev
=
ns
->
mem_max
;
ns
->
mem_max
=
maxu64
(
ns
->
mem
,
ns
->
mem_max
);
msg_header
h
;
msg_set_header
(
s_magic
,
S_ALLOC_ACK
,
lp
->
gid
,
&
h
);
resource_lp_get
(
bsize
,
0
,
lp
,
CODES_MCTX_DEFAULT
,
0
,
&
h
,
&
ns
->
cb
);
...
...
@@ -80,8 +79,8 @@ static void s_event(s_state *ns, tw_bf *bf, s_msg *m, tw_lp *lp){
if
(
ns
->
mem
>
0
){
tw_event
*
e
=
tw_event_new
(
lp
->
gid
,
codes_local_latency
(
lp
),
lp
);
s_msg
*
m
=
tw_event_data
(
e
);
msg_set_header
(
s_magic
,
S_FREE
,
lp
->
gid
,
&
m
->
h
);
s_msg
*
s
m
=
tw_event_data
(
e
);
msg_set_header
(
s_magic
,
S_FREE
,
lp
->
gid
,
&
s
m
->
h
);
tw_event_send
(
e
);
}
break
;
...
...
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