What is the actual name of this 'binning efficiency algorithm' I made up?

38 Views Asked by At

I thought about posting this on StackOverflow but figured the core of what I'm asking is mathematical. Also, please bear with me, I'm not a mathematician, I'm a quasi-biological programmer.

Short story: I'm trying to distribute f number of files to c cores as evenly as possible. My variable symbols are relative to my problem, but the algorithm is:

Assumptions: f > c, all f's are of equal size (they're not, but close enough)

f = # of files to process

c = cores

q = quotient of f/c

c_r = remainder of f/c

c_q = c - c_r

f_r = files per c_r = enter image description here

Conclusion: Efficient binning will be: c_q cores each have q files, c_r cores each have f_r files.

Long Story: I have f number of digital images from a microscope that we do a process on. The way people do it in the lab is just run one process (one core) for all the images. Unfortunately we routinely collect 1000s of images, so this processing takes all day/night. I decided to figure out a way that I can most efficiently distribute the images to c number of cores.

At first I thought I would just do f/c and whatever the remainder is I'll just dump in the last process or something, which would probably be fine but I wasn't satisfied. So I tried to figure out a way to distribute the files as evenly as possible by approaching it mathematically and I THINK IT WORKED! BUT! I know I didn't make this up, so what is it actually called? I've searched google with all kinds of names it could be but couldn't figure it out.