anti GC and reflow
This commit is contained in:
parent
fc148b7e4d
commit
8379550076
|
@ -2,61 +2,54 @@
|
||||||
|
|
||||||
argv <- commandArgs(trailingOnly = TRUE)
|
argv <- commandArgs(trailingOnly = TRUE)
|
||||||
|
|
||||||
nfrom = 128
|
nfrom <- 128
|
||||||
nto = 2048
|
nto <- 2048
|
||||||
nstep = 128
|
nstep <- 128
|
||||||
loops = 1
|
loops <- 1
|
||||||
|
|
||||||
if ( length(argv) > 0 ) {
|
if (length(argv) > 0) {
|
||||||
|
for (z in 1:length(argv)) {
|
||||||
for ( z in 1:length(argv) ) {
|
if (z == 1) {
|
||||||
|
nfrom <- as.numeric(argv[z])
|
||||||
if ( z == 1 ) {
|
} else if (z == 2) {
|
||||||
nfrom <- as.numeric(argv[z])
|
nto <- as.numeric(argv[z])
|
||||||
} else if ( z==2 ) {
|
} else if (z == 3) {
|
||||||
nto <- as.numeric(argv[z])
|
nstep <- as.numeric(argv[z])
|
||||||
} else if ( z==3 ) {
|
} else if (z == 4) {
|
||||||
nstep <- as.numeric(argv[z])
|
loops <- as.numeric(argv[z])
|
||||||
} else if ( z==4 ) {
|
}
|
||||||
loops <- as.numeric(argv[z])
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
p=Sys.getenv("OPENBLAS_LOOPS")
|
p <- Sys.getenv("OPENBLAS_LOOPS")
|
||||||
if ( p != "" ) {
|
if (p != "") {
|
||||||
loops <- as.numeric(p)
|
loops <- as.numeric(p)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
cat(sprintf("From %.0f To %.0f Step=%.0f Loops=%.0f\n",nfrom, nto, nstep, loops))
|
cat(sprintf(
|
||||||
|
"From %.0f To %.0f Step=%.0f Loops=%.0f\n",
|
||||||
|
nfrom,
|
||||||
|
nto,
|
||||||
|
nstep,
|
||||||
|
loops
|
||||||
|
))
|
||||||
cat(sprintf(" SIZE Flops Time\n"))
|
cat(sprintf(" SIZE Flops Time\n"))
|
||||||
|
|
||||||
n = nfrom
|
n <- nfrom
|
||||||
while ( n <= nto ) {
|
while (n <= nto) {
|
||||||
|
A <- matrix(rnorm(n * n), ncol = n, nrow = n)
|
||||||
|
ev <- 0
|
||||||
|
z <- system.time(for (l in 1:loops) {
|
||||||
|
ev <- eigen(A)
|
||||||
|
})
|
||||||
|
|
||||||
A <- matrix(runif(n*n), ncol = n, nrow = n, byrow = TRUE)
|
mflops <- (26.66 * n * n * n) * loops / (z[3] * 1.0e6)
|
||||||
|
|
||||||
l = 1
|
|
||||||
|
|
||||||
start <- proc.time()[3]
|
st <- sprintf("%.0fx%.0f :", n, n)
|
||||||
|
cat(sprintf("%20s %10.2f MFlops %10.6f sec\n", st, mflops, z[3]))
|
||||||
|
|
||||||
while ( l <= loops ) {
|
n <- n + nstep
|
||||||
|
|
||||||
ev <- eigen(A)
|
|
||||||
l = l + 1
|
|
||||||
}
|
|
||||||
|
|
||||||
end <- proc.time()[3]
|
|
||||||
timeg = end - start
|
|
||||||
mflops = (26.66 *n*n*n ) * loops / ( timeg * 1.0e6 )
|
|
||||||
|
|
||||||
st = sprintf("%.0fx%.0f :",n , n)
|
|
||||||
cat(sprintf("%20s %10.2f MFlops %10.6f sec\n", st, mflops, timeg))
|
|
||||||
|
|
||||||
n = n + nstep
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,62 +2,63 @@
|
||||||
|
|
||||||
argv <- commandArgs(trailingOnly = TRUE)
|
argv <- commandArgs(trailingOnly = TRUE)
|
||||||
|
|
||||||
nfrom = 128
|
nfrom <- 128
|
||||||
nto = 2048
|
nto <- 2048
|
||||||
nstep = 128
|
nstep <- 128
|
||||||
loops = 1
|
loops <- 1
|
||||||
|
|
||||||
if ( length(argv) > 0 ) {
|
if (length(argv) > 0) {
|
||||||
|
for (z in 1:length(argv)) {
|
||||||
for ( z in 1:length(argv) ) {
|
if (z == 1) {
|
||||||
|
nfrom <- as.numeric(argv[z])
|
||||||
if ( z == 1 ) {
|
} else if (z == 2) {
|
||||||
nfrom <- as.numeric(argv[z])
|
nto <- as.numeric(argv[z])
|
||||||
} else if ( z==2 ) {
|
} else if (z == 3) {
|
||||||
nto <- as.numeric(argv[z])
|
nstep <- as.numeric(argv[z])
|
||||||
} else if ( z==3 ) {
|
} else if (z == 4) {
|
||||||
nstep <- as.numeric(argv[z])
|
loops <- as.numeric(argv[z])
|
||||||
} else if ( z==4 ) {
|
}
|
||||||
loops <- as.numeric(argv[z])
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
p=Sys.getenv("OPENBLAS_LOOPS")
|
p <- Sys.getenv("OPENBLAS_LOOPS")
|
||||||
if ( p != "" ) {
|
if (p != "") {
|
||||||
loops <- as.numeric(p)
|
loops <- as.numeric(p)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
cat(sprintf("From %.0f To %.0f Step=%.0f Loops=%.0f\n",nfrom, nto, nstep, loops))
|
cat(sprintf(
|
||||||
|
"From %.0f To %.0f Step=%.0f Loops=%.0f\n",
|
||||||
|
nfrom,
|
||||||
|
nto,
|
||||||
|
nstep,
|
||||||
|
loops
|
||||||
|
))
|
||||||
cat(sprintf(" SIZE Flops Time\n"))
|
cat(sprintf(" SIZE Flops Time\n"))
|
||||||
|
|
||||||
n = nfrom
|
n <- nfrom
|
||||||
while ( n <= nto ) {
|
while (n <= nto) {
|
||||||
|
A <- matrix(runif(n * n),
|
||||||
|
ncol = n,
|
||||||
|
nrow = n,
|
||||||
|
byrow = TRUE)
|
||||||
|
B <- matrix(runif(n * n),
|
||||||
|
ncol = n,
|
||||||
|
nrow = n,
|
||||||
|
byrow = TRUE)
|
||||||
|
C <- 1
|
||||||
|
|
||||||
A <- matrix(runif(n*n), ncol = n, nrow = n, byrow = TRUE)
|
z <- system.time(for (l in 1:loops) {
|
||||||
B <- matrix(runif(n*n), ncol = n, nrow = n, byrow = TRUE)
|
C <- A %*% B
|
||||||
|
l <- l + 1
|
||||||
l = 1
|
})
|
||||||
|
|
||||||
start <- proc.time()[3]
|
mflops <- (2.0 * n * n * n) * loops / (z[3] * 1.0e6)
|
||||||
|
|
||||||
while ( l <= loops ) {
|
st <- sprintf("%.0fx%.0f :", n, n)
|
||||||
|
cat(sprintf("%20s %10.2f MFlops %10.6f sec\n", st, mflops, z[3]))
|
||||||
|
|
||||||
C <- A %*% B
|
n <- n + nstep
|
||||||
l = l + 1
|
|
||||||
}
|
|
||||||
|
|
||||||
end <- proc.time()[3]
|
|
||||||
timeg = end - start
|
|
||||||
mflops = ( 2.0 *n*n*n ) * loops / ( timeg * 1.0e6 )
|
|
||||||
|
|
||||||
st = sprintf("%.0fx%.0f :",n , n)
|
|
||||||
cat(sprintf("%20s %10.2f MFlops %10.6f sec\n", st, mflops, timeg))
|
|
||||||
|
|
||||||
n = n + nstep
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,62 +2,56 @@
|
||||||
|
|
||||||
argv <- commandArgs(trailingOnly = TRUE)
|
argv <- commandArgs(trailingOnly = TRUE)
|
||||||
|
|
||||||
nfrom = 128
|
nfrom <- 128
|
||||||
nto = 2048
|
nto <- 2048
|
||||||
nstep = 128
|
nstep <- 128
|
||||||
loops = 1
|
loops <- 1
|
||||||
|
|
||||||
if ( length(argv) > 0 ) {
|
if (length(argv) > 0) {
|
||||||
|
for (z in 1:length(argv)) {
|
||||||
for ( z in 1:length(argv) ) {
|
if (z == 1) {
|
||||||
|
nfrom <- as.numeric(argv[z])
|
||||||
if ( z == 1 ) {
|
} else if (z == 2) {
|
||||||
nfrom <- as.numeric(argv[z])
|
nto <- as.numeric(argv[z])
|
||||||
} else if ( z==2 ) {
|
} else if (z == 3) {
|
||||||
nto <- as.numeric(argv[z])
|
nstep <- as.numeric(argv[z])
|
||||||
} else if ( z==3 ) {
|
} else if (z == 4) {
|
||||||
nstep <- as.numeric(argv[z])
|
loops <- as.numeric(argv[z])
|
||||||
} else if ( z==4 ) {
|
}
|
||||||
loops <- as.numeric(argv[z])
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
p=Sys.getenv("OPENBLAS_LOOPS")
|
p <- Sys.getenv("OPENBLAS_LOOPS")
|
||||||
if ( p != "" ) {
|
if (p != "") {
|
||||||
loops <- as.numeric(p)
|
loops <- as.numeric(p)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
cat(sprintf("From %.0f To %.0f Step=%.0f Loops=%.0f\n",nfrom, nto, nstep, loops))
|
cat(sprintf(
|
||||||
|
"From %.0f To %.0f Step=%.0f Loops=%.0f\n",
|
||||||
|
nfrom,
|
||||||
|
nto,
|
||||||
|
nstep,
|
||||||
|
loops
|
||||||
|
))
|
||||||
cat(sprintf(" SIZE Flops Time\n"))
|
cat(sprintf(" SIZE Flops Time\n"))
|
||||||
|
|
||||||
n = nfrom
|
n <- nfrom
|
||||||
while ( n <= nto ) {
|
while (n <= nto) {
|
||||||
|
A <- matrix(rnorm(n * n), ncol = n, nrow = n)
|
||||||
|
B <- matrix(rnorm(n * n), ncol = n, nrow = n)
|
||||||
|
|
||||||
A <- matrix(runif(n*n), ncol = n, nrow = n, byrow = TRUE)
|
z <- system.time(for (l in 1:loops) {
|
||||||
B <- matrix(runif(n*n), ncol = n, nrow = n, byrow = TRUE)
|
solve(A, B)
|
||||||
|
})
|
||||||
l = 1
|
|
||||||
|
|
||||||
start <- proc.time()[3]
|
mflops <-
|
||||||
|
(2.0 / 3.0 * n * n * n + 2.0 * n * n * n) * loops / (z[3] * 1.0e6)
|
||||||
|
|
||||||
while ( l <= loops ) {
|
st <- sprintf("%.0fx%.0f :", n, n)
|
||||||
|
cat(sprintf("%20s %10.2f MFlops %10.6f sec\n", st, mflops, z[3]))
|
||||||
|
|
||||||
solve(A,B)
|
n <- n + nstep
|
||||||
l = l + 1
|
|
||||||
}
|
|
||||||
|
|
||||||
end <- proc.time()[3]
|
|
||||||
timeg = end - start
|
|
||||||
mflops = (2.0/3.0 *n*n*n + 2.0 *n*n*n ) * loops / ( timeg * 1.0e6 )
|
|
||||||
|
|
||||||
st = sprintf("%.0fx%.0f :",n , n)
|
|
||||||
cat(sprintf("%20s %10.2f MFlops %10.6f sec\n", st, mflops, timeg))
|
|
||||||
|
|
||||||
n = n + nstep
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue