Ignore:
Timestamp:
Jul 30, 2012, 6:14:22 PM (12 years ago)
Author:
alain
Message:

Introducing support for distributed schedulers in the "memo" tool.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/memo/src/memo.cpp

    r173 r187  
    3939#include "memo.h"
    4040
    41 //#define MOVER_DEBUG
     41//#define MOVER_DEBUG 
    4242
    4343MeMo::MeMo( const std::string &filename,
     
    203203// various mapping_info data structure access functions
    204204/////////////////////////////////////////////////////////////////////////////
    205 
     205mapping_cluster_t* MeMo::get_cluster_base( mapping_header_t* header )
     206{
     207    return   (mapping_cluster_t*) ((char*)header +
     208                                  MAPPING_HEADER_SIZE);
     209}
    206210/////////////////////////////////////////////////////////////////////////////
    207211mapping_pseg_t* MeMo::get_pseg_base( mapping_header_t* header )
     
    332336} // end print_mapping_info()
    333337
    334 //////////////////////////////////////////
    335 void MeMo::pseg_map( mapping_pseg_t* pseg)
    336 {
    337     std::string name(pseg->name);
    338     m_psegh.m_pSegs.push_back(PSeg(name, pseg->base, pseg->length));
    339 }
    340 
    341338
    342339//////////////////////////////////////////
     
    536533    mapping_header_t*   header = (mapping_header_t*)desc; 
    537534
     535    mapping_cluster_t*  cluster = get_cluster_base( header );     
    538536    mapping_vspace_t*   vspace = get_vspace_base( header );     
    539537    mapping_pseg_t*     pseg   = get_pseg_base( header );
     
    546544#endif
    547545
    548     for ( size_t pseg_id = 0 ; pseg_id < header->psegs ; pseg_id++ )
    549     {
    550         pseg_map( &pseg[pseg_id]);
     546#ifdef DISTRIBUTED_SCHEDULERS
     547    char found;
     548#endif
     549
     550    for ( size_t cluster_id = 0 ; cluster_id < header->clusters ; cluster_id++ )
     551    {
     552
     553#ifdef DISTRIBUTED_SCHEDULERS
     554        found    = 0;
     555#endif
     556
     557        for ( size_t pseg_id = cluster[cluster_id].pseg_offset ;
     558              pseg_id < cluster[cluster_id].pseg_offset + cluster[cluster_id].psegs ;
     559              pseg_id++ )
     560        {
     561            //build pseg
     562            std::string name(pseg[pseg_id].name);
     563            PSeg *ps = new PSeg(name, pseg[pseg_id].base, pseg[pseg_id].length);
     564
     565#ifdef DISTRIBUTED_SCHEDULERS
     566            if ( (pseg[pseg_id].type == PSEG_TYPE_RAM) && (found == 0) )
     567            {
     568                ps->incNextLma( (cluster[cluster_id].procs << 12) );
     569                found  = 1;
     570            }
     571#endif
     572            m_psegh.m_pSegs.push_back(*ps);
     573
     574        }
    551575    }
    552576
Note: See TracChangeset for help on using the changeset viewer.