示例#1
0
PtexMetaData* PtexReader::getMetaData()
{
    AutoLockCache locker(_cache->cachelock);
    if (_metadata) _metadata->ref();
    else readMetaData();
    return _metadata;
}
示例#2
0
bool Caching_Stream::open(const Input_Stream_Position& position)
{
    bool status;
    
    if (CFURLResourceIsReachable(m_metaDataUrl, NULL) &&
        CFURLResourceIsReachable(m_fileUrl, NULL)) {
        m_cacheable = false;
        m_writable  = false;
        m_useCache  = true;
        m_cacheMetaDataWritten = false;
        
        readMetaData();
        
        CS_TRACE("Playing file from cache\n");
        CS_TRACE_CFURL(m_fileUrl);
        
        status = m_fileStream->open(position);
    } else {
        m_cacheable = false;
        m_writable  = false;
        m_useCache  = false;
        m_cacheMetaDataWritten = false;
        
        CS_TRACE("File not cached\n");
        
        status = m_target->open(position);
    }
    
    return status;
}
示例#3
0
文件: VTK.cpp 项目: flbernard/bitpit
/*!
 * Reads entire VTK file (headers and data).
 */
void VTK::read( ){

    readMetaData( );
    readData( ) ;

    return ;
};
示例#4
0
 /// read only the meta data from a meta ARH file
 inline int readMetaData(std::string filename,
                         std::map<int, int>& elInRank,
                         std::map<int, int>& elCodeSize)
 {
   std::string tmp;
   return readMetaData(filename, elInRank, elCodeSize, tmp);
 }
示例#5
0
const DemoMetaData &DemoInfo::getMetaData()
{
    if( !hasMetaData ) {
        hasMetaData = true;
        readMetaData();
    }
    return metaData;
}
示例#6
0
void
IRTranslator::translateFCall(const NormalizedInstruction& i) {
  auto const numArgs = i.imm[0].u_IVA;

  const PC after = m_hhbcTrans.curUnit()->at(i.nextSk().offset());
  const Func* srcFunc = m_hhbcTrans.curFunc();
  Offset returnBcOffset =
    srcFunc->unit()->offsetOf(after - srcFunc->base());

  /*
   * If we have a calleeTrace, we're going to see if we should inline
   * the call.
   */
  if (i.calleeTrace) {
    if (!i.calleeTrace->m_inliningFailed) {
      assert(shouldIRInline(m_hhbcTrans.curFunc(), i.funcd, *i.calleeTrace));

      m_hhbcTrans.beginInlining(numArgs, i.funcd, returnBcOffset);
      static const bool shapeStats = Stats::enabledAny() &&
                                     getenv("HHVM_STATS_INLINESHAPE");
      if (shapeStats) {
        m_hhbcTrans.profileInlineFunctionShape(traceletShape(*i.calleeTrace));
      }

      Unit::MetaHandle metaHand;
      for (auto* ni = i.calleeTrace->m_instrStream.first;
           ni; ni = ni->next) {
        readMetaData(metaHand, *ni, m_hhbcTrans, false, MetaMode::Legacy);
        translateInstr(*ni);
      }
      return;
    }

    static const auto enabled = Stats::enabledAny() &&
                                getenv("HHVM_STATS_FAILEDINL");
    if (enabled) {
      m_hhbcTrans.profileFunctionEntry("FailedCandidate");
      m_hhbcTrans.profileFailedInlShape(traceletShape(*i.calleeTrace));
    }
  }

  HHIR_EMIT(FCall, numArgs, returnBcOffset, i.funcd,
            JIT::callDestroysLocals(i, m_hhbcTrans.curFunc()));
}
示例#7
0
      void readMeta(string filename, vector<DOFVector<double>*> vecs)
      {
        FUNCNAME("ArhReader::readMeta()");

        Mesh* mesh = NULL;
        for(size_t i = 0; i < vecs.size(); i++)
        {
          if(vecs[i])
          {
            if(!mesh)
              mesh = vecs[i]->getFeSpace()->getMesh();
            else
              TEST_EXIT(mesh == vecs[i]->getFeSpace()->getMesh())
              ("The mesh of the DOFVectors should be the same for Reader because in one file there is only one mesh.\n");
          }
        }
        if(!mesh)
        {
          WARNING("You haven't specified the target.\n");
          return;
        }
        // === Read the meta arh file. ===

        string arhPrefix = "";
        map<int, int> elInRank;
        map<int, int> elCodeSize;
        int nProc = readMetaData(filename, elInRank, elCodeSize, arhPrefix);


        // === Check which arh files must be read by current rank. ===

        // Set of all file indices which should be read to restore all macro elements.
        std::set<int> readArhFiles;

        TraverseStack stack;
        ElInfo* elInfo = stack.traverseFirst(mesh, 0, Mesh::CALL_EL_LEVEL);
        while (elInfo)
        {
          int macroElIndex = elInfo->getElement()->getIndex();
          TEST_EXIT(elInRank.count(macroElIndex))("Should not happen!\n");
          readArhFiles.insert(elInRank[macroElIndex]);
          elInfo = stack.traverseNext(elInfo);
        }


        // === Read the individual arh files. ===

        boost::filesystem::path p(filename.c_str());
        boost::filesystem::path directory = p.parent_path();

        for (std::set<int>::iterator it = readArhFiles.begin();
             it != readArhFiles.end(); ++it)
        {
          string arhFilename = directory.string() + "/" + arhPrefix;
          if (nProc == 1)
            arhFilename += ".arh";
          else
            arhFilename += "-p" + std::to_string(*it) + "-.arh";

          MSG("ARH file read from: %s\n", arhFilename.c_str());
          detail::read(arhFilename, mesh, vecs);
        }
      }