a strange problem when openmp with glib ghash



Hi,

I do a parallel open mp for which used shared data of g_hash_table.  Program do fine with the first parallel for loop but the third parallel for loop program will stop there and never be entered.
g_thread_init(NULL);
..............
#pragma omp parallel for private(i) shared(pdt_a)
        for(i=0;i<psize;i++)
         {
               .............
                pdt_a[i].gh   = g_hash_table_new(g_str_hash, compare_strings);
               ............
         }
#pragma omp parallel for private(i) shared(pdt_a,pit_a,lines,psize,nbuckets)
        for(i=0;i<psize;i++)
        {
               for....
                   lookup = g_hash_table_lookup(gh, input);
              .....................
                    g_hash_table_insert(gh, data, p_data);
              .....................
                      g_hash_table_replace(gh,strdup(input),p_data);
        }

#pragma omp parallel for private(i)   // this parallel for will not be entered. Program will stop here and halt.
        for(i=0;i<psize;i++)
--
Qingpeng Niu
Department of Computer Science and Engineering at OSU


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]