Ejemplo n.º 1
0
 public IGrid DeserializeGrid(Guid gridGuid)
 {
     using (Stream s = GetGridStream(false, gridGuid))
     {
         IGrid grid = (IGrid)Driver.Deserialize(s, typeof(IGrid));
         return(grid);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// loads a single <see cref="TimestepInfo"/>-object from the database.
        /// </summary>
        public T LoadTimestepInfo <T>(Guid timestepGuid, ISessionInfo session, IDatabaseInfo database)
            where T : TimestepInfo //
        {
            using (var tr = new FuncTrace())
            {
                tr.Info("Loading time-step " + timestepGuid);

                T tsi = null;
                if (MyRank == 0)
                {
                    using (Stream s = fsDriver.GetTimestepStream(false, timestepGuid))
                    {
                        tsi         = (T)Driver.Deserialize(s, typeof(T));
                        tsi.Session = session;
                        s.Close();
                    }
                    tsi.ID = timestepGuid;
                }
                tsi           = tsi.MPIBroadcast(0);
                tsi.Database  = database;
                tsi.WriteTime = Utils.GetTimestepFileWriteTime(tsi);
                return(tsi);
            }
        }