~ubuntu-branches/ubuntu/trusty/scotch/trusty

« back to all changes in this revision

Viewing changes to src/libscotch/library_arch.c

  • Committer: Bazaar Package Importer
  • Author(s): "Adam C. Powell, IV", Christophe Trophime, Adam C. Powell, IV
  • Date: 2010-12-29 13:07:19 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20101229130719-jwalolw5d6av6wqx
Tags: 5.1.11.dfsg-1
[Christophe Trophime]
* New upstream release
* Forward-ported patches to version 5.1.10b.
* Install scotch headers properly.
* Fix chrpath commands in debian/rules.
* Fix (pt)scotch library install paths.
* Fix lintian errors and warnings.

[Adam C. Powell, IV]
* Forward-ported patches to version 5.1.11.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright 2004,2007,2009 ENSEIRB, INRIA & CNRS
 
1
/* Copyright 2004,2007,2009,2010 ENSEIRB, INRIA & CNRS
2
2
**
3
3
** This file is part of the Scotch software package for static mapping,
4
4
** graph partitioning and sparse matrix ordering.
50
50
/**                # Version 5.0  : from : 12 sep 2007     **/
51
51
/**                                 to   : 12 sep 2007     **/
52
52
/**                # Version 5.1  : from : 05 jun 2009     **/
53
 
/**                                 to   : 11 aug 2009     **/
 
53
/**                                 to   : 17 nov 2010     **/
54
54
/**                                                        **/
55
55
/************************************************************/
56
56
 
81
81
/*                                     */
82
82
/***************************************/
83
83
 
 
84
/*+ This routine reserves a memory area
 
85
*** of a size sufficient to store a
 
86
*** target architecture.
 
87
*** It returns:
 
88
*** - !NULL  : if the initialization succeeded.
 
89
*** - NULL   : on error.
 
90
+*/
 
91
 
 
92
SCOTCH_Arch *
 
93
SCOTCH_archAlloc ()
 
94
{
 
95
  return ((SCOTCH_Arch *) memAlloc (sizeof (SCOTCH_Arch)));
 
96
}
 
97
 
84
98
/*+ This routine initializes the opaque
85
99
*** architecture structure used to handle
86
100
*** target architectures in the Scotch library.
324
338
int
325
339
SCOTCH_archTleaf (
326
340
SCOTCH_Arch * const         archptr,
327
 
const SCOTCH_Num            leafdep,              /*+ Maximum leaf depth                      +*/
328
 
const SCOTCH_Num            clusdep,              /*+ Depth before reaching complete clusters +*/
329
 
const SCOTCH_Num            linkval)              /*+ Value of extra-cluster links            +*/
 
341
const SCOTCH_Num            levlnbr,              /*+ Number of levels in architecture            +*/
 
342
const SCOTCH_Num * const    sizetab,              /*+ Size array, by increasing level number      +*/
 
343
const SCOTCH_Num * const    linktab)              /*+ Link cost array, by increasing level number +*/
330
344
{
 
345
  Anum                levlnum;
 
346
  Anum                sizeval;
331
347
  Arch *              tgtarchptr;
332
348
  ArchTleaf *         tgtarchdatptr;
333
349
 
336
352
    return     (1);
337
353
  }
338
354
 
339
 
  tgtarchptr    = (Arch *) archptr;
340
 
  tgtarchdatptr = (ArchTleaf *) (void *) (&tgtarchptr->data);
341
 
 
342
 
  tgtarchptr->class      = archClass ("tleaf");
343
 
  tgtarchdatptr->leafdep = (Anum) leafdep;
344
 
  tgtarchdatptr->clusdep = (Anum) clusdep;
345
 
  tgtarchdatptr->linkval = (Anum) linkval;
 
355
  tgtarchptr        = (Arch *) archptr;
 
356
  tgtarchdatptr     = (ArchTleaf *) (void *) (&tgtarchptr->data);
 
357
  tgtarchptr->class = archClass ("tleaf");
 
358
 
 
359
  if ((tgtarchdatptr->sizetab = memAlloc ((levlnbr * 2 + 1) * sizeof (Anum))) == NULL) { /* TRICK: One more slot for linktab[-1] */
 
360
    errorPrint ("SCOTCH_archTleaf: out of memory");
 
361
    return     (1);
 
362
  }
 
363
  tgtarchdatptr->levlnbr     = (Anum) levlnbr;
 
364
  tgtarchdatptr->linktab     = tgtarchdatptr->sizetab + tgtarchdatptr->levlnbr + 1;
 
365
  tgtarchdatptr->linktab[-1] = 0;                 /* TRICK: Dummy slot for for level-0 communication */
 
366
 
 
367
  for (levlnum = 0, sizeval = 1; levlnum < tgtarchdatptr->levlnbr; levlnum ++) {
 
368
    tgtarchdatptr->sizetab[levlnum] = sizetab[levlnum];
 
369
    tgtarchdatptr->linktab[levlnum] = linktab[levlnum];
 
370
    sizeval *= tgtarchdatptr->sizetab[levlnum];
 
371
  }
 
372
  tgtarchdatptr->sizeval = sizeval;
346
373
 
347
374
  return (0);
348
375
}
422
449
 
423
450
  tgtarchptr = (Arch *) archptr;
424
451
 
425
 
  tgtarchptr->class = archClass ("vcmplt");
 
452
  tgtarchptr->class = archClass ("varcmplt");
426
453
 
427
454
  return (0);
428
455
}