-
Notifications
You must be signed in to change notification settings - Fork 0
/
03_ApplyPaleoGenerate.R
executable file
·76 lines (64 loc) · 1.63 KB
/
03_ApplyPaleoGenerate.R
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# 03_ApplyPaleoGenerate
## Applying PaleoGenerate
## PaleoGenerate2.0
## ML Gaynor
# Load source
source("functions/PaleoGenerate.R")
# Load packages
library(foreach)
library(doParallel)
library(iterators)
library(doMC)
# Load time slices
Slice <- read.csv("Slice/Slice_time.csv")
time <- Slice$Time
seq(time)
## make_parallel
make_parallel <- function(schedulerCores){
numCores = 1
print(paste("Requested cores:", schedulerCores))
numCores = schedulerCores
registerDoParallel(numCores)
registerDoMC(numCores)
print(paste("Using ", numCores, " CPU cores for analysis"))
return(numCores)
}
## Set nodes to 15
num <- make_parallel(15)
# Run Paleo_layergenerate
## Bio1
foreach (data=seq_along(time)) %dopar% {
var1 <- as.numeric(time[[data]])
BioV <- "Bio1"
Paleo_layergenerate(var1, BioV, folder = "output/Bio1/")
}
## Bio4
foreach (data=seq_along(time)) %dopar% {
var1 <- as.numeric(time[[data]])
BioV <- "Bio4"
Paleo_layergenerate(var1, BioV, folder = "output/Bio4/")
}
## Bio12
foreach (data=seq_along(time)) %dopar% {
var1 <- as.numeric(time[[data]])
BioV <- "Bio12"
Paleo_layergenerate(var1, BioV, folder = "output/Bio12/")
}
## Bio13
foreach (data=seq_along(time)) %dopar% {
var1 <- as.numeric(time[[data]])
BioV <- "Bio13"
Paleo_layergenerate(var1, BioV, folder = "output/Bio13/")
}
## Bio14
foreach (data=seq_along(time)) %dopar% {
var1 <- as.numeric(time[[data]])
BioV <- "Bio14"
Paleo_layergenerate(var1, BioV, folder = "output/Bio14/")
}
## Bio15
foreach (data=seq_along(time)) %dopar% {
var1 <- as.numeric(time[[data]])
BioV <- "Bio15"
Paleo_layergenerate(var1, BioV, folder = "output/Bio15/")
}