codes_mapping.h 2.13 KB
Newer Older
1
/*
Philip Carns's avatar
Philip Carns committed
2
 * Copyright (C) 2013 University of Chicago.
3
 * See COPYRIGHT notice in top-level directory.
Philip Carns's avatar
Philip Carns committed
4
 *
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
 */

/* SUMMARY:
 * CODES custom mapping file for ROSS
 */
#include "configuration.h"
#include "codes.h"
#include "lp-type-lookup.h"
#define MAX_NAME_LENGTH 256

/* Returns number of LPs on the current PE */
int codes_mapping_get_lps_for_pe(void);

/* Takes the global LP ID and returns the rank (PE id) on which the LP is mapped.*/
tw_peid codes_mapping( tw_lpid gid);

/* loads the configuration file and sets up the number of LPs on each PE. */
22
void codes_mapping_setup(void);
23

24 25 26 27 28
/*Takes the group name and returns the number of repetitions in the group */
int codes_mapping_get_group_reps(char* grp_name);

/* Takes the group name and lp type name, returns the count for that lp type */
int codes_mapping_get_lp_count(char* grp_name, char* lp_type_name);
29 30
/* Gets the total lp type count across all groups */ 
int codes_mapping_get_global_lp_count(char* lp_type_name);
31

32 33 34
/* Takes the group name , type name, rep ID and offset (for that lp type + repetition) and then returns the global LP ID. */
void codes_mapping_get_lp_id(char* grp_name, char* lp_type_name, int rep_id, int offset, tw_lpid* gid);

35 36 37 38
/* Takes the LP ID and returns its logical ID across LPs of the same type in 
 * all groups */
int codes_mapping_get_lp_global_rel_id(tw_lpid gid);

39 40 41 42
/* takes the LP ID and returns its grp name and index, lp type name and ID, repetition ID and the offset of the LP 
 * (for multiple LPs in a repetition). */
void codes_mapping_get_lp_info(tw_lpid gid, char* grp_name, int* grp_id, int* lp_type_id, char* lp_type_name, int* grp_rep_id, int* offset);

43 44 45 46 47 48 49
/* given the group and LP type name, return the annotation (or NULL if there is
 * none) */
const char* codes_mapping_get_annotation_by_name(char *grp_name, char *lp_type_name);
/* given the LP ID, return the annotation (or NULL if there is none)
 * NOTE: both functions have equivalent results. The different ways of accessing
 * are for convenience */
const char* codes_mapping_get_annotation_by_lpid(tw_lpid gid);
Philip Carns's avatar
Philip Carns committed
50 51 52 53 54 55 56 57 58

/*
 * Local variables:
 *  c-indent-level: 4
 *  c-basic-offset: 4
 * End:
 *
 * vim: ts=8 sts=4 sw=4 expandtab
 */