/* Copyright 2004,2007 ENSEIRB, INRIA & CNRS
**
** This file is part of the Scotch software package for static mapping,
** graph partitioning and sparse matrix ordering.
**
** This software is governed by the CeCILL-C license under French law
** and abiding by the rules of distribution of free software. You can
** use, modify and/or redistribute the software under the terms of the
** CeCILL-C license as circulated by CEA, CNRS and INRIA at the following
** URL: "http://www.cecill.info".
**
** As a counterpart to the access to the source code and rights to copy,
** modify and redistribute granted by the license, users are provided
** only with a limited warranty and the software's author, the holder of
** the economic rights, and the successive licensors have only limited
** liability.
**
** In this respect, the user's attention is drawn to the risks associated
** with loading, using, modifying and/or developing or reproducing the
** software by the user in light of its specific status of free software,
** that may mean that it is complicated to manipulate, and that also
** therefore means that it is reserved for developers and experienced
** professionals having in-depth computer knowledge. Users are therefore
** encouraged to load and test the software's suitability as regards
** their requirements in conditions enabling the security of their
** systems and/or data to be ensured and, more generally, to use and
** operate it in the same conditions as regards security.
**
** The fact that you are presently reading this means that you have had
** knowledge of the CeCILL-C license and that you accept its terms.
*/
/************************************************************/
/** **/
/** NAME : dummysizes.c **/
/** **/
/** AUTHOR : Francois PELLEGRINI **/
/** **/
/** FUNCTION : Part of the libScotch compilation job. **/
/** This small program processes files that **/
/** are in fact pattern header files for **/
/** the libScotch library, and replaces **/
/** symbolic sizes of the opaque libScotch **/
/** by the proper integer values according **/
/** to the machine on which it is run. **/
/** **/
/** DATES : # Version 3.4 : from : 22 oct 2001 **/
/** to : 22 nov 2001 **/
/** # Version 4.0 : from : 25 nov 2001 **/
/** to : 06 jan 2006 **/
/** # Version 5.0 : from : 26 apr 2006 **/
/** to : 30 jun 2007 **/
/** **/
/************************************************************/
/*
** The defines and includes.
*/
#define DUMMYSIZES
#define CHARMAX 2048 /* Maximum line size */
#define SUBSMAX 32 /* Maximum number of substitutions */
#define C_FILENBR 2 /* Number of files in list */
#define C_FILEARGNBR 2 /* Number of files which can be arguments */
#define C_filenamehedinp C_fileTab[0].name /* Source graph input file name */
#define C_filenamehedout C_fileTab[1].name /* Statistics output file name */
#define C_filepntrhedinp C_fileTab[0].pntr /* Source graph input file */
#define C_filepntrhedout C_fileTab[1].pntr /* Statistics output file */
#define EXPAND(s) EXPANDTWO(s)
#define EXPANDTWO(s) #s
#include "module.h"
#include "common.h"
#include "parser.h"
#include "graph.h"
#include "geom.h"
#include "mesh.h"
#include "arch.h"
#include "mapping.h"
#include "order.h"
#ifdef SCOTCH_PTSCOTCH
#include "dgraph.h"
#include "dorder.h"
#endif /* SCOTCH_PTSCOTCH */
#include "library_mapping.h"
#include "library_order.h"
/*
** The static definitions.
*/
static int C_fileNum = 0; /* Number of file in arg list */
static File C_fileTab[C_FILENBR] = { /* The file array */
{ "-", NULL, "r" },
{ "-", NULL, "w" } };
/******************************/
/* */
/* This is the main function. */
/* */
/******************************/
void
subsFill (
char * substab[2],
char * origptr,
int subsval)
{
char * subsptr;
subsptr = malloc (32 * sizeof (char));
sprintf (subsptr, "%d", (int) ((subsval + sizeof (double) - 1) / sizeof (double)));
substab[0] = origptr;
substab[1] = subsptr;
}
/******************************/
/* */
/* This is the main function. */
/* */
/******************************/
int
main (
int argc,
char * argv[])
{
char chartab[CHARMAX];
char chartmp[CHARMAX];
char * substab[SUBSMAX][2]; /* Substitution array */
int subsnbr;
int i;
if ((argc >= 2) && (argv[1][0] == '?')) { /* If need for help */
printf ("Usage is:\ndummysizes [ [