TOC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 13, 14

7) RUNNING CDS LINDA PROGRAMS


7.1) Why do I get the message:

            "ping: Network linda executable missing +LARGS argument, aborting."
            "ping: Use +LARGS and linda arguments if starting by hand,"        
            "ping: or start the executable using the ntsnet utility."          
  
when trying to run my C-Linda program?

This message indicates that you're trying to execute a Network Linda program. Set the LINDA_CLC or LINDA_FLC environment variable to CDS, and relink the program.


7.2) Why do I get the message:

            "Linda Error: out of tb's"
  


when trying to run my Linda program under CDS?

It means that your program is creating more tuples than it has allocated shared memory. The default size is 2024 tuple blocks (tb's), where a tb is about 280 bytes. To double the number of tb's (to a little over a megabyte), relink your program using a command like:

% clc -linda ts 4000 -o foo foo.cl

If you try to allocate too much shared memory, you'll get the message:

linda init: cannot create shared region.

Then you have to either decrease the number of tb's, or reconfigure your Unix kernel for more shared memory. To allow for less shared memory, you may have to modify your Linda program to use water marking, for example.


7.3) How large is a CDS tuple block?


A tuple block is 280 bytes.


7.4) Why do I get the message:

            "linda init: cannot allocate semaphores."
  




CDS Linda is implemented using System V message queues, semaphores, and shared memory. If a CDS Linda program aborts abnormally, under certain circumstances, it will not be able to deallocate those resources. When you see this error message, use the "ipcs" command to see if your user account has resources allocated, and then "ipcrm" to remove resources that are from aborted Linda runs. The following shell script builds an ipcrm command that can be executed using the eval command after manual verification:

  #!/bin/sh                       
                                  
  ME=`whoami`                     
                                  
  ipcs | awk '                    
  BEGIN {                         
      me = "'$ME'"                
      printf("ipcrm")             
  }                               
  /^[qms][ \t]/ {                 
      if (me == $5) {             
          printf(" -%s %d", $1, $2)   
      }                           
  }                               
  END {                           
      printf("\n");               
  }                               
  '                               


An example session with ipclean could go:

  example% ipcs                                               
  IPC status from pandora as of Wed Aug 10 09:33:01 1994      
  T     ID     KEY        MODE       OWNER    GROUP           
  Message Queues:                                             
  q   3650 0x00000000 -Rrw-------   weston    linda           
  Shared Memory:                                              
  m   7300 0x00000000 --rw-------   weston    linda           
  Semaphores:                                                 
  s    730 0x00000000 --ra-------   weston    linda           
  example% ipclean                                            
  ipcrm -q 3650 -m 7300 -s 730                                
  example% eval `ipclean`                                     
  example% ipcs                                               
  IPC status from pandora as of Wed Aug 10 09:35:13 1994      
  T     ID     KEY        MODE       OWNER    GROUP           
  Message Queues:                                             
  Shared Memory:                                              
  Semaphores:                                                 



7.5) Why do I get the message:

            "linda init: cannot allocate msg structure."
  


See the answer to subject 7.4.


7.6) Why do I get the message:

            "linda init: cannot create shared region."
  


Either you've had a lot CDS Linda programs abort abnormally, or your machine isn't configured with enough shared memory. You can use the "ipcs" command to determine the status of System V IPC resource usage. You can use the "ipcrm" to clean up after abort CDS Linda programs, as described in the answer to subject 7.4. If that isn't the case, you either have to either decrease the amount of shared memory that your CDS Linda program uses, or reconfigure your Unix kernel for more shared memory. The clc/flc "-linda ts " option can be used to change the amount of shared memory that allocated to run your program. See subject 7.2 for more information on this subject.


7.7) How does CDS Linda emulate parallel processing, since it runs on a single workstation?

The CDS is designed to provide a resonable emulation of parallel processing, using the natural concurrency of a timesharing operating system. Programs running using the CDS are truly concurrent, because each eval is implemented with its own process. The programs are not parallel, because only one of them is executing at any instant in time. Tuplespace is implemented in a shared-memory segment using semaphores to control access.
There are two main points of concern when comparing the CDS to true, parallel versions of Linda: process environment and interleaving.
It is important that each eval in the CDS have the same environment as it would have in any other implementation of Linda, e.g. on a network. Fork *is* used to create new processes for evals in the CDS, but a clean version of the process (called the cloner process) is used. This prevents contamination of the child process by any of the state built up by the evaling process, and allows the eval semantics to be the same for CDS Linda and (non-shared memory) parallel versions of Linda.
Secondly, it is important that the individual processes in a Linda execution on the CDS be interleaved arbitrarily. This is accomplished reasonably well by the natural interleaving of the timesharing scheduler.

 



TOC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 13, 14

 
Copyright © 2024 Scientific Computing Associates, Inc.