Optimization and managemeent of large-scale scientific workflows in heterogeneous network environments: from theory to practice