fixed OpenMP problem with r.run_in_parallel