202UCS19_HPC-LAB_EXP2
202UCS19_HPC-LAB_EXP2
AIM : To run a program to find the sum of all elements of an array using 2
processors without MPI (Message Passing Interface).
CODE:
#include <stdio.h>
#include <pthread.h>
#define SIZE 10
int arr[SIZE] = {11, 12, 13, 14, 15, 16, 17};
int sum[2] = {0, 0};
return NULL;
}
int main() {
pthread_t threads[2];
int thread_index[2] = {0, 1};
return 0;
}
OUTPUT: