<commit_before>/**
* @version		GrPPI v0.1
* @copyright		Copyright (C) 2017 Universidad Carlos III de Madrid. All rights reserved.
* @license		GNU/GPL, see LICENSE.txt
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You have received a copy of the GNU General Public License in LICENSE.txt
* also available in <http://www.gnu.org/licenses/gpl.html>.
*
* See COPYRIGHT.txt for copyright notices and details.
*/
#include <iostream>
#include <vector>
#include <fstream>
#include <chrono>
#include <string>
#include "map.h"


void map_example1(int n, auto &p) {
		
    std::vector<int> in(n);
		std::iota(in.begin(), in.end(), 0);
    std::vector<int> out(n);
    
    grppi::map(p, in.begin(), in.end(), out.begin(), [&](int i){ return i*2; });

    for(int i=0;i<in.size();i++)
        std::cout << out[i] << " ";
    std::cout << "\n";
}

int main(int argc, char **argv) {

	if(argc < 3){
		printf("Invalid number of arguments. Usage: ./binary <problem_size> <SEQ|THR|TBB|OMP>\n");
		return -1;
	}

	int n = stoi(argv[1], nullptr, 10);
	if(n <= 0){
		printf("Invalid problem size. Use a positive integer number.\n");
		return -1;
	}

    if(!strcmp("SEQ", argv[2])){
    		grppi::sequential_execution p{};
				map_example1(n,p);
		}else if (!strcmp("THR", argv[2])){
        grppi::parallel_execution_thr p{};
        map_example1(n,p);<commit_msg>Removed some spaces in the code<commit_after>/**
* @version		GrPPI v0.1
* @copyright		Copyright (C) 2017 Universidad Carlos III de Madrid. All rights reserved.
* @license		GNU/GPL, see LICENSE.txt
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You have received a copy of the GNU General Public License in LICENSE.txt
* also available in <http://www.gnu.org/licenses/gpl.html>.
*
* See COPYRIGHT.txt for copyright notices and details.
*/
#include <iostream>
#include <vector>
#include <fstream>
#include <chrono>
#include <string>
#include "map.h"


void map_example1(int n, auto &p) {
		
    std::vector<int> in(n);
    std::iota(in.begin(), in.end(), 0);
    std::vector<int> out(n);
    
    grppi::map(p, in.begin(), in.end(), out.begin(), [&](int i){ return i*2; });

    for(int i=0;i<in.size();i++)
        std::cout << out[i] << " ";
    std::cout << "\n";
}

int main(int argc, char **argv) {

    if(argc < 3){
        printf("Invalid number of arguments. Usage: ./binary <problem_size> <SEQ|THR|TBB|OMP>\n");
        return -1;
	  }

    int n = stoi(argv[1], nullptr, 10);
    if(n <= 0){
        printf("Invalid problem size. Use a positive integer number.\n");
        return -1;
    }

    if(!strcmp("SEQ", argv[2])){
        grppi::sequential_execution p{};
        map_example1(n,p);
    }else if (!strcmp("THR", argv[2])){
        grppi::parallel_execution_thr p{};
        map_example1(n,p);
{'fraction_non_alphanumeric': 0.14504652435686918, 'fraction_numerical': 0.0120415982484948, 'mean_word_length': 3.591708542713568, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '3849167', 'n_tokens_mistral': 1247, 'n_tokens_neox': 1188, 'n_words': 418}