コード例 #1
0
 public IndraFOFProcess(GlobalParameters globals)
     : base(globals)
 {
 }
コード例 #2
0
ファイル: Process2.cs プロジェクト: dcrankshaw/GadgetLoader
 public Process(GlobalParameters _globals)
 {
     globals = _globals;
 }
コード例 #3
0
 public IndraFFTDataProcess(GlobalParameters globals) : base(globals)
 {
 }
コード例 #4
0
ファイル: Process2.cs プロジェクト: dcrankshaw/GadgetLoader
 public GroupProcess(GlobalParameters globals)
     : base(globals)
 {
 }
コード例 #5
0
ファイル: Process2.cs プロジェクト: dcrankshaw/GadgetLoader
 public HaloTreeProcess(GlobalParameters globals)
     : base(globals)
 {
 }
コード例 #6
0
ファイル: Process.cs プロジェクト: dcrankshaw/GadgetLoader
 public IndraFFTDataProcess(GlobalParameters globals)
     : base(globals)
 {
 }
コード例 #7
0
ファイル: Process2.cs プロジェクト: dcrankshaw/GadgetLoader
 public GalaxyTreeProcess(GlobalParameters globals)
     : base(globals)
 {
 }
コード例 #8
0
ファイル: frmMain.cs プロジェクト: dcrankshaw/GadgetLoader
 private void RefreshGlobalParameters()
 {
     float box = Single.Parse(txtBox.Text);
     int phBits = Int32.Parse(txtPHBits.Text);
     int numZones = Int32.Parse(txtNumZones.Text);
     int maxRandom = Int32.Parse(txtMaxRandom.Text);
     globalParameters = new GlobalParameters(phBits, numZones, box, maxRandom
         , txtSQLCommandsFile.Text);
 }
コード例 #9
0
ファイル: Process2.cs プロジェクト: dcrankshaw/GadgetLoader
 public SnapshotsProcess(GlobalParameters globals)
     : base(globals)
 {
 }
コード例 #10
0
ファイル: Program.cs プロジェクト: dcrankshaw/GadgetLoader
        /// <summary>
        /// Create new Process and initialize with parsed command line parameters
        /// </summary>
        /// <param name="gp">The GlobalParameters object containing global state</param>
        /// <param name="runner">The Runner object to execute the process</param>
        /// <param name="opts">The command line options</param>
        private static void RefreshProcess(GlobalParameters gp, Runner runner, CommandLineOptions opts)
        {
            string inpath = "";
            string outpath = "";

            //read snapshot configuration from database
            try
            {

                SqlConnection configConn = new SqlConnection(LoaderParamSingleton.createConnString(opts.database, opts.server));
                configConn.Open();

                SqlDataReader myReader = null;
                string command = "select * from dbo.config where sim = @sim and snapnum = @snapnum";
                SqlCommand myCommand = new SqlCommand(command, configConn);
                SqlParameter timestepParam = new SqlParameter("@snapnum", System.Data.SqlDbType.SmallInt);
                SqlParameter simParam = new SqlParameter("@sim", System.Data.DbType.String);
                timestepParam.Value = opts.timestep;
                simParam.Value = opts.sim;
                myCommand.Parameters.Add(timestepParam);
                myCommand.Parameters.Add(simParam);
                myReader = myCommand.ExecuteReader();

                //Can add any other properties we want to read from DB here
                int numLines = 0;
                while (myReader.Read())
                {
                    //TODO: do i need to escape backslashes in the paths?
                    //I don't think so, it's been working fine so far
                    inpath = myReader["inpath"].ToString();
                    outpath = myReader["outpath"].ToString();
                    numLines++;
                }

                configConn.Close();

                if (numLines > 1)
                {
                    throw new ConfigurationException(
                        "Multiple entries matching this snapshot in configuration table");
                }
                else if (numLines < 1)
                {
                    throw new ConfigurationException(
                        "Zero entries matching this snapshot in configuration table");
                }

                gp.summary.setFile(outpath + "\\summary");

            }
            /*catch (Exception e)
            {
                Console.Out.WriteLine("Caugth DB exception");
                gp.summary.addError(e.Message);
                return;
            }*/

            catch (Exception)
            {
                throw;
            }

            if (opts.snap)
            {
                Console.WriteLine("Adding Snapshot process to runner");
                runner.Add(RefreshSnapshotsProcess(gp, inpath, outpath, opts));
            }
            if (opts.fof)
            {
                runner.Add(RefreshIndraFOFProcess(gp, inpath, outpath, opts));
            }
            if (opts.fft)
            {
                runner.Add(RefreshIndraFFTProcess(gp, inpath, outpath, opts));
            }
        }
コード例 #11
0
ファイル: Program.cs プロジェクト: dcrankshaw/GadgetLoader
        /// <summary>
        /// Creates a new SnapshotsProcess to process the main snapshot files
        /// </summary>
        /// <param name="gp">The global parameters</param>
        /// <param name="inpath">Where the snapshot files are located on disk</param>
        /// <param name="outpath">Where the processed files should be written to before
        /// being bulk loaded into the database</param>
        /// <param name="opts">The command line options</param>
        /// <returns>A new SnapshotsProcess ready to be executed</returns>
        private static SnapshotsProcess RefreshSnapshotsProcess(GlobalParameters gp, string inpath, string outpath, CommandLineOptions opts)
        {
            SnapshotsProcess process = new SnapshotsProcess(gp);

            process.inPath = inpath;
            process.outPath = outpath;

            process.snapshotFilePrefix = LoaderParamSingleton.getInstance().snapFilePrefix;

            /* If we don't set the first and last snapshot files manually, the loader
             * will read how many subfiles the snapshot is supposed to have and read
             * that many*/

            //process.firstSnapshotFile = LoaderParamSingleton.getInstance().snapStartFile;
            //process.lastSnapshotFile = LoaderParamSingleton.getInstance().snapEndFile;
            process.snapNumber = opts.timestep;

            //TODO: HARDCODED
            process.writeArrays = true;

            return process;
        }
コード例 #12
0
ファイル: Program.cs プロジェクト: dcrankshaw/GadgetLoader
 /// <summary>
 /// Creates a new IndraFofProcess to process the FoF files generated by Gadget
 /// </summary>
 /// <param name="gp">The global parameters</param>
 /// <param name="inpath">Where the fof files are located on disk</param>
 /// <param name="outpath">Where the processed files should be written to before
 /// being bulk loaded into the database</param>
 /// <param name="opts">The command line options</param>
 /// <returns>A new IndraFoFProcess ready to be executed</returns>
 private static IndraFOFProcess RefreshIndraFOFProcess(GlobalParameters gp, string inpath, string outpath, CommandLineOptions opts)
 {
     IndraFOFProcess process = new IndraFOFProcess(gp);
     process.inPath = inpath;
     process.outPath = outpath;
     process.groupTabFilePrefix = LoaderParamSingleton.getInstance().groupTabPrefix;
     process.groupIDFilePrefix = LoaderParamSingleton.getInstance().groupIDPrefix;
     //process.firstSnapshotFile = LoaderParamSingleton.getInstance().fofFirstSnapshot;
     //process.lastSnapshotFile = LoaderParamSingleton.getInstance().fofLastSnapshot;
     process.snapnumber = opts.timestep;
     return process;
 }
コード例 #13
0
ファイル: Program.cs プロジェクト: dcrankshaw/GadgetLoader
 /// <summary>
 /// Creates a new IndraFFTProcess to process the FFT files generated by Gadget
 /// </summary>
 /// <param name="gp">The global parameters</param>
 /// <param name="inpath">Where the FFT files are located on disk</param>
 /// <param name="outpath">Where the processed files should be written to before
 /// being bulk loaded into the database</param>
 /// <param name="opts">The command line options</param>
 /// <returns>A new IndraFFTProcess ready to be executed</returns>
 private static IndraFFTDataProcess RefreshIndraFFTProcess(GlobalParameters gp, string inpath, string outpath, CommandLineOptions opts)
 {
     IndraFFTDataProcess process = new IndraFFTDataProcess(gp);
     process.inPath = inpath;
     process.outPath = outpath;
     process.filePrefix = LoaderParamSingleton.getInstance().fftFilePrefix;
     process.fileExtension = LoaderParamSingleton.getInstance().fftFileExtension;
     process.snapnumber = opts.timestep;
     return process;
 }
コード例 #14
0
ファイル: Process.cs プロジェクト: dcrankshaw/GadgetLoader
 public IndraFOFProcess(GlobalParameters globals)
     : base(globals)
 {
 }
コード例 #15
0
 public Process(GlobalParameters _globals)
 {
     globals = _globals;
 }
コード例 #16
0
ファイル: Process2.cs プロジェクト: dcrankshaw/GadgetLoader
        long multiplier = 1000000; // sufficient for minimilii

        #endregion Fields

        #region Constructors

        public FOFOrderedSnapshotsProcess(GlobalParameters globals)
            : base(globals)
        {
        }
コード例 #17
0
 public SnapshotsProcess(GlobalParameters globals)
     : base(globals)
 {
 }
コード例 #18
0
ファイル: Process.cs プロジェクト: dcrankshaw/GadgetLoader
 public SimDBFOFProcess(GlobalParameters globals)
     : base(globals)
 {
 }