Skip to Content.
Sympa Menu

baslinux - Re: [BL] openMosix on BL2

baslinux AT lists.ibiblio.org

Subject: Baslinux mailing list

List archive

Chronological Thread  
  • From: "Krzysztof A. Suchecki" <christopher.suchecki AT wp.pl>
  • To: baslinux AT lists.ibiblio.org
  • Subject: Re: [BL] openMosix on BL2
  • Date: Fri, 1 Aug 2003 10:27:59 +0200

I include C source of very simple benchmark for your openMosix
clusters.

Summing numbers is so-called optimal parallel problem. In theory,
summing time T should fall down to T/n, where n is number of
processors. As we can't forget about network latency, etc.,
we will never reach T/n.

Imagine that you must sum numbers from 1 to 100, you have
10 processors and you don't want to use well-known formula
(n*(n+1))/2.

Non-parallelized version will be sth like this:

sum=0;
for (i=1; i<101; i++)
{
sum+=i;
}

In parallelized version (easy to write for Beowulf cluster
thanks to MPI), 1st processor will count sum for i from 1 to 10,
2nd - for i from 11 to 20, etc. At the end all subsums, supplied
by each processor, will be added to make the global sum.

There are 2 loops in C source. First, called beta, increases
sum variable by 1 and does it 200,000,000 times.

Second loop, alpha, invokes beta loop and does it 10 times.
You may want to increase alpha loop to 1,000 if you have
a modern PC, and spare time.

The prog is not parallelized. It lets you see how openMosix
kernel can cope with running simple non-parallelized prog
on a cluster.

Run it on your cluster with 1,2,3... nodes and see how large
time reduction you get by adding new nodes.

Don't forget to share your results with us.

I'm still "on the move".

Chris

==C SOURCE STARTS HERE=====

#include <stdio.h>


int main (void)
{
long alpha = 0L;
long beta = 0L ;
long sum = 0L;

/* Remove next comment block if you need some info displayed */
/* long gamma = 0L;

printf ("Start...\n\n"); */

for (alpha = 1; alpha < 11; alpha ++ )
{
sum = 0;

for (beta = 1; beta < 200000001; beta ++ )
{
sum ++;

/* Remove next comment block if you need some info displayed */
/* gamma = beta / 10000000;
gamma *= 10000000;
gamma = beta - gamma;

if (gamma == 0)
{
printf ("Alpha = %d, Beta = %d\n", alpha, beta);
} */
}

}
/* Remove next comment block if you need some info displayed */
/* printf ("...end\n\n"); */
}

==C SOURCE ENDS HERE=====





Archive powered by MHonArc 2.6.24.

Top of Page