<commit_before>#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <omp.h>

int main(int argc, char *argv[])
{
  unsigned long long int i,j,limit;
  bool *primes;
  double start_t,end_t;

  limit=500000000;

  start_t=omp_get_wtime();

  primes = malloc(sizeof(bool)*limit);

#pragma omp parallel shared(primes) private(i,j) firstprivate(limit)
  {
    /* fill boolean array */
#pragma omp for
    for (i=2;i<limit;i++)
      {
	primes[i]=1;
      }
    /* Sieve of Eratosthenes */
#pragma omp for
    for (i=2;i<limit;i++)
      {
	if (primes[i])
	  {
	    for (j=i;i*j<limit;j++)
	      {
		primes[i*j]=0;
	      }
	  }
      }
  }
  
  end_t=omp_get_wtime();
  
  printf("Took %g s\n",end_t - start_t);
  return EXIT_SUCCESS;
}

<commit_msg>primes omp still not scaling well<commit_after>#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <omp.h>

int main(int argc, char *argv[])
{
  unsigned long long int i,j,limit;
  bool *primes;
  double start_t,end_t;

  limit=500000000;

  start_t=omp_get_wtime();

  primes = malloc(sizeof(bool)*limit);

#pragma omp parallel default(none) shared(primes) private(j) firstprivate(limit)
  {
    /* fill boolean array */
#pragma omp for schedule(static)
    for (i=2;i<limit;i++)
      {
	primes[i]=1;
      }
    /* Sieve of Eratosthenes */
#pragma omp for schedule(static)
    for (i=2;i<limit;i++)
      {
	if (primes[i])
	  {
	    for (j=i;i*j<limit;j++)
	      {
		primes[i*j]=0;
	      }
	  }
      }
  }
  
  end_t=omp_get_wtime();
  
  printf("Took %g s\n",end_t - start_t);
  return EXIT_SUCCESS;
}


{'fraction_non_alphanumeric': 0.16309823677581864, 'fraction_numerical': 0.0163727959697733, 'mean_word_length': 3.0432569974554706, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '4404617', 'n_tokens_mistral': 704, 'n_tokens_neox': 664, 'n_words': 130}