Skip to content

Commit

Permalink
fix print in exemple
Browse files Browse the repository at this point in the history
  • Loading branch information
pnavaro committed Sep 26, 2024
1 parent d6e2c1b commit 6cf222a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions corrections/rowsum.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@ hostname <- mpi.get.processor.name()
msg <- sprintf("Hello world from task %03d of %03d, on host %s \n", my.rank , my.size , hostname)
cat(msg)
my.loop <- 20
my.split <- data.frame(loop = 1 : my.loop,
rank = sort(c(rep(0 : (my.size-1), my.loop %/% my.size),
if(my.loop %% my.size > 0)
(my.size : 2)[1 : (my.loop %% my.size)])))
my.split <- .splitIndices(my.loop, my.size)

my.loop <- my.split$loop[my.split$rank == my.rank]
my.loop <- unlist(my.split[my.rank+1])
cat("\n", my.loop)

ret <- 0
for(i in my.loop){
Expand Down

0 comments on commit 6cf222a

Please sign in to comment.