Revision 743e659d

View differences:

Makefile
5 5
ifndef DBG
6 6
CFLAGS += -O8
7 7
endif
8
CFLAGS += -g -I EventScheduler/ -I Matrix/
9
LDLIBS = -lm 
8
CFLAGS += -g -I EventScheduler/ -I Matrix/ -I lpsolve
9
LDLIBS = -lm -ldl
10 10

  
11 11
CPPFLAGS += -Dpeer_send=peer_send_c_p
12 12
CPPFLAGS += -Dpeer_sched=$(PEER_SCHED)
......
23 23

  
24 24
OBJS = sssim.o sched.o graph.o stats.o
25 25
OBJS += td.o peer_event.o ed.o overlay.o
26
OBJS += wuli.o
26 27

  
27 28
all: sssim proc-time
28 29

  
overlay.c
16 16
#include "overlay.h"
17 17
#include "graph.h"
18 18
#include "sched.h"
19
#include "wuli.h"
19 20

  
20 21
extern float netload;
21 22

  
......
122 123
			offers = matrix_eigencentrality(A, NULL);
123 124
			overlay_matrix_optimize(&A, &offers);
124 125
		} else
125
		{
126
//			fprintf(stderr, "[DEBUG] uniform overlay..\n");
127
			offers = matrix_ones(matrix_num_rows(A), 1);
128
		}
126
			if (tokens_check(inputfile, ntok, "wuli") >= 0)
127
			{
128
				printf("Applying Wu-Li optimization...\n");
129
				offers = matrix_ones(matrix_num_rows(A), 1);
130
				overlay_matrix_wuli(&A, &offers, source_id);
131
			}
132
			else
133
			{
134
	//			fprintf(stderr, "[DEBUG] uniform overlay..\n");
135
				offers = matrix_ones(matrix_num_rows(A), 1);
136
			}
129 137
		matrix_shrink(&offers, source_id);
130 138
		matrix_divide(offers, matrix_sum_values(offers)/((*npeers - 1)*netload));
131 139
//		printf("Total number of offers: %f\n", matrix_sum_values(offers)); 
sssim.c
65 65
  printf("\t-T <Server Period>:\t\tSet the deadline postponing amount\n");
66 66
  printf("\t-g <Graph file name>:\t\tSave the overlay as a DOT file\n");
67 67
  printf("\t-e:\t\t\t\tSwitch to event-driven mode\n");
68
  printf("\t-G <Edge Graph file name>:\tImport the overlay from an '.edges' file. Options: [,optimize][,random_source]\n");
68
  printf("\t-G <Edge Graph file name>:\tImport the overlay from an '.edges' file. Options: [,optimize|,wuli][,random_source]\n");
69 69
  printf("\t-a <precision>:\t\t\tStops if convergence is reached.\n");
70 70
  printf("\t-w <analysis window size>:\tDefine the analysis chunk window.\n");
71 71
  exit(0);
wuli.c
1
#include<wuli.h>
1
#include"wuli.h"
2 2
#include<lp_lib.h>
3 3

  
4 4
#define x(n, i, j) (i+j*n + 1)
......
8 8
{
9 9
	if(t < source_id)
10 10
		return (n*n + i + j*n + t*n*n + 1);
11
	if(t == source_id)
12
		return -1;
13 11
	if(t > source_id)
14 12
		return (n*n + i + j*n + (t-1)*n*n + 1);
15

  
13
	return -1;
16 14
}
17 15

  
18 16
REAL node_output(const struct matrix * A, matsize i)

Also available in: Unified diff