// add.c // Author: Jon Pimentel // Description: Example Parallel C Program for MPI Simulator // History: // 9-7-11 add.c created // // #include #include // First example module begin example1 int obuf0; // connects to ibuf0 of 2nd example module int ibuf0; // input port int count = 0; // starting variable int temp; // temporary variable // CODE TO LOOP for (;;) { // Read from data file temp = ibuf0; // Increase counter count = temp + 1; // Send data to output obuf0 = count; } end // Second example module begin example2 int ibuf0; // input from example1 int obuf0; // final output int temp; // temporary variable to receive input // CODE TO LOOP for (;;) { // Get input from example1 and send to output temp = ibuf0; obuf0 = temp; } end