1. At least one computer-readable medium comprising instructions that when executed cause a system to: determine whether a sender of a message to be sent to a receiver using a message passing interface (MPI) shares a cache memory with the receiver and if so, select a first memory copy routine to pass the message; if the sender and the receiver do not share a cache memory, determine whether the sender and the receiver are located in a first processor package and if so, select a second memory copy routine to pass the message, wherein the second memory copy routine is selected from a different group of copy routines than the first memory copy routine; and if the sender and the receiver are not in the first processor package, select a third memory copy routine to pass the message, based on a size of the message.