Lan based loosely coupled large grain parallel processing method
This is a continuation of application Ser. No. 07/618,858, filed Nov. 28, 1990, and now abandoned. 
    
    
     TECHNICAL FIELD 
     This invention relates generally to a small computer system and more particularly to the operation of a large task on a small computer system based on a local area network (LAN). 
     BACKGROUND 
     It is well known that most computer systems in current use consist of a single central processing unit CPU with a concomitant memory. In addition, dedicated parallel computers have been developed to handle more complicated or large grain tasks. These parallel computers execute parallel processing by use of a plurality of CPU&#39;s each tightly coupled by an internal bus within the dedicated computer for communication with a memory inside the dedicated parallel computer. The plurality of CPU&#39;s are also connected to each other via the same internal communication medium or bus. 
     To accomplish a large task in the dedicated parallel computer, the task is distributed across the available plurality of processors (CPUs) processing simultaneously. To insure that access to the shared resources such as the memory, is made by only one processor at a time, some locking mechanism must be used that allows only one processor to access the resource at any one time and locks out the other processor from accessing the resource at that time. In the case of shared information, the information is generally stored in memory and hence the locking mechanism must control access to the memory or at least to that portion of the memory wherein the shared information is stored. 
     A type of locking mechanism used widely in multiprocessing systems such as a dedicated parallel computer is a semaphore. A semaphore is traditionally implemented as a register or a designated memory location on which is performed a read-and-clear operation, a test-and-set operation, a read-modify-write operation or some other form of a memory operation that performs an atomic read-modify-write function. An atomic or mutual exclusive read-modify-write function is one during whose execution no other register or memory references are permitted between the read and write portions of the operation. 
     A parallel computer then is conceptualized as being many individual, independent CPU&#39;s networked by a high speed internal communication bus as existing presently. This dedicated parallel computer has tremendous processing power to do large tasks (large grain) but the expense of the dedicated parallel computer is also tremendous. 
     Recently, systems in which a plurality of less expensive work stations each having its own CPU have been developed. To let users of the workstations share files in a common memory unit called the file server, a loosely coupled local area network (LAN) connects each workstation to the fileserver. The CPU of the work station is a powerful uniprocessing individual computer (UC) that is conventionally viewed to not have the same potential as a more powerful dedicated parallel computer. However, the uniprocessing individual computers (UCs) are each independently more powerful than the individual central processing units (CPUs) of the dedicated parallel computer. The power of the UC will help make up for the slower speed of the LAN as compared to the high speed internal bus. These uniprocessing individual computers may each handle a large problem, but would require an extreme amount of time as compared to the larger, more powerful dedicated parallel computer. 
     It is therefore a desire to be able to accomplish large tasks on small computer systems to avoid the purchase of larger, more expensive computers to do the same complicated task in a timely fashion. 
     SUMMARY OF THE INVENTION 
     Accordingly, it is an advantage of the present invention to be able to divide a large task into sub-tasks that can be performed simultaneously by a plurality of individual uniprocessing computers connected to a file server by a local area network (LAN). This loosely coupled parallel scheme will achieve the same powerful performance benefit without the expense of the existing dedicated parallel computer. 
     Briefly, according to the invention, a parallel processing system is provided to logically divide a task into subtasks that can be performed simultaneously by a plurality of computers loosely coupled in parallel via a loosely coupled interconnection. A file server is connected to the loosely coupled interconnection for sharing memory among the plurality of computers. For coordinating the cooperation of the plurality of computers performing these subtasks, a controlling methodology is taught. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a schematic of a network of computers embodying the present invention. 
     FIG. 2 shows an example of task splitting among the small computer network 10 of FIG. 1. 
     FIG. 3 is a flow chart of the major program module used to implement the present invention. 
     FIG. 4 is a flow chart of a subroutine illustrating a generic lock semaphore used in FIG. 3. 
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT 
     Referring to FIG. 1, a network of loosely connected CPUs or work stations 1-4 is shown. Any stand alone networkable processing unit may serve as the uniprocessing computer that is labeled CPU 1-4. The CPUs 1-4 are loosely connected to each other and to a common file server 9 containing the memory for the system via any loosely coupled interconnecting means such as a wireless RF interconnecting means or a local area network LAN 11. The system synchronization and queues will reside in the LAN file server 9 which serves as the shared memory between the central processing units 1-4. Local memory can be the processor&#39;s own RAM and the UC&#39;s local hard storage inside the CPU 1-4. By using this LAN (11) approach as only one example of a loosely coupled network, users of existing powerful unique processing individual computers (UCs) 1-4 can create a parallel processing system 10 that approaches the powerful potential of the larger and more expensive dedicated parallel computer. 
     To reduce the overall time necessary to execute a complicated or large gain task, by one CPU (1, 2, 3, or 4) operating alone. The complicated task is shared by more than one computer. By giving each CPU 1-4 a share of the overall work, each computer 1, 2, 3, and 4 will simultaneously solve a part of the problem to reduce the total time required by a single computer 1,2, 3, or 4. 
     Referring to FIG. 2, one simple example of task splitting in a small system network 10 of FIG. 1 is illustrated in accordance with the invention. For simplicity sake, assume a large grain complicated task is to read from a shared file 100 numbers. Assuming again, for simplicity&#39;s sake, each of the numbers must be replaced with another number that is a function of the original. If it takes &#34;T&#34; amount of time to calculate the function for all of the numbers, the completed task will be done in &#34;T&#34; amount of time. However, if &#34;N&#34; computers (where &#34;N&#34; equals 4 in this example) are used across a LAN 11 to solve the problem in parallel, the total time for completion will ideally be &#34;T&#34; divided by &#34;N&#34;. To accomplish this parallelism, each of the &#34;N&#34; computers 1-4 will receive a unique, individual identification (iid) number from 0 to N-1. This individual ID is a virtual and not a pre-defined number because it is assigned to each computer in sequence as it accesses the virtual ID semaphore as it will be described later in FIG. 3. Each processor or computer 1-4 will read the entire data into its own memory. By the virtual number iid assigned, the memory inside the file server 9 will be dedicated to each of the computers 1-4. Based on each processor&#39;s iid, it will calculate the answers to be provided to the file server 9 from location iid*S/N to location ((iid+1)*S/N)-1 where &#34;S&#34; is the total quantity of numbers to be read in. Each processor will then place its subset of the answers on the file server 9 for collection by the parent processor which accessed the virtual ID semaphore first to acquire iid=0. The communication to and from the file server 9, the figuring of each respective parcel of work and the final work done by the last executing processor, compose the overhead &#34;C&#34;. The total execution time will then be increased to T/N+C, where C is the overhead cost. However, this total execution time is still much reduced from the original total time &#34;T&#34; required for a single processor. 
     Referring to FIGS. 3, a flow chart for controlling the parallelism of the small computer system 10 is illustrated. This logical partition controlled software controls the partitioned work and data access for each of the plurality of computers 1-4 and will be run on each computer 1-4 in the same manner. However, due to different executing speeds of the computers 1-4 and the program itself, not all of the computers will be doing the same work but will share the work (and not necessarily in an equal manner). 
     As a system function in step 32, the logical partition control software starts to run by being booted and loaded. The routine proceeds to step 34, where a time-out semaphore (TOS) is locked to stop any other computer from entering the rest of the routine. Any other computer, other than the first computer who enters this point and locks the semaphore file, will have to wait until the file is unlocked to continue proceeding. As previously described, a semaphore allows access to a file by only one computer at a time to make the file mutually exclusive. This time-out semaphore is a preparation step to lock some information so that any other computer does not enter the lock virtual ID semaphore file (36), while the first or a previous computer is in the process of currently updating the virtual ID information (38). 
     Referring to FIG. 4, a generic lock semaphore subroutine is illustrated in more detail. The mutual exclusion provided by any generic lock semaphore of this example is implemented at the file server 9 to lock files such as the time-out, virtual ID, and virtual fork semaphore files. The first computer which enters the lock semaphore step 44 or any other computer, if the file is currently unlocked, can lock the semaphore file. A timing loop is continuously traversed in an idle wait step 42 and locking step 44, if someone else has already locked the file such that the lock is unsuccessful by the current computer as determined in decision block 46. If the lock is successful, the sub-routine returns to the main program in step 48. 
     Returning to the main program in FIG. 3, a similar virtual ID semaphore is locked in step 36. Each UC 1-4 will decide what to do based on a unique virtual ID number supplied to it by the control software of FIGS. 3. In step 38, each UC 1-4 will retrieve the current virtual ID stored in the virtual ID semaphore file as its own individual ID (iid) and will increment the virtual ID in the semaphore file for the next computer to retrieve. The first computer that locks the semaphores in steps 34 and 36, is termed the parent processor and would have retrieved a virtual ID VID=0 as its own individual ID (iid=0). Since the VID is equal to 0 for the parent processor in decision block 42, the parent processor will take the &#34;yes&#34; branch and lock the virtual fork semaphore in step 46. The virtual fork semaphore provides synchronization for the plurality of computers 1-4 such that while this file is locked, none of the computers can proceed (or fork) to work on different parts of the given task based on their different virtual id numbers. 
     The parent processor will unlock both the virtual ID semaphore in step 44 and the time-out semaphore in a subsequent step 48 for the next computer to proceed. Since the virtual ID semaphore is now unlocked, the subsequent computers that enters this part of the routine, one at a time as allowed by the time-out semaphore, will each retrieve the virtual ID that was incremented by the last computer in step 38 as their own virtual ID and increment and store the virtual ID for the next computer. All of the computers subsequently following the parent computer, (having VID not equal to 0) will take the &#34;no&#34; branch of the &#34;virtual ID equals 0 ?&#34; decision block 42 in unlocking the virtual ID semaphore in step 44 and the time-out semaphore in step 48 for the next computer to retrieve its own unique identification number. After the virtual ID and time-out semaphores have been locked and unlocked for the last time, in steps 36 and 44, each available computer in the network will now have received a unique virtual or individual ID number. 
     To synchronize all of the computers 1-4, the first or parent processor having a virtual ID=0, will take the &#34;yes&#34; branch in another &#34;virtual ID equals 0?&#34; decision block 52. A predetermined start-up time will be waited by the first or parent computer in step 56 to allow time for the rest of the computers to catch up to the parent and to retrieve their own unique IDs. After this catch-up time has passed, the time-out semaphore will be locked in step 58 by the parent computer so that no other computer can enter the network who currently does not have a unique virtual ID assigned to them. As previously described, the virtual ID semaphore contains a number associated with the sequence of computers accessing the semaphore file and is incremented as the virtual ID for the next computer to retrieve. The last incremented virtual ID in the semaphore file VIS can now be read by the parent computer in step 62 for VID=N where N is the total number of computers currently participating. Now that each computer has now received a virtual ID number, that virtual ID is what will facilitate the parallelism to keep the system dynamic and easily expandable. The virtual fork semaphore is then unlocked by the parent processor in step 64. 
     The lock and unlock virtual fork semaphore steps 54 and 66, taken by all the computers 1-4 are merely wait states to achieve computer synchronization. All but the first processor each having a virtual ID not equal to 0, will take the &#34;no&#34; branch in the &#34;virtual ID equals 0?&#34; decision block 52 as part of the synchronization scheme. Since the parent processor has already locked the virtual fork semaphore in step 46 or 54 and if the parent has not unlocked it yet in step 64 or 66, the rest of the computers will have to wait in the attempt to lock virtual fork semaphore step 54. 
     The actual logical partition of the work and data via the VID number is done in step 68. The work is partitioned as a function of the virtual ID number that was retrieved by each of the computers as is described for the simple example of FIG. 2. 
     After all the partitioned work has been done, the virtual ID semaphore is again locked in step 72. In step 74, the first computer which executes the fastest to arrive at this point will lock the virtual ID semaphore file. Since the virtual ID semaphore file was last incremented to N, this first post-work computer will decrement the virtual ID file and retrieve the decremented value (N-1) as its new virtual ID number, not necessarily equal to the original virtual ID number used in partitioning work. This first post-work computer will then unlock the virtual ID semaphore file for the rest of the computers. Proceeding to another &#34;VID=0?&#34; decision block 78, the first post-work computer having a VID=N-1 which does not equal 0 (assuming there is more than one computer in this parallel network) will take the &#34;no&#34; branch and end the routine in step 84 without doing any more work. 
     In turn, the rest of the computers will decrement the current virtual ID semaphore file and retrieve the decremented value in step 74, after each previous computer sequentially locks and unlocks the virtual ID semaphore in steps 72 and 76. The last or slowest executing computer or processor will now have its virtual ID equal to 0 after decrementing the virtual ID semaphore file. This last computer will be the only one to take the &#34;yes&#34; branch from the &#34;virtual ID=0?&#34; decision block 78 to do any post-fork work in step 82. Post-fork work is whatever work that is needed to achieve a final result or answer. 
     All of the rest of the computers will take the &#34;no&#34; branch from the decision block 78 and end the routine in step 84, just as the first executing post-work computer has done. The last processor after finishing the post-fork work in step 82 will likewise end the routine in step 84, after unlocking the time-out semaphore in step 83. 
     In summary, by the use of semaphores and the control of virtual ID numbers, a plurality of computers connected on a loosely coupled network such as a LAN can be logically controlled to partition work in a parallel processing scheme to do large tasks, normally too time consuming for a small computer.