/* tab:8 * * expar-dx.c - Experimental Data Sets (Sequential Code) * * * "Copyright (c) 1996 The Regents of the University of Maryland. * All rights reserved. * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose, without fee, and without written agreement is * hereby granted, provided that the above copyright notice and the following * two paragraphs appear in all copies of this software. * * IN NO EVENT SHALL THE UNIVERSITY OF MARYLAND BE LIABLE TO ANY PARTY FOR * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF * MARYLAND HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * THE UNIVERSITY OF MARYLAND SPECIFICALLY DISCLAIMS ANY WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF MARYLAND HAS NO OBLIGATION TO * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS." * * Authors: David A. Bader * Joseph F. Ja'Ja' * Institute for Advanced Computer Studies * Department of Electrical Engineering * AV Williams Building * College Park, MD 20742 * * Version: 1.0 * Creation Date: July 25, 1996 * Filename: expar-dx.c * History: */ #include #include #include #include #include "expar-dx.h" #include "nas_rand.h" void assert_malloc(void *ptr) { if (ptr==NULL) { fprintf(stderr,"ERROR: null pointer\n"); exit(-1); } } void RNG_init(int pid) { srandom(pid*(int)time(0) + 17*pid*(int)floor(time(0)*317.0)); } /************************************************************/ /* INTEGERS */ /************************************************************/ void fill_bench_i_N(int PROCS, int M, int **A) { int i, pid; nas_srand(); for (pid=0 ; pid ",pid); for (pid=0 ; pid ",pid); for (pid=0 ; pid=0 ; i--) free(A[i]); free(A); B = (double **)malloc(PROCS * sizeof(double*)); assert_malloc(B); for (i=0 ; i=0 ; i--) free(B[i]); free(B); }