If you can define these positions mathematically, FXMap would be good for this. The Quadrant node has position offsets that can be defined with functions, and this, often in conjunction with an Iterate node, can do many useful things.
If you're using an image to define the locations, though, like in your mask example, it might be simpler to use Tile Sampler, which can be set up to do this sort of thing without you having to do all the technical work.