Jyothish Soman wrote:
> I think that will be the parallel
> version of the code given in the link. Sorry, I dont have
> the resources right now to check the validity of the code,
> my laptop is fried, working from a common terminal.
> Just add -fopenmp flag in the make file for the code
Hamish:
thanks! small problem- `#pragma for` doesn't take shared() as an arg,
for that do you have to do something like:
#pragma omp parallel for
???
Jyothish:
Yes, shared is a default state, so that spawned an error.
Also, you are right, it is parallel for.
with
#pragma omp parallel for private(j,k,somma)
or just
#pragma omp parallel for
I get a segfault:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f11d6d96750 (LWP 4058)]
0x00007f11d6ab22ec in tcholDec.omp_fn.0 (.omp_data_i=0x7fffdeecf950) at TcholBand.c:37
37 somma -= T[i - k][k] * T[i - k][j + k];
(gdb) bt f
#0 0x00007f11d6ab22ec in tcholDec.omp_fn.0 (.omp_data_i=0x7fffdeecf950)
at TcholBand.c:37
No locals.
#1 0x00007f11d6ab2092 in tcholDec (N=0x7f11d6d47010, T=0x7f11c44f5010, n=40000, BW=401)
at TcholBand.c:49
i = -1
j = 0
k = 0
end = 0
somma = 6.9028182614708871e-310
also, is omp_set_num_threads(omp_get_num_procs()); really needed?
According to this article it sets default number of threads to number of
processors on system automatically:
http://software.intel.com/en-us/articles/threading-models-for-high-performance-computing-pthreads-or-openmp/
?
thanks,
Hamish