-malign-double

Jed Brown jed at 59A2.org
Tue Nov 17 13:08:51 CST 2009


I think this is complete.

http://petsc.cs.iit.edu/petsc/petsc-dev/rev/a36906938641

This was my first time messing with configure.  It works in all cases I
have tested, let me know if I screwed up.  The default alignment is now
16, configurable via --with-memalign.  Alignment of pointers compiles to
(gcc-4.4.2/x86-64 at all positive optimization levels)

  lea    r9,[r8+rbx*1+0xf]
  and    r9,0xfffffffffffffff0

so there should be no concern over runtime cost of alignment.  If the
user provides their own malloc (via PetscMallocSet) which does not
provide the desired alignment then the first array will not have that
alignment (obviously) but every other will.  It costs a few extra bytes
per allocation but this should only add up to a few kB in real
applications.

Jed

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20091117/7ffa0b93/attachment.sig>


More information about the petsc-dev mailing list