model-net-inspect.h 1.45 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
/*
 * 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

Jonathan Jenkins's avatar
Jonathan Jenkins committed
13 14 15 16
#ifdef __cplusplus
extern "C" {
#endif

17 18 19
/* ALL FUNCTIONS
 * anno is the annotation specified in the configuration (NULL -> no
 * annotation), while ignore_annotations is a flag controlling whether
Jonathan Jenkins's avatar
Jonathan Jenkins committed
20 21
 * annotations are checked for or not - if not, then the first matching LP type
 * found is used irrespective of annotation. */
22

23 24
/** TORUS FUNCTIONS **/

25 26 27 28 29 30 31 32
/* 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);

33 34 35 36 37 38 39 40 41 42 43
/* mapping utilities to and from linearized torus node ids */
void model_net_torus_get_dim_id(
        int         flat_id,
        int         ndims,
        const int * dim_lens,
        int       * out_dim_ids);

int model_net_torus_get_flat_id(
        int         ndims,
        const int * dim_lens,
        const int * dim_ids);
44

Jonathan Jenkins's avatar
Jonathan Jenkins committed
45 46 47 48
#ifdef __cplusplus
}
#endif

49 50 51 52 53 54 55 56 57 58 59
#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
 */