I don&#39;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&#39;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">&lt;<a href="mailto:buntinas@mcs.anl.gov" target="_blank">buntinas@mcs.anl.gov</a>&gt;</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 &quot;these need to be<br>
aligned on an 8-byte boundary to work on a BG/P.&quot;  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 &quot;OPA_ATTRIBUTE((aligned (SIZEOF_VOID_P)))&quot; 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>
&gt; This is the error I&#39;m seeing:<br>
&gt;<br>
&gt;     Assertion failed in file mpid_nem_init.c at line 89:<br>
&gt;     sizeof(MPID_nem_cell_rel_ptr_t) == 4<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; This appears to be the important code from the pre-processed version<br>
&gt; of mpid_nem_init.c<br>
&gt;<br>
&gt;<br>
&gt;     # 11<br>
&gt;     &quot;/bglhome/usr1/jratt/src-sles10/mpich2/mpich2-1.1/src/openpa/src/primitives/opa_gcc_ppc.h&quot;<br>
&gt;     typedef struct { volatile int v __attribute__ ((aligned (8))); }<br>
&gt;     OPA_int_t;<br>
&gt;     typedef struct { void * volatile v __attribute__ ((aligned (8))); }<br>
&gt;     OPA_ptr_t;<br>
&gt;<br>
&gt;     # 188 &quot;../include/mpid_nem_datatypes.h&quot;<br>
&gt;     typedef struct MPID_nem_cell_rel_ptr<br>
&gt;     {<br>
&gt;         OPA_ptr_t p;<br>
&gt;     }<br>
&gt;     MPID_nem_cell_rel_ptr_t;<br>
&gt;<br>
&gt;     # 135 mpid/ch3/include/mpidi_ch3_conf.h<br>
&gt;<br>
&gt;     #define SIZEOF_VOID_P 4<br>
&gt;<br>
&gt;     # 85 mpid_nem_init.c<br>
&gt;         /* The MPID_nem_cell_rel_ptr_t defined in mpid_nem_datatypes.h<br>
&gt;          * should only contain a pointer. Also, we don&#39;t support compilers<br>
&gt;          * which add random padding to the start of the structure. The<br>
&gt;          * below assert should blow up if any of these happens. */<br>
&gt;         MPIU_Assert(sizeof(MPID_nem_cell_rel_ptr_t) == SIZEOF_VOID_P);<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Given the above code, the size of that type appears to be 8 in both GCC<br>
&gt; and XLC.  I see that the alignment is hard-coded to 8 in<br>
&gt; src/openpa/src/primitives/opa_gcc_ppc.h.  Changing that first line to an<br>
&gt; alignment of 4, the type size shrinks to 4 (correspondingly, increasing<br>
&gt; it to 16 increases the type size as well).<br>
&gt;<br>
&gt; Changing the file to 4 and recompiling things allows a few simple tests<br>
&gt; to work fine--I haven&#39;t tried too much more.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Thanks,<br>
&gt; Joe Ratterman<br>
</div></div>&gt; <a href="mailto:jratt@us.ibm.com" target="_blank">jratt@us.ibm.com</a> &lt;mailto:<a href="mailto:jratt@us.ibm.com" target="_blank">jratt@us.ibm.com</a>&gt;<br>
&gt;<br>
&gt;<br>
&gt; ------------------------------------------------------------------------<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; opa-core mailing list<br>
&gt; <a href="mailto:opa-core@lists.mcs.anl.gov" target="_blank">opa-core@lists.mcs.anl.gov</a><br>
&gt; <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>