<commit_before>#include <syscall.h>
#include <sched.h>
#include <iostream>

#include "mcp.h"
#include "config.h"
#include "tile_manager.h"
#include "log.h"
#include "tile.h"
#include "simulator.h"
#include "syscall.h"
#include "thread_manager.h"
#include "thread_scheduler.h"

using namespace std;

MCP::MCP(Network & network)
   : m_finished(false)
   , m_network(network)
   , m_MCP_SERVER_MAX_BUFF(256*1024)
   , m_scratch(new char[m_MCP_SERVER_MAX_BUFF])
   , m_vm_manager()
   , m_syscall_server(m_network, m_send_buff, m_recv_buff, m_MCP_SERVER_MAX_BUFF, m_scratch)
   , m_sync_server(m_network, m_recv_buff)
   , m_clock_skew_management_server(NULL)
{
   m_clock_skew_management_server = ClockSkewManagementServer::create(Sim()->getCfg()->getString("clock_skew_management/scheme"), m_network, m_recv_buff);
}

MCP::~MCP()
{
   if (m_clock_skew_management_server)
      delete m_clock_skew_management_server;
   delete [] m_scratch;
}

void MCP::processPacket()
{
   m_send_buff.clear();
   m_recv_buff.clear();

   NetPacket recv_pkt;

   NetMatch match;
   match.types.push_back(MCP_REQUEST_TYPE);
   match.types.push_back(MCP_SYSTEM_TYPE);
   recv_pkt = m_network.netRecv(match);

   m_recv_buff << make_pair(recv_pkt.data, recv_pkt.length);

   int msg_type;

   m_recv_buff >> msg_type;

   LOG_PRINT("MCP message type(%i), sender(%i,%i)", (SInt32) msg_type, recv_pkt.sender.tile_id, recv_pkt.sender.core_type);

   switch (msg_type)
   {
   case MCP_MESSAGE_SYS_CALL:
      m_syscall_server.handleSyscall(recv_pkt.sender);<commit_msg>あとでよく読む<commit_after>#include <syscall.h>
#include <sched.h>
#include <iostream>

#include "mcp.h"
#include "config.h"
#include "tile_manager.h"
#include "log.h"
#include "tile.h"
#include "simulator.h"
#include "syscall.h"
#include "thread_manager.h"
#include "thread_scheduler.h"

using namespace std;

MCP::MCP(Network & network)
   : m_finished(false)
   , m_network(network)
   , m_MCP_SERVER_MAX_BUFF(256*1024)
   , m_scratch(new char[m_MCP_SERVER_MAX_BUFF])
   , m_vm_manager()
   , m_syscall_server(m_network, m_send_buff, m_recv_buff, m_MCP_SERVER_MAX_BUFF, m_scratch)
   , m_sync_server(m_network, m_recv_buff)
   , m_clock_skew_management_server(NULL)
{
   m_clock_skew_management_server = ClockSkewManagementServer::create(Sim()->getCfg()->getString("clock_skew_management/scheme"), m_network, m_recv_buff);
}

MCP::~MCP()
{
   if (m_clock_skew_management_server)
      delete &m_clock_skew_management_server;
   delete [] m_scratch;
}

void MCP::processPacket()
{
   m_send_buff.clear();
   m_recv_buff.clear();

   NetPacket recv_pkt;

   NetMatch match;
   match.types.push_back(MCP_REQUEST_TYPE);
   match.types.push_back(MCP_SYSTEM_TYPE);
   recv_pkt = m_network.netRecv(match);

   m_recv_buff << make_pair(recv_pkt.data, recv_pkt.length);

   int msg_type;

   m_recv_buff >> msg_type;

   LOG_PRINT("MCP message type(%i), sender(%i,%i)", (SInt32) msg_type, recv_pkt.sender.tile_id, recv_pkt.sender.core_type);

   switch (msg_type)
   {
   case MCP_MESSAGE_SYS_CALL:
      m_syscall_server.handleSyscall(recv_pkt.sender);
{'fraction_non_alphanumeric': 0.1286038224813735, 'fraction_numerical': 0.0058309037900874635, 'mean_word_length': 5.612419700214133, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 17, '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': '5245673', 'n_tokens_mistral': 1276, 'n_tokens_neox': 1237, 'n_words': 171}