Connecting Tech Pros Worldwide Forums | Help | Site Map

Using a multicore-processor

Peter Graf
Guest
 
Posts: n/a
#1: Aug 29 '08
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


Obnoxious User
Guest
 
Posts: n/a
#2: Aug 29 '08

re: Using a multicore-processor


On Fri, 29 Aug 2008 11:07:36 +0200, Peter Graf wrote:
Quote:
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

--
OU
Pascal J. Bourguignon
Guest
 
Posts: n/a
#3: Aug 29 '08

re: Using a multicore-processor


Peter Graf <Graf@_nospam_gmx.dewrites:
Quote:
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.

--
__Pascal Bourguignon__
Ian Collins
Guest
 
Posts: n/a
#4: Aug 29 '08

re: Using a multicore-processor


Peter Graf wrote:
Quote:
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

--
Ian Collins.
ankur saxena
Guest
 
Posts: n/a
#5: Aug 29 '08

re: Using a multicore-processor


On Aug 29, 2:57*pm, Ian Collins <ian-n...@hotmail.comwrote:
Quote:
Peter Graf wrote:
Quote:
Hi,
>
Quote:
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
>
--
Ian Collins.
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 flyankur@gmail.com

Thanx peter
Juha Nieminen
Guest
 
Posts: n/a
#6: Aug 29 '08

re: Using a multicore-processor


Ian Collins wrote:
Quote:
Check out OpenMP, most (if not all) decent compilers support it.
>
http://en.wikipedia.org/wiki/OpenMP
Here's a good tutorial:

http://bisqwit.iki.fi/story/howto/openmp/
Peter Graf
Guest
 
Posts: n/a
#7: Aug 31 '08

re: Using a multicore-processor


Hi,

thanks a lot for this really good tutorial. If I run a test program on
the system on which a compile it, every things works fine and the
program used all cores. By trying to run the program on a cluster, I
received the message

error while loading shared libraries: libgomp.so.1: cannot open shared
object file: No such file or directory

I think the library should be installed on the cluster, so can any one
help by linking the library correctly.

Thanks
Peter
Closed Thread