Skip to content
This repository has been archived by the owner on Oct 20, 2023. It is now read-only.

Parallelize radar visualization in image_viewer #17

Merged
merged 2 commits into from
Feb 12, 2021

Conversation

plb9772
Copy link
Contributor

@plb9772 plb9772 commented Feb 11, 2021

When using image_viewer, I find a bit annoying that we see only one radar at a time, and the fact that they are successively generated makes the process of obtaining merged video quite long. This is a proposal to make every radar processed in parallel (but not in sync), without changing too much the current logic.

I tested it, and the gain of time is consequent. Let me know what you think of it

Use python multiprocessing library to generate every radar video at
the same time.
@plb9772 plb9772 added the enhancement New feature or request label Feb 11, 2021
@plb9772 plb9772 self-assigned this Feb 11, 2021
Copy link
Contributor

@jimmy-zendar jimmy-zendar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I run the code, I ran into
`Gdk-Message: 15:14:14.198: image_viewer.py: Fatal IO error 0 (Success) on X server :1.

(image_viewer.py:14266): Gdk-ERROR **: 15:14:14.213: The program 'image_viewer.py' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadDrawable (invalid Pixmap or Window parameter)'.
(Details: serial 480 error_code 9 request_code 139 (RENDER) minor_code 4)
(Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the GDK_SYNCHRONIZE environment
variable to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error() function.)
`

This error is related to creating the figure in line 146 in image_viewer.py. Maybe Reza can see if he can get that to work on his machine.

Apparently, this seems to solve issues between matplotlib and multiprocessing
@mostajabi
Copy link
Contributor

@jimmy-zendar I could run it fine.

@jimmy-zendar
Copy link
Contributor

it works for me after the matplotlib backend change.

@mostajabi
Copy link
Contributor

I like this feature. I think it would be significantly better if we can somehow synchronize the threads and visualize them in the same plot. But it needs more work to be done. This way we would also address our synchronizing issue #9. @jimmy-zendar what is your opinion on this?

@mostajabi
Copy link
Contributor

With that being said, I think running the threads in parallel in its current format, saves time which is pretty good.

@plb9772 plb9772 merged commit 3ce7b9e into main Feb 12, 2021
@plb9772 plb9772 deleted the image_viewer_parallelization branch February 12, 2021 20:57
@plb9772
Copy link
Contributor Author

plb9772 commented Feb 12, 2021

For the synchronization of all the threads, we have to wait that Gilbert work with a separate output of the image model. I merged this PR now as it makes the workflow faster.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants