I'm working on configuring our model to run in Rapid Accelerator mode with the "RapidAcceleratorUpToDateCheck" set to "off", following the demo in the MATLAB help, but I'm having trouble.
The main issue is that each simulation runs with the parameter values that were used when the buildRapidAcceleratorTarget method is called, because the parameter values in the source workspace aren't being loaded into the pre-compiled rapid accelerator model. There aren't any tuneable parameters, or at least the parameters are all stored in structures, so it's very difficult to set them up as tuneable; otherwise, it might have been possible to use the modifyTunableParameters method as in the demo.
Therefore, the current approach is to use the buildRapidAcceleratorTarget method for each case in a FOR loop and save each parameter vector to a separate MAT file, then, within the PARFOR loop, load the parameter vector for each case and pass it to the SIM command via the simulation options. This does work, but, it's significantly slower than the sequential version because it's having to rebuild the rapid accelerator target so many times.
Since the buildRapidAcceleratorTarget method uses a P-file to build the rapid accelerator target and to create the parameter vector, I haven't been able to dig down and work out whether there is a more direct way to obtain just the parameter vector for the Rapid Accelerator target.
We also have it configured to use the "Rapid Simulation" RTW target. That uses the simulation command "WriteExtModeParamVect" to obtain the required parameter vector, which is going to be much faster than also compiling the model. However, the output of that command is different from the output of the buildRapidAcceleratorTarget method.
I think this is the last viable option. So, is there a better way to get the parameter vector, or do I have to admit defeat?
We have to use R2008b, although it may be possible to use R2009b, if I can demonstrate that that's a necessary step.