<commit_before>#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <math.h>
#include "results.h"

void write_results(timer* t, char* inputfile, int thread_count, char algorithm, int size) {
	//clock time
	#ifdef __linux__ // || _unix_ || _unix
		struct timespec spec;
		clock_gettime(CLOCK_REALTIME, &spec);
		long timestamp = floor(spec.tv_sec * 1.0e8 + spec.tv_nsec / 100.0);
	# else
    	long timestamp = 0;
	#endif

    //date and time as string
	time_t rawtime;
	time(&rawtime);
	struct tm *timeinfo = localtime(&rawtime);
	char datetime[100];
	strftime((char*) &datetime, 80, "%Y-%m-%d %H:%M:%S", timeinfo);

	//filename
	char filename[200];
	if (algorithm == 'S') {
		sprintf((char*) &filename, "results/%c.txt", algorithm);
	} else {
		sprintf((char*) &filename, "results/%c%i.txt", algorithm, thread_count);
	}

   	//write to file
	FILE* f = fopen(filename, "a");
	if (f == NULL) {
		puts("Fail writing result file!");
		puts(filename);
		exit(0);
	}
	fprintf(f, "%s\t%s\t%li\t%i\t%i\t%.9f\t%.9f\t%i\t%.9f\t\n",
			inputfile,
			datetime,
			timestamp,
			thread_count,
			0,
			t->timeval_diff,
			t->timespec_diff,
			(int) t->clock_diff,
			t->clock_diff_time);

	fclose(f);
}<commit_msg>fixed matrix size on result file<commit_after>#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <math.h>
#include "results.h"

void write_results(timer* t, char* inputfile, int thread_count, char algorithm, int size) {
	//clock time
	#ifdef __linux__ // || _unix_ || _unix
		struct timespec spec;
		clock_gettime(CLOCK_REALTIME, &spec);
		long timestamp = floor(spec.tv_sec * 1.0e8 + spec.tv_nsec / 100.0);
	# else
    	long timestamp = 0;
	#endif

    //date and time as string
	time_t rawtime;
	time(&rawtime);
	struct tm *timeinfo = localtime(&rawtime);
	char datetime[100];
	strftime((char*) &datetime, 80, "%Y-%m-%d %H:%M:%S", timeinfo);

	//filename
	char filename[200];
	if (algorithm == 'S') {
		sprintf((char*) &filename, "results/%c.txt", algorithm);
	} else {
		sprintf((char*) &filename, "results/%c%i.txt", algorithm, thread_count);
	}

   	//write to file
	FILE* f = fopen(filename, "a");
	if (f == NULL) {
		puts("Fail writing result file!");
		puts(filename);
		exit(0);
	}
	fprintf(f, "%s\t%s\t%li\t%i\t%i\t%.9f\t%.9f\t%i\t%.9f\t\n",
			inputfile,
			datetime,
			timestamp,
			thread_count,
			size,
			t->timeval_diff,
			t->timespec_diff,
			(int) t->clock_diff,
			t->clock_diff_time);

	fclose(f);
}
{'fraction_non_alphanumeric': 0.1821138211382114, 'fraction_numerical': 0.016666666666666666, 'mean_word_length': 3.844488188976378, 'pattern_counts': {'":': 0, '<': 11, '<?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': '3773234', 'n_tokens_mistral': 1066, 'n_tokens_neox': 982, 'n_words': 221}