Using `info` inside a function that is executed in parallel


#1

INFO seems to get printed multiple times on the same line

julia> @everywhere function test(i)
       info("HI $i")
       end

julia> pmap(test,1:10);
INFO: INFO: INFO: INFO: HI 3
HI 4
HI 2
HI 1
INFO: INFO: HI 5
INFO: HI 6
INFO: HI 7
INFO: HI 8
INFO: HI 9
HI 10

I’m not sure if this is actually a bug or expected behavior since io with parallel stuff is finicky


#2

This is expected. You cannot expect anything running in parallel to be atomic unless explicitly synchronized.


#3

Hi,
in Version 0.7.0-DEV.33 (2017-05-05 19:56 UTC)

julia> @everywhere function test(i)
              info("HI $i")
              end
julia> pmap(test,1:10);
INFO: HI 1
INFO: HI 2
INFO: HI 3
INFO: HI 4
INFO: HI 5
INFO: HI 6
INFO: HI 7
INFO: HI 8
INFO: HI 9
INFO: HI 10

#4

Did you add more processes?


#5

:smile:

PS C:\WINDOWS\system32> julia -p 2
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: https://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.7.0-DEV.33 (2017-05-05 19:56 UTC)
 _/ |\__'_|_|_|\__'_|  |  Commit 22901aa* (1 day old master)
|__/                   |  x86_64-w64-mingw32

julia> @everywhere function test(i)
              info("HI $i")
              end

julia> pmap(test,1:10);
INFO: INFO: HI 1
INFO: HI 3
INFO: HI 4
INFO: HI 5
INFO: HI 6
INFO: HI 7
INFO: HI 8
INFO: HI 9
INFO: HI 10
HI 2