<commit_before>// set_intersection example
#include <iostream>     // std::cout
#include <algorithm>    // std::set_union, std::sort
#include <vector>       // std::vector
#include <iterator>
#include <ctime>        // std::time
#include <parallel/algorithm>
#include "microbench.h"


#define DATA_SIZE 1000*1000*500
//#define DATA_SIZE 1000

//int RandomNumber () { return (std::rand()%100); }

//class generator:
struct c_unique {
  int current;
  c_unique() {current=1;}
  int operator()() {
    current += 2; 
    return current;
  }
} OddNumber;

struct c_unique_1 {
  int current;
  c_unique_1() {current=0;}
  int operator()() {
    current += 2; 
    return current;
  }
} EvenNumber;

struct c_unique_2 {
  int current;
  c_unique_2() {current=1;}
  int operator()() {
    return current;
  }
} ConstNumber;



unsigned int data_size = 0;

// @INPUT:
// first: sequential odd number 
// sencond: sequential even number 
// Note: both inputs are sequential to reduce initialization time

//  std::vector<int> first(DATA_SIZE);
//  std::vector<int> second(DATA_SIZE);
//  std::vector<int> v(DATA_SIZE);                     
  std::vector<int> first(data_size);
  std::vector<int> second(data_size);
  std::vector<int> v(data_size);                     

int main (int argc, char * argv[]) {
    SET_INPUT_SIZE(argc, argv[1])
    first.resize(data_size);
    second.resize(data_size);
    v.resize(data_size);
    

    struct timeval start, end;
    fprintf(stderr, "omp num threads %d\n", omp_get_max_threads());
    
    __gnu_parallel::generate (first.begin(), first.end(), ConstNumber, __gnu_parallel::sequential_tag());
    __gnu_parallel::generate (second.begin(), second.end(), EvenNumber, __gnu_parallel::sequential_tag());
 
    fprintf(stderr, "initialization done...\n");
//    std::vector<int>::iterator it;  
//    it = __gnu_parallel::set_intersection(first.begin(), first.end(), second.begin(), second.end(), v.begin());<commit_msg>Fix STL set_intersection.cpp segment fault when running w/ xtern.<commit_after>// set_intersection example
#include <iostream>     // std::cout
#include <algorithm>    // std::set_union, std::sort
#include <vector>       // std::vector
#include <iterator>
#include <ctime>        // std::time
#include <parallel/algorithm>
#include "microbench.h"


#define DATA_SIZE 1000*1000*500
//#define DATA_SIZE 1000

//int RandomNumber () { return (std::rand()%100); }

//class generator:
struct c_unique {
  int current;
  c_unique() {current=1;}
  int operator()() {
    current += 2; 
    return current;
  }
} OddNumber;

struct c_unique_1 {
  int current;
  c_unique_1() {current=0;}
  int operator()() {
    current += 2; 
    return current;
  }
} EvenNumber;

struct c_unique_2 {
  int current;
  c_unique_2() {current=1;}
  int operator()() {
    return current;
  }
} ConstNumber;



unsigned int data_size = 0;

// @INPUT:
// first: sequential odd number 
// sencond: sequential even number 
// Note: both inputs are sequential to reduce initialization time

//  std::vector<int> first(DATA_SIZE);
//  std::vector<int> second(DATA_SIZE);
//  std::vector<int> v(DATA_SIZE);                     
  std::vector<int> first(data_size);
  std::vector<int> second(data_size);
  std::vector<int> v(data_size);                     

int main (int argc, char * argv[]) {
    SET_INPUT_SIZE(argc, argv[1])
    first.resize(data_size);
    second.resize(data_size);
    v.resize(data_size);
    

    struct timeval start, end;
    fprintf(stderr, "omp num threads %d\n", omp_get_max_threads());
    
    __gnu_parallel::generate (first.begin(), first.end(), OddNumber, __gnu_parallel::sequential_tag());
    __gnu_parallel::generate (second.begin(), second.end(), EvenNumber, __gnu_parallel::sequential_tag());
 
    fprintf(stderr, "initialization done...\n");
//    std::vector<int>::iterator it;  
//    it = __gnu_parallel::set_intersection(first.begin(), first.end(), second.begin(), second.end(), v.begin());
{'fraction_non_alphanumeric': 0.15689742294087924, 'fraction_numerical': 0.014653865588681153, 'mean_word_length': 3.6358313817330212, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, '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': '4802488', 'n_tokens_mistral': 1348, 'n_tokens_neox': 1284, 'n_words': 301}