#include <iostream>
#include <vector>
#include <omp.h>

#define VECTOR_SIZE 1000000

int main() {
    std::vector<int> vec1(VECTOR_SIZE, 1);
    std::vector<int> vec2(VECTOR_SIZE, 2);

    int dot_product = 0;

    // Static scheduling
    #pragma omp parallel for reduction(+:dot_product) schedule(static)
    for (int i = 0; i < VECTOR_SIZE; ++i) {
        dot_product += vec1[i] * vec2[i];
    }

    std::cout << "Dot product using static scheduling: " << dot_product << std::endl;

    dot_product = 0;

    // Dynamic scheduling
    #pragma omp parallel for reduction(+:dot_product) schedule(dynamic)
    for (int i = 0; i < VECTOR_SIZE; ++i) {
        dot_product += vec1[i] * vec2[i];
    }

    std::cout << "Dot product using dynamic scheduling: " << dot_product << std::endl;

    dot_product = 0;

    // Guided scheduling
    #pragma omp parallel for reduction(+:dot_product) schedule(guided)
    for (int i = 0; i < VECTOR_SIZE; ++i) {
        dot_product += vec1[i] * vec2[i];
    }

    std::cout << "Dot product using guided scheduling: " << dot_product << std::endl;

    return 0;
}