Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Using a multicore-processor

Reply
Thread Tools

Using a multicore-processor

 
 
Obnoxious User
Guest
Posts: n/a
 
      08-29-2008
On Fri, 29 Aug 2008 11:07:36 +0200, Peter Graf wrote:

> 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
 
Reply With Quote
 
 
 
 
Peter Graf
Guest
Posts: n/a
 
      08-29-2008
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

 
Reply With Quote
 
 
 
 
Pascal J. Bourguignon
Guest
Posts: n/a
 
      08-29-2008
Peter Graf <Graf@_nospam_gmx.de> writes:

> 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__
 
Reply With Quote
 
Ian Collins
Guest
Posts: n/a
 
      08-29-2008
Peter Graf wrote:
> 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.
 
Reply With Quote
 
ankur saxena
Guest
Posts: n/a
 
      08-29-2008
On Aug 29, 2:57*pm, Ian Collins <(E-Mail Removed)> wrote:
> Peter Graf wrote:
> > 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.


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 http://www.velocityreviews.com/forums/(E-Mail Removed)

Thanx peter
 
Reply With Quote
 
Juha Nieminen
Guest
Posts: n/a
 
      08-29-2008
Ian Collins wrote:
> 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/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using a Link Button to redirect to another page by using data from =?Utf-8?B?R1REcml2ZXI=?= ASP .Net 1 02-16-2005 07:04 PM
Error page using the Application_Error void dosnt work when using DIV for a please wait message s_erez@hotmail.com ASP .Net 2 12-24-2004 12:11 PM
no code in webform using vs.net, but in webform using notepad timmso ASP .Net 1 12-12-2003 04:30 PM
Using GetOleDbSchemaTable to get SQL Server Field Description - using pete ASP .Net 1 08-29-2003 10:50 AM
Re: MVP? Index error on nested element using System.xml but NOT using msxml??? William F. Robertson, Jr. ASP .Net 1 06-25-2003 08:08 PM



Advertisments