On 19 March 2016 at 14:11, aakrem...@aol.com wrote: | Dear Rcpp Developer List subscribers, | | I am experimenting with OpenMP on Rcpp. Here is a simple program I'm trying to | run on my (4-core MacBookPro 8,3, Intel Cor i7, 2.3 GHz) computer (clang-omp | compiler): | | #include <RcppArmadillo.h> | #include <math.h> | #ifdef _OPENMP | #include <omp.h> | #endif | #include<map> | #include<vector> | #include<random> | | //[[Rcpp::plugins(openmp)]] | //[[Rcpp::depends(RcppArmadillo)]] | using namespace Rcpp; | using namespace arma; | | | // [[Rcpp::export]] | void nof(int nn_thrds) | { | omp_set_num_threads(nn_thrds); | #pragma omp parallel for | for(int i = 0; i < 100; i++) { | #pragma omp critical | { | Rcout << i << std::endl; | } | } | } | | /***R | nof(2) | */ | | PROBLEMS: | 1. (Minor): Diagnostics message use of undeclared identifier | omp_set_num_threads,
So you don't declare OMP correct. | 2. (Major): The program terminates the R session with | R Session Aborted | R encountered a fatal error | The session was terminated | | Sometimes I receive the messages | Error C stack is too close to the limit | Error during wrapup: C stack usage is too close to the limit | Type Error: 'null' is not an object (evaluating 'c[a]') That means you are messing your calls up and the stack does not get unwound. Simplify. | I use RStudio 0.99.893 Irrelevant. | QUESTIONS: | 1. What is going on? You have bugs. | 2. Is there any legible description of such error messages on the Internet? | --I mean, they seem way too cryptic to me... At least the resources are free... Dirk | Thank you in advance. | | Anguel | _______________________________________________ | Rcpp-devel mailing list | Rcpp-devel@lists.r-forge.r-project.org | https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel -- http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org _______________________________________________ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel