예제 #1
0
void resources_input::writeout_old(string env_var, resources &r)
{
  mapping_t map;
  string warning = "";
  if (!map_to(r, map, warning)){
    cout << "DMTCP_DISCOVER_RM_ERROR=\'Cannot map initial resources into the restart allocation\'" << endl;
    return;
  }
  if( warning != "" ){
    cout << "DMTCP_DISCOVER_RM_WARNING=\'" << warning << "\'" << endl;
  }

  cout << env_var + "=\'" << endl;
  for (size_t i = 0; i < r.ssize(); i++) {
    if (map[i].size()) {
      cout << ":: " + r[i].name + " :" + sorted_v[0]->mode + ": ";
      for (size_t j = 0; j < map[i].size(); j++) {
        int k = map[i][j];
        string name = sorted_v[k]->name;
        slots_v &v = node_ckpt_map[name];
        slots_v::iterator it = v.begin();
        for(; it != v.end(); it++){
            cout << (*it) + " ";
        }
      }
      cout << endl;
    }
  }
  cout << "\'" << endl;
}
예제 #2
0
    void Resources::collect(resources& r)
    {
        for (resourcesMap::const_iterator i = _resourcesMap.cbegin(); i != _resourcesMap.cend(); ++i)
        {
            spResource res = i->second;
            r.push_back(res);
        }

    }
예제 #3
0
    void _initializeResources()
    {
        debug::log::println ("initializing resource managers ...");

        _resourceManagers.configFilesManager().addFileSearchLocation ("config");
        _resourceManagers.exs3dMeshesManager().addFileSearchLocation ("resources/models");
        _resourceManagers.gpuProgramsManager().addFileSearchLocation ("resources/shaders");
        _resourceManagers.vertexShadersManager().addFileSearchLocation ("resources/shaders");
        _resourceManagers.fragmentShadersManager().addFileSearchLocation ("resources/shaders");
        _resourceManagers.geometryShadersManager().addFileSearchLocation ("resources/shaders");
        _resourceManagers.fontsManager().addFileSearchLocation ("resources/fonts");
        _resourceManagers.texturesManager().addFileSearchLocation ("resources/textures");

        _resourceManagers.addFilesSearchLocation ("resources");
    }
예제 #4
0
    void Resources::collect(resources& r)
    {
#ifdef __S3E__
        for (resourcesMap::const_iterator i = _resourcesMap.begin(); i != _resourcesMap.end(); ++i)
#else
        for (resourcesMap::const_iterator i = _resourcesMap.cbegin(); i != _resourcesMap.cend(); ++i)
#endif
        {
            spResource res = i->second;
            r.push_back(res);
        }

    }
예제 #5
0
    particle_system_object::particle_system_object (const transform_d &transform, resources &res)
        : transformable_renderable_object (transform)
    {
        auto particleShaderId = gpu_program::id (particle_vertex_layout::alloc(),
                                                  "particles/particle.vert", "particles/particle.geom",
                                                  "particles/particle.frag");

        auto particleShader = res.gpuProgramsManager().request (particleShaderId, res);
        _material = material::alloc (technique::alloc (particleShader));
        _material->set ("uTexture", res.requestFromFile<texture> ("SmokeShape.png"));

        _generateVertexBuffer();
    }
예제 #6
0
void resources_input::writeout_new(string env_var, resources &r)
{
  mapping_t map;
  string warning = "";
  if (!map_to(r, map, warning)){
    cout << "DMTCP_DISCOVER_RM_ERROR=\'Cannot map initial resources into the restart allocation\'" << endl;
    return;
  }
  if( warning != "" ){
    cout << "DMTCP_DISCOVER_RM_WARNING=\'" << warning << "\'" << endl;
  }

  cout << env_var + "_NODES=" << r.ssize() << endl;

  bool has_srv_slots = false;
  for (size_t i = 0; i < r.ssize(); i++) {
    if (map[i].size()) {
      int slots_cnt = 0, slot_num;
      for (size_t j = 0; j < map[i].size(); j++) {
        int k = map[i][j];
        string name = sorted_v[k]->name;
        slots_v &v = node_ckpt_map[name];
        slots_cnt += v.size();
        has_srv_slots = has_srv_slots || node_map[name].srv_slots > 0;
      }

      if( !has_srv_slots ){
        std::cout << env_var + "_" << r[i].id << "_SLOTS=" << slots_cnt << std::endl;

        slot_num = 0;
        for (size_t j = 0; j < map[i].size(); j++) {
          int k = map[i][j];
          string name = sorted_v[k]->name;
          slots_v &v = node_ckpt_map[name];
          slots_v::iterator it = v.begin();
          for(; it != v.end(); it++){
            std::cout << env_var + "_" << r[i].id << "_" << slot_num;
            std::cout  << "=\'" << (*it) << "\'" << endl;
            slot_num++;
          }
        }
      }else{
          slots_cnt = 1;
          std::cout << env_var + "_" << r[i].id << "_SLOTS=" << slots_cnt << std::endl;
          slot_num = 0;
          std::cout << env_var + "_" << r[i].id << "_" << slot_num << "=\'";
          for (size_t j = 0; j < map[i].size(); j++) {
            int k = map[i][j];
            string name = sorted_v[k]->name;
            slots_v &v = node_ckpt_map[name];
            slots_v::iterator it = v.begin();
            for(; it != v.end(); it++){
              std::cout  << (*it) << " " << endl;
            }
          }
          std::cout << "\'" << std::endl;
      }
    }else{
        cout << env_var + "_" << r[i].id << "_SLOTS=0";
    }
  }
}