SyncAll

Waits until every image reaches this point.

Declaration

Syntax

SyncAll(expr? stat, expr? errmsg)

Arguments

Argument

Description

stat

a variable receiving the status of the synchronisation.

errmsg

a character variable receiving the error message.

Return values

None.

Description

sync all is a barrier across all images of a coarray program: no image continues until all of them have arrived, and every coarray write made before the barrier is visible to every image after it.

Examples

(SyncAll
  :stat (Var
    :v (SymbolRef 1 "stat")
  )
  :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

SyncImages, SyncMemory, SyncTeam, CoarrayRef