scala.svd.setup: Initializes Calls to ScaLAPACK SVD

Description Usage Arguments Examples

Description

Creates directory with everything needed to run scalapack 1) Fortran program with call to scalapack 2) Parameters needed for fortran program 3) Block Cyclic Distribution of input array 4) Folders for output 5) Script to compile (NOTE: designed to work on SCINET, but should be easily modifiable to your preferred cluster) 6) Script to execute (NOTE: same note as 5)

Usage

1
2
scala.svd.setup(input, BIGarr = TRUE, read.function = NULL, matdims,
  blockdims, procdims, proc.dir, walltime = "01:00:00", progbar = TRUE)

Arguments

input

2D numeric matrix (if BIGarr=FALSE) or vector of filenames (if BIGarr=TRUE), where filenames contain numeric vectors corresponding to columns of the input 2D matrix

BIGarr

LOGICAL. If FALSE, input must be a 2D numeric matrix. If TRUE, input must be a vector of filenames.

read.function

CHARACTER. String of function name that reads input filenames (needed if BIGarr=TRUE). Function can only have one argument and that MUST be the filename.

matdims

dimensions of input matrix, for which SVD will be computed

blockdims

dimensions of blocks for block-cyclic distribution (see http://netlib.org/scalapack/slug/node75.html for details on block-cyclic distribution)

procdims

dimensions of processor array (Example procdims=c(8,7) means processor array has 8 rows and 7 columns, thus 56 processors in all).

proc.dir

directory where all the ScaLAPACK SVD computations will be run.

walltime

Max time for jobs on a PBS queuing system. You can ignore this is you have a different queuing system.

progbar

progress bar when reading files (BIGarr=TRUE). Requires 'pbapply' package.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
## Not run: 
#### Example where the input array is huge (BIGarr=TRUE)
# Read csv with filenames
# Make read.function for the filenames. 
#    Read function requires functions from package 'ABIgeneRMINC'.
#    First mask the data, then interpolate and scale (mean 0, sd 1), and output the resulting vector
# Call scala.svd.setup to set up directory for ScaLAPACK SVD

# Read CSV
library(ABIgeneRMINC)
df=read.csv("/projects/egerek/matthijs/2015-07-Allen-Brain/Allen_Gene_Expression/gene_ids_stats2.csv")
files=as.character(subset(df,cutting_plane=='coronal')$raw_data)

# Create Function That Reads Filename
mask=read.raw.gene("/projects/egerek/matthijs/2015-07-Allen-Brain/Allen_Gene_Expression/labels/allen_grid_labels.raw",labels=TRUE)>0
read.gene.int.scale=function(filename){
     genevec=read.raw.gene(filename)
     intgene=interpolate.gene(genevec,mask)
     sgene=scale(intgene[mask],center=TRUE,scale=TRUE)
     return(scale(intgene[mask],center=TRUE,scale=TRUE))
}

# call scala.svd.setup
scala.svd.setup(files,read.function="read.gene.int.scale",matdims=c(62529,4345),blockdims=c(100,100),procdims=c(8,8),proc.dir="gene_svd",walltime="01:00:00")


#### Example where the input array is small (BIGarr=FALSE)
#Read files into columns of input matrix
inptmatrix=do.call('cbind',lapply(files,read.gene.int.scale))

# call scala.svd.setup
scala.svd.setup(inptmatrix,BIGarr=FALSE,matdims=dim(inptmatrix),blockdims=c(100,100),procdims=c(8,8),proc.dir="gene_svd",walltime="01:00:00")

## End(Not run)

DJFernandes/RscalapackSVD documentation built on May 6, 2019, 1:17 p.m.