Ejemplo n.º 1
0
 public IndraFOFProcess(GlobalParameters globals)
     : base(globals)
 {
 }
Ejemplo n.º 2
0
 public Process(GlobalParameters _globals)
 {
     globals = _globals;
 }
Ejemplo n.º 3
0
 public IndraFFTDataProcess(GlobalParameters globals) : base(globals)
 {
 }
Ejemplo n.º 4
0
 public GroupProcess(GlobalParameters globals)
     : base(globals)
 {
 }
Ejemplo n.º 5
0
 public HaloTreeProcess(GlobalParameters globals)
     : base(globals)
 {
 }
Ejemplo n.º 6
0
 public IndraFFTDataProcess(GlobalParameters globals)
     : base(globals)
 {
 }
Ejemplo n.º 7
0
 public GalaxyTreeProcess(GlobalParameters globals)
     : base(globals)
 {
 }
Ejemplo n.º 8
0
 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);
 }
Ejemplo n.º 9
0
 public SnapshotsProcess(GlobalParameters globals)
     : base(globals)
 {
 }
Ejemplo n.º 10
0
        /// <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));
            }
        }
Ejemplo n.º 11
0
        /// <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;
        }
Ejemplo n.º 12
0
 /// <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;
 }
Ejemplo n.º 13
0
 /// <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;
 }
Ejemplo n.º 14
0
 public IndraFOFProcess(GlobalParameters globals)
     : base(globals)
 {
 }
Ejemplo n.º 15
0
 public Process(GlobalParameters _globals)
 {
     globals = _globals;
 }
Ejemplo n.º 16
0
        long multiplier = 1000000; // sufficient for minimilii

        #endregion Fields

        #region Constructors

        public FOFOrderedSnapshotsProcess(GlobalParameters globals)
            : base(globals)
        {
        }
Ejemplo n.º 17
0
 public SnapshotsProcess(GlobalParameters globals)
     : base(globals)
 {
 }
Ejemplo n.º 18
0
 public SimDBFOFProcess(GlobalParameters globals)
     : base(globals)
 {
 }