Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
Scatter/gather is when you use one operation to shovel data into multiple buffers (scatter) or read data from multiple buffers (gather). It's a general pattern. Think of it as write and read operations respectively which work over multiple buffers instead of a single one.
Eg. In MPI (a framework for writing parallel programs as cooperating processes) a scatter operation takes an array of data and send different chunks of that array to different MPI processes, all in one procedure call. Similarly, a gather operation fills an array with different bits of data from different MPI processes.
@Haxk20 You'll see this come up when you're doing parallel or vector programming.
As an example imagine you have a hypothetical processor with N processing cores, each with one input register and one output register. Suppose you want to compute the sum of squares of elements of an array. Instead of sending data one by one to registers, such a processor would generally have scatter/gather functionality.
So you have an input array of numbers. You'll scatter that array to the input registers of said cores so that each input register now holds one number from the array. Then all the cores compute squares in parallel and put that value in their output registers. Then you gather all the output registers to some other array and sum them.
The advantage is that scatter/gather can be implemented to be more efficient than individual read/write to each buffer and it is a useful primitive for parallel/vector algorithms.
Haxk20404437doh wait as you said i could just use more cores to do it. really cool indeed.
Your Job Suck?
Take a quick quiz from Triplebyte to skip the job search hassles and jump to final interviews at hot tech firms
Get a Better Job