FAQ  •  Login

Choose CPU?

Moderators: Dan Negrut, ME964 Spring 2012

<<

S12fwang

Newbie
Newbie

Posts: 46

Joined: Mon Jan 23, 2012 9:07 pm

Unread post Thu Apr 26, 2012 8:10 pm

Choose CPU?

I have no idea about apply for cores in CPU, and I am also confused by how to choose CPU between AMD and Intel.

BTW,when I try to use
  Code:
#pragma omp parallel for reduction(+:sum)
fro the slide, I faced up with some compile problem when I add -fopenmp flag (use g++ without -fopenmp flag, this problem didn't appear);
I change to
  Code:
#pragma omp  parallel reduction(+:sum)
,compile is good but result is wrong.
<<

S12dhinckley

Newbie
Newbie

Posts: 41

Joined: Mon Jan 23, 2012 9:07 pm

Unread post Fri Apr 27, 2012 10:43 am

Re: Choose CPU?

After you request a node, you can look at the /proc/cpuinfo file to determine how many cores are on that node.
  Code:
vi /proc/cpuinfo

Then you can set OMP_NUM_THREADS to use whatever number of threads you'd like.

With regards to your problem with the OMP reduction, I ran into a similar problem. The following works for me
  Code:
#pragma omp parallel
{
   #pragma omp for reduction(+:sum)
   for (    )
   {
        do_stuff();
        sum += ...
   }
}
<<

S12pyadav

Newbie
Newbie

Posts: 30

Joined: Mon Jan 23, 2012 9:07 pm

Unread post Fri Apr 27, 2012 4:01 pm

Re: Choose CPU?

The error seems to be creeping up with more number of processes. Is that a common problem?
<<

S12dhinckley

Newbie
Newbie

Posts: 41

Joined: Mon Jan 23, 2012 9:07 pm

Unread post Fri Apr 27, 2012 4:32 pm

Re: Choose CPU?

I experienced similar difficulties yesterday. I isolated my problem by writing a program with a simple for loop and then gradually adding features until I broke it. Good luck!
<<

S12fwang

Newbie
Newbie

Posts: 46

Joined: Mon Jan 23, 2012 9:07 pm

Unread post Fri Apr 27, 2012 9:04 pm

Re: Choose CPU?

It works for me!

Thank you so much!

Return to ME964 Spring 2012: High Performance Computing

Who is online

Users browsing this forum: No registered users and 1 guest

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software.