Using a multicore-processor

O

Obnoxious User

Hi,

I want to use to quadcore processor to calculate a matrix with a
C++-program. The elapsed time for calculating one entry is very variably
(approx. 1-30 min) and I'm not able to estimate the time before the
calculation.Therefore simply splitting the matrix in four blocks and
calculated each on one core will not use efficiently the processor.
Hence my question, is there is a (simple) way to modify a program, which
use now only one core in a way that it will be able to use all four
cores, so that the entries will be calculated one after another.

http://en.wikipedia.org/wiki/Parallel_programming
 
P

Peter Graf

Hi,

I want to use to quadcore processor to calculate a
matrix with a C++-program. The elapsed time for
calculating one entry is very variably (approx.
1-30 min) and I'm not able to estimate the time
before the calculation.Therefore simply splitting
the matrix in four blocks and calculated each on
one core will not use efficiently the processor.
Hence my question, is there is a (simple) way to
modify a program, which use now only one core in a
way that it will be able to use all four cores, so
that the entries will be calculated one after another.

Thanks in advance
Peter
 
P

Pascal J. Bourguignon

Peter Graf said:
Hi,

I want to use to quadcore processor to calculate a matrix with a
C++-program. The elapsed time for calculating one entry is very
variably (approx. 1-30 min) and I'm not able to estimate the time
before the calculation.Therefore simply splitting the matrix in four
blocks and calculated each on one core will not use efficiently the
processor.
Hence my question, is there is a (simple) way to modify a program,
which use now only one core in a way that it will be able to use all
four cores, so that the entries will be calculated one after another.

Instead of splitting it in 4, split it in 16 or 256, etc. Then you
will have more, smaller jobs to feed your cores with, and you will be
able to keep them all busy till the end. However, you will lost more
time scheduling these tasks, so you shouldn't split it in too many jobs.
 
I

Ian Collins

Peter said:
Hi,

I want to use to quadcore processor to calculate a matrix with a
C++-program. The elapsed time for calculating one entry is very variably
(approx. 1-30 min) and I'm not able to estimate the time before the
calculation.Therefore simply splitting the matrix in four blocks and
calculated each on one core will not use efficiently the processor.
Hence my question, is there is a (simple) way to modify a program, which
use now only one core in a way that it will be able to use all four
cores, so that the entries will be calculated one after another.
Check out OpenMP, most (if not all) decent compilers support it.

http://en.wikipedia.org/wiki/OpenMP
 
A

ankur saxena

Check out OpenMP, most (if not all) decent compilers support it.

http://en.wikipedia.org/wiki/OpenMP

hey hi,
I recently used MPICH 2 , its an API used to compile and run a C / C++
programm on Multiple processors, but each processor was on different
machine( this is parallel computing, but i guess ur problem stricly
needs parallel PROGRAMMING , i.e u just need to code in a way to
divide ur matrix ( more specifically the JOBS like "for loops" into
chunks and use system calls to direct each chunk of jobs to each
processor, hopefully the link by " OU ", would be of great help to
you) . And seach for it, there must be some library or API to DO above
for C++ or VC++ . and if you are done and manage to make this
programm( i am sure u will) , Please if you dont mind , mail me your
program, and if possible with some description, i want to see hows it
all works. please mail me at (e-mail address removed)

Thanx peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,835
Latest member
KetoRushACVBuy

Latest Threads

Top