To load the same probability profile into multiple nodes of a multinode model, you can load an assembler program into one node and copy its probability profile to other nodes—clone a probability profile. Cloning a probability profile from a node to other nodes is faster than loading the same assembler program into them.
Use the function described below to clone a probability profile.
This function copies a probability profile from a node of a multinode model to another node of this model.
The argument node_from specifies the identifier of a source node.
The argument node_to specifies the identifier of a destination node.
The function clears event history statistics collected for the destination node.
If the destination node already has a probability profile loaded, the function first unloads the profile from this node along with additional information the function can copy (see the description of flags argument below).
To clear the event history statistics and unload the profile, this function calls the function
qsmm_node_unload described in Unloading the Probability Profile.
qsmm_node_profile_clone cannot copy probability profiles manually written to storage without prior calling the function
The argument flags is a bitmask specifying the types of information to copy from the source node to the destination node along with the probability profile. The following macros specify the bits of this bitmask taken into account.
Copy the definitions of controlled and output probability variables and arrays.
This copying makes it possible to modify the controlled probability variables of the destination node and to retrieve the output probability variables and arrays of that node, as you can modify and retrieve them for the source node.
Before copying the definitions of controlled probability variables, this function calls the function
qsmm_node_var_realize for the source node if that node has uncommitted assignments to controlled probability variables.
Copy names assigned to node states by the arguments of
qsmm_get_node_state_by_name can retrieve this information from the destination node.
qsmm_node_disasm can use this information when disassembling the destination node.
qsmm_mat_goto_dump_v2 uses this information when dumping the state transition matrix of that node.
qsmm_mat_action_dump_v2 uses this information when dumping the action emission matrix of that node.
If the source node has an associated assembler program template, copy the template.
qsmm_node_disasm uses this template when disassembling the destination node.
The function returns a non-negative value on success or a negative error code on failure. Currently, the function can return the following error codes.
The argument node_from is equal to the argument node_to.
The source or destination node does not exist.
The source node does not have a loaded probability profile.
The instruction class set of the source node and the instruction class set of the destination node are different.
The destination node has the number of states less than it is necessary to hold the probability profile of the source node.
The model instance does not exist.
The multinode model has positive length of look-ahead signal segment.
The source node is a user of a source probability profile provided by another node.
One of the following conditions is true:
qsmm_node_profile_clonecalled the function
qsmm_node_var_realizefor the source node, and the latter function has failed because that node is a probability profile source for other nodes.
This error can leave the probability profile of the destination node in inconsistent state. If after removing a reason of this error a repeated call to this function succeeds, the probability profile becomes consistent.
qsmm_node_profile_clone called the function
qsmm_node_var_realize for the source node, and the latter function failed because the sum of probabilities of
case instructions in a
choice instruction block would exceed 1.
A Storage API function reported storage failure.
Inconsistent statistics on an action choice state or cycle type detected.
Unable to convert a multibyte string to a wide string or vice versa according to a current locale.
There was not enough memory to perform the operation.
QSMM_ERR_NOMEM can leave the probability profile of the source or destination node in inconsistent state.
If after removing a reason of this error a repeated call to this function succeeds, the probability profile becomes consistent.