Commit a611dd16 authored by Jonathan Jenkins's avatar Jonathan Jenkins

Partly automated merge of codes-net

Build system and documentation files were largely hand-merged.
parents f32214c7 41431554
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/ /
/aclocal.m4 /aclocal.m4
/autom4te.cache/ /autom4te.cache/
/ /
/compile /compile
/config.guess /config.guess
/config.sub /config.sub
...@@ -16,8 +16,9 @@ ...@@ -16,8 +16,9 @@
/config.status /config.status
/Makefile /Makefile
/stamp-h1 /stamp-h1
/codes_base_config.h /codes_config.h
/maint/codes-base.pc /maint/codes.pc
.deps .deps
# make generated artifacts # make generated artifacts
...@@ -13,35 +13,37 @@ EXTRA_PROGRAMS = ...@@ -13,35 +13,37 @@ EXTRA_PROGRAMS =
src_models_CESOURCES =
# pkgconfig files # pkgconfig files
pkgconfigdir = $(libdir)/pkgconfig pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = maint/codes-base.pc pkgconfig_DATA = maint/codes.pc
$(pkgconfig_DATA): config.status $(pkgconfig_DATA): config.status
EXTRA_DIST += COPYRIGHT uc-codes.cfg EXTRA_DIST += \ COPYRIGHT TODO.txt uc-codes.cfg \
misc/README misc/ptrn_loggp-2.4.6.patch \
AM_CPPFLAGS = -I$(top_srcdir)/src ${ROSS_CFLAGS} AM_CPPFLAGS = -I$(top_srcdir)/src ${ROSS_CFLAGS}
include Make.rules include Make.rules
include $(top_srcdir)/scripts/Makefile.subdir include $(top_srcdir)/scripts/Makefile.subdir
include $(top_srcdir)/src/Makefile.subdir include $(top_srcdir)/src/Makefile.subdir
include $(top_srcdir)/src/models/Makefile.subdir
include $(top_srcdir)/tests/Makefile.subdir include $(top_srcdir)/tests/Makefile.subdir
include $(top_srcdir)/doc/Makefile.subdir include $(top_srcdir)/doc/Makefile.subdir
src_libcodes_base_a_SOURCES += src/workload/methods/codes-darshan-io-wrkld.c src_libcodes_base_a_SOURCES += src/workload/methods/codes-darshan-io-wrkld.c
tests_workload_codes_workload_test_LDADD += ${DARSHAN_LIBS} LDADD += ${DARSHAN_LIBS}
tests_workload_codes_workload_mpi_replay_LDADD += ${DARSHAN_LIBS}
TESTS += tests/workload/ TESTS += tests/workload/
endif endif
...@@ -53,6 +55,5 @@ endif ...@@ -53,6 +55,5 @@ endif
src_libcodes_base_a_SOURCES += src/workload/methods/codes-dumpi-trace-nw-wrkld.c src_libcodes_base_a_SOURCES += src/workload/methods/codes-dumpi-trace-nw-wrkld.c
tests_workload_codes_workload_test_LDADD += ${DUMPI_LIBS} LDADD += ${DUMPI_LIBS}
tests_workload_codes_workload_mpi_replay_LDADD += ${DUMPI_LIBS}
endif endif
1- Torus network model:
- Check how to specify the buffer size in the config file (buffer size is in flits)--- Option 1 specify the buffer size in packets and convert it into flits?
- Check how to specify the number of torus nodes from the config file? Currently they are being calculated from the file... How to integrate this with the mapping thing?
Option: Specify the torus network and the length of each torus dimension.
2- Tests
- clean up modelnet-test.c and code based on it. The way it calculates lpids is
extremely fragile (a bunch of constants + some assumptions that lead to very
confusing code)
* 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) */
* 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);
/* 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);
#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
* Copyright (C) 2014 University of Chicago.
* See COPYRIGHT notice in top-level directory.
/* This is the base model-net LP that all events pass through before
* performing any topology-specific work. Packet scheduling, dealing with
* packet loss (potentially), etc. happens here.
* Additionally includes wrapper event "send" function that all
* events for underlying models must go through */
#ifndef MODEL_NET_LP_H
#define MODEL_NET_LP_H
#include <ross.h>
#include "codes/lp-msg.h"
#include "model-net.h"
#include "model-net-sched.h"
#include "net/dragonfly.h"
#include "net/loggp.h"
#include "net/simplenet-upd.h"
#include "net/simplep2p.h"
#include "net/torus.h"
extern int model_net_base_magic;
// register the networks with ROSS, given the array of flags, one for each
// network type
void model_net_base_register(int *do_config_nets);
// configure the base LP type, setting up general parameters
void model_net_base_configure();
/// The remaining functions/data structures are only of interest to model-net
/// model developers
// Construct a model-net-specific event, analagous to a tw_event_new and
// codes_event_new. The difference here is that we return pointers to
// both the message data (to be cast into the appropriate type) and the
// pointer to the end of the event struct.
// This function is expected to be called within each specific model-net
// method - strange and disturbing things will happen otherwise
tw_event * model_net_method_event_new(
tw_lpid dest_gid,
tw_stime offset_ts,
tw_lp *sender,
int net_id,
void **msg_data,
void **extra_data);
// Construct a model-net-specific event, similar to model_net_method_event_new.
// The primary differences are:
// - the event gets sent to final_dest_lp and put on it's receiver queue
// - no message initialization is needed - that's the job of the
// model_net_method_recv_msg_event functions
// NOTE: this is largely a constructor of a model_net_request
void model_net_method_send_msg_recv_event(
tw_lpid final_dest_lp,
tw_lpid dest_mn_lp, // which model-net lp is going to handle message
tw_lpid src_lp, // the "actual" source (as opposed to the model net lp)
uint64_t msg_size, // the size of this message
int is_pull,
uint64_t pull_size, // the size of the message to pull if is_pull==1
int remote_event_size,
const mn_sched_params *sched_params,
const char * category,
int net_id,
void * msg,
tw_stime offset,
tw_lp *sender);
// just need to reverse an RNG for the time being
void model_net_method_send_msg_recv_event_rc(tw_lp *sender);
// Issue an event from the underlying model (e.g., simplenet, loggp) to tell the
// scheduler when next to issue a packet event. As different models update their
// notion of "idleness" separately, this is necessary. DANGER: Failure to call
// this function appropriately will cause the scheduler to hang or cause other
// weird behavior.
// This function is expected to be called within each specific model-net
// method - strange and disturbing things will happen otherwise
void model_net_method_idle_event(tw_stime offset_ts, int is_recv_queue,
tw_lp * lp);
// Get a ptr to past the message struct area, where the self/remote events
// are located, given the type of network.
// NOTE: this should ONLY be called on model-net implementations, nowhere else
void * model_net_method_get_edata(int net_id, void * msg);
/// The following functions/data structures should not need to be used by
/// model developers - they are just provided so other internal components can
/// use them
enum model_net_base_event_type {
// schedule next packet
// message goes directly down to topology-specific event handler
typedef struct model_net_base_msg {
// no need for event type - in wrap message
model_net_request req;
int is_from_remote;
// parameters to pass to new messages (via model_net_set_msg_params)
// TODO: make this a union for multiple types of parameters
mn_sched_params sched_params;
model_net_sched_rc rc; // rc for scheduling events
} model_net_base_msg;
typedef struct model_net_wrap_msg {
msg_header h;
union {
model_net_base_msg m_base; // base lp
terminal_message m_dfly; // dragonfly
loggp_message m_loggp; // loggp
sn_message m_snet; // simplenet
sp_message m_sp2p; // simplep2p
nodes_message m_torus; // torus
// add new ones here
} msg;
} model_net_wrap_msg;
#endif /* end of include guard: MODEL_NET_LP_H */
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* End:
* vim: ft=c ts=8 sts=4 sw=4 expandtab
* Copyright (C) 2013 University of Chicago.
* See COPYRIGHT notice in top-level directory.
#include <ross.h>
// forward decl of model_net_method since we currently have a circular include
// (method needs sched def, sched needs method def)
struct model_net_method;
#include "codes/model-net-sched.h"
// interface that each model-net model implements
struct model_net_method
uint64_t packet_size; /* packet size */
void (*mn_configure)(); /* For initializing the network */
/* Register lp types with ROSS. This may be left as NULL, in which case the
* type corresponding to name "modelnet_<type>" will be registered
* automatically. Most networks don't need this (currently, only dragonfly
* uses it) */
void (*mn_register)(tw_lptype *base_type);
tw_stime (*model_net_method_packet_event)(
model_net_request const * req,
uint64_t message_offset, // offset in the context of the whole message
uint64_t packet_size, // needed in case message < packet
tw_stime offset,
mn_sched_params const * sched_params,
void const * remote_event,
void const * self_event,
tw_lp *sender,
int is_last_pckt);
void (*model_net_method_packet_event_rc)(tw_lp *sender);
tw_stime (*model_net_method_recv_msg_event)(
const char * category,
tw_lpid final_dest_lp,
tw_lpid src_mn_lp, // the modelnet LP this message came from
uint64_t msg_size,
int is_pull,
uint64_t pull_size,
tw_stime offset,
int remote_event_size,
const void* remote_event,
tw_lpid src_lp, // original caller of model_net_(pull_)event
tw_lp *sender); // lp message is being called from (base LP)
void (*model_net_method_recv_msg_event_rc)(tw_lp *lp);
const tw_lptype* (*mn_get_lp_type)();
int (*mn_get_msg_sz)();
void (*mn_report_stats)();
void (*mn_collective_call)(char const * category, int message_size, int remote_event_size, const void* remote_event, tw_lp* sender);
void (*mn_collective_call_rc)(int message_size, tw_lp* sender);
extern struct model_net_method * method_array[];
#endif /* MODELNET_METHOD_H */
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* End:
* vim: ft=c ts=8 sts=4 sw=4 expandtab
* Copyright (C) 2014 University of Chicago.
* See COPYRIGHT notice in top-level directory.
/* A scheduler interface for use by model-net models. */
#include <ross.h>
#include "model-net.h"
// forward decl of mn_sched_params since we currently have a circular include
// (method needs sched def, sched needs method def)
typedef struct mn_sched_params_s mn_sched_params;
#include "model-net-method.h"
/// types of schedulers
/// format: enum type, config string, function pointer names
/// fcfs-full eschews packetization
X(MN_SCHED_FCFS, "fcfs", &fcfs_tab) \
X(MN_SCHED_FCFS_FULL, "fcfs-full", &fcfs_tab) \
X(MN_SCHED_RR, "round-robin", &rr_tab) \
X(MN_SCHED_PRIO, "priority", &prio_tab) \
#define X(a,b,c) a,
enum sched_type {
#undef X
/// scheduler decls
typedef struct model_net_sched_s model_net_sched;
typedef struct model_net_sched_rc_s model_net_sched_rc;
// priority scheduler configurtion parameters
typedef struct mn_prio_params_s {
int num_prios; // number of priorities
// sub-scheduler to use. can be any but prio
enum sched_type sub_stype;
} mn_prio_params;
// TODO: other scheduler config params
// initialization parameter set
typedef struct model_net_sched_cfg_params_s {
enum sched_type type;
union {
mn_prio_params prio;
} u;
} model_net_sched_cfg_params;
typedef struct mn_sched_cfg_params {
mn_prio_params prio;
} mn_sched_cfg_params;
/// message-specific parameters
enum sched_msg_param_type {
MN_SCHED_PARAM_PRIO, // currently, only the priority scheduler has params
// scheduler-specific parameter definitions must go here
struct mn_sched_params_s {
int prio; // MN_SCHED_PARAM_PRIO (currently the only one)
} ;
/// interface to be implemented by schedulers
/// see corresponding general functions
typedef struct model_net_sched_interface {
// initialize the scheduler
// params - scheduler specific params (currently only prio q uses)
void (*init)(
const struct model_net_method * method,
const model_net_sched_cfg_params * params,
int is_recv_queue,
void ** sched);
// finalize the scheduler
void (*destroy)(void * sched);
// add a new request to the scheduler
// sched_params - per-message parameters distinct to each scheduler:
// prio (currently the only user): int priority
// - NULL arguments should be treated as "use default value"
void (*add)(
const model_net_request * req,
const mn_sched_params * sched_params,
int remote_event_size,
void * remote_event,
int local_event_size,
void * local_event,
void * sched,
model_net_sched_rc * rc,
tw_lp * lp);
// reverse the previous request addition
void (*add_rc)(void *sched, const model_net_sched_rc *rc, tw_lp *lp);
// schedule the next packet for processing by the model
int (*next)(
tw_stime * poffset,
void * sched,
// NOTE: copy here when deleting remote/local events for rc
void * rc_event_save,
model_net_sched_rc * rc,
tw_lp * lp);
// reverse schedule the previous packet
void (*next_rc)(
void * sched,
const void * rc_event_save,
const model_net_sched_rc * rc,
tw_lp * lp);
} model_net_sched_interface;
/// overall scheduler struct - type puns the actual data structure
struct model_net_sched_s {
enum sched_type type;
// data for the underlying scheduler implementation (see
// model-net-sched-impl*)
void * dat;
const model_net_sched_interface * impl;
/// scheduler-specific structures go here
/// reverse computation structure - this is expected to be held by upper-level
/// model-net LPs and passed to the scheduler functions to allow proper rc
/// NOTE: since modelnet LPs will be stashing this in their event structs,
/// need to provide full definition in header
struct model_net_sched_rc_s {
// NOTE: sched implementations may need different types, but for now they
// are equivalent
model_net_request req; // request gets deleted...
mn_sched_params sched_params; // along with msg params
int rtn; // return code from a sched_next
int prio; // prio when doing priority queue events
// initialize the scheduler
// - params is created by the configuration routine and can be different from
// type to type. Currently only priority scheduler uses it
void model_net_sched_init(
const model_net_sched_cfg_params * params,
int is_recv_queue,
struct model_net_method *method,
model_net_sched *sched);
/// schedules the next chunk, storing any info needed for rc in sched_rc
/// packet issue time is placed in poffset to be able to separate packet calls
/// between multiple scheduler events
/// returns:
/// * 0 on success,
/// * 1 on success and the corresponding request is finished. In this case,
/// out_req is set to the underlying request
/// * -1 when there is nothing to be scheduled
int model_net_sched_next(
tw_stime *poffset,
model_net_sched *sched,
void *rc_event_save,
model_net_sched_rc *sched_rc,
tw_lp *lp);
void model_net_sched_next_rc(
model_net_sched *sched,
const void *rc_event_save,
const model_net_sched_rc *sched_rc,
tw_lp *lp);
/// enter a new request into the scheduler, storing any info needed for rc in
/// sched_rc
/// sched_msg_params is scheduler-specific parameters (currently only used by
/// prio scheduler)
void model_net_sched_add(
const model_net_request *req,
const mn_sched_params * sched_params,
int remote_event_size,
void * remote_event,
int local_event_size,
void * local_event,
model_net_sched *sched,
model_net_sched_rc *sched_rc,
tw_lp *lp);
void model_net_sched_add_rc(
model_net_sched *sched,
const model_net_sched_rc *sched_rc,
tw_lp *lp);
// set default parameters for messages that don't specify any
void model_net_sched_set_default_params(mn_sched_params *sched_params);
extern char * sched_names[];
#endif /* end of include guard: MODEL_NET_SCHED_H */
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* End:
* vim: ft=c ts=8 sts=4 sw=4 expandtab
This diff is collapsed.
* Copyright (C) 2014 University of Chicago.
* See COPYRIGHT notice in top-level directory.
#include <ross.h>
typedef struct terminal_message terminal_message;
/* this message is used for both dragonfly compute nodes and routers */
struct terminal_message
/* magic number */
int magic;
/* flit travel start time*/
tw_stime travel_start_time;
/* packet ID of the flit */
unsigned long long packet_ID;
/* event type of the flit */
short type;
/* category: comes from codes */
char category[CATEGORY_NAME_MAX];
/* final destination LP ID, this comes from codes can be a server or any other LP type*/
tw_lpid final_dest_gid;
/*sending LP ID from CODES, can be a server or any other LP type */
tw_lpid sender_lp;
tw_lpid sender_mn_lp; // source modelnet id
/* destination terminal ID of the dragonfly */
tw_lpid dest_terminal_id;
/* source terminal ID of the dragonfly */
unsigned int src_terminal_id;
/* local LP ID to calculate the radix of the sender node/router */
unsigned int local_id;
/* message originating router id */
unsigned int origin_router_id;
/* number of hops traversed by the packet */
short my_N_hop;
short my_l_hop, my_g_hop;
short saved_channel;
/* Intermediate LP ID from which this message is coming */
unsigned int intm_lp_id;
short new_vc;
short saved_vc;
/* last hop of the message, can be a terminal, local router or global router */
int last_hop;
/* For routing */
int intm_group_id;
int chunk_id;
uint64_t packet_size;
uint64_t message_id;
uint64_t total_size;
int saved_remote_esize;
int remote_event_size_bytes;
int local_event_size_bytes;
// For buffer message
int vc_index;
int sender_radix;
int output_chan;
model_net_event_return event_rc;
int is_pull;
uint64_t pull_size;
/* for reverse computation */
int path_type;
tw_stime saved_available_time;
tw_stime saved_avg_time;
tw_stime saved_rcv_time;
tw_stime saved_busy_time;
tw_stime saved_total_time;
tw_stime saved_hist_start_time;
tw_stime msg_start_time;
int saved_hist_num;
int saved_occupancy;
/* for reverse computation of a node's fan in*/
int saved_fan_nodes;
tw_lpid sender_svr;
/* LP ID of the sending node, has to be a network node in the dragonfly */
tw_lpid sender_node;
tw_lpid next_stop;
struct dfly_qhash_entry * saved_hash;
#endif /* end of include guard: DRAGONFLY_H */
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* End:
* vim: ft=c ts=8 sts=4 sw=4 expandtab
* Copyright (C) 2014 University of Chicago.
* See COPYRIGHT notice in top-level directory.
#ifndef LOGGP_H
#define LOGGP_H
#include "../model-net-sched.h"
/* types of events that will constitute triton requests */
enum loggp_event_type
LG_MSG_READY = 1, /* sender has transmitted msg to receiver */
LG_MSG_START, /* initiate a transmission */
typedef struct loggp_message loggp_message;
struct loggp_message
int magic; /* magic number */
enum loggp_event_type event_type;
tw_lpid src_gid; /* who transmitted this msg? */
tw_lpid src_mn_lp; // src modelnet id, provided by sender