The swarm robots should be divided into some sub-swarms through task allocation when searching for multiple targets so as that each sub-swarm can work together on a desired target. For this end, a strategy of control is proposed which apply to cooperation relationship and competition relationship between some sub-swarms. To coordinate cooperatively, a spokesperson for each sub-swarm is required to elect in a self-organization fashion. On behalf of its sub-swarm, it communicate with spokespersons of other sub-swarms, exchanging the respective local best information with these spokespersons each other, guiding its sub-swarm to search a target. For coordinating competitively, a mechanism of contract is proposed. These advantage sub-swarms contract with targets. On the contrast, those disadvantage sub-swarms abandon searching these targets. In a word, we design a control algorithm for the two kinds of coordination at coarse granularity level. Simulation results show that, coordinating cooperatively expand robots' sense range. Coordinating competitively resolve space conflicts. Coordinating which occur between sub-swarms at coarse granularity level and in sub-swarm frame at fine granularity level, promote search efficiency to more high obviously than the existed methods.