In the current bitmap implementation every time we set or check a bit
we have to compute the index of the char where this bit is set and the
relative position from the beginning of char. This requires two _VERY_
expensive operations: a division and a modulo. Compared with the cost
of these
On Feb 3, 2009, at 3:24 PM, George Bosilca wrote:
In the current bitmap implementation every time we set or check a
bit we have to compute the index of the char where this bit is set
and the relative position from the beginning of char. This requires
two _VERY_ expensive operations: a divis
George,
May I miss something, but the division is a division by 8 or 16 or so
one... So it's not really costly since it's just a right bit shifft.
Same thing for the modulo (with a sub operation which not costly too):
#define SIZE_OF_CHAR ((int) (sizeof(char) * 8))
index = bit / SIZE_OF_CHAR;
off
Let's keep something in mind. Tim W and I hammered at this topic for a
long, long time. The fact is that there is nothing in the usage of
opal_bitmap that would in any way be hampered by the limit imposed in
ompi_bitmap. We just don't use ompi_bitmap in orte because it is in
the OMPI layer.
These places are easy to find and track. I did it on the ORTE layer,
and in this context the bitmap is _NOT_ required to grow as all
bitmaps are initialize with the number of processes in the jobid. In
the OMPI layer there are few places using the bitmap:
- the hierarch collective. There th
I hardly trust the compilers to do what I hope they're doing. However
in this particular case, it turn out that at least gcc 4.0.1 is doing
the right thing, and it convert the division and module to shift
operations.
george.
PS: But I still don't trust them :)
On Feb 3, 2009, at 15:50 ,
Hi guys,
we're talking about a data structure that is used in the attribute-code, and
the BTLs for reachability-information called when we add_procs.
Let's not worry about a shift vs. division optimization compared to two if-
statements, when it does not really matter (yet).
There's other struct
Ah; I thought this data structure was used for the fortran MPI object
handles as well, but looking at the code now, I see that
opal_pointer_array's are used for that. The only Fortran place it is
used is for attributes.
I see ompi_bitmap_t used for attributes, BTL reachability
computatio