<jupyter_start><jupyter_text><jupyter_code>#<NAME> 18BCE2030
#Demo on How to run openMP program on Google Colab
code = """
#include <time.h>
// OpenMP header 
#include <omp.h>   
#include <stdio.h>

int main() 
{ 
         
    clock_t start, end;
    double cpu_time_used;
     
    start = clock();
    // Beginning of parallel region 
    #pragma omp parallel 
    { 
        printf("Hello World... from thread = %d \\n", omp_get_thread_num()); 
    } 
    // Ending of paralSlel region 
    end = clock();
    cpu_time_used = ((double) (end - start)) / CLOCKS_PER_SEC;
    printf("%f", cpu_time_used);
}
"""
text_file = open("code.c", "w")
text_file.write(code)
text_file.close()
%env OMP_NUM_THREADS=5
!gcc -o hello -fopenmp code.c
!./hello<jupyter_output>env: OMP_NUM_THREADS=5
Hello World... from thread = 0 
Hello World... from thread = 1 
Hello World... from thread = 2 
Hello World... from thread = 3 
Hello World... from thread = 4 
0.000406
{'fraction_non_alphanumeric': 0.1407563025210084, 'fraction_numerical': 0.02100840336134454, 'mean_word_length': 2.889795918367347, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, '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}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '293087', 'license': 'MIT', 'n_tokens_mistral': 373, 'n_tokens_neox': 346, 'n_words': 97, 'path': 'PDCexample.ipynb', 'repo_name': 'holps-7/PDC-weekly', 'size': '959'}