-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parallelization of computeIntegral and computeDoubleIntegral #12
Comments
The only path I see worth trying are threads. Maybe an idea could be to launch two threads that wait for input data to process, this way we avoid the overhead of creating and destroying. That said, I have no deep experience in the subject. Since we are working at the microsecond level, I think that interacting with the OS is generally not a good idea. Clearly some experiments could be done, the problem is quite specific |
Maybe just google it first to see what people say about it. Then it might be worth it to do a few tests. |
I've thought a bit about the computation of these two integrals. Basically we are computing expm of two matrices that are very similar because one of them is contained in the other one. Since most of the computational effort in expm is dedicated to computing powers of the input matrix, it turns out that these two methods share a lot of computations. Therefore, instead of parallelizing them, it might be more efficient to just write a dedicated method that computes both at the same time. If implemented well, I think this customized computation could be faster than computing the two operations in parallel. Here you can find some notes that I wrote down on the subject. |
I just found out that computing both the first and double integral together is extremely simple. In fact, we're already doing it without knowing it! It turns out that the first integral is already inside the matrix exponential that we compute to get the double integral. Here an example with a 6x6 matrix A, and the matrix C being the augmented matrix we use to compute the double integral:
The first 6 elements of the last column of @olimexsmart Could you provide us with a method that computes both first and double integral based on this new knowledge? Basically you should just do exactly the same computation as for computing the double integral, but then also return the before-last column, which contains the first integral. Then @hammoudbilal could switch to this new method in consim, which will save us about 50% of the computation time! |
This is quite unexpected! I should manage to get it done this afternoon, I'm not at home at the moment |
At the moment the function is implemented only in the dynamic version of |
Hi @olimexsmart ,
what do you think about parallelizing the computation of the two integrals? Do you think the overhead coming from the parallelization would be higher than the time gained? Of course this depends on the time taken to compute the matrix exponentials, which in turn depends on size and norm of the matrix A, but do you have some experience on the "price" of parallelization?
The text was updated successfully, but these errors were encountered: