FormTeam

Divides the current team into new teams.

Declaration

Syntax

FormTeam(expr team_number, expr team, expr? new_index, expr? stat,
    expr? errmsg)

Arguments

Argument

Description

team_number

which new team this image joins.

team

the team variable that describes the new team.

new_index

the index this image takes in the new team.

stat

a variable receiving the status.

errmsg

a character variable receiving the error message.

Return values

None.

Description

form team is executed by every image of the current team: each one names the team it joins, and the images naming the same number end up in the same team. The resulting team variable is what ChangeTeam and SyncTeam take.

Examples

(FormTeam
  :team_number (IntegerConstant
    :n 1
    :type (Integer
      :kind 4
    )
    :intboz_type :Decimal
  )
  :team (Var
    :v (SymbolRef 1 "team")
  )
  :new_index (Var
    :v (SymbolRef 1 "n")
  )
  :stat nil
  :errmsg nil
)

It comes from this complete ASR text document:

(TranslationUnit
  :symtab (SymbolTable
    :id 0
    :symbols {
      "main" (Program
        :symtab (SymbolTable
          :id 1
          :symbols {
            "n" (Variable
              :parent_symtab 1
              :name "n"
              :dependencies []
              :intent :Local
              :symbolic_value nil
              :value nil
              :storage :Default
              :type (Integer
                :kind 4
              )
              :type_declaration nil
              :abi :Source
              :access :Public
              :presence :Required
              :value_attr false
              :target_attr false
              :contiguous_attr false
              :bindc_name nil
              :is_volatile false
              :is_protected false
              :pass_attr :NotMethod
              :self_argument nil
              :codims []
            )
            "stat" (Variable
              :parent_symtab 1
              :name "stat"
              :dependencies []
              :intent :Local
              :symbolic_value nil
              :value nil
              :storage :Default
              :type (Integer
                :kind 4
              )
              :type_declaration nil
              :abi :Source
              :access :Public
              :presence :Required
              :value_attr false
              :target_attr false
              :contiguous_attr false
              :bindc_name nil
              :is_volatile false
              :is_protected false
              :pass_attr :NotMethod
              :self_argument nil
              :codims []
            )
            "team" (Variable
              :parent_symtab 1
              :name "team"
              :dependencies []
              :intent :Local
              :symbolic_value nil
              :value nil
              :storage :Default
              :type (Integer
                :kind 4
              )
              :type_declaration nil
              :abi :Source
              :access :Public
              :presence :Required
              :value_attr false
              :target_attr false
              :contiguous_attr false
              :bindc_name nil
              :is_volatile false
              :is_protected false
              :pass_attr :NotMethod
              :self_argument nil
              :codims []
            )
          }
        )
        :name "main"
        :dependencies []
        :body [
          (SyncAll
            :stat (Var
              :v (SymbolRef 1 "stat")
            )
            :errmsg nil
          )
          (SyncImages
            :image_set (Var
              :v (SymbolRef 1 "n")
            )
            :stat (Var
              :v (SymbolRef 1 "stat")
            )
            :errmsg nil
          )
          (SyncMemory
            :stat (Var
              :v (SymbolRef 1 "stat")
            )
            :errmsg nil
          )
          (FormTeam
            :team_number (IntegerConstant
              :n 1
              :type (Integer
                :kind 4
              )
              :intboz_type :Decimal
            )
            :team (Var
              :v (SymbolRef 1 "team")
            )
            :new_index (Var
              :v (SymbolRef 1 "n")
            )
            :stat nil
            :errmsg nil
          )
          (SyncTeam
            :team (Var
              :v (SymbolRef 1 "team")
            )
            :stat (Var
              :v (SymbolRef 1 "stat")
            )
            :errmsg nil
          )
          (ChangeTeam
            :team (Var
              :v (SymbolRef 1 "team")
            )
            :stat nil
            :errmsg nil
            :body [
              (Assignment
                :target (Var
                  :v (SymbolRef 1 "n")
                )
                :value (IntegerConstant
                  :n 0
                  :type (Integer
                    :kind 4
                  )
                  :intboz_type :Decimal
                )
                :overloaded nil
                :realloc_lhs false
                :move_allocation false
              )
            ]
            :end_stat nil
            :end_errmsg nil
          )
        ]
      )
    }
  )
  :items []
)

See Also

ChangeTeam, SyncTeam, SyncAll