[petsc-dev] Cross-compiling/batch systems and getting rid of --know-sizeof-<type> (or at least making it not required at all)

Lisandro Dalcin dalcinl at gmail.com
Thu May 23 05:19:13 CDT 2019


On Wed, 22 May 2019 at 22:25, Smith, Barry F. <bsmith at mcs.anl.gov> wrote:

>
> > On May 22, 2019, at 11:27 AM, Jed Brown <jed at jedbrown.org> wrote:
> >
> > Byte swapping to/from big endian for integer types can be written in a
> > portable way that compiles to no-op (at least when optimization is on;
> > but see [1]), but I don't think that's possible for floating point data.
> > Of course we could just compile code for both options and select which
> > one to call at run-time.  Since they operate on arrays instead of
> > individual values, the dispatch should be negligible.
>
>     This is a great idea, we should do it. Presumably we just run the test
> to determine which format the system uses once, the first time we need to
> byte swap and then reuse the info?
>

Probably not the prettiest way of doing it, but it works right now for
PETSc code:
https://bitbucket.org/petsc/petsc/pull-requests/1698/runtime-endianness-detection/diff

-- 
Lisandro Dalcin
============
Research Scientist
Extreme Computing Research Center (ECRC)
King Abdullah University of Science and Technology (KAUST)
http://ecrc.kaust.edu.sa/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20190523/35532ef5/attachment.html>


More information about the petsc-dev mailing list