New Models


Admin

 

File: general_blocks/All.sim

Description

Admin is a dynamic scheduler that initiates and tracks the execution of tasks. The model receives a message, indicating that a task is to be initiated. The type of task to be initiated is identified by the task name contained in the field specified by TaskFieldName. The model uses an algorithm to identify which processor should execute the task, inserts the routing address of the processor, and sends the message from its out port. Using Router and other blocks, the message is routed to the appropriate processor (typically a module existing at the top level) where it is interpreted.

The file FileName (normally task_table.dat) contains the maximum number of tasks for each task type and processor. It is a tab delimited set of rows and columns. Given M processors and N Task types;
1) the first row contains the processor names (1 through M)

For rows 2 through N+1;

2) Column 1 contains the Task names

3) Column 2 contains the Mapping Algorithm name. There are currently four 
   Mapping algorithms:

    fill_u - Fill up. If the first processor is not running its maximum 
             number of tasks of this type, assign the task to it; 
             otherwise, try the next processor up, etc. 
    fill_d - Fill down. If the last processor is not running its maximum 
             number of tasks of this type, assign the task to it; 
             otherwise, try the next processor down, etc. 
    u_task - Uniform distribution of this task. Assign this task to the 
             processor currently executing the fewest instances of this 
             task type.
    u_all  - Uniform distribution of all tasks. Assign this task to the 
             processor currently executing the fewest total tasks. 

4) Fields ((3 through M+2), (2 through N+1)) contain the maximum 
   simultaneous task mappings of each task type for each processor.

For example,

                Node1  Node2  Node3  Node4  
Task1   fill_u  4       1       2       1  
Task2   fill_d  3       2       2       1 
Task3   u_task  2       3       2       3 
Task4   u_all   1       4       2       3 

Ports:

    Input Ports:                                                     
      in        Data Type: COMPOUND DATA STRUCTURE                    

    Output Ports:                                                    
      out       Data Type: COMPOUND DATA STRUCTURE                    

    Parameters:                                                      
      FileName            Data Type: STRING                           
      TaskFieldName       Data Type: STRING                           
      TaskIDField         Data Type: STRING                           
                          The name of the field is a string; the     
                          data in the field is an int.               
      TaskEndMode         Data Type: STRING                           
                          May be General (=0) or Specific (=1)       
                           if General, active tasks are counted and  
                             displayed as totals. End task (decrement
                             active task count) message is expected  
                             to be: end_TaskName_NodeName            
                           if Specific, the taskID (an integer) is   
                             tracked and displayed against its       
                             processor assignment. End task message  
                             is in the form: end_TaskName_TaskID     
      RouteField	   Data Type: STRING                           
      numTaskTypes        Data Type: INT (range 1-10)                 
      numProcessors       Data Type: INT (range 1-100)                
      ShowState           Data Type: INT (0=no, 1=print, 2=popup)     
      Task_Summary        Data Type: INT (0=no, 1=yes)                
                           Sum the number of active tasks of each    
                           type and insert into the field specified 
                           by the TaskSum_n attribute. Requires a    
                           field for each task type (=numTaskTypes)  
      TaskSum_n           Data Type: STRING                           
                           Active if Task_Summary = 1                
                           The name of the field into which the      
                           number of active tasks of type n will be  
                           inserted. The total number of fields      
                           required to be specified equals           
                           numTaskTypes, and the task numbering is 0 
                           based (0 through numTaskTypes-1)          

Append_Route_List

 

File: general_blocks/All.sim

Description

Append_Route_List appends routing information to a route list. It appends character Envelopes to the Composite Data Structure specified by the FieldName parameter. Up to twenty (specified by the NumberOfRoutes parameter) routes may be specified (Route_1 through Route_20) for attribute-based operation (Mode = 0). For Mode = 1, the character string received at the string port is appended. After all routes have been added, the modified data structure is placed on the out port.

    Input Ports                                               
      in       Data Type: Compound                             
      string   Data Type: STRING                               

    Output Ports                                              
      out      Data Type: Compound                             

    Parameters                                                
      Mode         Data Type: INT                              
                     (0 = use attributes, 1 = use string input)
      FieldName    Data Type: STRING                           
      NumberOfRoutes = N    Data Type: INTEGER (1 <= N <= 20)  
      Route_n                                                  

Append_String

 

File: general_blocks/All.sim

Description

Append_String appends strings and sends out the result. There are twelve methods of constructing the output string, which are combinations of fixed strings and received strings. These methods are specified by the parameter smode. In some smodes where only parameter data is used to build strings, (9 and 12) in1 is used as the trigger.
    The available smodes are:
      smode = 1: in1 string is appended by in2 string
      smode = 2: in1 string is appended by Fstring1
      smode = 3: in1 string is appended by Fstring2
      smode = 4: in2 string is appended by in1 string
      smode = 5: in2 string is appended by Fstring1
      smode = 6: in2 string is appended by Fstring2
      smode = 7:  Fstring1  is appended by in1 string
      smode = 8:  Fstring1  is appended by in2 string
      smode = 9:  Fstring1  is appended by Fstring2
      smode = 10: Fstring2  is appended by in1 string
      smode = 11: Fstring2  is appended by in2 string
      smode = 12: Fstring2  is appended by Fstring1

    Input Ports                                                
      in1      Data Type: STRING                                
      in2      Data Type: STRING                                

    Output Ports                                               
      out      Data Type: STRING                                

    Parameters ( none )                                        
      Smode     Data Type: INT                                  
      Fstring1  Data Type: STRING                               
      Fstring2  Data Type: STRING                               

Generic_Batcher

 

File: general_blocks/All.sim

Description

Generic_Batcher creates a batch (a vector; specifically, a Generic Vector or gvec) of Envelopes from the incoming Envelopes. The batch is sent out when the vector has been filled or when a timeout occurs.

The Generic_Batcher and Generic_UnBatcher are blocks intended to dramatically simplify assembly and disassembly of gvecs, eliminating the synchronization and pointer issues often encountered when trying to implement batching and unbatching using the Access_GVector, Setup_GVElem, GVCreate and GVLen blocks.

Ports
Input Ports
Output Ports
Parameters
     Vector_Size    Data Type: INTEGER                         
                     Specifies the maximum number of Envelopes 
                       assembled into a batch                  
     Timeout_Value  Data Type: REAL                            
                     Specifies the maximum time allowed for    
                       assembling a batch. Empty batches are   
                       not sent out (they are skipped).        
     Start_Time     Data Type: REAL                            
                     Specifies the time to start batching. If  
                       a negative time is specified (i.e. -1.0)
                       batching is triggered by the first      
                       message received.                       

Generic_UnBatcher

 

File: general_blocks/All.sim

Description

Generic_UnBatcher extracts Envelopes from the received batch (GVec).

The Generic_Batcher and Generic_UnBatcher are blocks intended to dramatically simplify assembly and disassembly of gvecs, eliminating the synchronization and pointer issues often encountered when trying to implement batching and unbatching using the Access_GVector, Setup_GVElem, GVCreate and GVLen blocks.

Ports
Input Ports
Output Ports
Parameters   ( none )


LockRealTime

 

File: general_blocks/All.sim

Description

LockRealTime is used to force a simulation which might normally run very quickly to proceed at the same rate as wall clock time. It does this by using the system "sleep" command. If a simulation is running slower than wall clock time (CSIM time is proceeding more slowly than wall clock time) there will be no effect.

Ports
Input Ports
Output Ports
Parameters

Num_to_String

 

File: general_blocks/All.sim

Description

Num_to_String receives an integer or real number, converts it to a character string, and outputs the string.
    Input Ports                                               
      in       Data Type: INT or REAL                          
    Output Ports                                              
      out      Data Type: STRING                               
    Parameters ( none )                                       

PortConvert

 

File: general_blocks/All.sim

Description

PortConvert splits a full duplex link into two simplex links, and/or combines two simplex links into a duplex link. Data received at the inout port is sent from the out port, and data received at the in port is sent from the inout port.
    Input Port 
      in        Data Type: Any

    Output Port
      out       Data Type: Any

    Bidirectional Port
      inout     Data Type: Any

    Parameters  ( none )

QSR1

 

File: general_blocks/All.sim

Description

QSR1 allocates and frees indexed Resource units for a Quantity-Shared resource. A request for a resource unit occurs when a data structure arrives at the Allocate port. This request is also called a "transaction". If there are resource units available, one is allocated, the index of the resource slot used is inserted into field FieldName, and the incoming data structure is sent out the DS_Out port. If no resource units are available, the request and the incoming data structure are queued. When a data struct is received at the Free port, the slot referenced by the FieldName field is freed. If there are queued requests, the request at the head of the queue is retrieved, the available slot is allocated, the index of the allocated slot is inserted into FieldName, and the data struct is sent out of the DS_Out port.

NOTE: Must use Set_QResource.sim model with all the Quantity Shared Resource models. This model requires the Addr_Mode attribute set to Addr_Mode = Indexed

Ports
Input Ports
Output Ports
Parameters

QSR2

 

File: general_blocks/All.sim

Description

QSR2 allocates and frees indexed Resource units for a Quantity-Shared resource. A request for a resource unit is made by sending a data structure to the Allocate port. The index to be used is obtained from the field FieldName. If the resource unit of the specified index is available, that index is then marked as busy and the incoming data structure is sent out the DS_Out port. If it is busy, the request and incoming data structure are queued. Releasing indexed resource units is done when a data structure is received at the Release port, with the index determined as above. If there are queued requests for the specified index, the first in line is dequeued, the index is marked as busy, and the associated data structure is sent out the DS_Out port.

NOTE: Must use Set_QResource.sim model with all the Quantity Shared Resource models. This model requires the Addr_Mode attribute set to Addr_Mode = Indexed
    Input Ports                                               
      Access              Data Type: DATA STRUCTURE            
      Release             Data Type: DATA STRUCTURE            

    Output Ports                                              
      DS_Out              Data Type: DATA STRUCTURE            

    Parameters                                                
      ResourceID          Data Type: CHARACTER                 
      FieldName           Data Type: CHARACTER                 

Receiver

 

File: general_blocks/All.sim

Description

Receiver receives an Envelope via a Named Synchron. It is often used in combination with the Sender device.

Ports
Input Ports
Output Ports
Parameters
             0 = send out the received data structure after incrementing its ref_count     
             1 = make and send out a new and separate copy of the incoming data structure                       

Router

   

Description

Router is a very flexible "Router" implementation, which can also be used as a general purpose data sorter. It's "routing rules" are configurable using attributes, by matching a destination address to an outgoing port-name.
Router expects to receive a compound data structure (2001 type Envelope) with a specified field containing route_to information. This field will be of type char in the data_structs.txt file. Route Lists may also be used (see below).

Unicast

Unicast routing rules are identified by the string "route_" appended by an address, which is equated to a port name, for example.
route_198_28_32_1 = p5
route_24_50_20_7 = p1

They can also be specified like zero subnet specifiers. For example, 24.50.0.0 can be equated to route_24_50 = p5 . Rule specification is efficient because rules are evaluated from most specific to least specific. For example, if you wanted to route one subnet address to one port, and 254 to another, only two entries are required, i.e.
route_24_50_20 = p5
route_24_50_20_7 = p1

Furthermore, because this specification is based on alphanumeric (a-z, A-Z, 0-9) strings separated by underscores, you can use arbitary strings with arbitrary numbers of separators, as well as IP addresses. For example, these are also all legal specifications:

route_3_2_1_1_0_3_7up = p1
route_cabinet2_card3_cpu4 = p4
route_24_50_F = p2

Multicast

When a message arrives, the router checks its destination address against the multicast addresses which have been specified. If the address matches a multicast address the router sends copies of the message out each of the subscribed ports.

Subscribe/unsubscribe

When a message arrives whose destination address is of the form

subscribe_w_x_y_z or
unsubscribe_w_x_y_z

the port which received the message is added to/removed from (respectively) the multicast subscription list for that address.

Ports
Input Ports
Output Ports
In/Out Ports
Parameters
Routing Rules Description

 Unicast:
 Multicast
Route Lists

In defining complex simulation models, it is often necessary to specify a complete messaging sequence: for example, a message is sent to worker A, who does something and then sends a message to worker B, who does something and sends a message to worker C, etc. Messaging sequences such as these can be handled in either of two ways:

1) The next destination is specified at each point. In this example, worker A might insert the address of worker B into RouteField, or might create a new data structure with RouteField set to worker B's address. The message is then sent. Worker B does its job and sets RouteField to worker C's address before sending it's message.

2) Several or all of the steps in the process may be specified in a Routing List. This could apply when the workers in the example don't know who should receive their message because it is decided by someone else, maybe a Scheduler or Admin. Route lists are constructed using the Append_Route_List device.

In this case, a hierarchical data structure is used to specify the routing list. An example of a simple data_structs.txt file including such a routing list data structure is:
< DEFINE_DATA_STRUCTURES>
struct CompuSys	
 {
  int  MsgLENGTH=1
  real CREATED=0.0
  real COMPLETED=0.0
  Route_List R_Data
 }

struct Route_List
 {
   char Dummy=Temp
 }
</DEFINE_DATA_STRUCTURES>
In this case, R_Data is a route list of type Route_List, and the setup attribute is:

RouteField = R_Data

The definition of the route list data structure must be exactly as shown above.

Related models:

    Append_Route_List
    Num_to_String
    Append_String
    Admin
    PortConvert


Sender

 

File: general_blocks/All.sim

Description

Sender "wirelessly" transmits a data structure (message) between points (via a Named Synchron). It can also be used to broadcast. It is often used in combination with the Receiver device.

Ports
Input Ports
Output Ports
Parameters