When there is a need to load the same probability profile into multiple nodes, an assembler program can be loaded into one node, and then the probability profile can be copied to other nodes. In QSMM, the process of copying a probability profile from one node to the other node is called “cloning the probability profile”. Cloning a probability profile from a node to other nodes is faster than loading the same assembler program into them.
To clone a probability profile, use the function described below.
This function copies a probability profile from one node of a multinode model specified by handle model to the other node.
Argument node_from specifies a source node identifier.
Argument node_to specifies a destination node identifier.
The function clears event history statistics that might have been collected for the destination node.
If the destination node already has a probability profile loaded, then that profile along with additional information this function may copy (see a description of argument flags below) will be first unloaded.
To clear the event history statistics and unload the profile, this function implicitly calls the function
qsmm_node_unload described in Unloading the Probability Profile.
Probability profiles manually written to storage without prior calling the function
qsmm_node_asm cannot be copied by the function
Argument flags is a bitmask, which specifies types of additional information that should be copied from node node_from to node node_to along with the probability profile. Bits of the bitmask, which are taken into account, are represented by the following macros that can be merged by bitwise “or.”
Copy definitions of controlled and output probability variables and arrays, so values of controlled probability variables of node node_to can be set, and values of output probability variables and arrays of that node can be retrieved, as they can be set and retrieved for node node_from.
Before copying the definitions of controlled probability variables, the function
qsmm_node_var_realize is implicitly called for node node_from if that node has uncommitted assignments to those variables.
Copy names assigned to node states by arguments of
You will be able to retrieve that information for node node_to by the functions
qsmm_get_node_state_by_name and use that information when disassembling node node_to and dumping the state transition matrix and the action emission matrix of node node_to.
If node node_from has an assembler program template associated with it, then copy that template. The template will be used when disassembling node node_to.
The function returns a non-negative value on success or a negative error code on failure. Currently, the following error codes can be returned.
The value of node_from is equal to the value of node_to.
A node with identifier node_from or node_to does not exist.
A node with identifier node_to has the number of states less than it is required to hold the probability profile of a node with identifier node_from.
Instruction class sets that represent node classes, to which nodes node_from and node_to belong, are not the same.
A probability profile is not loaded into a node with identifier node_from.
A node with identifier node_from is a user of a source probability profile provided by another node.
One of the following conditions is met:
qsmm_node_var_realizewas implicitly called, and it turned out that a node with identifier node_from is a source of probability profile for other nodes.
qsmm_node_var_realize was implicitly called for node node_from, and it turned out that the sum of probabilities of
case instructions in a
choice instruction block or the sum of elements of a probabilities list used by a
casels instruction will exceed 1 if assignments to controlled probability variables are committed.
This could leave the model instance in indeterminate state.
If the model instance is in indeterminate state, then after removing a reason of the error, the operation can be repeated, and if the function succeeds, then the model instance state will become determinate.
The model instance does not exist.
The multinode model has positive length of the look-ahead signal segment.
Statistics storage failure. This could leave the model instance in indeterminate state. If the model instance is in indeterminate state, then after removing a reason of the error, the operation can be repeated, and if the function succeeds, then the model instance state will become determinate.
There was not enough memory to perform the operation. This could leave the model instance in indeterminate state. If the model instance is in indeterminate state, then after removing a reason of the error, the operation can be repeated, and if the function succeeds, then the model instance state will become determinate.