Complex adaptation in subdivided populations