mpi::send

Name

mpi::send -- Allow rank 0 to execute scripts in other ranks.

Synopsis

mpi:send target-list script

DESCRIPTION

When run in rank 0 (root process) requests that the script be run in the processes specified by target-list. The worst status and the longest result are returned. The script is only run once in each host irregardless of the number of times it is specified by target-list

The target-list parameter is a well formed Tcl list whose elements are any mixture of the following:

Using role names is the preferred way to target scripts.

NoteNOTE:
 

If you use a SpecTcl command in the script you send, you should use the local version of the command to prevent SpecTcl from trying to retransmit it. The local version of each SpecTcl command is in the namespace ::spectcl::serial::. See the examples.

EXAMPLES

Example C-1. Output the rank in each worker


mpi::send all {puts "Hello from $mpi::rank"}
                    

Note that if your SpecTclRC.tcl loads the TkCon console, the rank 0 output will go there and all other ranks output will go to its stdout

Example C-2. Have workers output their roles and ranks


mpi::send worker {puts "Hello from $mpi::role at rank $mpi::rank"}
                    

Example C-3. A send command that clears all spectra


mpi::send event_sink {
    ::spectcl::serial::clear -all
}
                    

Note this prior example is a bit silly as it can also be accomplished by clear -all in the root process.