ies_num_threads() vs physical cores #204
-
|
The solves for each iteration takes quite a long time due to a ridiculous number of tiny local solves. I have set
From the pest++ namual (p133): |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 9 replies
-
|
So, as you mention @wkitlasten there are lots of little solves with localization - essentially, one solve for each column in the localizer matrix for each lambda value. These solves require various linear algebra components like the simulated value ensemble and obs+noise ensemble for the non-zero localizer entries in the column, the current and initial par ensemble for the localizer column, the prior par cov matrix piece for the localizer column, etc. In a multithreaded setting, access to these containers has to be guarded by semaphores/mutexs to make them thread-safe, meaning one and only one thread can access each of these at a time. Then the solution process, which is independent for each thread. Then results of the solve have to be put into the result parameter ensemble container (which also has to be access controlled with semaphores/mutexs). What this means is that for problems with only a few reals (less than 500 say) and only a few non-zero weighted obs (less than a few hundred), the threads will spend almost all their time fighting/waiting for access to the containers, not actually solving - the SVD needed in the solution process is on a matrix of size num reals X nnz obs, so if those are large, then the SVD solve will take some time and help the threads not just wait on access. The "waiting for access" actually requires clock cycles so it chews up resources...all this is to say that in most cases 3-4 threads would probably be max (at least that is the most Ive used...). Ive been dreaming about offloading the localized solve to the workers for a while but its a massive undertaking...and in most cases, just using more reals is probably faster than waiting a fully localized solve... |
Beta Was this translation helpful? Give feedback.
So, as you mention @wkitlasten there are lots of little solves with localization - essentially, one solve for each column in the localizer matrix for each lambda value. These solves require various linear algebra components like the simulated value ensemble and obs+noise ensemble for the non-zero localizer entries in the column, the current and initial par ensemble for the localizer column, the prior par cov matrix piece for the localizer column, etc. In a multithreaded setting, access to these containers has to be guarded by semaphores/mutexs to make them thread-safe, meaning one and only one thread can access each of these at a time. Then the solution process, which is independent for e…