HPCE / hpce-2017-cw5

1 stars 6 forks source link

edit_distance: Caught exception: std::bad_alloc #14

Closed filangelos closed 6 years ago

filangelos commented 6 years ago

Running edit_distance for scaling>15000 throws a std::bad_alloc exception.

build command: make bin/run_puzzle

execution command bin/run_puzzle 20000 2

edit_distance.hpp reference version

m8pple commented 6 years ago

Is this on the AWS instance, or a laptop?

I would have thought a 15GB machine could do more than that, as the array is only about 8n^2, so 400M8 is about 3.2GB. Unless it is using 32-bit.

But anyway - consider the time and space complexity of the puzzle. Should they be the same?

filangelos commented 6 years ago

It is on an 8GB laptop, I will try again on AWS and resolve the issue if I notice a considerable difference!

m8pple commented 6 years ago

You will notice a slight difference, though probably not much :) I would guess about a factor of 2 in scale before you hit the same problem again.

But it's a good thing to hit early.