Commit | Line | Data |
---|---|---|
ebf1280e | 1 | ppam_exe = function(path=".", np=parallel::detectCores(), data=NULL, args="DontLetMeEmpty") |
f1fea222 | 2 | { |
687aed4f | 3 | command_line = paste("mpirun -np ",np," ",path,"/ppam.exe cluster",sep="") |
ebf1280e BA |
4 | |
5 | #if data provided (as data.frame or matrix...): binarize it, and add it as first argument | |
6 | if (!is.null(data)) | |
7 | { | |
f9f51b6a BA |
8 | if (!is.character(data)) |
9 | { | |
10 | #assuming matrix or data.frame, WITH row names (identifiers; could be line number...) | |
11 | write.csv(data, "/tmp/data_csv", row.names=TRUE, col.names=FALSE) | |
12 | system(paste(path,"/ppam.exe serialize /tmp/data_csv /tmp/data_bin 0 0",sep="")) | |
13 | } else | |
14 | { | |
15 | system(paste(path,"/ppam.exe serialize ",data," /tmp/data_bin 0 0",sep="")) | |
16 | } | |
17 | command_line = paste(command_line," /tmp/data_bin",sep="") | |
ebf1280e BA |
18 | } |
19 | ||
20 | command_line = paste(command_line," ",args,sep="") | |
f1fea222 BA |
21 | system(command_line) |
22 | } |