sla.gridInit {RScaLAPACK} | R Documentation |
Sets up grid for use by the sla.* functions by spawning the requested number of processes.
sla.gridInit(NPROWS=1, NPCOLS=1, BLOCKSIZE=16)
NPROWS |
Number of Process Rows in the process grid |
NPCOLS |
Number of Process Columns in the process grid |
BLOCKSIZE |
Block Size. |
The requested number of processes are spawned and left waiting for further instruction. If a grid a already present, the function instead prints and error and returns. The grid can then be used by sla.* functions by setting the SPAWN
parameter of those function to zero (most of the time, RFLAG
should also be set to zero). Functions do not have to use the full grid, and the shape doesn't matter. For example if user spawns 6 processes by "sla.gridInit(6)",
it can be used as a "2 x 2", "1 x 6", "2 x 3", "3 x 2", etc process grid.
This was implemented for two reasons. One, it slightly reduces the overhead of the call. Second, it allows many ScaLAPACK calls without needing to open lots of sockets (as LAM/MPI does for each process spawned). We strongly recommend that you release the process grid before exiting R, although in our tests the MPI daemon usually closed the child processes when the R session was closed.
Nagiza Samatova (samatovan@ornl.gov), Guruprasad Kora (koragh@ornl.gov), Srikanth Yoginath (yoginathsb@ornl.gov), David Bauer (bauerda@ornl.gov)
http://www.netlib.org/scalapack/
sla.gridExit
for releasing the Process Grid,
x = matrix(rnorm(128*128), 128, 128) sla.gridInit(NPROWS=2, NPCOLS=2) sla.solve(x, NPROWS=2, NPCOLS=2, RFLAG=FALSE, SPAWN=FALSE)->a sla.gridExit()