An important aspect of successful locomotion in Modular Self-reconfigurable Robots (MSRs) is to be able to autonomously coordinate the movement of themodules so that the robot can move towards the goal.We consider the locomotion problem in a partially distributed setting wheremultiple MSRs (disconnected groups of connected modules) are within the communication range of each other and modules do not have a priori information about other modules that belong to the same configuration. Coordinating the movement of modules in such a setting becomes a challenging problem because of the limited perception and computation resources available on each module. To address these problems, we propose a strategy that first combines neighbor-to-neighbor message passing techniques via infrared and wireless communication to enable each module to autonomously determine the set of modules that belong to the same MSR. The strategy then uses a distributed leader election algorithm to identify the leader, which thereafter coordinates the actions of the modules in its configuration. We have verified the performance of our approach using an accurately simulated model of the ModRED MSR within the Webots simulator and in the embedded system of ModRED (This work was done as part of the ModRED project which is supported by NASA EPSCoR grant no. NNH11ZHA003C.). It is shown that our strategy can successfully determine the set of connected modules, elect a leader for each configuration and coordinate the locomotion of MSRs for different numbers of modules.