-
Notifications
You must be signed in to change notification settings - Fork 359
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
Final grdimage upgrade related to transparency #8241
Conversation
Summary of changed imagesThis is an auto-generated report of images that have changed on the DVC remote
Image diff(s)Added images
Modified images
Report last updated at commit 41df65d |
Building fails on Linux:
|
Did not test OpenMP so missed some new variables.
Oops, was not using OpenMP here so that was never exercised. Fixed now I hope - let me know. Removed x, added ix,iy as shared, and idim as private. |
Still fails:
|
Sorry, blindness. Now y is gone and dim is idim |
|
Amazingly stupid. Sorry about this @seisman but hopefully this nʻth iteration works. |
Yes, it works, and please add |
Thanks, and done. |
This still crashes gmt grdimage RandomGeoTIFFWithAlpha.tiff -png lixo |
Tried to fix the indexed images case with a transp value set by the nan_value by adding a I->alpha but didn't work. Debugged but couldn't find why. |
The trans_mix test and image_vartrans fail for me with corrupted PS. Here goes one (not finished PS). |
Two issues I think.
With |
You haven’t open the PS I attached. The problem is more serious and I don’t know how to debug it. Nor have time these next 3 days. |
I did look at it, and was pushed, so I ran transp_mix.sh again and it crashed. Reason was I had not updated git etc as I mentioned so it complained that grdimage -Q+i was not available (it wasn't before). After git pull etc and rebuild it ran fine. So please run transp_mix.sh again manually (maybe bash -xv transp_mix.sh) and see if you still get any errors or message, and let me know. Hard to debug what does not crash here but it is clearly at the end of the square-transparency call. |
Comparing your and my PS. While I have
...
Not sure why you use Standard+ and how, and the degree symbol is an odd glyph? You also have a lot of color setting duplicates, e.g.,
which I dont understand how can happen. I dont see that since they are the same color as before. But, it is possible this is some roundoff causing trouble when I check if next color is the same or not as the previous. I'll see how that is handled. |
I use this to determine if the new and old color are the same: #define PSL_same_rgb(a,b) (PSL_eq(a[0],b[0]) && PSL_eq(a[1],b[1]) && PSL_eq(a[2],b[2]) && PSL_eq(a[3],b[3])) /* If two colors are ~identical */ with #define PSL_eq(a,b) (fabs((a)-(b)) < PSL_SMALL) /* If two color component are ~identical */ and PSL_SMALL = 1.0e-10. |
I was using latest git (nothing new comes out on a git pull) It would be a disaster if different compilers gave different results on a comparison to < 1e-10. They all round off to same numbers, that's IEEE thing. A thing that my change it is the use of Running the
|
Sorry, but I cannot determine what goes wrong on Windows. You should be able to place a stop point at line 607 and 618 and then go up and see why you get crazy sizes? |
Ah OpenMP. That makes sense since Xcode does not have it. K, will do the gcc build we use for the release then and I suspect I will figure that out quickly, Thanks! |
We should have checks to see if the OMP blocks actually speed up or not. |
Built with OMP and got crash etc so will work on this tomorrow. |
So learning a few things about OPenMP here. The initial issue was that even though I memset fill to 0 before the loops and use fill as a private variable for each thread, it clearly was not passed in to each thread as empty. So the PS had output in it as if it had pattern fill. Just junk. I then placed the memset init inside the for loop over columns so it was set to NULL before we start filling in fill.rgb. Now we have no more image, pattern crap. But, still problems. The issue is at least partly the check in PSL if the new rgb differs from the last one sat. Well, what does that mean when there are 10 threads doing this and the PSL is doing this
This test fails because we implemented this to think that if we had just set the same rgb then skip it, but "just" does not work in parallel mode. So we end up with duplications in the PS:
And once in a while we get a junk character: {0.53 0.514 0.593 C�} FS Those are the things that crash gs, not the duplications. Conclusion seems to be we cannot do OPM if we change color or transparency inside those loops. So probably no point with OPM in those cases. This is very different from the calculation OPM which does not depend on some recently set variable like in PSL. Agree on reming OpenMP when PSL functions expecting linear memory is engaged, @joa-quim ? |
Sure. If it can’t be used. |
Gonna try one more thing. We have no gmt_setcolor function (only set fill) which complicates this as I need to pass that fill structure that the f**s us. If that still fails then most of the loops with OPM are ok; it is only the new ones with fill.rgb that fails (hence most tests were not affected - just the new stuff). Will update you soon |
Removed only the OPENMP loop that surrounds the plotting of squares since that is where the color and previous color enters. See how it works for you now. |
Updated some PS files (dvc pull) and all pass except two colorbar categorical plots due to the new #8246 PR. FYI, I will remove that as it messed with the placement of the label and causes two failures. I think the best plan is to
|
let's finish this. I cannot be at the computer today and tomorrow. This was in master. With the branch it still crashes. |
I know you can't. And I cannot work at the moment but maybe a bit later. |
As I understand it, the PR is already superseded by PR #8251. So closing. |
This branch replaces the deprecated branch #8191 which added some complications. This branch still passes 100% of the tests. I will now work on adding tests that highlight new capabilities (like variable transparency via square polygons) while making sure all tests still pass.