Click here to Skip to main content
15,886,806 members
Articles / Programming Languages / C#

Multicore Speedup Analysis using Jacobi Relaxation Running on Multiple Threads

Rate me:
Please Sign up or sign in to vote.
3.18/5 (8 votes)
10 Jul 2007CPOL3 min read 38.9K   220   16  
Analyse the speedup achieved by multicore processors by running a computation intensive task, using multithreading to create 1 separate thread per processor.
using System;
using System.Collections.Generic;
using System.Text;

namespace Jacobi_RedBlack
{
    public class Constants
    {
        public static double SmootingFactor = 10;
        //Maximum number of itterations for Jacobi. Note that we are not checking for convergence...
        public static double MaxLoops = 1000000; 

        public enum STATUS
        {
            INITIAL_STATE,
            STARTED_PROCESSING,
            STOPPED_PROCESSING
        };

        public static int numberOfSegments = 4;

        //Following constants used by GridCell.cs
        public static int gridCellsPerRow = 5;
        public static int gridCellsPerCol = 5;
        public static int gridCellOffsetAdd = 19;
        public static int gridCellOffsetMul = 27;

        public static int numberOfLoopsToCount = 50000;

    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
Sri Lanka Sri Lanka
coding in C# C++ C

==============================================

Code in English, not Gibberish Smile | :)

Comments and Discussions