Pattern-based parallel programming framework