~ubuntu-branches/ubuntu/hoary/heartbeat/hoary

« back to all changes in this revision

Viewing changes to membership/ccm/ccmgraph.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2005-02-24 10:12:16 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20050224101216-17p0xnfe5f1tn6bc
Tags: 1.2.3-3ubuntu1
debian/control: Removed raidtools2 build dependency, to help demotion of
raidtools2 to universe.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: ccmgraph.c,v 1.8.4.1 2004/04/20 05:05:34 alan Exp $ */
 
1
/* $Id: ccmgraph.c,v 1.8.4.2 2004/09/11 06:36:34 msoffen Exp $ */
2
2
/* 
3
3
 * ccmgraph.c: Keeps track of the connectivity within the cluster members
4
4
 *              to derive the largest totally connected subgraph.
35
35
#define GRAPH_TIMEOUT  15
36
36
#define GRAPH_TIMEOUT_TOO_LONG  25
37
37
 
38
 
//
39
 
// clean up the unneccessary bits in the graph and check for
40
 
// inconsistency.
41
 
//
 
38
/*  */
 
39
/*  clean up the unneccessary bits in the graph and check for */
 
40
/*  inconsistency. */
 
41
/*  */
42
42
static void
43
43
graph_sanitize(graph_t *gr)
44
44
{
100
100
}
101
101
                
102
102
 
103
 
//
104
 
// print the vertices that belong the largest totally connected subgraph.
105
 
//
 
103
/*  */
 
104
/*  print the vertices that belong the largest totally connected subgraph. */
 
105
/*  */
106
106
static void
107
107
print_vertex(vertex_t **vertex, int maxnode)
108
108
{
124
124
}
125
125
 
126
126
 
127
 
//
128
 
// BEGIN OF FUNCTIONS THAT FORM THE CORE OF THE ALGORITHM
129
 
//
 
127
/*  */
 
128
/*  BEGIN OF FUNCTIONS THAT FORM THE CORE OF THE ALGORITHM */
 
129
/*  */
130
130
 
131
 
//
132
 
// the function that orders the vertices in the graph while sorting.
133
 
//
 
131
/*  */
 
132
/*  the function that orders the vertices in the graph while sorting. */
 
133
/*  */
134
134
static int
135
135
compare(const void *value1, const void *value2)
136
136
{
351
351
 
352
352
        return size;
353
353
}
354
 
//
355
 
// END OF FUNCTIONS THAT FORM THE CORE OF THE ALGORITHM
356
 
//
 
354
/*  */
 
355
/*  END OF FUNCTIONS THAT FORM THE CORE OF THE ALGORITHM */
 
356
/*  */
357
357
 
358
 
//
359
 
// initialize the graph.
360
 
//
 
358
/*  */
 
359
/*  initialize the graph. */
 
360
/*  */
361
361
graph_t *
362
362
graph_init()
363
363
{
377
377
}
378
378
 
379
379
 
380
 
//
381
 
// free all the datastructures 
382
 
//
 
380
/*  */
 
381
/*  free all the datastructures  */
 
382
/*  */
383
383
void
384
384
graph_free(graph_t *gr)
385
385
{
395
395
}
396
396
 
397
397
 
398
 
//
399
 
// add a new member to the graph, whose id is 'uuid'
400
 
//
 
398
/*  */
 
399
/*  add a new member to the graph, whose id is 'uuid' */
 
400
/*  */
401
401
void
402
402
graph_add_uuid(graph_t *gr, int uuid)
403
403
{
404
404
        gr->graph_node[gr->graph_nodes++]->uuid = uuid;
405
405
}
406
406
 
407
 
//
408
 
// add the member whose id is 'dst_uuid' to the connectivity list
409
 
// of the member with id 'src_uuid'
410
 
//
 
407
/*  */
 
408
/*  add the member whose id is 'dst_uuid' to the connectivity list */
 
409
/*  of the member with id 'src_uuid' */
 
410
/*  */
411
411
void
412
412
graph_add_to_membership(graph_t *gr, int src_uuid, int dst_uuid)
413
413
{
425
425
 
426
426
 
427
427
 
428
 
//
429
 
// update the connectivity information of the member whose id is 'uuid'.
430
 
//
 
428
/*  */
 
429
/*  update the connectivity information of the member whose id is 'uuid'. */
 
430
/*  */
431
431
void
432
432
graph_update_membership(graph_t *gr, 
433
433
                        int uuid, 
457
457
        return;
458
458
}
459
459
 
460
 
//
461
 
// return TRUE, if all the members of the graph have their
462
 
// connectivity information updated.
463
 
//
 
460
/*  */
 
461
/*  return TRUE, if all the members of the graph have their */
 
462
/*  connectivity information updated. */
 
463
/*  */
464
464
int
465
465
graph_filled_all(graph_t *gr)
466
466
{
468
468
}
469
469
 
470
470
 
471
 
//
472
 
// return the largest fully connected subgraph.
473
 
//
 
471
/*  */
 
472
/*  return the largest fully connected subgraph. */
 
473
/*  */
474
474
int
475
475
graph_get_maxclique(graph_t *gr, unsigned char **bitmap)
476
476
{