Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround nvlink bug #118

Merged
merged 3 commits into from
Jan 26, 2021
Merged

Commits on Jan 26, 2021

  1. Configuration menu
    Copy the full SHA
    8f5367c View commit details
    Browse the repository at this point in the history
  2. Rearrange include order to work around nvlink bug

    On emmet and @pcanal's machine, we saw the following error (which didn't
    appear on the CI, which runs CUDA 11.1):
    ```
    nvlink error   : Size doesn't match for '_ZN9celeritas9SecondaryC1Ev$53' in 'CMakeFiles/celeritas.dir/physics/em/detail/EPlusGG.cu.o', first specified in 'CMakeFiles/celeritas.dir/physics/em/detail/BetheHeitler.cu.o'
    nvlink fatal   : merge_elf failed
    ```
    
    A bug report for LLVM hinted at a bug in `nvlink` regarding weak
    symbols: https://bugs.llvm.org/show_bug.cgi?id=40893 . Using the nvcc
    `-keep` flag led to finding the Secondary's constructor was defined as a
    weak symbol, and internally it stores two values (for the initialization
    values of def_id and energy), which are defined internally in
    BetheHeitler as
    ```
    .weak .global .align 4 .b8 _ZN9celeritas9SecondaryC1Ev$53[4] = {255, 255, 255, 255};
    .weak .global .align 8 .b8 _ZN9celeritas9SecondaryC1Ev$54[8];
    ```
    
    However, the constructor's private variables show up with a different
    suffix in the EPlusGG kernel:
    ```
    .weak .global .align 4 .b8 _ZN9celeritas9SecondaryC1Ev$52[4] = {255, 255, 255, 255};
    .weak .global .align 8 .b8 _ZN9celeritas9SecondaryC1Ev$53[8];
    ```
    so the suffixes are off by one and end up causing a collision.
    
    I'm not sure how the suffixes are created, but changing the include
    order changes their value, so rearranging the includes causes the
    collision to disappear.
    sethrj committed Jan 26, 2021
    Configuration menu
    Copy the full SHA
    f067c0e View commit details
    Browse the repository at this point in the history
  3. Fix emmet with-mpi build

    Work around a bug ini the FindMPI cmake script
    sethrj committed Jan 26, 2021
    Configuration menu
    Copy the full SHA
    a82a151 View commit details
    Browse the repository at this point in the history