/****************************************************************************** * DESCRIPTION: * In this simple example, an array is initialized and values assigned. * In the parallel version the root process initiates numtasks-1 number of * processes. It then distributes an equal portion of an array to each * process. Each process 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 process then sends its portion of the array back to the root * process. As the root receives back each portion of the array, selected * elements are displayed. ****************************************************************************/ #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