Commit a761990c authored by Robert Ricci's avatar Robert Ricci

Merge in changes from the assign-paper branch - this brings us back to

using the new assign, and captures Leigh's linkdelays work.
parent 7d4ddc23
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2002 University of Utah and the Flux Group.
# All rights reserved.
# Insert Copyright Here.
#
SRCDIR = @srcdir@
TESTBED_SRCDIR = @top_srcdir@
OBJDIR = ..
SUBDIR = assign
#
# Support for optional assign binary to avoid LEDA restrictions
#
ASSIGNBINARY = @ASSIGN@
include $(OBJDIR)/Makeconf
all: assign
include $(TESTBED_SRCDIR)/GNUmakerules
LEDA=@LEDA@
OBJS=parse_top.o parse_ptop.o assign.o pclass.o vclass.o config.o score.o \
parser.o
LIBS+= -lm
LDFLAGS+= -pipe -O3
CXXFLAGS = -pipe -I/usr/local/include -ftemplate-depth-30
OBJS=score.o parse_top.o parse_ptop.o config.o pclass.o vclass.o
LIBS+=-L${LEDA} -lD3 -lW -lP -lG -lL -L/usr/X11R6/lib -lX11 -lm -L.
LDFLAGS+= -O3
CXXFLAGS = -I${LEDA}/incl
# Pick one of the following:
CXXFLAGS += -Wall -O3
# Pick either this
CXXFLAGS += -O3
# or this
#CXXFLAGS += -O0 -g -Wall -DVERBOSE
#CXXFLAGS += -O0 -g -Wall -DVERBOSE -DSCORE_DEBUG -DPCLASS_DEBUG
#CXXFLAGS += -O0 -g -Wall -DVERBOSE -DSCORE_DEBUG -DPCLASS_DEBUG -DPCLASS_DEBUG_MORE
#CXXFLAGS += -O0 -g -Wall -DVERBOSE -DSCORE_DEBUG -DSCORE_DEBUG_MORE -DPCLASS_DEBUG -DPCLASS_DEBUG_MORE
# and then zero or more of these
#CXXFLAGS += -DSCORE_DEBUG
#CXXFLAGS += -DSCORE_DEBUG_MORE
#CXXFLAGS += -DPCLASS_DEBUG
#CXXFLAGS += -DDUMP_GRAPH
#CXXFLAGS += -DSCORE_DEBUG_LOTS
# And then, regardless, you can also have this
#CXXFLAGS += -DSTATS
# assign now supports a dizzing array of defines, which are as-yet undocumented
# Here are the ones used for a typical build:
# Pick cooling schedule
CXXFLAGS += -DMELT -DEPSILON_TERMINATE -DCHILL -DNEIGHBOR_LENGTH \
-DLOCAL_DERIVATIVE -DALLOW_NEGATIVE_DELTA
# Bug/scoring fixes
CXXFLAGS += -DINTERSWITCH_LENGTH -DPNODE_SWITCH_LOAD -DFIX_SHARED_INTERFACES
# Various tweaks to the simulated annealing behavior
CXXFLAGS += -DFIND_PNODE_SEARCH -DNO_REVERT
# This should be enabled, for better mapping, but has to be disabled
# for now because it breaks vclasses
#CXXFLAGS += -DPER_VNODE_TT -DSMART_UNMAP
# If you're looking to turn on or off USE_OPTIMAL, its now a cmdline
# option. Use OP={0,1} on the command line at run time... :)
DEPLIBS=$(OBJS)
ifdef ASSIGNBINARY
assign: ${ASSIGNBINARY}
rm -f assign
cp $< assign
else
assign: ${DEPLIBS} ${OBJS} assign.o
${CXX} assign.o -o assign ${LIBS} $(OBJS) ${LDFLAGS}
endif
assign: ${DEPLIBS} ${OBJS}
${CXX} -o assign ${LIBS} $(OBJS) ${LDFLAGS}
install: $(INSTALL_LIBEXECDIR)/assign
clean:
/bin/rm -f *.o assign
This diff is collapsed.
/*
* EMULAB-COPYRIGHT
* Copyright (c) 2000-2002 University of Utah and the Flux Group.
* All rights reserved.
*/
#ifndef __COMON_H
#define __COMON_H
#include "config.h"
const int MAX_PNODES = 2048; /* maximum # of physical nodes */
const int MAX_PNODES = 1024; /* maximum # of physical nodes */
/*
To use these on the command line, each entry gets a
......@@ -17,29 +11,78 @@ const int MAX_PNODES = 2048; /* maximum # of physical nodes */
Here we declare them all and give them defaults.
*/
static int init_temp = 100;
//static int init_temp = 100;
static int init_temp = 10;
static int USE_OPTIMAL = 1;
static int temp_prob = 130;
static int temp_stop = 20;
#ifdef LOW_TEMP_STOP
//static int temp_stop = 1;
static float temp_stop = .005;
#else
static float temp_stop = 2;
//static int temp_stop = 20;
#endif
static int CYCLES = 20;
// The following are basically arbitrary constants
// Initial acceptance ratio for melting
static float X0 = .95;
//static float epsilon = 0.1;
#ifdef LOCAL_DERIVATIVE
static float epsilon = 0.0001;
#else
static float epsilon = 0.01;
#endif
static float delta = 2;
//static float delta = 1;
//static float min_temp_end = 0.01;
//static float min_temp_end = 10000000.0;
// Number of runs to spend melting
static int melt_trans = 500;
static int min_neighborhood_size = 500;
static float temp_rate = 0.9;
static float opt_nodes_per_sw = 5.0;
#ifdef PENALIZE_BANDWIDTH
static float SCORE_DIRECT_LINK = 0.0;/* Cost of a direct link */
static float SCORE_INTRASWITCH_LINK = 0.0;/* Cost of an intraswitch link*/
static float SCORE_INTERSWITCH_LINK = 0.0;/* Cost of an interswitch link*/
#else
static float SCORE_DIRECT_LINK = 0.01;/* Cost of a direct link */
static float SCORE_DIRECT_LINK_PENALTY = 0.5;/* Cost of overused direct link*/
static float SCORE_INTRASWITCH_LINK = 0.02;/* Cost of an intraswitch link*/
static float SCORE_INTERSWITCH_LINK = 0.05;/* Cost of an interswitch link*/
static float SCORE_INTERSWITCH_LINK = 0.2;/* Cost of an interswitch link*/
#endif
static float SCORE_DIRECT_LINK_PENALTY = 0.5;/* Cost of overused direct link*/
static float SCORE_NO_CONNECTION = 0.5;/* Cost of not filling a virt. link*/
static float SCORE_PNODE = 0.05;/* Cost of using a pnode*/
static float SCORE_PNODE = 0.2;/* Cost of using a pnode*/
static float SCORE_PNODE_PENALTY = 0.5;/* Cost of overusing a pnode*/
static float SCORE_SWITCH = 0.5;/* Cost of using a switch.*/
static float SCORE_UNASSIGNED = 1;/* Cost of an unassigned node*/
static float SCORE_OVER_BANDWIDTH = 0.5;/* Cost of going over bandwidth*/
static float SCORE_DESIRE = 1;/* Multiplier for desire costs*/
static float SCORE_FEATURE = 1;/* Multiplier for feature weights*/
static float SCORE_UNASSIGNED = 1.0;/* Cost of an unassigned node*/
static float SCORE_DESIRE = 1.0;/* Multiplier for desire costs*/
static float SCORE_FEATURE = 1.0;/* Multiplier for feature weights*/
#ifdef NO_PCLASS_PENALTY
static float SCORE_PCLASS = 0.0; /* Cost of each pclass */
#else
static float SCORE_PCLASS = 0.5; /* Cost of each pclass */
static float SCORE_VCLASS = 1; /* vclass score multiplier */
#endif
static float SCORE_VCLASS = 1.0; /* vclass score multiplier */
static float SCORE_EMULATED_LINK = 0.01; /* cost of an emualted link */
static float SCORE_OUTSIDE_DELAY = 0.5; /* penalty for going out of delay
requirements */
static float SCORE_DELAY = 10.0; /* multiplier to distance for delay scoring */
#ifdef PENALIZE_UNUSED_INTERFACES
static float SCORE_UNUSED_INTERFACE = 0.04;
#endif
// The following are used to weight possible link resolutions. Higher
// numbers mean a more likely resolution. Trivial resolutions are always
// used if possible.
static float LINK_RESOLVE_DIRECT = 4.0;
static float LINK_RESOLVE_INTRASWITCH = 2.0;
static float LINK_RESOLVE_INTERSWITCH = 1.0;
static struct config_param options[] = {
{ "IT", CONFIG_INT, &init_temp, 0 },
......@@ -53,7 +96,6 @@ static struct config_param options[] = {
{ "1S", CONFIG_FLOAT, &SCORE_INTERSWITCH_LINK, 0 },
{ "2S", CONFIG_FLOAT, &SCORE_INTRASWITCH_LINK, 0 },
{ "NC", CONFIG_FLOAT, &SCORE_NO_CONNECTION, 0 },
{ "OB", CONFIG_FLOAT, &SCORE_OVER_BANDWIDTH, 0 },
{ "DL", CONFIG_FLOAT, &SCORE_DIRECT_LINK, 0 },
{ "DP", CONFIG_FLOAT, &SCORE_DIRECT_LINK_PENALTY, 0 },
{ "PN", CONFIG_FLOAT, &SCORE_PNODE, 0 },
......@@ -63,12 +105,41 @@ static struct config_param options[] = {
{ "SW", CONFIG_FLOAT, &SCORE_SWITCH, 0 },
{ "EL", CONFIG_FLOAT, &SCORE_EMULATED_LINK, 0 },
{ "ON", CONFIG_FLOAT, &opt_nodes_per_sw, 0 },
{ "TR", CONFIG_FLOAT, &temp_rate, 0 }
{ "TR", CONFIG_FLOAT, &temp_rate, 0 },
{ "LD", CONFIG_FLOAT, &LINK_RESOLVE_DIRECT, 0 },
{ "LI", CONFIG_FLOAT, &LINK_RESOLVE_INTRASWITCH, 0 },
{ "LT", CONFIG_FLOAT, &LINK_RESOLVE_INTERSWITCH, 0 },
{ "OD", CONFIG_FLOAT, &SCORE_OUTSIDE_DELAY, 0 },
{ "DM", CONFIG_FLOAT, &SCORE_DELAY, 0 }
};
static int noptions = sizeof(options) / sizeof(options[0]);
#endif
void parse_options(char **argv, struct config_param options[], int nopt);
struct eqstr
{
bool operator()(const char* A, const char* B) const
{
return (! strcmp(A, B));
}
};
enum edge_data_t {edge_data};
enum vertex_data_t {vertex_data};
namespace boost {
BOOST_INSTALL_PROPERTY(edge,data);
BOOST_INSTALL_PROPERTY(vertex,data);
}
typedef hash_map<crope,crope> name_name_map;
typedef slist<crope> name_slist;
template <class T> struct hashptr {
size_t operator()(T const &A) const {
return (size_t) A;
}
};
#endif
/*
* EMULAB-COPYRIGHT
* Copyright (c) 2000-2002 University of Utah and the Flux Group.
* Copyright (c) 1999-2001 The University of Utah and the Flux Group.
* All rights reserved.
*/
......@@ -25,7 +24,7 @@ struct config_param {
/* types */
#define CONFIG_INT 0
#define CONFIG_FLOAT 1
void parse_options(char **argv, struct config_param options[], int nopt);
int config_parse(char **args, struct config_param cparams[], int nparams);
void dump_options(const char *str, struct config_param cparams[], int nparams);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*
* EMULAB-COPYRIGHT
* Copyright (c) 2000-2002 University of Utah and the Flux Group.
* All rights reserved.
*/
#ifndef __PCLASS_H
#define __PCLASS_H
// Declared in assign.cc - indicated whether or not we should use pclasses
extern bool use_pclasses;
// tb pnode list is a data structure that acts like list but has
// O(1) removal. It is a list of tb_pnode*.
class tb_pnodelist {
public:
list<tb_pnode*> L;
dictionary<tb_pnode*,list_item> D;
typedef list<tb_pnode*> pnode_list;
typedef pnode_list::iterator list_iter;
pnode_list L;
typedef hash_map<tb_pnode*,list_iter,hashptr<tb_pnode*> > pnode_iter_map;
pnode_iter_map D;
list_item push_front(tb_pnode *p) {
list_item it = L.push_front(p);
D.insert(p,it);
list_iter push_front(tb_pnode *p) {
L.push_front(p);
list_iter it = L.begin();
D[p]=it;
return it;
};
list_item push_back(tb_pnode *p) {
list_item it = L.push_back(p);
D.insert(p,it);
list_iter push_back(tb_pnode *p) {
L.push_back(p);
list_iter it = L.end();
it--;
D[p]=it;
return it;
};
int remove(tb_pnode *p) {
if (exists(p)) {
list_item it = D.access(p);
L.del_item(it);
D.del(p);
pnode_iter_map::iterator dit = D.find(p);
L.erase((*dit).second);
D.erase(dit);
return 0;
} else {
return 1;
}
};
int exists(tb_pnode *p) {
return (D.lookup(p) != nil);
return (D.find(p) != D.end());
}
tb_pnode *front() {
list_item it = L.first();
return ((it == nil) ? NULL : L[it]);
return (L.empty() ? NULL : L.front());
};
friend ostream &operator<<(ostream &o, const tb_pnodelist& l)
{
pnode_list::const_iterator lit;
for (lit=l.L.begin();lit!=l.L.end();++lit) {
o << " " << (*lit)->name << endl;
}
return o;
}
};
class tb_pclass {
public:
tb_pclass() {
size=0;
used=0;
}
tb_pclass() : size(0), used(0) {;}
typedef hash_map<crope,tb_pnodelist*> pclass_members_map;
typedef hash_set<tb_pnode*,hashptr<tb_pnode*> > tb_pnodeset;
typedef hash_map<crope,tb_pnodeset*> pclass_members_set;
int add_member(tb_pnode *p);
string name; // purely for debugging
crope name; // purely for debugging
int size;
double used;
dictionary<string,tb_pnodelist*> members;
pclass_members_map members;
#ifdef SMART_UNMAP
pclass_members_set used_members;
#endif
friend ostream &operator<<(ostream &o, const tb_pclass& p)
{
o << p.name << "(" << &p << ") size=" << p.size <<
" used=" << p.used << "\n";
pclass_members_map::const_iterator dit;
for (dit=p.members.begin();dit!=p.members.end();++dit) {
o << " " << (*dit).first << ":\n";
o << *((*dit).second) << endl;
}
o << endl;
return o;
}
};
typedef list<tb_pclass*> pclass_list;
typedef array<tb_pclass*> pclass_array;
typedef two_tuple<int,pclass_array*> tt_entry;
typedef dictionary<string,tt_entry> pclass_types;
typedef vector<tb_pclass*> pclass_vector;
typedef pair<int,pclass_vector*> tt_entry;
typedef hash_map<crope,tt_entry> pclass_types;
/* Constants */
#define PCLASS_BASE_WEIGHT 1
......@@ -74,10 +102,9 @@ int generate_pclasses(tb_pgraph &PG);// sets pclasses and type_table globals
/* The following two routines sets and remove mappings in pclass
datastructures */
int pclass_set(tb_vnode &v,tb_pnode &p);
int pclass_unset(tb_pnode &p);
int pclass_set(tb_vnode *v,tb_pnode *p);
int pclass_unset(tb_pnode *p);
void pclass_debug(); // dumps debug info
int compare(tb_pclass *const &, tb_pclass *const &);
void pclass_debug();
#endif
/*
* EMULAB-COPYRIGHT
* Copyright (c) 2000-2002 University of Utah and the Flux Group.
* All rights reserved.
*/
#ifndef __PHYSICAL_H
#define __PHYSICAL_H
#include "common.h"
// Icky, but I can't include virtual.h here
class tb_vnode;
typedef hash_set<tb_vnode*,hashptr<tb_vnode*> > tb_vnode_set;
class tb_pclass;
class tb_pnode;
class tb_switch;
class tb_plink;
class tb_slink;
typedef property<vertex_data_t,tb_pnode*> PNodeProperty;
typedef property<edge_data_t,tb_plink*> PEdgeProperty;
typedef property<vertex_data_t,tb_switch*> SNodeProperty;
typedef property<edge_data_t,tb_slink*,
property<edge_weight_t,long> > SEdgeProperty;
typedef adjacency_list<listS,listS,undirectedS,
PNodeProperty,PEdgeProperty> tb_pgraph;
typedef adjacency_list<listS,vecS,undirectedS,
SNodeProperty,SEdgeProperty> tb_sgraph;
typedef property_map<tb_pgraph,vertex_data_t>::type tb_pgraph_vertex_pmap;
typedef property_map<tb_pgraph,edge_data_t>::type tb_pgraph_edge_pmap;
typedef property_map<tb_sgraph,vertex_data_t>::type tb_sgraph_vertex_pmap;
typedef property_map<tb_sgraph,edge_data_t>::type tb_sgraph_edge_pmap;
typedef property_map<tb_sgraph,edge_weight_t>::type tb_sgraph_weight_pmap;
typedef graph_traits<tb_pgraph>::vertex_descriptor pvertex;
typedef graph_traits<tb_pgraph>::edge_descriptor pedge;
typedef graph_traits<tb_sgraph>::vertex_descriptor svertex;
typedef graph_traits<tb_sgraph>::edge_descriptor sedge;
typedef graph_traits<tb_pgraph>::vertex_iterator pvertex_iterator;
typedef graph_traits<tb_pgraph>::edge_iterator pedge_iterator;
typedef graph_traits<tb_pgraph>::out_edge_iterator poedge_iterator;
typedef graph_traits<tb_sgraph>::vertex_iterator svertex_iterator;
typedef graph_traits<tb_sgraph>::edge_iterator sedge_iterator;
typedef graph_traits<tb_sgraph>::out_edge_iterator soedge_iterator;
typedef hash_set<pvertex,hashptr<void*> > pvertex_set;
typedef hash_map<tb_pnode*,pvertex,hashptr<tb_pnode*> > pnode_pvertex_map;
typedef hash_map<crope,pvertex> name_pvertex_map;
typedef vector<svertex> switch_pred_map;
typedef hash_map<svertex,switch_pred_map*>switch_pred_map_map;
typedef vector<svertex> switch_dist_map;
typedef hash_map<svertex,switch_dist_map*>switch_dist_map_map;
typedef list<pedge> pedge_path;
typedef list<pvertex> pvertex_list;
extern tb_pgraph_vertex_pmap pvertex_pmap;
extern tb_pgraph_edge_pmap pedge_pmap;
extern tb_sgraph_vertex_pmap svertex_pmap;
extern tb_sgraph_edge_pmap sedge_pmap;
class tb_pnode {
public:
tb_pnode() {;}
friend ostream &operator<<(ostream &o, const tb_pnode& node)
{
o << "TBNode: " << node.name << endl;
o << "tb_pnode: " << node.name << " (" << &node << ")" << endl;
o << " Types:" << endl;
for (types_map::const_iterator it = node.types.begin();
it!=node.types.end();it++)
o << " " << (*it).first << " -> " << (*it).second << endl;
o << " Features:" << endl;
for (features_map::const_iterator it = node.features.begin();
it!=node.features.end();it++)
cout << " " << (*it).first << " -> " << (*it).second << endl;
o << " Current Type: " << node.current_type <<
" (" << node.current_load << "/" << node.max_load << ")" << endl;
o << " switches=";
for (pvertex_set::const_iterator it = node.switches.begin();
it != node.switches.end();++it) {
o << " " << get(pvertex_pmap,*it)->name;
}
o << endl;
o << " pnodes_used="<< node.pnodes_used << " sgraph_switch=" <<
node.sgraph_switch << " my_class=" << node.my_class << endl;
return o;
}
friend istream &operator>>(istream &i, const tb_pnode& node)
{
return i;
}
dictionary<string,int> types; // contains max nodes for each type
sortseq<string,double> features; // contains cost of each feature
string current_type;
typedef hash_map<crope,int> types_map;
typedef hash_map<crope,double> features_map;
// contains max nodes for each type
types_map types;
// contains cost of each feature
features_map features;
crope current_type;
bool typed; // has it been typed
int max_load; // maxmium load for current type
int current_load; // how many vnodes are assigned to this pnode
string name;
node the_switch; // the switch the node is attached to
// this is in the physical graph.
crope name;
pvertex_set switches; // what switches the node is attached to
int pnodes_used; // for switch nodes
node sgraph_switch; // only for switches, the corresponding
svertex sgraph_switch; // only for switches, the corresponding
// sgraph switch.
int switch_used_links; // only for switches, how many links are
// in use. Switch is in use whenever > 0
int total_interfaces;
#ifdef PENALIZE_UNUSED_INTERFACES
int used_interfaces;
#endif
tb_pclass *my_class;
#ifdef SMART_UNMAP
tb_vnode_set assigned_nodes;
#endif
};
class tb_switch {
public:
tb_switch() {;}
friend ostream &operator<<(ostream &o, const tb_switch& node)
{
o << "unimplemented osteam << for tb_switch" << endl;
return o;
}
friend ostream &operator<<(ostream &o, const tb_switch& node)
{
o << "tb_switch: " << &node << endl;
o << " mate=" << node.mate << endl;
return o;
}
friend istream &operator>>(istream &i, const tb_switch& node)
{
return i;
}
tb_switch() {;}
pvertex mate; // match in PG
};
node mate; // match in PG
#ifdef FIX_PLINK_ENDPOINTS
// Hasher for pairs
template <class T> struct pairhash {
size_t operator()(pair<T,T> const &A) const {
hash<T> H;
return (H(A.first) | H(A.second));
}
};
typedef pair<crope,crope> nodepair;
typedef hash_map<nodepair,int,pairhash<crope> > nodepair_count_map;
#endif
class tb_plink {
public:
#ifdef FIX_PLINK_ENDPOINTS
tb_plink():current_count(0) {;}
#else
tb_plink() {;}
friend ostream &operator<<(ostream &o, const tb_plink& edge)
{
o << "unimplemeted ostream << for tb_plink " << endl;
return o;
}
friend istream & operator>>(istream &i, const tb_plink& edge)
{
return i;
#endif
friend ostream &operator<<(ostream &o, const tb_plink& link)
{
o << "tb_plink: " << link.name << " (" << &link << ")" << endl;
o << " type: ";
switch (link.type) {
case tb_plink::PLINK_NORMAL:
o << "normal" << endl;
break;
case tb_plink::PLINK_INTERSWITCH:
o << "interswitch" << endl;
break;
case tb_plink::PLINK_LAN:
o << "lan" << endl;
break;
}
int bandwidth; // maximum bandwidth of this link
o << " bw_used=" << link.bw_used <<
" srcmac=" << link.srcmac << " dstmac=" << link.dstmac <<
" emulated=" << link.emulated << " nonemulated=" <<
link.nonemulated << endl;
o << link.delay_info;
return o;
}
typedef enum {PLINK_NORMAL,PLINK_INTERSWITCH,PLINK_LAN} plinkType;
plinkType type;
tb_delay_info delay_info; // the delay characteristics of this link
int bw_used; // how much is used
string srcmac,dstmac; // source and destination MAC addresses.
string name; // The name
crope srcmac,dstmac; // source and destination MAC addresses.
crope name; // The name
int emulated; // number of emulated vlinks
int nonemulated; // number of nonemulated vlinks
bool interswitch; // is this an interswitch link
#ifdef PENALIZE_BANDWIDTH
float penalty;
#endif
#ifdef FIX_PLINK_ENDPOINTS
bool fixends; // If using as a emulated link, fix endpoints
nodepair_count_map vedge_counts;
nodepair current_endpoints;
int current_count;
#endif
};
class tb_slink {
public:
tb_slink() {;}
friend ostream &operator<<(ostream &o, const tb_slink& edge)
{
o << "unimplemeted ostream << for tb_psink " << endl;
return o;
}
friend istream & operator>>(istream &i, const tb_slink& edge)
{
return i;
}
edge mate; // match in PG
friend ostream &operator<<(ostream &o, const tb_slink &link)
{
o << "tb_slink: " << &link << endl;
o << " mate=" << link.mate << endl;
return o;
}
pedge mate; // match in PG
};
typedef GRAPH<tb_pnode,tb_plink> tb_pgraph;
typedef UGRAPH<tb_switch,tb_slink> tb_sgraph;
int parse_ptop(tb_pgraph &PG, tb_sgraph &SG, istream& i);
int compare(tb_pnode *const &a, tb_pnode *const &b);
#endif
This diff is collapsed.
/*
* EMULAB-COPYRIGHT
* Copyright (c) 2000-2002 University of Utah and the Flux Group.
* All rights reserved.
*/
#ifndef _SCORE_H
#define _SCORE_H
typedef struct {
int unassigned;
int pnode_load;
......@@ -17,16 +10,23 @@ typedef struct {
int bandwidth;
int desires;
int vclass;
int delay;
#ifdef FIX_PLINK_ENDPOINTS
int incorrect_endpoints;
#endif
} violated_info;
extern float score;
extern double score;
extern int violated;
extern violated_info vinfo;
extern bool allow_trivial_links;
void init_score();
void remove_node(node n);
int add_node(node n,int loc);
float get_score();
void remove_node(vvertex vv);
int add_node(vvertex vv,pvertex pv,bool deterministic);
double get_score();
double fd_score(tb_vnode &vnoder,tb_pnode &pnoder,int *fd_violated);
pvertex make_lan_node(vvertex vv);
void delete_lan_node(pvertex pv);
#endif
/*
* EMULAB-COPYRIGHT
* Copyright (c) 2000-2002 University of Utah and the Flux Group.
* All rights reserved.
*/
#include "port.h"
#include <LEDA/graph_alg.h>
#include <LEDA/graphwin.h>
#include <LEDA/ugraph.h>
#include <LEDA/dictionary.h>
#include <LEDA/map.h>
#include <LEDA/graph_iterator.h>
#include <LEDA/node_pq.h>
#include <LEDA/sortseq.h>
#include <iostream.h>
#include <stdio.h>
#include <stdlib.h>