Merged src/client_server/ into src/shakespeare/parallel/.
authorW. Trevor King <wking@drexel.edu>
Tue, 14 Sep 2010 19:17:41 +0000 (15:17 -0400)
committerW. Trevor King <wking@drexel.edu>
Tue, 14 Sep 2010 19:17:41 +0000 (15:17 -0400)
14 files changed:
content/Advanced_MPI/client_server/index.shtml [moved from src/client_server/index.shtml with 100% similarity]
content/Advanced_MPI/img/client.jpg [moved from src/client_server/Images/client.jpg with 100% similarity]
content/Advanced_MPI/img/client_and_worker.jpg [moved from src/client_server/Images/client_and_worker.jpg with 100% similarity]
content/Advanced_MPI/img/figure.jpg [moved from src/client_server/Images/figure.jpg with 100% similarity]
content/Advanced_MPI/img/master_server.jpg [moved from src/client_server/Images/master_server.jpg with 100% similarity]
content/Advanced_MPI/img/worker.jpg [moved from src/client_server/Images/worker.jpg with 100% similarity]
src/client_server/C-codes/search_text.c [deleted file]
src/client_server/Client_Server.doc [deleted file]
src/client_server/Content.shtml [deleted file]
src/client_server/Shakespeare.tar [deleted file]
src/client_server/list_plays [deleted file]
src/shakespeare/parallel/read_file.c [moved from src/client_server/C-codes/read_file.c with 100% similarity]
src/shakespeare/parallel/search_text_p.c [moved from src/client_server/C-codes/search_text_p.c with 100% similarity]
src/shakespeare/parallel/search_text_p_with_bugs.c [moved from src/client_server/C-codes/search_text_p_with_bugs.c with 100% similarity]

diff --git a/src/client_server/C-codes/search_text.c b/src/client_server/C-codes/search_text.c
deleted file mode 100644 (file)
index 91e040f..0000000
+++ /dev/null
@@ -1,314 +0,0 @@
-
-
-             /*         Simple client server skeleton                   */
-             /*                                                         */
-             /*         Searches litterary works                        */
-             /*                                                         */
-             /*         Sample built-in commands:                       */ 
-             /*                  frequency "word"                       */
-             /*                  distribution "word"                    */
-             /*                  correlation  "word_1" " word_2"        */
-             /*                  help                                   */
-             /*                  quit                                   */
-
-
-                                                         /* Michel Vallieres */
-                                                         /* Spring 2001      */
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-#define MAX_WORDS 100000
-
-char word[MAX_WORDS][100];
-
-                                                         /* function */
-                                                         /* prototypes */
-void correlation ( char word_1[], char word_2[], int corr[], int n_word );
-void search_word( char *a_word, int *occurences, int n_word );
-void distribution( char *a_word, int *occurences, int n_word );
-void get_the_data ( char *fname, int *n_word );
-void lower_case_letters ( char *string );
-void cleanup ( char string[], char in_string );
-void command_input ( char command[], char word_1[], char word_2[] );
-
-
-/* correlations between the words */
-void correlation ( char word_1[], char word_2[], int corr[], int n_word )
-{
-  int iw, wscan, wscan_min, wscan_max;
-                                                         /* zeroth */
-                                                         /* correlation */
-  for ( wscan=0; wscan<5 ; wscan++ )
-    corr[wscan] = 0;
-                                                         /* scan over text */
-  for ( iw=0 ; iw<n_word ; iw++ )
-    {                                                    /* find word #1 */
-       if ( strcmp( word[iw] , word_1 ) == 0 )
-        {
-           wscan_max = iw + 5;
-            if ( wscan_max > n_word )
-             wscan_max = n_word;
-            wscan_min = iw+1;
-            if ( wscan_min > n_word )
-             wscan_min = n_word;                        /* find word #2 */
-                                                        /* nearby */
-            if ( wscan_max >= wscan_min )
-             {
-                for ( wscan=wscan_min ; wscan<wscan_max ; wscan++ )
-                 {
-                    if ( strcmp( word[wscan] , word_2 ) == 0 )
-                     corr[wscan-iw-1] = corr[wscan-iw-1] + 1;
-                 }
-             }
-        }
-    }
-
-}
-
-
-
-/*  frequency  search  */
-void search_word( char *a_word, int *occurences, int n_word )
-{
-  int iw, times;
-
-  times = 0;
-  for ( iw=0 ; iw<n_word ; iw++ )
-    {
-      if ( strcmp( word[iw] , a_word ) == 0 )
-       times++;
-    }
-  *occurences = times;
-}
-
-
-/*  distribution search  */
-void distribution( char *a_word, int dist[], int n_word )
-{
-  int iw, iw_1_3, iw_2_3, times;
-
-                                                         /* first third */
-  iw_1_3 = n_word/3;
-  iw_2_3 = 2*n_word/3;
-  times = 0;
-  for ( iw=0 ; iw<iw_1_3 ; iw++ )
-    {
-      if ( strcmp( word[iw] , a_word ) == 0 )
-       times++;
-    }
-  dist[0] = times;
-                                                         /* second third */
-  times = 0;
-  for ( iw=iw_1_3 ; iw<iw_2_3 ; iw++ )
-    {
-      if ( strcmp( word[iw] , a_word ) == 0 )
-       times++;
-    }
-  dist[1] = times;
-                                                         /* last third */
-  times = 0;
-  for ( iw=iw_2_3 ; iw<n_word ; iw++ )
-    {
-      if ( strcmp( word[iw] , a_word ) == 0 )
-       times++;
-    }
-  dist[2] = times;
-}
-
-
-
-/* read in the data */
-void get_the_data ( char *fname, int *n_word )
-{
-   FILE *fp;
-   int  i_word;
-   char *found, comma, dot, semi_colon, colon, question, exclamation;
-   int  ic, nc, lw;
-
-   if ( ( fp = fopen( fname, "r" ) )  == NULL )
-     {
-       printf( " error in opening file \n" );
-       exit(1);
-     }
-
-   comma = ',';
-   dot = '.';
-   semi_colon = ';';
-   colon = ':';
-   question = '?';
-   exclamation = '!';
-   i_word = 0;
-
-   while ( fscanf( fp, "%s", word[i_word] ) != EOF )
-     {
-                                                         /* clean out | */
-       if ( strcmp( word[i_word], "|" ) == 0 ) 
-                           i_word--;
-                                                         /* removes , */
-       cleanup ( word[i_word],  comma );
-                                                         /* removes . */
-       cleanup ( word[i_word],  dot );
-                                                         /* removes ; */
-       cleanup ( word[i_word],  semi_colon );
-                                                         /* removes : */
-       cleanup ( word[i_word],  colon );
-                                                         /* removes ? */
-       cleanup ( word[i_word],  question );
-                                                         /* removes ! */
-       cleanup ( word[i_word],  exclamation );
-                                                         /* small case letters */
-       lower_case_letters ( word[i_word] );
-                                                         /* next word */
-       i_word++;
-
-       if ( i_word == MAX_WORDS )
-        {
-          printf( "\n Dimension too small - increase MAX_WORDS\n\n" );
-           exit(1);
-        }
-     }
-                                                         /* close file */
-   fclose(fp);
-
-   *n_word = i_word-1;
-
-}
-
-
-
-/* utility to rewrite string in small case letters only */
-void lower_case_letters ( char string[] )
-{
-  int ic, lw;
-
-  lw = strlen( string );
-    for ( ic=0 ; ic<lw ; ic++ )
-       string[ic] = tolower( string[ic] );
-}
-
-
-
-/* special characters clean-up routine - removes   */
-/* single ocurence of in_string from string        */
-void cleanup (   char string[], char in_string )
-{
-  int ic, nc, lw;
-  char *found;
-
-  if ( ( found = strchr( string, in_string ) ) != NULL )
-         {
-           nc = found-string;
-           lw = strlen( string );
-           for ( ic=nc ; ic<lw ; ic++ )
-              string[ic] = string[ic+1];
-         }
-}
-
-
-
-/* input command  */
-void command_input ( char command[], char word_1[], char word_2[] )
-{
-      printf( " Enter a command (quit): " );
-      scanf( "%s", command );
-      lower_case_letters ( command );
-
-
-      if ( strcmp ( command, "frequency" ) == 0 )
-        {
-          printf( " Word to search for    : " );
-          scanf( "%s", word_1 );
-          lower_case_letters ( word_1 );
-        }
-      else if ( strcmp ( command, "distribution" ) == 0 )
-        {
-          printf( " Word to search for    : " );
-          scanf( "%s", word_1 );
-          lower_case_letters ( word_1 );
-        }
-      else if ( strcmp ( command, "correlation" ) == 0 )
-        {
-          printf( " Words to correlate    : " );
-          scanf( "%s", word_1 );
-          scanf( "%s", word_2 );
-          lower_case_letters ( word_1 );
-          lower_case_letters ( word_2 );
-       }
-      else if ( strcmp ( command, "quit" ) == 0 )
-        exit(0); 
-      else if ( strcmp ( command, "help" ) == 0 )
-       {
-          printf( "\n" );
-          printf( " Syntax:   help \n" );
-          printf( "           frequency  word \n" );
-          printf( "           distribution word \n" );
-          printf( "           corrolation  word_1  word_2 \n" );
-          printf( "           quit \n\n" );
-       }
-      else 
-        {
-          printf( " Error - command not implemented \n");
-        }
-
-}
-
-
-
-int main( int argc, char *argv[] )
-{
-
-   int n_word;
-   char command[100], word_1[100], word_2[100];
-   int occurences;
-   int wscan, corr[5];
-   int dist[3];
-   char *directory;
-   char fname[100];
-
-                                                         /* get the text data */
-   directory = getenv( "PWD" );
-   strcpy( fname, "" );
-   strcat( fname, directory );
-   strcat( fname, "/Shakespeare/hamlet.html" );
-   printf( "\n\n File to read: %s \n", fname );
-   get_the_data ( fname,  &n_word );
-   printf( " \n Number of words: %d \n\n", n_word );
-
-                                                         /* scan over commands */
-   for ( ; ; )
-     {
-                                                         /* read in command */
-       command_input(  command, word_1, word_2 );
-                                                         /* frequency */
-       if ( strcmp ( command, "frequency" ) == 0 )
-        {
-            search_word( word_1, &occurences, n_word );
-            printf( "\n %s  -- appears %d times \n\n", word_1, occurences );
-        }
-                                                         /* correlations */
-       if( strcmp ( command, "correlation" ) == 0 )
-        {
-          correlation( word_1, word_2, corr, n_word );
-          printf( "\n distance   number \n");
-           for ( wscan=0 ; wscan<5 ; wscan++ )
-             printf( "      %d         %d  \n", wscan, corr[wscan] );
-           printf( " \n" );
-        }
-                                                         /* distribution */
-                                                         /* of word */
-       if( strcmp ( command, "distribution" ) == 0 )
-        {
-           distribution( word_1, dist, n_word );
-           printf( " distribution: %d %d %d\n\n", 
-                            dist[0], dist[1], dist[2] ); 
-        }
-     }
-
-}
-
-
-
-
-
diff --git a/src/client_server/Client_Server.doc b/src/client_server/Client_Server.doc
deleted file mode 100644 (file)
index e7742c7..0000000
Binary files a/src/client_server/Client_Server.doc and /dev/null differ
diff --git a/src/client_server/Content.shtml b/src/client_server/Content.shtml
deleted file mode 100644 (file)
index 890cd5d..0000000
+++ /dev/null
@@ -1,431 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-  <meta name="generator" content=
-  "HTML Tidy for Linux/x86 (vers 25 March 2009), see www.w3.org" />
-  <meta http-equiv="Content-Type" content=
-  "text/html; charset=us-ascii" />
-  <meta name="GENERATOR" content="Microsoft FrontPage 4.0" />
-  <meta name="ProgId" content="FrontPage.Editor.Document" />
-
-  <title>New Page 2</title>
-</head>
-
-<body background="GIF_files_PHYS405/grid.gif">
-  <!--BACKGROUND="GIF_files_PHYS405/wallp1.gif"-->
-  <img border="0" src="GIF_files_PHYS405/PHYS405.gif" width="226"
-  height="45" /><br />
-  <img border="0" src="GIF_files_PHYS405/Advanced.gif" width="94"
-  height="30" /> <img border="0" src=
-  "GIF_files_PHYS405/Computational.gif" width="125" height="30" />
-  <img border="0" src="GIF_files_PHYS405/Physics.gif" width="84"
-  height="29" /><img border="0" src=
-  "GIF_files_PHYS405/Parallel.gif" width="73" height="30" />
-  <img border="0" src="GIF_files_PHYS405/Computing.gif" width="98"
-  height="29" />
-  <hr />
-
-  <p><i>Table of Content</i></p>
-
-  <ul>
-    <li>
-      <a href="Elementary_MPI/arch.html">Introduction to Parallel
-      Computing</a>
-
-      <ul>
-        <li>
-          <a href="Elementary_MPI/arch.html#CA">Computer
-          Architecture</a>
-
-          <ul>
-            <li><a href="Elementary_MPI/arch.html#BC">Basic
-            Computer</a></li>
-
-            <li><a href=
-            "Elementary_MPI/arch.html#SM1">Processors</a></li>
-
-            <li><a href=
-            "Elementary_MPI/arch.html#SM2">Memory</a></li>
-
-            <li><a href=
-            "Elementary_MPI/arch.html#SM3">Cache</a></li>
-
-            <li><a href="Elementary_MPI/arch.html#SM4">Virtual
-            Memory</a></li>
-
-            <li><a href="Elementary_MPI/arch.html#SM5">Inter-leaved
-            Memory</a></li>
-
-            <li><a href="Elementary_MPI/arch.html#SM6">Bus and I/O
-            bandwidth</a></li>
-          </ul>
-        </li>
-
-        <li>
-          <a href="Elementary_MPI/arch.html#HPC">High Performance
-          Computing - Parallelism</a>
-
-          <ul>
-            <li><a href=
-            "Elementary_MPI/arch.html#HPC1">Granularity</a></li>
-          </ul>
-        </li>
-
-        <li>
-          <a href="Elementary_MPI/arch.html#TCC">Traditional
-          Computer Classification</a>
-
-          <ul>
-            <li><a href="Elementary_MPI/arch.html#TCC1">Flynn's
-            Taxonomy</a></li>
-          </ul>
-        </li>
-
-        <li>
-          <a href="Elementary_MPI/arch.html#TCC2">Fast processors
-          architectures</a>
-
-          <ul>
-            <li><a href="Elementary_MPI/arch.html#TCC21">Pipelined
-            Processors</a></li>
-
-            <li><a href="Elementary_MPI/arch.html#TCC22">Vector
-            Processors</a></li>
-
-            <li><a href=
-            "Elementary_MPI/arch.html#TCC23">Super-Scalar
-            Processors</a></li>
-          </ul>
-        </li>
-
-        <li>
-          <a href="Elementary_MPI/arch.html#MEM">MIMD - memory
-          organization</a>
-
-          <ul>
-            <li><a href="Elementary_MPI/arch.html#MEM1">Shared
-            Memory</a></li>
-
-            <li><a href="Elementary_MPI/arch.html#MEM2">Distributed
-            Memory</a></li>
-
-            <li><a href=
-            "Elementary_MPI/arch.html#Standards">Message Passing
-            Standards -- PVM&nbsp; and MPI</a></li>
-          </ul>
-        </li>
-      </ul>
-    </li>
-  </ul>
-
-  <ul>
-    <li>
-      <a href="Elementary_MPI/Elementary_MPI.html">Elementary
-      MPI</a>
-
-      <ul>
-        <li><a href=
-        "Elementary_MPI/Elementary_MPI.html#WhatIs">What is
-        MPI?</a></li>
-
-        <li><a href=
-        "Elementary_MPI/Elementary_MPI.html#Binding">Binding to C
-        and Fortran</a></li>
-
-        <li><a href="Elementary_MPI/Elementary_MPI.html#Init">MPI
-        Initialization</a></li>
-
-        <li><a href="Elementary_MPI/Elementary_MPI.html#Who">Who Am
-        I?</a></li>
-
-        <li><a href=
-        "Elementary_MPI/Elementary_MPI.html#Final">Finalizing
-        MPI</a></li>
-
-        <li><a href=
-        "Elementary_MPI/Elementary_MPI.html#CL">Building an MPI
-        code</a></li>
-
-        <li><a href=
-        "Elementary_MPI/Elementary_MPI.html#Running">Running an MPI
-        code</a></li>
-
-        <li><a href=
-        "Elementary_MPI/examples.html">Examples</a></li>
-      </ul>
-    </li>
-  </ul>
-
-  <ul>
-    <li>
-      <a href="Message_Passing/Message_Passing.html">Message
-      Passing</a>
-
-      <ul>
-        <li><a href=
-        "Message_Passing/Message_Passing.html#Content">Message
-        Content</a></li>
-
-        <li><a href=
-        "Message_Passing/Message_Passing.html#Types">MPI Fortran -
-        C datatypes</a></li>
-
-        <li><a href=
-        "Message_Passing/Message_Passing.html#Protocols">Communication
-        Protocols</a></li>
-      </ul>
-    </li>
-  </ul>
-
-  <ul>
-    <li>
-      <a href="Point_to_Point/point_to_point_comm.html">Point to
-      Point Communication</a>
-
-      <ul>
-        <li><a href=
-        "Point_to_Point/point_to_point_comm.html#Content">Communication
-        Modes</a></li>
-
-        <li><a href=
-        "Point_to_Point/point_to_point_comm.html#Types">Communication
-        Envelope</a></li>
-
-        <li><a href=
-        "Point_to_Point/point_to_point_comm.html#Dead">Deadlock</a></li>
-
-        <li><a href=
-        "Point_to_Point/point_to_point_comm.html#Protocols">Timing</a></li>
-
-        <li><a href=
-        "Point_to_Point/point_to_point_comm.html#Cost">The Cost of
-        Communication</a></li>
-
-        <li><a href=
-        "Point_to_Point/examples.html">Examples</a></li>
-
-        <li>Assignment #1<br /></li>
-      </ul>
-    </li>
-
-    <li>
-      <a href="Monte-Carlo/index.html">Monte Carlo Techniques</a>
-
-      <ul>
-        <li><a href="Monte-Carlo/index.html#MCI">Monte Carlo
-        Integral</a></li>
-
-        <li><a href="Monte-Carlo/index.html#calc_pi">Calculation of
-        π</a></li>
-
-        <li><a href=
-        "Monte-Carlo/index.html#Applicability">Applicability of the
-        Method</a></li>
-
-        <li><a href=
-        "Monte-Carlo/index.html#Metropolis%20Algorithm">Metropolis
-        Algorithm</a></li>
-
-        <li><a href="Monte-Carlo/index.html#Guided">Guided Monte
-        Carlo Integral</a></li>
-
-        <li><a href="Monte-Carlo/index.html#Parallel_MC">Parallel
-        Monte Carlo Algorithm<br /></a>
-        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href=
-        "Monte-Carlo/index.html#Random_Numbers_Generation">Random
-        Numbers Generation<br /></a>
-        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href=
-        "Monte-Carlo/index.html#Parallel_MC_Codes">Parallel Monte
-        Carlo Codes</a></li>
-      </ul>
-
-      <p>&nbsp;</p>
-    </li>
-
-    <li>
-      <a name="Client_Server" href="Client_Server/index.html" id=
-      "Client_Server">Client-Server Model - Parallel I/O</a>
-
-      <ul>
-        <li><a href=
-        "Client_Server/index.html#Parallel_Model">Parallel
-        Model</a></li>
-
-        <li><a href="Client_Server/index.html#Literary">Literary
-        Search</a></li>
-
-        <li><a href=
-        "Client_Server/index.html#Parallel_Implementation">Parallel
-        Implementation</a></li>
-
-        <li><a href=
-        "Client_Server/index.html#MPI_2">MPI-2</a><a href=
-        "Point_to_Point/examples.html"><br /></a></li>
-      </ul>
-    </li>
-
-    <li>Solution of Partial Differential Equations
-
-      <ul>
-        <li>Poisson Equation ( Jacobi, Gauss-Siedel, SOR )</li>
-      </ul>
-    </li>
-  </ul>
-
-  <ul>
-    <li>Programming Strategies
-
-      <ul>
-        <li>Parallel Algorithms, Communications &amp; Load
-        Balancing</li>
-
-        <li>Static Load Balance</li>
-
-        <li>Dynamical Load Balance</li>
-
-        <li>The Mandelbrot Set</li>
-
-        <li>Assignment #2<br /></li>
-      </ul>
-    </li>
-  </ul>
-
-  <ul>
-    <li>MPE Graphics Environment
-
-      <ul>
-        <li>Introduction</li>
-
-        <li>C-binding</li>
-
-        <li>Example<br /></li>
-      </ul>
-    </li>
-  </ul>
-
-  <ul>
-    <li>Domain Decomposition
-
-      <ul>
-        <li>Lattice Problems</li>
-
-        <li>Domain Decomposition</li>
-
-        <li>Parallel Implementation</li>
-
-        <li>Elliptic Equation - 1-D Poisson Equation
-
-          <ul>
-            <li>The Model</li>
-
-            <li>Sequential Implementation</li>
-
-            <li>Parallel Implementation</li>
-          </ul>
-        </li>
-
-        <li>Elliptic Equation - 2-D Poisson Equation
-
-          <ul>
-            <li>The Model</li>
-
-            <li>Sequential Implementation</li>
-
-            <li>Parallel Implementation</li>
-          </ul>
-        </li>
-
-        <li>Red and Black algorithm<br /></li>
-      </ul>
-    </li>
-
-    <li>Global Operations
-
-      <ul>
-        <li>Synchronization</li>
-
-        <li>Broadcast</li>
-
-        <li>Reduce</li>
-
-        <li>Sample Codes</li>
-
-        <li>Binary Tree Algorithm - Broadcast</li>
-      </ul>
-    </li>
-
-    <li>Advanced MPI
-
-      <ul>
-        <li>Non-Blocking Communications</li>
-
-        <li>Simultaneous Calculations/Communications</li>
-
-        <li>Just on Time Communication</li>
-
-        <li>Examples
-
-          <ul>
-            <li>Communication in a ring</li>
-
-            <li>Poisson Equation<br /></li>
-          </ul>
-        </li>
-      </ul>
-    </li>
-
-    <li>Derived Data Types - Buffering
-
-      <ul>
-        <li>MPI Approach</li>
-
-        <li>C structures</li>
-
-        <li>Examples<br /></li>
-      </ul>
-    </li>
-
-    <li>Projects
-
-      <ul>
-        <li>Diffusion Equation</li>
-
-        <li style="list-style: none; display: inline">
-          <ul>
-            <li>Parabolic Equation</li>
-
-            <li>Model</li>
-
-            <li>Parabolic PDEs solution</li>
-
-            <li>Serial Implementation</li>
-
-            <li>Some Results</li>
-
-            <li>Project</li>
-          </ul>
-        </li>
-
-        <li>Navier-Stokes Equations</li>
-
-        <li>Gene search</li>
-
-        <li>Classical N-Body problem
-
-          <p>&nbsp;</p>
-        </li>
-      </ul>
-    </li>
-  </ul>
-  <hr />
-  <a href="index.html">Back to PHYS 405 main page</a>
-  <hr />
-  Any questions or suggestions should be directed to <a href=
-  "mailto:valliere@physics.drexel.edu">Michel Vallières</a>
-  <hr />
-
-  <p>&nbsp;</p>
-</body>
-</html>
diff --git a/src/client_server/Shakespeare.tar b/src/client_server/Shakespeare.tar
deleted file mode 100644 (file)
index ce3b06f..0000000
Binary files a/src/client_server/Shakespeare.tar and /dev/null differ
diff --git a/src/client_server/list_plays b/src/client_server/list_plays
deleted file mode 100644 (file)
index 0d1cb90..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-/home/cyborg5/valliere/Shakespeare/
-antonyandcleopatra.html  Antony and Cleopatra  
-juliusceasar.html        Julius Ceasar
-othello.html                othello
-titusandronicus.html     Titus and Ronicus
-coriolanus.html          Coriolanus
-kinglear.html               King Lear
-romeoandjuliet.html      Romeo and Juliet
-hamlet.html              Hamlet
-macbeth.html             Macbeth
-timonofathens.html       Timon of Athens