Main Content

Testing Parallel Computing

R2026b

Follow these steps to test whether your problem runs correctly in parallel.

  1. 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.

  2. Set UseParallel to "on", and ensure that no parallel pool exists by entering delete(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 runs parfor serially, with loop iterations in reverse order from a for loop. Make sure this test is successful (gives correct results) before going to the next test.

  3. Set UseParallel to "on", and create a parallel pool using parpool. 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.

See Also

Topics