1 /* Copyright 2004,2007,2012,2014 IPB, Universite de Bordeaux, INRIA & CNRS
2 **
3 ** This file is part of the Scotch software package for static mapping,
4 ** graph partitioning and sparse matrix ordering.
5 **
6 ** This software is governed by the CeCILL-C license under French law
7 ** and abiding by the rules of distribution of free software. You can
8 ** use, modify and/or redistribute the software under the terms of the
9 ** CeCILL-C license as circulated by CEA, CNRS and INRIA at the following
10 ** URL: "http://www.cecill.info".
11 **
12 ** As a counterpart to the access to the source code and rights to copy,
13 ** modify and redistribute granted by the license, users are provided
14 ** only with a limited warranty and the software's author, the holder of
15 ** the economic rights, and the successive licensors have only limited
16 ** liability.
17 **
18 ** In this respect, the user's attention is drawn to the risks associated
19 ** with loading, using, modifying and/or developing or reproducing the
20 ** software by the user in light of its specific status of free software,
21 ** that may mean that it is complicated to manipulate, and that also
22 ** therefore means that it is reserved for developers and experienced
23 ** professionals having in-depth computer knowledge. Users are therefore
24 ** encouraged to load and test the software's suitability as regards
25 ** their requirements in conditions enabling the security of their
26 ** systems and/or data to be ensured and, more generally, to use and
27 ** operate it in the same conditions as regards security.
28 **
29 ** The fact that you are presently reading this means that you have had
30 ** knowledge of the CeCILL-C license and that you accept its terms.
31 */
32 /************************************************************/
33 /**                                                        **/
34 /**   NAME       : library_random.c                        **/
35 /**                                                        **/
36 /**   AUTHOR     : Francois PELLEGRINI                     **/
37 /**                                                        **/
38 /**   FUNCTION   : This module is the API for the random   **/
39 /**                generator control routine.              **/
40 /**                                                        **/
41 /**   DATES      : # Version 4.0  : from : 15 jan 2005     **/
42 /**                                 to     15 jun 2005     **/
43 /**                # Version 6.0  : from : 08 oct 2012     **/
44 /**                                 to     03 oct 2014     **/
45 /**                                                        **/
46 /************************************************************/
47 
48 /*
49 **  The defines and includes.
50 */
51 
52 #define LIBRARY
53 
54 #include "module.h"
55 #include "common.h"
56 #include "scotch.h"
57 
58 /************************************/
59 /*                                  */
60 /* These routines are the C API for */
61 /* the random handling routines.    */
62 /*                                  */
63 /************************************/
64 
65 /*+ This routine sets the process number that
66 *** is used to generate a different seed across
67 *** all processes.
68 *** It returns:
69 *** - void  : in all cases.
70 +*/
71 
72 void
SCOTCH_randomProc(int procnum)73 SCOTCH_randomProc (
74 int                         procnum)
75 {
76   intRandProc (procnum);
77 }
78 
79 /*+ This routine resets the random generator
80 *** to simulate a start from scratch.
81 *** It returns:
82 *** - void  : in all cases.
83 +*/
84 
85 void
SCOTCH_randomReset()86 SCOTCH_randomReset ()
87 {
88   intRandReset ();
89 }
90 
91 /*+ This routine resets the random generator
92 *** to simulate a start from scratch.
93 *** It returns:
94 *** - void  : in all cases.
95 +*/
96 
97 void
SCOTCH_randomSeed(INT seedval)98 SCOTCH_randomSeed (
99 INT                         seedval)
100 {
101   intRandSeed (seedval);
102 }
103