Changes between Version 7 and Version 8 of Session2


Ignore:
Timestamp:
Oct 12, 2015, 11:49:13 AM (10 years ago)
Author:
Greg Couch
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Session2

    v7 v8  
    2222
    2323== Protocols ==
     24
     25For discussion purposes, any method we choose for session files will need to follow the following protocols (the solution will have more details):
    2426
    2527=== Saving protocol: ===
     
    117119On the Python side, it is possible to provide an API that takes simple data and implements all of the individual save and restore steps.
    118120
     121=== Avoiding Two-phase Initialization ===
     122
     123If a directed graph of the data dependences has no cycles,
     124then it can be serialized in an order such that when it is deserialized,
     125all of the referenced data will exist before it is needed.
     126That requirement, we assert, holds for anything in the Chimera2 core.
     127And we can detect when it is violated,
     128and report to the user what the offending toolor tools are.
     129
     130==== Saving Protocol ====
     131
     1321. Discovery
     133  * All state is reachable from the session object
     134  * The initial set objects to save in the session are the session's registered state attributes
     135  * Objects to save are examined for referred to non-simple objects, and those objects are added to the set of savable objects, until all objects are examined
     136    * These are the objects that need to be named symbolically
     137    * Simple objects are ints, lists, dicts, etc.
     138  * While examining savable objects:
     139    * dependency graph is constructed
     140    * the set of needed tools is constructed
     141  * Detect "all" cycles, so user can take corrective action if there are cycles
     1422. Serializing
     143  * The list of needed tools and their session state versions
     144  * The data in sorted order
     145
     146==== Restoring Protocol ====
     147
     1481. Get list of needed tools
     149   * If installed tools are insufficient, allow user to install them
     150     * If not installed, don't restore data from those tools, might fail
     1512. Clear main session
     1523. Restore into main session while blocking triggers
     153
    119154=== Tool Classes ===
    120155