Create new branch OpenUH from trunk.

git-svn-id: https://svn.open64.net/svnroot/open64/branches/OpenUH@1120 ead328b1-e903-0410-a19d-eacee4b031f6
fix duplicated content

git-svn-id: https://svn.open64.net/svnroot/open64/branches/OpenUH@1133 ead328b1-e903-0410-a19d-eacee4b031f6
install omp.h into /include/

git-svn-id: https://svn.open64.net/svnroot/open64/branches/OpenUH@1139 ead328b1-e903-0410-a19d-eacee4b031f6
Merged some bug fixes of the OpenMP runtime library from OpenUH
liao@gomez:~/OpenUH4.1/osprey/libopenmp> svn diff
Index: omp_thread.c
===================================================================
--- omp_thread.c        (revision 1139)
+++ omp_thread.c        (working copy)
@@ -370,7 +370,8 @@
 
   /* determine number of threads to create*/
   threads_to_create = num_threads == 0 ? __omp_nthreads_var : num_threads;
-
+ /*keep it as nthreads-var suggested in spec. Liao*/
+  __omp_nthreads_var = threads_to_create;
   /* setup pthread attributes */
   pthread_attr_init(&__omp_pthread_attr);
   pthread_attr_setscope(&__omp_pthread_attr, PTHREAD_SCOPE_SYSTEM);
@@ -638,6 +639,8 @@
     current_u_thread = __ompc_get_current_u_thread();
     original_v_thread = current_u_thread->task;
 
+    //inherit the thread number from the 1st level. Liao
+    if (num_threads ==0 ) num_threads = __omp_level_1_team_size;
     temp_team.team_size = num_threads;
     temp_team.is_nested = 1;
     temp_team.team_level = original_v_thread->team->team_level + 1;
@@ -721,6 +724,8 @@
     current_u_thread = __ompc_get_current_u_thread();
     original_v_thread = current_u_thread->task;
 
+    //bug 361, get_local_thread_num() return garbage value, Liao
+    temp_v_thread.vthread_id = 0; 
     temp_v_thread.team_size = 1;
     temp_v_thread.single_count = 0;
     temp_v_thread.loop_count = 0;
Index: omp_thread.h
===================================================================
--- omp_thread.h        (revision 1139)
+++ omp_thread.h        (working copy)
@@ -65,10 +65,33 @@
 
 inline int __ompc_get_max_threads(void)
 {
+  /*Could be called in 1. sequential part or 2. parallel region
+
+  1.  for sequential part invoking: 
+    return the value of OMP_NUM_THREADS or
+                   number of available processors
+    cannot use the internal var because the RTL may not yet been initialized!!
+  2. for a parallel region: return the initialized internal var.
+    By Liao. 8/30/2006 bug 157
+  */
+        char *env_var_str;
+        int  env_var_val;
+
   if (__omp_rtl_initialized == 1)
     return __omp_nthreads_var;
-  else
-    return Get_SMP_CPU_num();
+  else {
+       env_var_str = getenv("OMP_NUM_THREADS");
+       if (env_var_str != NULL)
+          {
+              sscanf(env_var_str, "%d", &env_var_val);
+            Is_Valid(env_var_val > 0, ("OMP_NUM_THREAD should > 0"));
+            if (env_var_val > __omp_max_num_threads)
+                env_var_val = __omp_max_num_threads;
+            return env_var_val;
+           } 
+       else
+          return Get_SMP_CPU_num();
+  }
 }
 
 inline int __ompc_get_num_procs(void)
@@ -134,6 +157,8 @@
     while (uthread_next != NULL) {
       if (uthread_next->uthread_id == uthread_id) {
        uthread_temp->hash_next = uthread_next->hash_next;
+        // release the lock before returning!! bug 359 Liao
+        pthread_mutex_unlock(&__omp_hash_table_lock);
        return;
       } else {
        uthread_temp = uthread_next;




git-svn-id: https://svn.open64.net/svnroot/open64/branches/OpenUH@1140 ead328b1-e903-0410-a19d-eacee4b031f6
enabled building & installing libopenmp.a under targia32_builtonia32
to support ia32 and -m32 of AMD64

changed #ifdef TARG_X8664 to #ifndef TARG_IA64 in omp_sys.h
 to avoid ia32 to use Itanium instrutions

fixed installation path for whirl2c/f_be





git-svn-id: https://svn.open64.net/svnroot/open64/branches/OpenUH@1143 ead328b1-e903-0410-a19d-eacee4b031f6
change opencc/CC/f90 to uhcc/CC/f90 to be compatible with previous OpenUH versions

git-svn-id: https://svn.open64.net/svnroot/open64/branches/OpenUH@1164 ead328b1-e903-0410-a19d-eacee4b031f6
Commit test.


git-svn-id: https://svn.open64.net/svnroot/open64/branches/OpenUH@1168 ead328b1-e903-0410-a19d-eacee4b031f6
First integration of instrumentation/tools for OpenUH branch


git-svn-id: https://svn.open64.net/svnroot/open64/branches/OpenUH@1170 ead328b1-e903-0410-a19d-eacee4b031f6
single data structure test.


git-svn-id: https://svn.open64.net/svnroot/open64/branches/OpenUH@1173 ead328b1-e903-0410-a19d-eacee4b031f6
Single Data Structure for regions.


git-svn-id: https://svn.open64.net/svnroot/open64/branches/OpenUH@1177 ead328b1-e903-0410-a19d-eacee4b031f6
Corrected the issue of the -epilog flag.


git-svn-id: https://svn.open64.net/svnroot/open64/branches/OpenUH@1178 ead328b1-e903-0410-a19d-eacee4b031f6
First patch for the compiler instrumentation


git-svn-id: https://svn.open64.net/svnroot/open64/branches/OpenUH@1183 ead328b1-e903-0410-a19d-eacee4b031f6
Changes to test new TAU interface and deal with scalability issues.


git-svn-id: https://svn.open64.net/svnroot/open64/branches/OpenUH@1191 ead328b1-e903-0410-a19d-eacee4b031f6
use the previous gcc frontend for OpenMP

git-svn-id: https://svn.open64.net/svnroot/open64/branches/OpenUH@1195 ead328b1-e903-0410-a19d-eacee4b031f6
Merge from LNO 3.1 (UH version)



git-svn-id: https://svn.open64.net/svnroot/open64/branches/OpenUH@1215 ead328b1-e903-0410-a19d-eacee4b031f6
merge to Open64 4.x for FOMPI



git-svn-id: https://svn.open64.net/svnroot/open64/branches/OpenUH@1216 ead328b1-e903-0410-a19d-eacee4b031f6
add flags for autoscope and apocost



git-svn-id: https://svn.open64.net/svnroot/open64/branches/OpenUH@1217 ead328b1-e903-0410-a19d-eacee4b031f6
add flag for autoscope and apocost



git-svn-id: https://svn.open64.net/svnroot/open64/branches/OpenUH@1218 ead328b1-e903-0410-a19d-eacee4b031f6
add flags for autoscope and apocost



git-svn-id: https://svn.open64.net/svnroot/open64/branches/OpenUH@1221 ead328b1-e903-0410-a19d-eacee4b031f6
Bugs fix:
- turn on scalar reduction when -apocost flag is set on
- do not write XML file if not needed.



git-svn-id: https://svn.open64.net/svnroot/open64/branches/OpenUH@1226 ead328b1-e903-0410-a19d-eacee4b031f6