I don't know much about how locks are done on BG/P, but I have a couple pretty-sure bits:<div>1) Pointers are 4 bytes and 4-byte-aligned; we don't need 8-byte for pointers.</div><div>2) Pointers used in LL/SC operations get best performance on their own cache line (32 bytes), but I believe I was told that no alignment was *required*. To me, that implies 4-byte-aligned is fine.</div>
<div><br></div><div>Sameer, do you know anything about this? You can see the file in question here:</div><div><a href="https://svn.mcs.anl.gov/repos/openpa/trunk/src/primitives/opa_gcc_ppc.h">https://svn.mcs.anl.gov/repos/openpa/trunk/src/primitives/opa_gcc_ppc.h</a></div>
<div><br></div><div><br></div><div>Thanks,</div><div>Joe Ratterman</div><div><a href="mailto:jratt@us.ibm.com">jratt@us.ibm.com</a></div><div><br></div><div><br><br><div class="gmail_quote">On Tue, Jun 9, 2009 at 3:23 PM, Darius Buntinas <span dir="ltr"><<a href="mailto:buntinas@mcs.anl.gov" target="_blank">buntinas@mcs.anl.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I see that there is a comment in opa_gcc_ppc.h that "these need to be<br>
aligned on an 8-byte boundary to work on a BG/P." Do you know if this<br>
is true?<br>
<br>
Dave, this looks like your comment. Can you comment?<br>
<br>
Should this be changed to "OPA_ATTRIBUTE((aligned (SIZEOF_VOID_P)))" to<br>
handle different pointer sizes (similarly for SIZEOF_INT for ints)?<br>
<br>
-d<br>
<div><div></div><div><br>
On 06/09/2009 03:04 PM, Joe Ratterman wrote:<br>
> This is the error I'm seeing:<br>
><br>
> Assertion failed in file mpid_nem_init.c at line 89:<br>
> sizeof(MPID_nem_cell_rel_ptr_t) == 4<br>
><br>
><br>
><br>
> This appears to be the important code from the pre-processed version<br>
> of mpid_nem_init.c<br>
><br>
><br>
> # 11<br>
> "/bglhome/usr1/jratt/src-sles10/mpich2/mpich2-1.1/src/openpa/src/primitives/opa_gcc_ppc.h"<br>
> typedef struct { volatile int v __attribute__ ((aligned (8))); }<br>
> OPA_int_t;<br>
> typedef struct { void * volatile v __attribute__ ((aligned (8))); }<br>
> OPA_ptr_t;<br>
><br>
> # 188 "../include/mpid_nem_datatypes.h"<br>
> typedef struct MPID_nem_cell_rel_ptr<br>
> {<br>
> OPA_ptr_t p;<br>
> }<br>
> MPID_nem_cell_rel_ptr_t;<br>
><br>
> # 135 mpid/ch3/include/mpidi_ch3_conf.h<br>
><br>
> #define SIZEOF_VOID_P 4<br>
><br>
> # 85 mpid_nem_init.c<br>
> /* The MPID_nem_cell_rel_ptr_t defined in mpid_nem_datatypes.h<br>
> * should only contain a pointer. Also, we don't support compilers<br>
> * which add random padding to the start of the structure. The<br>
> * below assert should blow up if any of these happens. */<br>
> MPIU_Assert(sizeof(MPID_nem_cell_rel_ptr_t) == SIZEOF_VOID_P);<br>
><br>
><br>
><br>
> Given the above code, the size of that type appears to be 8 in both GCC<br>
> and XLC. I see that the alignment is hard-coded to 8 in<br>
> src/openpa/src/primitives/opa_gcc_ppc.h. Changing that first line to an<br>
> alignment of 4, the type size shrinks to 4 (correspondingly, increasing<br>
> it to 16 increases the type size as well).<br>
><br>
> Changing the file to 4 and recompiling things allows a few simple tests<br>
> to work fine--I haven't tried too much more.<br>
><br>
><br>
><br>
> Thanks,<br>
> Joe Ratterman<br>
</div></div>> <a href="mailto:jratt@us.ibm.com" target="_blank">jratt@us.ibm.com</a> <mailto:<a href="mailto:jratt@us.ibm.com" target="_blank">jratt@us.ibm.com</a>><br>
><br>
><br>
> ------------------------------------------------------------------------<br>
><br>
> _______________________________________________<br>
> opa-core mailing list<br>
> <a href="mailto:opa-core@lists.mcs.anl.gov" target="_blank">opa-core@lists.mcs.anl.gov</a><br>
> <a href="https://lists.mcs.anl.gov/mailman/listinfo/opa-core" target="_blank">https://lists.mcs.anl.gov/mailman/listinfo/opa-core</a><br>
</blockquote></div><br>
</div>