I was testing the latest version of scoop from the git source, specifically the calc.py monte carlo example. It ran very quickly on my 8-core machine, so I decided to test it harder, and multiplied both arguments of the calcPi function by 10, e.g.
dataPi = calcPi(30000, 50000)
. Now this took longer (not surprisingly, it was close to 100 times longer - the initial time was about 1.52 seconds while the extended time was about 115 seconds). Having a long enough run to let me test how well it worked on multiple devices, I created a hostfile listing my machine and 4 others, each with 8 cpus. I had already followed the instructions to make ssh work easily, and all machines share a commonly mounted drive. I could check on each host during the run and see that there were processes executing. So the result surprised me - it still took 115 seconds!
Did I do something wrong? Considering that making each parameter ten times bigger resulted in a roughly 100 times the calculation time, I was assuming that having 5 times the processing power would make it take a fifth of the time, so somewhere in the range of 20-30 seconds.
Here is a copy of relevant input/output (I've renamed all the hosts and obfuscated some IPs just to keep my IT guys happy about security). As mentioned above, this is using examples/pi_calc.py, with the main line changed to dataPi = calcPi(30000, 50000). In case it changes drastically over time, here's a copy of it:
[smermelstein@host1 examples]$ python -m scoop --pythonpath $PYTHONPATH pi_calc.py
[2016-06-20 11:57:42,599] launcher INFO SCOOP 0.7 2.0 on linux using Python 3.5.1 |Anaconda 4.0.0 (64-bit)| (default, Dec 7 2015, 11:16:01) [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)], API: 1013
[2016-06-20 11:57:42,599] launcher INFO Deploying 8 worker(s) over 1 host(s).
[2016-06-20 11:57:42,599] launcher INFO Worker d--istribution:
[2016-06-20 11:57:42,599] launcher INFO
127.0.0.1: 7 + origin
Launching 8 worker(s) using /bin/bash.
pi = 3.141626184
total time: 115.43567848205566
[2016-06-20 11:59:38,905] launcher (
127.0.0.1:38437) INFO Root process is done.
[2016-06-20 11:59:38,905] launcher (
127.0.0.1:38437) INFO Finished cleaning spawned subprocesses.
[smermelstein@host1 examples]$ python -m scoop --hostfile hostfile --pythonpath $PYTHONPATH pi_calc.py
[2016-06-20 11:50:56,504] launcher INFO SCOOP 0.7 2.0 on linux using Python 3.5.1 |Anaconda 4.0.0 (64-bit)| (default, Dec 7 2015, 11:16:01) [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)], API: 1013
[2016-06-20 11:50:56,504] launcher INFO Deploying 40 worker(s) over 5 host(s).
[2016-06-20 11:50:56,504] launcher INFO Worker d--istribution:
[2016-06-20 11:50:56,504] launcher INFO host1: 7 + origin
[2016-06-20 11:50:56,505] launcher INFO host2: 8
[2016-06-20 11:50:56,505] launcher INFO host3: 8
[2016-06-20 11:50:56,505] launcher INFO host4: 8
[2016-06-20 11:50:56,505] launcher INFO host5: 8
Warning: Permanently added 'host2,10.0.xx.aa' (ECDSA) to the list of known hosts.
Warning: Permanently added 'host4,
10.0.xx.bb' (ECDSA) to the list of known hosts.
Warning: Permanently added 'host5,
10.0.xx.cc' (ECDSA) to the list of known hosts.
Launching 8 worker(s) using /bin/bash.
Authorized Users Only!
By accessing this system you are consenting to complete
monitoring with no expectation of privacy. Unauthorized access or use may
subject you to disciplinary action and criminal prosecution.
Authorized Users Only!
By accessing this system you are consenting to complete
monitoring with no expectation of privacy. Unauthorized access or use may
subject you to disciplinary action and criminal prosecution.
Authorized Users Only!
By accessing this system you are consenting to complete
monitoring with no expectation of privacy. Unauthorized access or use may
subject you to disciplinary action and criminal prosecution.
Warning: Permanently added 'host3,10.0.xx.dd' (ECDSA) to the list of known hosts.
Authorized Users Only!
By accessing this system you are consenting to complete
monitoring with no expectation of privacy. Unauthorized access or use may
subject you to disciplinary action and criminal prosecution.
Launching 8 worker(s) using /bin/bash.
Launching 8 worker(s) using /bin/bash.
Launching 8 worker(s) using /bin/bash.
Launching 8 worker(s) using /bin/bash.
pi = 3.1415989786666665
total time: 117.70856070518494
[2016-06-20 11:52:55,385] launcher (
127.0.0.1:37657) INFO Root process is done.
Killed by signal 15.
Killed by signal 15.
Killed by signal 15.
[2016-06-20 11:52:55,385] launcher (
127.0.0.1:37657) INFO Finished cleaning spawned subprocesses.
Killed by signal 15.
As you can probably infer from the above, this is what the hostfile (again, with the names changed) looks like:
I must be doing something wrong. I'd love to use this module, but it only helps me if running on multiple hosts reduces the execution time. Thanks for any help you can give!