Exemple #1
0
        static void WriteConfiguration(ConfigurationMgr mgr)
        {
            mgr.SmithWatermanSection.FastaFile           = _fastaFile;
            mgr.SmithWatermanSection.DistanceMatrixFile  = _distanceFile;
            mgr.SmithWatermanSection.IndexFile           = _indexFile;
            mgr.SmithWatermanSection.TimingFile          = _timingFile;
            mgr.SmithWatermanSection.SummaryFile         = _summaryFile;
            mgr.SmithWatermanSection.WriteFullMatrix     = _writeFullResults;
            mgr.SmithWatermanSection.WritePartialMatrix  = _writePartialResults;
            mgr.SmithWatermanSection.WriteAlignments     = _writeAlignments;
            mgr.SmithWatermanSection.WriteAlignmentsFile = _writeAlignmentFile;

            mgr.SmithWatermanSection.NodeCount           = _nodeCount;
            mgr.SmithWatermanSection.ProcessPerNodeCount = _processPerNodeCount;

            mgr.SmithWatermanSection.SequenceCount       = _sequenceCount;
            mgr.SmithWatermanSection.GapOpenPenalty      = _gapOpen;
            mgr.SmithWatermanSection.GapExtensionPenalty = _gapExtension;

            mgr.SmithWatermanSection.AlignmentType        = _alignmentType;
            mgr.SmithWatermanSection.DistanceFunctionType = _distanceFunction;
            mgr.SmithWatermanSection.ScoringMatrixName    = _scoringMatrixName;

            // Changes the MDS config
            mgr.ManxcatSection.DataPoints         = _sequenceCount;
            mgr.ManxcatSection.DistanceMatrixFile = _distanceFile;
            mgr.ManxcatSection.IndexFile          = _indexFile;

            // Changes the Pairwise config
            mgr.PairwiseSection.DataPoints         = _sequenceCount;
            mgr.PairwiseSection.DistanceMatrixFile = _distanceFile;
            mgr.PairwiseSection.IndexFile          = _indexFile;
        }
Exemple #2
0
        static void ReadConfiguration(ConfigurationMgr mgr)
        {
            _fastaFile           = mgr.SmithWatermanSection.FastaFile;
            _distanceFile        = mgr.SmithWatermanSection.DistanceMatrixFile;
            _indexFile           = mgr.SmithWatermanSection.IndexFile;
            _timingFile          = mgr.SmithWatermanSection.TimingFile;
            _summaryFile         = mgr.SmithWatermanSection.SummaryFile;
            _writeFullResults    = mgr.SmithWatermanSection.WriteFullMatrix;
            _writePartialResults = mgr.SmithWatermanSection.WritePartialMatrix;
            _writeAlignments     = mgr.SmithWatermanSection.WriteAlignments;
            _writeAlignmentFile  = mgr.SmithWatermanSection.WriteAlignmentsFile;

            _nodeCount           = mgr.SmithWatermanSection.NodeCount;
            _processPerNodeCount = mgr.SmithWatermanSection.ProcessPerNodeCount;

            _sequenceCount = 0;
            _gapOpen       = mgr.SmithWatermanSection.GapOpenPenalty;
            _gapExtension  = mgr.SmithWatermanSection.GapExtensionPenalty;

            _alignmentType     = mgr.SmithWatermanSection.AlignmentType;
            _distanceFunction  = mgr.SmithWatermanSection.DistanceFunctionType;
            _scoringMatrixName = mgr.SmithWatermanSection.ScoringMatrixName;

            _emailResultsTo = string.Join(",", mgr.GlobalSection.EmailAddresses);
        }
Exemple #3
0
 static public void SavePath()
 {
     ConfigurationMgr.AddConfigurationElement(CustomDefine.configKey_StandealoneOutPath, strStandAloneOutPath);
     ConfigurationMgr.AddConfigurationElement(CustomDefine.configKey_IOSOutPath, strIOSOutPath);
     ConfigurationMgr.AddConfigurationElement(CustomDefine.configKey_AndroidOutPath, strAndroidOutPath);
     ConfigurationMgr.AddConfigurationElement(CustomDefine.configKey_IOSGetPath, strIOSGetPath);
     ConfigurationMgr.AddConfigurationElement(CustomDefine.configKey_AndroidGetPath, strStandAloneOutPath);
     ConfigurationMgr.AddConfigurationElement(CustomDefine.configKey_StandealoneOutPath, strAndroidGetPath);
 }
Exemple #4
0
        private void OnLoad(object sender, EventArgs e)
        {
            _configMgr = new ConfigurationMgr(ConfigFile);

            Rectangle boundsTmp = Screen.GetBounds(Point.Empty);

            _configMgr.Settings.StartPoint = Point.Empty;
            _configMgr.Settings.EndPoint   = new Point(boundsTmp.Width, boundsTmp.Height);

            _optionsCtrl.SetObject(_configMgr.Settings);
        }
Exemple #5
0
        private void OnLoad(object sender, EventArgs e)
        {
            _configMgr = new ConfigurationMgr();

            _configMgr.LoadProfile(out _option);
            _fileMonitor.Option = _option;
            _optionsCtrl.SetObject(_option);

            _refreshTimer          = new Timer();
            _refreshTimer.Tick    += new EventHandler(OnTimer);
            _refreshTimer.Enabled  = false;
            _refreshTimer.Interval = 1500;
        }
Exemple #6
0
        static PathMgr()
        {
            strStandAloneOutPath = ConfigurationMgr.ReadConfigurationElement(CustomDefine.configKey_StandealoneOutPath);

            strIOSOutPath = ConfigurationMgr.ReadConfigurationElement(CustomDefine.configKey_IOSOutPath);

            strAndroidOutPath = ConfigurationMgr.ReadConfigurationElement(CustomDefine.configKey_AndroidOutPath);

            strStandAloneGetPath = ConfigurationMgr.ReadConfigurationElement(CustomDefine.configKey_StandealoneGetPath);

            strIOSGetPath = ConfigurationMgr.ReadConfigurationElement(CustomDefine.configKey_IOSGetPath);

            strAndroidGetPath = ConfigurationMgr.ReadConfigurationElement(CustomDefine.configKey_AndroidGetPath);
        }
        static void Main(string[] args)
        {
            ConfigurationMgr configMgr = new ConfigurationMgr();

            Console.WriteLine("***** appSettings before adding section, element and element items *****");
            Console.WriteLine();
            configMgr.ReadAllAppSettings();

            configMgr.CreateAppSettings("appSettings", "KEY0", "VALUE0");

            configMgr.CreateAppSettings("appSettings", "KEY1", "VALUE1");

            configMgr.CreateAppSettings("appSettings", "KEY2", "VALUE2");

            Console.WriteLine("***** appSettings after adding section, element and element items *****");
            Console.WriteLine();
            configMgr.ReadAllAppSettings();

            Console.WriteLine("appSettings value for KEY0 is {0}", configMgr.GetAppSettingValue("KEY0"));
            Console.WriteLine();

            Console.ReadLine();
        }
Exemple #8
0
 public MainDlg(ConfigurationMgr configMgr)
 {
     _configMgr = configMgr;
     InitializeComponent();
 }
	public ConfigurationMgr()
	{
		if (m_Instance == null)
			m_Instance = this;
	}
Exemple #10
0
        static void Main(string[] args)
        {
            // Load the command line args into our helper class which allows us to name arguments
            Arguments pargs = new Arguments(args);

            pargs.Usage = "Usage: Salsa.SmithWatermanMPI.exe /configFile=<string> /nodeCount=<int>";

            if (pargs.CheckRequired(new string[] { "configFile", "nodeCount" }) == false)
            {
                Console.WriteLine(pargs.Usage);
                return;
            }

            using (MPI.Environment env = new MPI.Environment(ref args))
            {
                Stopwatch overallTimer = Stopwatch.StartNew();
                _configFile = pargs.GetValue <string>("configFile");

                _mgr = ConfigurationMgr.LoadConfiguration(_configFile, true);
                ReadConfiguration(_mgr);

                _jobId               = Environment.GetEnvironmentVariable("%CCP_JOBID%");
                _taskId              = Environment.GetEnvironmentVariable("%CCP_TASKID%");
                _nodeCount           = pargs.GetValue <int>("nodeCount");
                _processPerNodeCount = MPI.Intracommunicator.world.Size / _nodeCount;

                // Read the fasta input file using our parser.
                FastaSequenceParser parser = new FastaSequenceParser();
                _sequences     = parser.Parse(_fastaFile);
                _sequenceCount = _sequences.Count;

                Console.WriteLine("Read {0} sequence from Fasta File {1}", _sequenceCount, _fastaFile);

                if ((_writeAlignments == true) && (!string.IsNullOrWhiteSpace(_writeAlignmentFile)))
                {
                    string fileName = string.Format("{0}_{1}{2}", Path.GetFileNameWithoutExtension(_writeAlignmentFile), MPI.Intracommunicator.world.Rank, Path.GetExtension(_writeAlignmentFile));
                    string filePath = Path.Combine(Path.GetDirectoryName(_writeAlignmentFile), fileName);
                    _writeAlignmentsWriter = File.CreateText(filePath);
                }

                MPIComputeLowerTriangularBlocked computeAlignments = new MPIComputeLowerTriangularBlocked(_sequenceCount, ComputeBlock);

                // Block Compute Section
                MPI.Intracommunicator.world.Barrier();
                Stopwatch computeTimer = Stopwatch.StartNew();

                Console.WriteLine("Rank {0} Beginning Blocks Compute: {1}", MPI.Intracommunicator.world.Rank, DateTime.Now.ToString());
                computeAlignments.Compute();
                Console.WriteLine("Rank {0} Finished Blocks Compute: {1}", MPI.Intracommunicator.world.Rank, DateTime.Now.ToString());

                MPI.Intracommunicator.world.Barrier();
                _overallComputeTime = computeTimer.ElapsedMilliseconds;
                computeTimer.Stop();

                if (_writeAlignmentsWriter != null)
                {
                    _writeAlignmentsWriter.Flush();
                    _writeAlignmentsWriter.Dispose();
                    return;
                }

                // MPI Scatter Section
                MPI.Intracommunicator.world.Barrier();
                Stopwatch mpiScatterTimer = Stopwatch.StartNew();

                Console.WriteLine("Rank {0} Beginning Scatter Blocks: {1}", MPI.Intracommunicator.world.Rank, DateTime.Now.ToString());
                computeAlignments.Scatter();
                Console.WriteLine("Rank {0} Finished Scatter Blocks: {1}", MPI.Intracommunicator.world.Rank, DateTime.Now.ToString());

                MPI.Intracommunicator.world.Barrier();

                _overallMPIScatterTime = mpiScatterTimer.ElapsedMilliseconds;
                mpiScatterTimer.Stop();

                Stopwatch ioTimer = Stopwatch.StartNew();
                Console.WriteLine("Rank {0} Beginning File IO: {1}", MPI.Intracommunicator.world.Rank, DateTime.Now.ToString());
                {
                    if (_writePartialResults)
                    {
                        string partialDistanceFile = string.Format("{0}_{1}{2}", Path.GetFileNameWithoutExtension(_distanceFile), MPI.Intercommunicator.world.Rank, Path.GetExtension(_distanceFile));
                        partialDistanceFile = Path.Combine(Path.GetDirectoryName(_distanceFile), partialDistanceFile);
                        PartialMatrixBinaryWriter partialWriter = new PartialMatrixBinaryWriter();
                        partialWriter.Write(computeAlignments.PartialMatrix, partialDistanceFile);
                    }


                    // todo: saliya - Workaround code for issue with Tempest. Remove this once Tempest is healthy.
                    if (_writeFullResults)
                    {
                        computeAlignments.WriteFullMatrixOnRank0(_distanceFile);
                    }

                    // todo: saliya - This code doesn't work on Tempest with all cores for large data sizes.
                    //                Something is wrong with MPI in Tempest probably. Till then we will use the
                    //                code above.

                    /*
                     * if (_writeFullResults)
                     * {
                     *  foreach (int minRankOnNode in MPI.Intracommunicator.world.GetMinRankOnAllNodes())
                     *  {
                     *      computeAlignments.WriteFullMatrix(minRankOnNode, _distanceFile);
                     *      //    Matrix<TDistance> fullMatrix = computeAlignments.GetFullMatrix(minRankOnNode);
                     *
                     *      //    if (MPI.Intracommunicator.world.Rank == minRankOnNode)
                     *      //    {
                     *      //        MatrixBinaryWriter fullWriter = new MatrixBinaryWriter();
                     *      //        fullWriter.Write(fullMatrix, _distanceFile);
                     *      //        Console.WriteLine("\tWrote Distance Matrix: {0}\t{1}", Environment.MachineName, _distanceFile);
                     *      //    }
                     *  }
                     * }*/
                }
                Console.WriteLine("Rank {0} Finished File IO: {1}", MPI.Intracommunicator.world.Rank, DateTime.Now.ToString());
                MPI.Intracommunicator.world.Barrier();
                _overallDiskIOTime = ioTimer.ElapsedMilliseconds;
                ioTimer.Stop();

                _overallTime = overallTimer.ElapsedMilliseconds;
                overallTimer.Stop();

                _totalPairCount      = MPI.Intercommunicator.world.Reduce <long>(computeAlignments.CellsComputed, MPI.Operation <long> .Add, 0);
                _totalComputeTime    = MPI.Intracommunicator.world.Reduce <long>(computeAlignments.BlockComputeTime, MPI.Operation <long> .Add, 0);
                _totalMPIScatterTime = MPI.Intracommunicator.world.Reduce <long>(computeAlignments.MPIScatterTime, MPI.Operation <long> .Add, 0);

                if (MPI.Intracommunicator.world.Rank == 0)
                {
                    WriteIndexFile(_indexFile, _sequences);
                    WriteTimingFile(_timingFile);
                    WriteSummaryFile(_summaryFile);
                    WriteConfiguration(_mgr);
                    _mgr.SaveAs(_configFile);
                }
            }
        }