/****************************************************************************** * Serial Example - Array Assignment - C Version * FILE: ser_array.c * DESCRIPTION: * In this simple example, an array is initialized and values assigned. * In the parallel version the master task initiates numtasks-1 number of * worker tasks. It then distributes an equal portion of an array to each * worker task. Each worker task receives its portion of the array, and * performs a simple value assignment to each of its elements. The value * assigned to each element is simply that element's index in the array+1. * Each worker task then sends its portion of the array back to the master * task. As the master receives back each portion of the array, selected * elements are displayed. * AUTHOR: Blaise Barney * LAST REVISED: 11/25/95 Blaise Barney ****************************************************************************/ #include #define ARRAYSIZE 600000 main() { int i; /* loop variable */ float data[ARRAYSIZE]; /* the intial array */ /************************* initializations *********************************/ printf("\n*********** Starting Serial Example ************\n"); fflush(stdout); /* Initialize the array */ for(i=0; i