- changed version to Development Branch
-
assigned issue to
std::tie(global_ptr<T>, global_ptr<T>) = when_all(....).wait();
so this works in my upcxx/examples/prog-guide/non-contig-example.cpp
future<global_ptr<float>> dgpf = dmesh.fetch(nebrHi);
future<global_ptr<float>> sgpf = smesh.fetch(nebrLo);
when_all(dgpf, sgpf).wait();
global_ptr<float> d_gp=dgpf.result();
global_ptr<float> s_gp=sgpf.result();
but this fails with a compiler error
global_ptr<float> d_gp, s_gp;
std::tie(d_gp, s_gp) = when_all(dmesh.fetch(nebrHi), smesh.fetch(nebrLo)).wait();
with the compiler error with clang++ as
non-contig-example.cpp:73:24: error: no viable overloaded '='
std::tie(d_gp, s_gp) = when_all(dmesh.fetch(nebrHi), smesh.fetch(nebrLo)).wait();
~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/tuple:876:12: note:
candidate function not viable: no known conversion from
'decltype(this->result())' (aka '__type_pack_element<0UL,
upcxx::global_ptr<float>, upcxx::global_ptr<float> >') to 'const typename
conditional<_CanCopyAssign::value, tuple<global_ptr<float> &,
global_ptr<float> &>, __nat>::type' (aka 'const
std::__1::tuple<upcxx::global_ptr<float> &, upcxx::global_ptr<float> &>')
for 1st argument
tuple& operator=(typename conditional<_CanCopyAssign::value, tuple...
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/tuple:884:12: note:
candidate function not viable: no known conversion from
'decltype(this->result())' (aka '__type_pack_element<0UL,
upcxx::global_ptr<float>, upcxx::global_ptr<float> >') to 'typename
conditional<_CanMoveAssign::value, tuple<global_ptr<float> &,
global_ptr<float> &>, __nat>::type' (aka
'std::__1::tuple<upcxx::global_ptr<float> &, upcxx::global_ptr<float>
&>') for 1st argument
tuple& operator=(typename conditional<_CanMoveAssign::value, tuple...
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/tuple:894:26: note:
candidate template ignored: disabled by 'enable_if' [with _Tuple =
upcxx::global_ptr<float>]
__tuple_assignable<_Tuple, tuple>::value
^
1 error generated.
I don't know where tuple_assignable for global_ptr is determined and why it is different from how this works with using std::tie with futures.
Comments (4)
-
-
reporter I think this can be changed to a feature request. The code does do what the spec currently says. We probably want to upgrade the spec to wait return a tuple and not just the first element of the tuple.
-
- changed milestone to 2018.09.30 release
- marked as enhancement
- marked as minor
Current behavior is correct wrt the spec. Making this an enhancement for now even though I'm not describing how it should be enhanced. Spec will receive the "true" enhancement issue.
Spec issue is number 123: https://bitbucket.org/berkeleylab/upcxx-spec/issues/123/future-result-and-wait-should-return
-
- changed status to resolved
This was implemented in d05e90b
- Log in to comment
@jdbachan can you confirm this bug, and is this something we need to fix for this release?