Axelrod-Python / axelrod-fortran

Python wrapper library around TourExec Fortran for Axelrod's second tournament.
Other
4 stars 0 forks source link

Error in tournament on a given machine #78

Closed drvinceknight closed 5 years ago

drvinceknight commented 6 years ago

@marcharper and @meatballs not sure if you can offer any insight here, following #77 I'm giving the following code a go (a simple tournament with all strategies):

import axelrod as axl

from axelrod_fortran import Player
from axelrod_fortran.strategies import second_tournament_strategies

if __name__ == "__main__":
    players = [Player(name) for name in second_tournament_strategies]
    tournament = axl.Tournament(players, repetitions=1)
    results = tournament.play(processes=4)
    print(results.ranked_names)

I get the following error(s), then the tournament continues to run:

(investigate-axlf) vince@siren:~$ python test_axlf.py 
Playing matches:   0%|                                                                                                       | 0/2016 [00:00<?, ?it/s]Exception ignored in: <bound method Player.__del__ of k31r>
Traceback (most recent call last):
  File "/home/vince/.conda/envs/investigate-axlf/lib/python3.6/site-packages/axelrod_fortran/player.py", line 134, in __del__
    self._release_shared_library()
  File "/home/vince/.conda/envs/investigate-axlf/lib/python3.6/site-packages/axelrod_fortran/player.py", line 122, in _release_shared_library
    shared_library_manager.release(self.original_name, self.index)
  File "<string>", line 2, in release
  File "/home/vince/.conda/envs/investigate-axlf/lib/python3.6/multiprocessing/managers.py", line 772, in _callmethod
    raise convert_to_error(kind, result)
KeyError: 1
Process Process-4:
Traceback (most recent call last):
  File "/home/vince/.conda/envs/investigate-axlf/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/home/vince/.conda/envs/investigate-axlf/lib/python3.6/multiprocessing/process.py", line 93, in run
    self._target(*self._args, **self._kwargs)
  File "/home/vince/.conda/envs/investigate-axlf/lib/python3.6/site-packages/axelrod/tournament.py", line 401, in _worker
    interactions = self._play_matches(chunk, build_results)
  File "/home/vince/.conda/envs/investigate-axlf/lib/python3.6/site-packages/axelrod/tournament.py", line 430, in _play_matches
    match.play()
  File "/home/vince/.conda/envs/investigate-axlf/lib/python3.6/site-packages/axelrod/match.py", line 142, in play
    p.reset()
  File "/home/vince/.conda/envs/investigate-axlf/lib/python3.6/site-packages/axelrod_fortran/player.py", line 128, in reset
    self._release_shared_library()
  File "/home/vince/.conda/envs/investigate-axlf/lib/python3.6/site-packages/axelrod_fortran/player.py", line 122, in _release_shared_library
    shared_library_manager.release(self.original_name, self.index)
  File "<string>", line 2, in release
  File "/home/vince/.conda/envs/investigate-axlf/lib/python3.6/multiprocessing/managers.py", line 772, in _callmethod
    raise convert_to_error(kind, result)
KeyError: 3
Playing matches:   2%|

It does seem to hang on a final match (2015/2016):

Playing matches: 100%|█████████████████████████▉| 2015/2016 [02:00<00:00, 16.82it/s]

I get similar results when running different number of repetitions.

I seem unable to reproduce this on other machines of mine (where this code runs just fine).

I was aiming to give the full tournament a whirl for comparison with the reproducing paper and it could just be something weird on the specific server I tried so it's not the end of the world, I can run on something else.

Any immediate thoughts?

marcharper commented 6 years ago

Nothing immediate comes to mind. I can take a look at it later.

On Fri, Oct 19, 2018, 7:46 AM Vince Knight notifications@github.com wrote:

@marcharper https://github.com/marcharper and @meatballs https://github.com/meatballs not sure if you can offer any insight here, following #77 https://github.com/Axelrod-Python/axelrod-fortran/pull/77 I'm giving the following code a go (a simple tournament with all strategies):

import axelrod as axl

from axelrod_fortran import Player from axelrod_fortran.strategies import second_tournament_strategies

if name == "main": players = [Player(name) for name in second_tournament_strategies] tournament = axl.Tournament(players, repetitions=1) results = tournament.play(processes=4) print(results.ranked_names)

I get the following error(s), then the tournament continues to run:

(investigate-axlf) vince@siren:~$ python test_axlf.py Playing matches: 0%| | 0/2016 [00:00<?, ?it/s]Exception ignored in: Traceback (most recent call last): File "/home/vince/.conda/envs/investigate-axlf/lib/python3.6/site-packages/axelrod_fortran/player.py", line 134, in del self._release_shared_library() File "/home/vince/.conda/envs/investigate-axlf/lib/python3.6/site-packages/axelrod_fortran/player.py", line 122, in _release_shared_library shared_library_manager.release(self.original_name, self.index) File "", line 2, in release File "/home/vince/.conda/envs/investigate-axlf/lib/python3.6/multiprocessing/managers.py", line 772, in _callmethod raise convert_to_error(kind, result) KeyError: 1 Process Process-4: Traceback (most recent call last): File "/home/vince/.conda/envs/investigate-axlf/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap self.run() File "/home/vince/.conda/envs/investigate-axlf/lib/python3.6/multiprocessing/process.py", line 93, in run self._target(*self._args, **self._kwargs) File "/home/vince/.conda/envs/investigate-axlf/lib/python3.6/site-packages/axelrod/tournament.py", line 401, in _worker interactions = self._play_matches(chunk, build_results) File "/home/vince/.conda/envs/investigate-axlf/lib/python3.6/site-packages/axelrod/tournament.py", line 430, in _play_matches match.play() File "/home/vince/.conda/envs/investigate-axlf/lib/python3.6/site-packages/axelrod/match.py", line 142, in play p.reset() File "/home/vince/.conda/envs/investigate-axlf/lib/python3.6/site-packages/axelrod_fortran/player.py", line 128, in reset self._release_shared_library() File "/home/vince/.conda/envs/investigate-axlf/lib/python3.6/site-packages/axelrod_fortran/player.py", line 122, in _release_shared_library shared_library_manager.release(self.original_name, self.index) File "", line 2, in release File "/home/vince/.conda/envs/investigate-axlf/lib/python3.6/multiprocessing/managers.py", line 772, in _callmethod raise convert_to_error(kind, result) KeyError: 3 Playing matches: 2%|

It does seem to hang on a final match (2015/2016):

Playing matches: 100%|█████████████████████████▉| 2015/2016 [02:00<00:00, 16.82it/s]

I get similar results when running different number of repetitions.

I seem unable to reproduce this on other machines of mine (where this code runs just fine).

I was aiming to give the full tournament a whirl for comparison with the reproducing paper and it could just be something weird on the specific server I tried so it's not the end of the world, I can run on something else.

Any immediate thoughts?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Axelrod-Python/axelrod-fortran/issues/78, or mute the thread https://github.com/notifications/unsubscribe-auth/AAMaUWClhJjrI3zV5i6LiXyHcV83drodks5umeXIgaJpZM4XwgTC .

drvinceknight commented 6 years ago

Only if you have time to spare. If it's not immediately familiar I suspect it's just something weird on the machine in question... 🙂

On Fri, 19 Oct 2018 at 16:24, Marc notifications@github.com wrote:

Nothing immediate comes to mind. I can take a look at it later.

On Fri, Oct 19, 2018, 7:46 AM Vince Knight notifications@github.com wrote:

@marcharper https://github.com/marcharper and @meatballs https://github.com/meatballs not sure if you can offer any insight here, following #77 https://github.com/Axelrod-Python/axelrod-fortran/pull/77 I'm giving the following code a go (a simple tournament with all strategies):

import axelrod as axl

from axelrod_fortran import Player from axelrod_fortran.strategies import second_tournament_strategies

if name == "main": players = [Player(name) for name in second_tournament_strategies] tournament = axl.Tournament(players, repetitions=1) results = tournament.play(processes=4) print(results.ranked_names)

I get the following error(s), then the tournament continues to run:

(investigate-axlf) vince@siren:~$ python test_axlf.py Playing matches: 0%| | 0/2016 [00:00<?, ?it/s]Exception ignored in:

Traceback (most recent call last): File "/home/vince/.conda/envs/investigate-axlf/lib/python3.6/site-packages/axelrod_fortran/player.py", line 134, in __del__ self._release_shared_library() File "/home/vince/.conda/envs/investigate-axlf/lib/python3.6/site-packages/axelrod_fortran/player.py", line 122, in _release_shared_library shared_library_manager.release(self.original_name, self.index) File "", line 2, in release File "/home/vince/.conda/envs/investigate-axlf/lib/python3.6/multiprocessing/managers.py", line 772, in _callmethod raise convert_to_error(kind, result) KeyError: 1 Process Process-4: Traceback (most recent call last): File "/home/vince/.conda/envs/investigate-axlf/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap self.run() File "/home/vince/.conda/envs/investigate-axlf/lib/python3.6/multiprocessing/process.py", line 93, in run self._target(*self._args, **self._kwargs) File "/home/vince/.conda/envs/investigate-axlf/lib/python3.6/site-packages/axelrod/tournament.py", line 401, in _worker interactions = self._play_matches(chunk, build_results) File "/home/vince/.conda/envs/investigate-axlf/lib/python3.6/site-packages/axelrod/tournament.py", line 430, in _play_matches match.play() File "/home/vince/.conda/envs/investigate-axlf/lib/python3.6/site-packages/axelrod/match.py", line 142, in play p.reset() File "/home/vince/.conda/envs/investigate-axlf/lib/python3.6/site-packages/axelrod_fortran/player.py", line 128, in reset self._release_shared_library() File "/home/vince/.conda/envs/investigate-axlf/lib/python3.6/site-packages/axelrod_fortran/player.py", line 122, in _release_shared_library shared_library_manager.release(self.original_name, self.index) File "", line 2, in release File "/home/vince/.conda/envs/investigate-axlf/lib/python3.6/multiprocessing/managers.py", line 772, in _callmethod raise convert_to_error(kind, result) KeyError: 3 Playing matches: 2%| It does seem to hang on a final match (2015/2016): Playing matches: 100%|█████████████████████████▉| 2015/2016 [02:00<00:00, 16.82it/s] I get similar results when running different number of repetitions. I seem unable to reproduce this on other machines of mine (where this code runs just fine). I was aiming to give the full tournament a whirl for comparison with the reproducing paper and it could just be something weird on the specific server I tried so it's not the end of the world, I can run on something else. Any immediate thoughts? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub , or mute the thread < https://github.com/notifications/unsubscribe-auth/AAMaUWClhJjrI3zV5i6LiXyHcV83drodks5umeXIgaJpZM4XwgTC .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Axelrod-Python/axelrod-fortran/issues/78#issuecomment-431400506, or mute the thread https://github.com/notifications/unsubscribe-auth/ACCGWhbmO9rMomIpXXvNRct7YqM1zoavks5ume6sgaJpZM4XwgTC .

meatballs commented 6 years ago

File "/home/vince/.conda/envs/investigate-axlf/lib/python3.6/site-packages/axelrod_fortran/player.py", line 122, in _release_shared_library shared_library_manager.release(self.original_name, self.index) File "", line 2, in release

There is something very odd going on here. That last line should be referring to axelrod_fortran/shared_library_manager.py but it just says "string." The release method starts at line 98 in that file, so the line number is nonsense too, but the method name is fine!

marcharper commented 6 years ago

It doesn't reproduce on my machine and I don't see any good reason for the error. Perhaps the installation is in an unhappy state? I would try a new venv and see if you can reproduce it on the same machine or a similar one.

drvinceknight commented 6 years ago

Yeah I'm not too sure what's happening... I've reproduced it in a virtual env (on that same machine). Not sure what we can do as it doesn't reproduce on other machines...

Following #77 are the installation instructions for TourExec (https://github.com/Axelrod-Python/TourExec) any different? Perhaps I've not done that quite right on this machine...

If anyone would like me to try anything on this specific machine let me know otherwise perhaps we just close this issue (we can always reopen if anyone happens to stumble on this thing again)?

marcharper commented 5 years ago

No changes to installation instructions AFAIK, so I vote to close for now.