<commit_before>#include "simulator.h"
#include "performance_modeler.h"
#include "core_manager.h"

PerformanceModeler::PerformanceModeler()
{
   UInt32 num_local_cores = Config::getSingleton()->getNumLocalCores();
   m_performance_models = new PerformanceModel[num_local_cores];
}

PerformanceModeler::~PerformanceModeler()
{
   UInt32 num_local_cores = Config::getSingleton()->getNumLocalCores();
   UInt32 proc_id = Config::getSingleton()->getCurrentProcessNum();
   const Config::CoreList &local_cores = Config::getSingleton()->getCoreListForProcess(proc_id);

   fprintf(stderr, "Model Summary:\n", num_local_cores);
   for(unsigned int i = 0; i < num_local_cores; i++)
   {
       fprintf(stderr, "Core: %d\n", local_cores[i]);
       fprintf(stderr, "  Instructions: %lld\n", m_performance_models[i].getInstructionCount());
       fprintf(stderr, "  Cycles: %lld\n", m_performance_models[i].getCycleCount());
   }


    delete [] m_performance_models;
    m_performance_models = NULL;
}


PerformanceModel* PerformanceModeler::getPerformanceModel()
{
   UInt32 core_index = Sim()->getCoreManager()->getCoreIndexFromTID(Sim()->getCoreManager()->getCurrentTID());
   return &m_performance_models[core_index];
}

PerformanceModel* PerformanceModeler::getPerformanceModelForCore(core_id_t core_id)<commit_msg>[performance_model] Correct the output arguments for the output summary.<commit_after>#include "simulator.h"
#include "performance_modeler.h"
#include "core_manager.h"

PerformanceModeler::PerformanceModeler()
{
   UInt32 num_local_cores = Config::getSingleton()->getNumLocalCores();
   m_performance_models = new PerformanceModel[num_local_cores];
}

PerformanceModeler::~PerformanceModeler()
{
   UInt32 num_local_cores = Config::getSingleton()->getNumLocalCores();
   UInt32 proc_id = Config::getSingleton()->getCurrentProcessNum();
   const Config::CoreList &local_cores = Config::getSingleton()->getCoreListForProcess(proc_id);

   fprintf(stderr, "Model Summary:\n");
   for(unsigned int i = 0; i < num_local_cores; i++)
   {
       fprintf(stderr, "Core: %d\n", local_cores[i]);
       fprintf(stderr, "  Instructions: %lld\n", m_performance_models[i].getInstructionCount());
       fprintf(stderr, "  Cycles: %lld\n", m_performance_models[i].getCycleCount());
   }


    delete [] m_performance_models;
    m_performance_models = NULL;
}


PerformanceModel* PerformanceModeler::getPerformanceModel()
{
   UInt32 core_index = Sim()->getCoreManager()->getCoreIndexFromTID(Sim()->getCoreManager()->getCurrentTID());
   return &m_performance_models[core_index];
}

PerformanceModel* PerformanceModeler::getPerformanceModelForCore(core_id_t core_id)
{'fraction_non_alphanumeric': 0.135236664162284, 'fraction_numerical': 0.0067618332081141996, 'mean_word_length': 6.674351585014409, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '246054', 'n_tokens_mistral': 880, 'n_tokens_neox': 824, 'n_words': 128}