HolyLab / BlockRegistrationScheduler.jl

Multi-core image registration scheduler
1 stars 0 forks source link

Re: Cuda type error fix #24

Closed mdhe1248 closed 7 years ago

mdhe1248 commented 7 years ago

I tried to register SubArray data type. Type error occurred due to the type mismatch between moving and fixed. After slice an image in the code, the data type remained as SubArray, which does not match with the type of fixed. I modified the code. Now, the data type of moving becomes Array. This matches with that of fixed There might be a better way; changing the data type of fixed did not work on my hands

timholy commented 7 years ago

Can you show the original error? It seems possible that the best fix is somewhere else in the code.

The test failures don't seem to have anything to do with this change. I may have time to try to get this passing tests again in the coming week.

Cody-G commented 7 years ago

For what it's worth I ran into something like this too. It seems it's not about CUDA. It's about using registering a SubArray that is based on a SharedArray (and all of our microscope images are loaded as SharedArrays). I think the problem is that SharedArrays by design have local versions of their indices (see docs), so when multiple workers are passed the same SubArray of a SharedArray, indexing gets messed up. For me the solution was to load the image and slice it separately on every worker. After adding workers you can do that like this:

@everywhere begin
        #load and slice image here
end

If I'm understanding correctly then this is not a bug, but happens by design. If so should we update the README?

timholy commented 7 years ago

Sounds like a good idea. If you have a simple reproducer I can look for myself, but for right now I can't say much.