Clearly, both of the above captures should work the same way as the create_work analog, since:
They can't execute at the same time (at least until the first one releases permissions on my_ahc)
Their execution must obey lexical order just like ordinary tasks.
This similarity means that the same logic can be used for handling Tasks and TaskCollections for the MN -> { MM } -> MN case.
However, inside of the TaskCollection, it's less clear what the permissions on the UseCollection should be. The MM immediate permissions are represented by local Use objects at the time the TaskCollection starts, so holding a CollectionManagingUse with MM permissions is redundant. It also leads to awkwardness with respect to capture:
struct MyFunctor {
void operator()(Index1D<int> idx, AccessHandleCollection<int, Range1D<int>> ahc) const {
// <-- suppose the `CollectionManagingUse` has `MM` permissions here
create_work([=]{ ahc[idx].local_access().set_value(42); }
// <-- even if the above create_work only implicitly captures RN permissions on the
// CollectionManagingUse (so that read_access() to published info can be created),
// the permissions here *release* that Use and create a new CollectionManagingUse
}
};
Perhaps a better solution is to say that the CollectionManagingUse has Commutative RN permissions (and implicitly captures Commutative RN permissions) since what is being expressed is the ability to call read_access() on some non-local index.
Thoughts? Note that TestCreateConcurrentWork.nested_reverse depends on this decision, and won't work until we decide what to do.
Some pieces of the VASP semantics for collections are obvious. For instance,
Clearly, both of the above captures should work the same way as the
create_work
analog, since:my_ahc
)Task
s andTaskCollection
s for theMN -> { MM } -> MN
case.However, inside of the
TaskCollection
, it's less clear what the permissions on theUseCollection
should be. TheMM
immediate permissions are represented by localUse
objects at the time theTaskCollection
starts, so holding aCollectionManagingUse
withMM
permissions is redundant. It also leads to awkwardness with respect to capture:Perhaps a better solution is to say that the
CollectionManagingUse
has CommutativeRN
permissions (and implicitly captures CommutativeRN
permissions) since what is being expressed is the ability to callread_access()
on some non-local index.Thoughts? Note that
TestCreateConcurrentWork.nested_reverse
depends on this decision, and won't work until we decide what to do.