<commit_before>#include "config.h"

#define DEBUG

using namespace std;

Config::Config()
{
   UInt32 i, j;

   // FIXME: These are temporary defaults.  Eventually, we'll load these from
   // a file or the command line.

   if (g_knob_num_process == 0) {
      cerr << "\nWARNING: Using compatibility mode for number of processes!\n"
	   << "  Assuming number of processes = 1.\n"
	   << "  Please use the -np command-line argument in the future.\n"
	   << endl;
      num_process = 1;
   } else {      
      num_process = g_knob_num_process;
   }
   my_proc_num = 0;
   // Default location for MCP is process 0
   MCP_process = 0;

   if (g_knob_total_cores == 0) {
      // Backwards compatibility mode (in case the user does not specify
      // the -tc command line argument)
      cerr << "\nWARNING: Using compatibility mode for total number of cores!\n"
	   << "  Assuming all cores are in one process.\n"
	   << "  Please use the -tc command-line argument in the future.\n"
	   << endl;
      total_cores = g_knob_num_cores;
   } else {
      total_cores = g_knob_total_cores;
   }

   // Sanity check on number of process and cores.  FIXME: For now, assume
   //  all processes have the same number of cores.
   assert((num_process*g_knob_num_cores) == total_cores);

   //Add one to account for the MCP
   total_cores += 1;

   num_modules = new UInt32[num_process];
   // FIXME: This assumes that every process has the same number of modules.
   //  Each entry should be filled in with a different value.
   for (i=0; i<num_process; i++) { num_modules[i] = g_knob_num_cores; }  
  
   // Create an empty list for each process
   core_map = new CoreList[num_process];

   // FIXME: This code is temporary and is only here until we have a final
   //  mechanism for reading the list of cores in each process.
   // Since we only have one process, fill in its list with all the core #'s
   UInt32 k = 0;
   for (i=0; i<num_process; i++) {
      for (j=0; j<num_modules[i]; j++) {
	 		core_map[i].push_back(k++);
      }
   }

#ifdef DEBUG  <commit_msg>[config] Properly setup the core map based on an extra MCP thread.<commit_after>#include "config.h"

#define DEBUG

using namespace std;

Config::Config()
{
   UInt32 i, j;

   // FIXME: These are temporary defaults.  Eventually, we'll load these from
   // a file or the command line.

   if (g_knob_num_process == 0) {
      cerr << "\nWARNING: Using compatibility mode for number of processes!\n"
	   << "  Assuming number of processes = 1.\n"
	   << "  Please use the -np command-line argument in the future.\n"
	   << endl;
      num_process = 1;
   } else {      
      num_process = g_knob_num_process;
   }
   my_proc_num = 0;
   // Default location for MCP is process 0
   MCP_process = 0;

   if (g_knob_total_cores == 0) {
      // Backwards compatibility mode (in case the user does not specify
      // the -tc command line argument)
      cerr << "\nWARNING: Using compatibility mode for total number of cores!\n"
	   << "  Assuming all cores are in one process.\n"
	   << "  Please use the -tc command-line argument in the future.\n"
	   << endl;
      total_cores = g_knob_num_cores;
   } else {
      total_cores = g_knob_total_cores;
   }

   // Sanity check on number of process and cores.  FIXME: For now, assume
   //  all processes have the same number of cores.
   assert((num_process*g_knob_num_cores) == total_cores);

   //Add one to account for the MCP
   total_cores += 1;

   num_modules = new UInt32[num_process];
   // FIXME: This assumes that every process has the same number of modules.
   //  Each entry should be filled in with a different value.
   for (i=0; i<num_process; i++) { num_modules[i] = total_cores; }  
  
   // Create an empty list for each process
   core_map = new CoreList[num_process];

   // FIXME: This code is temporary and is only here until we have a final
   //  mechanism for reading the list of cores in each process.
   // Since we only have one process, fill in its list with all the core #'s
   UInt32 k = 0;
   for (i=0; i<num_process; i++) {
      for (j=0; j<num_modules[i]; j++) {
	 		core_map[i].push_back(k++);
      }
   }

#ifdef DEBUG  
{'fraction_non_alphanumeric': 0.10091083413231064, 'fraction_numerical': 0.00862895493767977, 'mean_word_length': 2.676651982378855, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 3, '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': '6679088', 'n_tokens_mistral': 1410, 'n_tokens_neox': 1323, 'n_words': 501}