Pushing a persona in progress

Issue #64 resolved
Dan Bonachea created an issue

The following program pushes a new persona within the dynamic scope of a progress call:

#include <upcxx/upcxx.hpp>

int main() {
  upcxx::init();

  upcxx::rpc(0,[](){
    upcxx::persona p;
    upcxx::persona_scope s(p);
  }).wait();

  upcxx::finalize();
  return 0;
}

At runtime in ef95a45 this results in a runtime crash:

UPC++ assertion failure on rank 0 [/home/pcp1/bonachea/UPC/inst-upcxx/upcxx.debug.gasnetex_par.smp/include/upcxx/persona.hpp:189]: Cannot change active persona stack while in progress.

This is not currently prohibited by the specification. I don't see a particular semantic problem with this (and even some hypothetical cases where it may be useful).

We need to either fix the implementation to support this, or change the spec to prohibit it.

Comments (9)

  1. Dan Bonachea reporter

    This issue was discussed in the 1/10/18 meeting, and John agreed to investigate for the March release.

    The tentative plan put forth is for the persona stack to remain unchanged when entering progress (so the callback runs with all the "credentials" of the call to progress), but have the runtime push an entry corresponding to the callback being run before invoking it (and pop it after return). This ensures the "active" persona for that callback is always at the top of the stack, and as a side effect ensures that callbacks attempting to modify the pre-progress stack (eg doing anything other than balanced push and pop operations) get UB.

  2. Log in to comment