Block Matrix

General OpenMP discussion

Block Matrix

Postby openmp_newbie » Thu Feb 21, 2008 2:55 pm

Unfortunately my results are incorrect.
Can anyone explain what I am doing wrong?
N is the size of the Blocks.

Thanks!
Last edited by openmp_newbie on Fri Feb 22, 2008 4:57 pm, edited 2 times in total.
openmp_newbie
 
Posts: 3
Joined: Thu Feb 21, 2008 2:35 pm

Re: Block Matrix

Postby ejd » Thu Feb 21, 2008 3:32 pm

I don't really have time to look at it much right now, but for starters the loop indices (il, jl. and kl) should be private and not shared.
ejd
 
Posts: 1025
Joined: Wed Jan 16, 2008 7:21 am

Re: Block Matrix

Postby openmp_newbie » Thu Feb 21, 2008 3:35 pm

Yea,
I had it private at first, still does me no good, will change it back.
openmp_newbie
 
Posts: 3
Joined: Thu Feb 21, 2008 2:35 pm

Re: Block Matrix

Postby ejd » Thu Feb 21, 2008 4:47 pm

Are you sure that your block algorithm is correct? I just took a quick look at the literature and it doesn't look like it is.
ejd
 
Posts: 1025
Joined: Wed Jan 16, 2008 7:21 am

Re: Block Matrix

Postby openmp_newbie » Thu Feb 21, 2008 5:42 pm

Well, my serial block matrix works ,I tested it against a regular matrix function for large array sizes, and small ones, answers were the same.
I cant claim it is more correct than that because I am no expert.
My problem is when Im creating the variable temp and passing it back to matrix3 I believe..
Thank You!
openmp_newbie
 
Posts: 3
Joined: Thu Feb 21, 2008 2:35 pm

Re: Block Matrix

Postby ejd » Fri Feb 22, 2008 2:21 pm

The nice thing about OpenMP is that most programs can still be run serially and you should get the correct result. It you do this with the OpenMP code that you posted, you don't get the correct result. That means that it is not the OpenMP part that is causing the problem. You are correct in your comment about it being your use of the variable "temp", because if you just add the OpenMP pragma to your serial code and run it in parallel, it works fine. I understand why you want to use temp to do the assignments, since it will be private to the thread and reduce possible cache conflicts. If you look at the loops closely you should see your problem.

The OpenMP ARB has made it a policy not to do homework for students and while I am not positive that you are a student, this is a common program assignment for intro parallel programming courses.
ejd
 
Posts: 1025
Joined: Wed Jan 16, 2008 7:21 am


Return to Using OpenMP

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 7 guests