[Rd] How to use mpi.allreduce() in Rmpi?

2010-07-12 Thread Eduardo García
Hi everybody! I have the next code which makes a reduction of the *a *variable in two slaves, using the Rmpi package. library(Rmpi) #get the slaves mpi.spawn.Rslaves(nslaves=2) #slaves will execute this function reduc<-function(){ a<-mpi.comm.rank()+2 mpi.reduce(a,type=2, op="prod") retur

[Rd] Set the number of threads using openmp with .C

2010-07-10 Thread Eduardo García
Hi everybody! Could somebody help me with the following? I'm trying to run a simple Hello World code in openmp using .C function. The C code i have is: #include #include #include void hello_omp(int *n) { int th_id, nthreads; omp_set_num_threads(*n); #pragma omp parallel private(t