-
Notifications
You must be signed in to change notification settings - Fork 50
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
TrackStack - multi cores support #224
TrackStack - multi cores support #224
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you put the TQDM changes back? This was added to make display more user-friendly progress by presenting a thermometer type progress bar rather than a scrolling list. I hope it can still be used in the multithreaded case?
Also typo at line 339, should be "Stacking".
Hi, TQDM could not be used in multi core as it wrapper on list (or I need suggestion how to integrate it). I made inline thermometer which looks pretty same but without remaining time and scrolls only when QueuedPool prints current jobs state (probably need add option to suppress prints) Also I thought to create new file with name like StackTrack2 to leave current as is, I can do if it is preferable option. But it means someone will use old and wait )) |
ok, ref tqdm, that makes sense. I did wonder if that might be a problem, and anyway it hopefully removes a dependency. I'll pull this branch to one of my systems and run it for a couple of days if thats ok? |
Sure, I think we need more testing but can't find volunteers with different envs, I'm testing on everyday basis but probably exists other issues which cannot be reproduced on Mac or Raspberry Pi. |
I think the progress bar code is not valid on a Pi3 because the end= kwarg is not supported in python 2.7. You might need to put some conditionality round this |
You can probably just put "from future import print_function" at the top and that should solve it. |
Also i have a problem with the unicode character in that print() statement which generates an error on my test pi4 as its not a valid character in ISO-8859-1. |
@dvida yes, that works though it should be
(I think github removed the underscores from your comment!) |
I tested with a set of 188 meteors. After deploying this update, the same stack took: On both Pis, the "Stacking" percentage progress bar only appeared occasionally, mostly being skipped or perhaps overwirtten by messages such as the below. I don't think this is a big issue, as stacking did complete successfully albeit with the above problem with drawConstellations. |
Hi, thank you for your help!
|
@markmac99 could you please specify what error message you got?
|
This issue also present in current version - fixed by type cast
I tested with code bellow and all issues which I had - resolved, need test with locale ISO-8859-1 (not sure how to set it), I'm expecting no errors but it could print something wrong symbol = u'\u2588'
try:
symbol = str(symbol)
except UnicodeEncodeError:
symbol = symbol.encode('utf-8')
added flag and tested on Raspberry Pi - looks good |
Thanks, I'll pull this and run some tests later today on Windows, Pi4 and Pi3. Will also try on Ubuntu if i get time. |
unfortunately, still getting a unicode error on my Pi4 I'll do some testing to see if i can find the workaround. |
Unfortunately, if the OS doesn't understand UTF-8, then the symbols with a value > 255 can't be printed whether encoded or not and str() of the unicode character just converts it into a unicode string I think. ISO-8859-1 is another name for 256-bit ASCII. |
it produced error on my env: SyntaxError: Non-ASCII character '\xe2' in file # -*- coding: utf-8 -*- but if no utf-8 support not sure how it could be handled Is your snipped above working for ISO-8859-1 ? |
I might be missing something, but why not have a progress bar that looks something like: That should be fully cross-platform and only uses ASCII characters. It's not as pretty, but it does the job. |
Agree, initial try was copy progress bar from TQDM lib. if will not help - let's replace with "#" symbol. |
No luck I'm afraid. On the Pi4 it still fails with The problem is, neither of these tests fail
because in Python3, I believe all strings are unicode strings (this is different to python2 where strings are single-byte-character arrays). And so the Except... isn't triggered. The only safe test is whether the print() statement fails, i think. But i agree with Denis comment, just use an eASCII character! I did get it to work ok with this:
|
Replaced with "#", for me it looks better than "X"
|
Current version of TrackStack supports only one core for stacking and it takes a lot of time for big amount of meteors (i.e. in meteor shower maximum it could be up to 200-300)
This version is attempt to improve performance as modern CPUs have 4 and more cores.
I made tests for stacking of 30 meteors and got next results on my test environments:
Mac M2 Pro (10 cores)
single core time : 1 min 20 sec
all cores time : 21 sec
Raspberry Pi 4 (4 cores) (my friend still using Pi for stacks )
single core time : 18 min 23 sec
all cores time : 5 min 53 sec
Any suggestions - welcome