Define and share a function:
When called from each subkernel, the function updates next on the master kernel:
Set up a shared function with a default rule:
Make additional definitions on the subkernels:
Since the function is shared, the master kernel knows about the additional rules:
Maintain indexed shared variables with a default value:
Define a shared function to manipulate the local variable results on the master kernel:
Call the function from the subkernels:
The variable on the master has been modified: