rdicosmo / parmap

Parmap is a minimalistic library allowing to exploit multicore architecture for OCaml programs with minimal modifications.

Home Page:http://rdicosmo.github.io/parmap/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

redirect error

JuliaLawall opened this issue · comments

My code is:

	Printf.eprintf
	  "prefix: %s %b\n" prefix (Sys.file_exists prefix);
	flush stderr;
	Parmap.parfold
	  ~init:(fun id ->
	    Printf.eprintf "init: %s %d\n" prefix id; flush stderr;
	    Parmap.redirect ~path:prefix ~id)

I'm getting:

prefix: nothing_17_10_2017:8:36:16_9316 false
init: nothing_17_10_2017:8:36:16_9316 0
init: nothing_17_10_2017:8:36:16_9316 1
[Pid 9338]: Error creating nothing_17_10_2017:8:36:16_9316 : File exists; procee
ding without stdout/stderr redirection
init: nothing_17_10_2017:8:36:16_9316 2
init: nothing_17_10_2017:8:36:16_9316 3

What is going wrong?

On another machine, it works fine.

The problem is in the version of parmap distributed with Ubuntu (1.0-rc7). Since then, can_redirect has been extended to not fail if the directory already exists (Unix.EEXISTS error). So the problem is already solved.