OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
mumps_scotch64.c
Go to the documentation of this file.
1/*
2 *
3 * This file is part of MUMPS 5.5.1, released
4 * on Tue Jul 12 13:17:24 UTC 2022
5 *
6 *
7 * Copyright 1991-2022 CERFACS, CNRS, ENS Lyon, INP Toulouse, Inria,
8 * Mumps Technologies, University of Bordeaux.
9 *
10 * This version of MUMPS is provided to you free of charge. It is
11 * released under the CeCILL-C license
12 * (see doc/CeCILL-C_V1-en.txt, doc/CeCILL-C_V1-fr.txt, and
13 * https://cecill.info/licences/Licence_CeCILL-C_V1-en.html)
14 *
15 */
16/* Interfacing with 64-bit SCOTCH and pt-SCOTCH */
17#include <stdio.h>
18#include <stdlib.h>
19#include <string.h>
20#include "mumps_scotch64.h"
21#if defined(scotch) || defined(ptscotch)
22void MUMPS_CALL
23MUMPS_SCOTCH_ORD_64( const MUMPS_INT8 * const n, /* in */
24 const MUMPS_INT8 * const iwlen, /* in */
25 MUMPS_INT8 * const petab, /* inout */
26 const MUMPS_INT8 * const pfree, /* in */
27 MUMPS_INT8 * const lentab, /* in (modified in ANA_H) */
28 MUMPS_INT8 * const iwtab, /* in (modified in ANA_H) */
29 MUMPS_INT8 * const nvtab, /* out or inout if weight used on entry */
30 MUMPS_INT8 * const elentab, /* out permutation on output */
31 MUMPS_INT8 * const lasttab, /* out */
32 MUMPS_INT * const ncmpa, /* out */
33 MUMPS_INT * const weightused, /* out */
34 MUMPS_INT * const weightrequested ) /* in */
35{
36/* weightused(out) = weightrequested since it is always used to build graph
37 FIXME it is not exploited on output and could be suppressed from interface
38 = 0 otherwise
39*/
40/* weightused(out) = weightrequested since it is always used to build graph
41 FIXME it is not exploited on output and could be suppressed from interface
42 = 0 otherwise
43*/
44 MUMPS_INT8 * vendtab ; /* Vertex end array */
45 SCOTCH_Graph grafdat; /* Graph */
46 SCOTCH_Strat stratdat;
47 MUMPS_INT8 vertnum;
48 *weightused = *weightrequested;
49 vendtab=malloc(*n * sizeof(MUMPS_INT));
50 for (vertnum = 0; vertnum < *n; vertnum ++)
51 vendtab[vertnum] = petab[vertnum] + lentab[vertnum];
52 SCOTCH_graphInit (&grafdat);
53 if ( *weightrequested == 1 )
54 {
55 SCOTCH_graphBuild (&grafdat, 1, *n, (SCOTCH_Num *) petab, (SCOTCH_Num *) vendtab, (SCOTCH_Num *) nvtab, NULL, *iwlen, (SCOTCH_Num *) iwtab, NULL); /* Assume Fortran-based indexing */
56 }
57 else
58 {
59 SCOTCH_graphBuild (&grafdat, 1, *n, (SCOTCH_Num *) petab, (SCOTCH_Num *) vendtab, NULL, NULL, *iwlen, (SCOTCH_Num *) iwtab, NULL); /* Assume Fortran-based indexing */
60 }
61 SCOTCH_stratInit(&stratdat);
62 *ncmpa=SCOTCH_graphOrder(&grafdat, &stratdat, (SCOTCH_Num *) elentab, (SCOTCH_Num *) lasttab, NULL, NULL, NULL);
63 SCOTCH_stratExit(&stratdat);
64 SCOTCH_graphExit(&grafdat);
65 free(vendtab);
66}
67void MUMPS_CALL
68MUMPS_SCOTCH_64( const MUMPS_INT8 * const n, /* in */
69 const MUMPS_INT8 * const iwlen, /* in */
70 MUMPS_INT8 * const petab, /* inout */
71 const MUMPS_INT8 * const pfree, /* in */
72 MUMPS_INT8 * const lentab, /* in (modified in ANA_H) */
73 MUMPS_INT8 * const iwtab, /* in (modified in ANA_H) */
74 MUMPS_INT8 * const nvtab, /* out or inout if weight used on entry */
75 MUMPS_INT8 * const elentab, /* out */
76 MUMPS_INT8 * const lasttab, /* out */
77 MUMPS_INT * const ncmpa, /* out */
78 MUMPS_INT * const weightused, /* out */
79 MUMPS_INT * const weightrequested ) /* in */
80{
81/* weightused(out) = 1 if weight of nodes provided in nvtab are used (esmumpsv is called)
82 = 0 otherwise
83*/
84#if ((SCOTCH_VERSION == 6) && (SCOTCH_RELEASE >= 1)) || (SCOTCH_VERSION >= 7)
85/* esmumpsv prototype with 64-bit integers weights of nodes in the graph are used on entry (nvtab) */
86 if ( *weightrequested == 1 )
87 {
88 *ncmpa = esmumpsv( *n, *iwlen, petab, *pfree,
89 lentab, iwtab, nvtab, elentab, lasttab );
90 *weightused=1;
91 }
92 else
93 {
94 /* esmumps prototype with standard integers (weights of nodes not used on entry) */
95 *ncmpa = esmumps( *n, *iwlen, petab, *pfree,
96 lentab, iwtab, nvtab, elentab, lasttab );
97 *weightused=0;
98 }
99#else
100 /* esmumps prototype with standard integers (weights of nodes not used on entry) */
101 *ncmpa = esmumps( *n, *iwlen, petab, *pfree,
102 lentab, iwtab, nvtab, elentab, lasttab );
103 *weightused=0;
104#endif
105}
106#endif
#define MUMPS_INT8
#define MUMPS_INT
#define MUMPS_CALL
n