thekingofkings / chicago-crime

Crime correlation anaysis
MIT License
11 stars 3 forks source link

Print information in parallel R for loop %dopar% #22

Open thekingofkings opened 7 years ago

thekingofkings commented 7 years ago

Task

Output debugging message within %dopar% function.

Scenario

When debugging #21, most permutations are run within the parallel %dopar for-loop, and there is no easy way to print message to stdout.

Reference

I found this socket based solution link here. However, the socket does not work for me.

Problem

Nothing is outputted to the socket. Also, the socket will automatically shutdown and make the program stuck.

I tried the socket write in a parent R process, and it works. Potential reason for the socket stuck is multiple threads compete for I/O resource and deadlock the program.

Fix this in the future this issue is independent to this project.