finalize R 'wrapper' for stage 1; WARNING: changed series encoding. TODO: test
[epclust.git] / code / stage1 / wrapper.R
CommitLineData
ebf1280e 1ppam_exe = function(path=".", np=parallel::detectCores(), data=NULL, args="DontLetMeEmpty")
f1fea222 2{
ebf1280e
BA
3 command_line = paste("mpirun -np ",np," ",path,"/ppam.exe",sep="")
4
5 #if data provided (as data.frame or matrix...): binarize it, and add it as first argument
6 if (!is.null(data))
7 {
8 write.csv(data, "/tmp/data_csv")
9 system(paste(path,"/ppam.exe serialize /tmp/data_csv /tmp/data_bin 0 0",sep=""))
10 command_line = paste(command_line," ","/tmp/data_bin",sep="")
11 }
12
13 command_line = paste(command_line," ",args,sep="")
f1fea222
BA
14 system(command_line)
15}