Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
codes
codes
Commits
a57bc2d2
Commit
a57bc2d2
authored
Jun 17, 2015
by
Jonathan Jenkins
Browse files
network introspection abilities
parent
3ced26b0
Changes
3
Hide whitespace changes
Inline
Side-by-side
codes/model-net-inspect.h
0 → 100644
View file @
a57bc2d2
/*
* Copyright (C) 2013 University of Chicago.
* See COPYRIGHT notice in top-level directory.
*
*/
/* This header provides ways for modelnet users to look at the state of the
* underlying implementations (e.g., torus) */
#ifndef MODEL_NET_INSPECT_H
#define MODEL_NET_INSPECT_H
/* ALL FUNCTIONS
* anno is the annotation specified in the configuration (NULL -> no
* annotation), while ignore_annotations is a flag controlling whether
* annotations are checked for or not - if not, then */
/* get the dimensions of a torus configuration torus network. n and dims are
* return paramters */
void
model_net_torus_get_dims
(
char
const
*
anno
,
int
ignore_annotations
,
int
*
n
,
int
const
*
const
*
dims
);
#endif
/* end of include guard: MODEL_NET_INSPECT_H */
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*
* vim: ft=c ts=8 sts=4 sw=4 expandtab
*/
src/models/Makefile.subdir
View file @
a57bc2d2
...
...
@@ -21,6 +21,7 @@ nobase_include_HEADERS = \
codes/model-net-method.h
\
codes/model-net-lp.h
\
codes/model-net-sched.h
\
codes/model-net-inspect.h
\
codes/net/dragonfly.h
\
codes/net/loggp.h
\
codes/net/simplenet-upd.h
\
...
...
src/models/networks/model-net/torus.c
View file @
a57bc2d2
...
...
@@ -1374,6 +1374,36 @@ struct model_net_method torus_method =
.
mn_collective_call_rc
=
torus_collective_rc
};
/* user-facing modelnet functions */
void
model_net_torus_get_dims
(
char
const
*
anno
,
int
ignore_annotations
,
int
*
n
,
int
const
**
dims
)
{
torus_param
const
*
p
=
NULL
;
int
i
;
if
(
ignore_annotations
)
p
=
&
all_params
[
0
];
else
if
(
anno_map
->
has_unanno_lp
>
0
&&
anno
==
NULL
)
p
=
&
all_params
[
anno_map
->
num_annos
];
else
{
for
(
i
=
0
;
i
<
num_params
;
i
++
)
{
if
(
strcmp
(
anno
,
anno_map
->
annotations
[
i
])
==
0
)
{
p
=
&
all_params
[
i
];
break
;
}
}
}
if
(
p
==
NULL
)
tw_error
(
TW_LOC
,
"unable to find configuration for annotation %s"
,
anno
);
*
n
=
p
->
n_dims
;
*
dims
=
p
->
dim_length
;
}
/*
* Local variables:
* c-indent-level: 4
...
...
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