[MOAB-dev] OpenMP

Tim Tautges (ANL) tautges at mcs.anl.gov
Tue Mar 4 14:33:43 CST 2014


At this time, MOAB itself is not thread safe per se, so doing that loop with OpenMP is probably dangerous; the problem 
has to do with "bread crumbs" the MOAB instance leaves behind to speed up finding the sequence containing a given 
handle.  But:

- there's a very good chance we'll be looking into thread safety over the next few months, as we have other customers 
asking for the same thing (and, there aren't that many places where such break crumbs are left around), and,
- if you're just wanting to set/get tags, and you don't mind managing the parallelism inherent in the threads, you could 
probably do an equivalent thing by using direct access to tag storage; for this, see the examples in 
<MOAB_DIR>/examples/DirectAccess* (there are 3, one for the case where the database/handle space has holes in it in C++, 
and another for the case of no holes, in Fortran and C++); figuring out whether your handle space has holes in it is 
much easier in C++ than in Fortran (MOAB's Range class has a psize() function that gives the number of chunks in a 
range); in DirectAccessNoHolesF90.F90, there's a line CHECK(count-nverts) that checks that the value is zero, which in 
that case it should be if there are no holes in the handle space of the given iterator.

- tim

On 03/04/2014 01:09 PM, kanaev at ibrae.ac.ru wrote:
> Hello MOAB-dev!
>
> Is there a way to use OpenMP over Range iterator loops ?
>
> e.g. here:  for (moab::Range::iterator it = ents.begin(); it != ents.end(); it++) {sum_ +=2*sum_; mb->tag_set_data(sum,
> &ent, 1, &sum_); }
>
> Thanks
>
> Anton
>

-- 
================================================================
"You will keep in perfect peace him whose mind is
   steadfast, because he trusts in you."               Isaiah 26:3

              Tim Tautges            Argonne National Laboratory
          (tautges at mcs.anl.gov)      (telecommuting from UW-Madison)
  phone (gvoice): (608) 354-1459      1500 Engineering Dr.
             fax: (608) 263-4499      Madison, WI 53706



More information about the moab-dev mailing list