fix bugs on generating parallel plan
fix bugs on determining pi value