Compilation warning involving rput on MacOS

Issue #146 resolved
Scott Baden created an issue

The code is in the scott repo scott/rb1d/upcxx

You want to build OrderlyOutput

See the attached log for details.

This problem doesn't occur on Cori (where I used the nightly build)

Comments (8)

  1. Paul Hargrove

    Does this occur with clang on Kotten?
    module load upcxx/nightly/clang-5.0.0 .
    I suspect that this is specific to the compiler, not to MacOS.

  2. Dan Bonachea

    The code that triggered the warning:

     rput(cstr,sbuff+myrank*maxLen,len,operation_cx::as_future()).wait();
    

    This appears to be valid input, but the completion argument is also redundant in this case because that is the default completion. It's possible that deleting the redundant completion argument may silence the warning.

    It may also explain wy we've never seen this in other codes because they usually don't explicit specify the default completion.

    However, this warning looks to me like it's pointing to a real bug in the assertion code in rput.hpp (copied in two places):

    332     UPCXX_ASSERT_ALWAYS((
    333       detail::completions_has_event<Cxs, operation_cx_event>::value |
    334       detail::completions_has_event<Cxs, remote_cx_event>::value,
    335       "Not requesting either operation or remote completion is surely an "
    336       "error. You'll have know way of ever knowing when the target memory is "
    337       "safe to read or write again."
    338     ));
    

    The bug is there should not be two sets of parentheses in the call to UPCXX_ASSERT_ALWAYS - this bug causes the compiler to discard the expression it is meant to check (which is why the compiler throws an unused-value warning), and more importantly disables the check the assertion is meant to enforce!

  3. john bachan

    Confirmed. rget.hpp and vis.hpp have similar asserts but do not have this bug, their double parens are correctly nested only around the (comma containing) condition argument.

  4. Scott Baden reporter

    Actually, I added the completion object hoping that it would remove the problem. I just tested again without the completion object and the error remains (I tested on the mac)

  5. Log in to comment