Mathematica: ParallelMap getting slower

  • Mathematica
  • Thread starter Polyrhythmic
  • Start date
  • Tags
    Mathematica
In summary, the ParallelMap function in Mathematica may slow down due to increased input data size or limited resources for parallel processing. However, it can potentially be sped up by optimizing the code or increasing available resources. Using too many parallel kernels or certain data types/functions can also affect its speed. Additionally, the network connection can impact the function's performance, especially for distributed parallel processing tasks.
  • #1
Polyrhythmic
343
0
Hi,

I use ParallelMap with Mathematica on Linux to solve 100 eigenvalue problems on 4 kernels. This operation ist repeated very often, and over the course of time the performance drops significantly. Using top, you can see that the CPU used by the master kernel increases, and the CPU used by the slave kernels decreases from 70 to appr. 20 percent. Has anyone else experienced this phenomenon?
 
Physics news on Phys.org
  • #2
Whats the associated ram usage? Try use ClearSystemCache[] at the end of your loops.
 

Related to Mathematica: ParallelMap getting slower

1. Why is the ParallelMap function in Mathematica getting slower?

There could be multiple reasons for the slowing down of the ParallelMap function in Mathematica. One possible reason could be that the input data size has increased significantly, resulting in longer processing times. Another reason could be that the resources available for parallel processing, such as CPU cores or memory, are being used by other processes, thus slowing down the ParallelMap function.

2. Is there a way to speed up the ParallelMap function in Mathematica?

Yes, there are several ways to potentially speed up the ParallelMap function in Mathematica. One approach is to optimize the code being used in the function, such as using more efficient algorithms or data structures. Another approach is to increase the available resources for parallel processing, such as using a computer with more CPU cores or allocating more memory for the function to use.

3. Can using too many parallel kernels in Mathematica slow down the ParallelMap function?

Yes, using too many parallel kernels in Mathematica can potentially slow down the ParallelMap function. This is because each parallel kernel requires resources such as memory and processing power, and using too many of them can result in resource contention and slower processing times. It is important to find the optimal number of parallel kernels to use for a given task.

4. Are there any specific data types or functions that can cause the ParallelMap function in Mathematica to run slower?

Certain data types or functions may cause the ParallelMap function in Mathematica to run slower, depending on the specific task at hand. For example, using complex data types or functions that require a lot of memory can slow down the function. It is important to carefully select the appropriate data types and functions for the task to optimize the performance of the ParallelMap function.

5. Does the network connection affect the speed of the ParallelMap function in Mathematica?

The network connection can potentially affect the speed of the ParallelMap function in Mathematica, especially if the function is being used for distributed parallel processing across multiple computers. A slow or unreliable network connection can result in slower processing times or even errors. It is important to ensure a stable and fast network connection when using the ParallelMap function for distributed parallel processing.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
8K
  • Engineering and Comp Sci Homework Help
Replies
7
Views
3K
Replies
15
Views
2K
Replies
9
Views
2K
Replies
3
Views
3K
  • Math Proof Training and Practice
2
Replies
38
Views
9K
  • Aerospace Engineering
Replies
3
Views
2K
  • Mechanical Engineering
Replies
1
Views
3K
  • STEM Career Guidance
2
Replies
37
Views
13K
Back
Top