Sun Studio Express 11.08 Known Problems and Workarounds

compared with
Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (2)

View page history

----
h2. OpenMP
The following issues have been reported with the OpenMP implementation in the compilers.
 

* C++ only: Compilation of a C++ program with {{-xopenmp}} may fail if the program contains a {{goto}} that jumps around a parallel region (CR 6708263).\\
Here is an example program that will fail compilation:
{code}
#include <omp.h>
#include <stdio.h>

int main ()
{
int i;
int x = 0;

if (omp_get_nested() != 0) {
goto END;
}

#pragma omp parallel
{
#pragma omp critical
x += 1;
}

END:
printf("x: %i\n", x);
return 0;
}
{code}


* C, C++, and Fortran: Static with chunksize loop schedule does not work with unsigned loop index (CR 6728643).
\\
Here is an example program. The program will loop forever at runtime.
{code}
#include <stdio.h>
#include <omp.h>

int main(void)
{
unsigned int k;

omp_set_dynamic(0);
omp_set_num_threads(2);

#pragma omp parallel for schedule(static, 2)
for (k = 1; k <= 30; k++)
{
printf ("k = %d, id = %d\n", k, omp_get_thread_num());
}

return 0;
}
{code}


* Fortran only: Loop nest in a subroutine with collapse clause and with variable loop step (step passed as argument to subroutine) gives incorrect result (CR 6714724).
\\
Here is an example program. The program will print a wrong value for {{i}}
{code}
subroutine sub (l1, u1, s1, l2, u2, s2)
implicit none
integer :: l1, u1, s1, l2, u2, s2
integer :: i, j, m

!$omp parallel do collapse (2) lastprivate (i, j, m)
do i = l1, u1, s1
do j = l2, u2, s2
m = i * 100 + j * 10
end do
end do

print *, "i =", i, " j =", j, " m =", m
end subroutine sub


program test
integer, parameter :: LB1 = 2, UB1 = 6, ST1 = 1
integer, parameter :: LB2 = -2, UB2 = 3, ST2 = 1

call sub (LB1, UB1, ST1, LB2, UB2, ST2)
end program
{code}

* C, C++, and Fortran: {{omp_init_nest_lock()}} fails when program is compiled with {{-xopenmp=noopt}} and {{-m64}} (CR 6723134).
\\
Here is an example program. The program will dump core at runtime.
{code}
#include <omp.h>
#include <stdio.h>

int main ()
{
omp_nest_lock_t lck;
int t;
int errors = 0;

omp_init_nest_lock (&lck);
return 0;
}
{code}

----
{column}
{column:width=30%}

The individuals who post here are part of the extended Sun Microsystems community and they might not be employed or in any way formally affiliated with Sun Microsystems. The opinions expressed here are their own, are not necessarily reviewed in advance by anyone but the individual authors, and neither Sun nor any other party necessarily agrees with them.

Copyright 1994-2009 Sun Microsystems, Inc.
Powered by Atlassian Confluence
Sun Guidelines on Public Discourse Privacy Policy Terms of Use Trademarks Site Map Employment Investor Relations Contact