From: Eric Frederich (eric.frederich_at_gmail_dot_com)
Date: Wed Dec 07 2005 - 14:50:26 PST
sorry, I attached the wrong file. I have the input file attached now. I was going to attach one for a 500 by 500 matrix, but the problem still exists when using a 5 by 5 matrix, so I attached a smaller file. ~Eric On 12/7/05, Eric Frederich <eric.frederich_at_gmail_dot_com> wrote: > > Hello, > I'd like to share something that has been troubling me. > > Attached I have two files. One is the program, the other is the input to > the program. > > I compiled the program with > > ./upcc -pthreads -o matrixSolver -T=2 matrixSolver.upc > > and run the program like > > ./upcrun -n 2 -c 2 -p 2 matrixSolver matrix.500.in > > As the program is attached it freezes on me at the following point in the > code. > if (ABS(a[j][i]) > ABS(a[maxrow][i])) > > I take the two operands of this inequality and store them in local > variables tmpa and tmpb. > If you use these variables for the inequality (like if(tmpa > tmpb) ) the > program runs fine and solves the matrix. > > This confuses me greatly since the macro ABS still works since I am using > it when storing the variables in tmpa and tmpb. > > the ABS macro is defined as follows... > > #define ABS(x) (x < 0 ? -(x) : (x)) > > Any ideas anyone? > > Also, I hope that I am accomplishing what I wanted to do. I want to > distribute the rows of the matrix in a round robin fashion. > I haven't got to dynamic memory allocation with UPC yet so I defined the > array as follows. > > shared[1001] double a[1000][1001]; > > By doing this is affinity of a[0][0] through a[0][1001] going to the first > thread, > and the affinity of a[1][0] through a[1][1001] going to the next thread, > and the affinity of a[2][0] through a[2][1001] to the next, and so on? > > This is a square matrix with an extra column to store the one dimensional > vector. > > > > Thanks ahead of time, > ------------------------ > Eric L. Frederich > > -- ------------------------ Eric L. Frederich