Posts

Showing posts with the label MultiCore

Sobol Quasi Random Number Generator single thread version

#include<stdio.h> #include<stdlib.h> #include<error.h> #include<errno.h> #include"nrutil.h" #define MAXBIT 30 #define MAXDIM 6 #define DEBUG 1 void sobseq(int *, float []); int main(int argc, char *argv[]) {   int n,i;   float x[100];   for(i=0;i<100;i++)     x[i]=0;   n=-1;   sobseq(&n,x);   //  for(i=0;i<100;i++)   //  printf("%f",x[i]);   n=4;   sobseq(&n,x);   for(i=0;i<100;i++)     printf("%f\n",x[i]);  n=5;   sobseq(&n,x);   for(i=0;i<100;i++)     printf("%f\n",x[i]);   return 0; } void sobseq(int *n,float x[]) {   int j,k,l;   unsigned long i,im,ipp;   static float fac;   static unsigned long in,ix[MAXDIM+1],*iu[MAXBIT+1];   static unsigned long mdeg[MAXDIM+1]={0,1,2,3,3,4,4};   static unsigned long ip[MAXDIM+1]={0,0,1,1,2,1,4};   stat...

Parallelized Sobol Quasi Random Number Generator using Pthreads

/* ******************************************************************** Quasi Random Number Generator - serial version Abishek Ramdas ******************************************************************** Inputs : 1. Number of patterns (limit 64000) can be varied by varying the LIM paramter 2. Number of dimensions Outputs: All patterns are stored in file QRNG_Patterns_sngl_thrd.txt the patterns are printed along the x axis and the dimensions are along y axis ******************************************************************** */ #include<stdio.h> #include<stdlib.h> #include<error.h> #include<errno.h> #include"nrutil.h" #define LIM 64000 //limitng the number of patterns generated to max of 64000 #define MAXBIT 30 #define MAXDIM 6 #define DEBUG_INIT 0 #define DEBUG_SEED 0 #define DEBUG_SOBOL 0 #define DEBUG_SOBOL_E 0 float random_numbers[MAXDIM][LIM];//dynamic declaration of 2D array is not possible int main(int argc, char ...

Transition Fault Testing using pattern shifting - The sequential Pseudocode

Program - Transition fault testing using pattern shifting Serial version of the program is described here in detail This is the program i had written for testing delay transition faults. I am trying to parallelize this program. DELAY TESTING OBJECTIVE slow to raise and slow to fall patterns are to be tested. to test a slow to rise fault- apply a sa1 pattern (for a modified netlist) followed by a sa0 pattern (for unmodified netlist) to test a slow to fall fault - apply a sa0 pattern (for a modified netlist) followed by a sa1 pattern (for unmodified netlist)                      pattern 1   pattern 2  Slow to rise    sa1         sa0        Slow to fall    sa0         sa1    pattern 1 - patterns for modified netlist pattern 2 - patterns for unmodified netlist Testing for faults A. fault pattern ge...

Parallelizing Transition fault testing algorithm

Hi, I am working towards parallelization of one of my own sequential program. The sequential program is used to generate test patterns for Delay testing. (Testing of the rise and fall delays in a circuit). It takes up a lot of time to run and is a massively parallel program. So parallelization is a good idea to achieve speed up. I gathered a few points on parallelization of the program from the book "Parallel programming for Multicore and cluster systems" by Thomas Rauber Gudula Runger, I present them here. Aim: To parallelize the transition fault testing program so that it runs on more than one processor Steps involved in parallelization 1. Decomposition of the computations : GOAL : of task decomposition is keeping all the processors busy at all times. a. Computations of the sequential algorithm are decomposed into tasks and dependencies between the tasks are determined.Tasks are the smallest units of parallelism. b. Task may involve accesses to shared address s...

Parallelization of SOBOL Quasi Random Number Generator

Sobol Quasi Random Number Generaotors Sobol Quasi Random Number Generaotors (sobol QRNG) are pseudo random number generators. There are often applications, for example in financial engineering, where random numbers are to be generated within an upper and lower limit. The main requirement of the random numbers to be generated in these applications are that the random numbers must fill the N space more uniformly than uncorrelated random points. The serial algorithm for Sobol QRNG can be found at " Implementation of Sobol Quasi Random Number generator “sobseq()” Chapter 7.7, Numerical Recepies in C, http://www.nrbook.com/a/bookcpdf.php " I have used pthreads to parallelize the algorithm. The main idea is "Divide and Conquer". If 64000 patterns are to be generated by 4 threads then each thread generates 64000/4 = 16000 random numbers. The catch is that each thread must be provided with an intial seed so that no two threads generate the same set of random numbe...

MultiCore - Introduction

Hi, I have started working on Multicore Programming. The subject is fascinating because all the super computers are multicored (obviously). Multicore is introducing a paradigm shift in computing. Earlier Clock frequencies were increased to achieve a higher speed. But a point has been reached where increasing the clock frequencies are bound to give diminishing returns because of increased leakage and heating. So to keep up with Moore's law speed up is achieved by parallelizing the program and running it on multiple cores (Amdahl's law). It is a point of consideration that most of the programs are serial by nature and the parallelize-able portion is very small when compared to the serial portion. so one might argue that there might not be significant speed up. But consider a massively parallel machine which runs the same program on different sets of data. It offers a definite advantage to run them simultaneously on different sets of data. That is what i believe multicore progr...