/// <summary>
        /// The factory to build compuation platform.
        /// </summary>
        /// <param name="mode">The mode of compuation platform.</param>
        /// <param name="preparationWork">The preparation work.</param>
        /// <param name="computationPlatform">The platform for parallel computation.</param>
        /// <param name="xmlConfig">Xml config.</param>
        /// <param name="workingFolder">The working folder.</param>
        public static void CreateComputationPlatform(ComputationPlatform mode, PlatformPreparationWork preparationWork, out ParallelComputation computationPlatform, string xmlConfig = null, string workingFolder = null)
        {
            switch (mode)
            {
                case ComputationPlatform.MultiThreadPlatform:
                    computationPlatform = new MultiThreadParallelComputation();
                    break;
                case ComputationPlatform.SingleMachinePlatform:
                    computationPlatform = new SingleMachineComputation();
                    break;
                case ComputationPlatform.HPCPlatform:
                    computationPlatform = new HPCParallelComputaion();
                    break;
                default:
                    throw new ArgumentException("The invalid computation platform is given");
            }

            if (preparationWork != null)
            {
                preparationWork();
            }
        }
 /// <summary>
 /// Overload CreateComputationPlatform(ComputationPlatform mode, PlatformPreparationWork preparationWork) with the second para as null.
 /// </summary>
 /// <param name="mode">The mode of compuation platform.</param>
 /// <param name="comPlatform">The platform for parallel computation.</param>
 public static void CreateComputationPlatform(ComputationPlatform mode, out ParallelComputation comPlatform)
 {
     CreateComputationPlatform(mode, null, out comPlatform);
 }