Testing Parallel Computing
R2026bFollow these steps to test whether your problem runs correctly in parallel.
Try your problem without parallel computation to ensure that it runs serially. Make sure this test is successful (gives correct results) before going to the next test.
Set
UseParallelto"on", and ensure that no parallel pool exists by enteringdelete(gcp). To make sure that MATLAB® does not create a parallel pool, select Parallel > Parallel Settings... in the Environment group on the Home tab, and then clear Automatically create a parallel pool. Your problem runsparforserially, with loop iterations in reverse order from aforloop. Make sure this test is successful (gives correct results) before going to the next test.Set
UseParallelto"on", and create a parallel pool usingparpool. Unless you have a multicore processor or a network set up, this test does not increase processing speed. This testing is simply to verify the correctness of the computations.
Remember to call your solver using an options argument to test or use
parallel functionality.