diff --git a/R_lib/CMakeLists.txt b/R_lib/CMakeLists.txt index 46896d88e..24bab1690 100644 --- a/R_lib/CMakeLists.txt +++ b/R_lib/CMakeLists.txt @@ -1 +1 @@ -install(FILES kin_r_library.R parallel_r_library.R DESTINATION R_lib) +install(FILES kin_r_library.R DESTINATION R_lib) diff --git a/R_lib/parallel_r_library.R b/R_lib/parallel_r_library.R deleted file mode 100644 index ecaecbcc5..000000000 --- a/R_lib/parallel_r_library.R +++ /dev/null @@ -1,58 +0,0 @@ -### Copyright (C) 2018-2021 Marco De Lucia (GFZ Potsdam) -### -### POET is free software; you can redistribute it and/or modify it under the -### terms of the GNU General Public License as published by the Free Software -### Foundation; either version 2 of the License, or (at your option) any later -### version. -### -### POET is distributed in the hope that it will be useful, but WITHOUT ANY -### WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR -### A PARTICULAR PURPOSE. See the GNU General Public License for more details. -### -### You should have received a copy of the GNU General Public License along with -### this program; if not, write to the Free Software Foundation, Inc., 51 -### Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -distribute_work_packages <- function(len, package_size) -{ - ## Check if work_package is a divisor of grid length and act - ## accordingly - if ((len %% package_size) == 0) { - n_packages <- len/package_size - } else { - n_packages <- floor(len/package_size) + 1 - } - - ids <- rep(1:n_packages, times=package_size, each = 1)[1:len] - return(ids) -} - -compute_wp_sizes <- function(ids) -{ - as.integer(table(ids)) -} - -shuffle_field <- function(data, send_ord) -{ - shf <- data[send_ord,] - return(shf) -} - -unshuffle_field <- function(data, send_ord) -{ - data[send_ord,] <- data - rownames(data) <- NULL - return(data) -} - -stat_wp_sizes <- function(sizes) -{ - res <- as.data.frame(table(sizes)) - if (nrow(res)>1) { - msgm("Chosen work_package_size is not a divisor of grid length. ") - colnames(res) <- c("Size", "N") - print(res) - } else { - msgm("All work packages of length ", sizes[1]) - } -} diff --git a/app/poet.cpp b/app/poet.cpp index c6c455143..0cd79ef75 100644 --- a/app/poet.cpp +++ b/app/poet.cpp @@ -66,10 +66,8 @@ int main(int argc, char *argv[]) { /*Loading Dependencies*/ // TODO: kann raus - std::string r_load_dependencies = "suppressMessages(library(Rmufits));" - "suppressMessages(library(RedModRphree));" - "source('../R_lib/kin_r_library.R');" - "source('../R_lib/parallel_r_library.R');"; + std::string r_load_dependencies = "suppressMessages(library(RedModRphree));" + "source('../R_lib/kin_r_library.R');"; R.parseEvalQ(r_load_dependencies); SimParams params(world_rank, world_size);