1. A method of topology mapping in a distributed processing system, the distributed processing system including a plurality of compute nodes, each compute node having a plurality of tasks, the method comprising: initiating, by a sending task, a message passing operation that is unrelated to topology mapping with a receiving task; including, by the sending task, in a message generated by the message passing operation topological information for the sending task; mapping, by the receiving task, the topological information for the sending; determining whether the sending task and the receiving task reside on the same topological unit; if the sending task and the receiving task reside on the same topological unit, using an optimal local network pattern for subsequent message passing operations between the sending task and the receiving task; and if the sending task and the receiving task do not reside on the same topological unit, using a data communications network between the topological unit of the sending task and the topological unit of the receiving task for subsequent message passing operations between the sending task and the receiving task.