[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4586: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3765)
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4588: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3765)
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4589: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3765)
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4590: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3765)
AI Challenge Forums • View topic - Permanent timeouts with Haskell?

It is currently Thu Jan 18, 2018 9:57 am Advanced search

Permanent timeouts with Haskell?

Code won't compile? Found a bug? Post here!

Permanent timeouts with Haskell?

Postby _adept_ » Mon Feb 22, 2010 9:49 pm

Hi.

I'm in the same fix as the other people who already posted here on the same topic (albeit they used java).

I'm trying to implement code that does as much as possible within 0.9 second. Of course, everything is fine when i run it locally.

But when submitted, it times out with 0.9 time window. And with 0.8. And with 0.7. And with any other window, all the way down to 0.1.

I guess that high number of participants and higher load on servers is to blame, because this code with small alterations was running flawlessly two or three days ago.

Does this mean that I'd better spend my time on something else, since there is no chance that my code will run again until deadline, or am I missing something obvious?
_adept_
Cadet
 
Posts: 8
Joined: Mon Feb 22, 2010 9:39 pm

Re: Permanent timeouts with Haskell?

Postby lambda-bandit » Tue Feb 23, 2010 9:42 am

Do not use System.CPUTime in haskell, use System.Time and System.Timeout. (Sadly, Data.Time.Clock is not available here.)
lambda-bandit
Cadet
 
Posts: 5
Joined: Sun Feb 14, 2010 11:49 am

Re: Permanent timeouts with Haskell?

Postby _adept_ » Tue Feb 23, 2010 12:16 pm

Unfortunately, this does not help much.

I took the haskell starter package and put testBot from there in my code. The bot that just selects the first available move. No fancy timeout processing, no nothing.

It timed out after the first game.
_adept_
Cadet
 
Posts: 8
Joined: Mon Feb 22, 2010 9:39 pm

Re: Permanent timeouts with Haskell?

Postby jmcarthur » Tue Feb 23, 2010 2:25 pm

I'm using SIGALRM and still timing out even though I have an answer ready immediately when it fires.
jmcarthur
Colonel
 
Posts: 80
Joined: Fri Feb 05, 2010 3:41 pm

Re: Permanent timeouts with Haskell?

Postby chirono » Tue Feb 23, 2010 4:27 pm

I'm having much the same issue. I'm using System.Time/Timeout and and my code passes all the tests I can throw at it, except entering into the tournament. If I hard-code the depth,without using timeout, it runs fine.

Might it be the the same 'wall clock' vs 'cpu clock' that other languages are facing?
chirono
Cadet
 
Posts: 6
Joined: Tue Feb 09, 2010 8:43 am

Re: Permanent timeouts with Haskell?

Postby _adept_ » Tue Feb 23, 2010 6:34 pm

I see no way of reliable sleep/timeout detection when time is measured by wall clock and we receive infinitesmal amounts of CPU time. After all, during 1 sec of wall clock we could only get 0.1 sec of CPU time, which might not be enough to do anything useful, or even take two measures of wall time.

I see no real difference between code that relies on cpu clock and times out and code that is forced to depth-two minimax by shortage of CPU time
_adept_
Cadet
 
Posts: 8
Joined: Mon Feb 22, 2010 9:39 pm

Re: Permanent timeouts with Haskell?

Postby aerique » Tue Feb 23, 2010 6:53 pm

I'm watching the wall clock in my entry which runs under and I'm having no issues whatsoever (except that my bot sucks) while reserving 0.95s to take my turn. I'm checking the time every iteration of my main evaluation loop though which might cost me some performance. Once the time is up the loop is exited straight away although there's some calculations afterwards to round up my turn.

I'm sure it's mostly an issue of which implementations are used and some of them being too old but perhaps my description is of help to some who have not exhausted all their options.
aerique
Brigadier-General
 
Posts: 131
Joined: Fri Feb 05, 2010 3:23 pm
Location: Netherlands

Re: Permanent timeouts with Haskell?

Postby _adept_ » Thu Feb 25, 2010 9:48 am

Here is the code of the very primitive Haskell bot that just goes North on each move after 0.8 sec delay: http://pastebin.com/z29K9SSz
In order not to miss this delay, it constantly polls wall clock. It does not even parse a map in order not to incur any unnecessary CPU overhead.

I just uploaded this code and it was suspended without playing a single game.

Any hints on what's wrong in this code?
_adept_
Cadet
 
Posts: 8
Joined: Mon Feb 22, 2010 9:39 pm

Re: Permanent timeouts with Haskell?

Postby chirono » Thu Feb 25, 2010 12:24 pm

You have your height and width the wrong way round on line 35. This won't make a difference for square maps, but for maps that are longer than they are wide, you'll be left waiting for more input, hence the timeout.


Chris
chirono
Cadet
 
Posts: 6
Joined: Tue Feb 09, 2010 8:43 am

Re: Permanent timeouts with Haskell?

Postby jmcarthur » Thu Feb 25, 2010 5:15 pm

My solution for this was to return an answer quite early and continue processing while waiting for I/O so that at least on my next turn I might have had some more time put in. It won't work for every algorithm people are using, of course, but it works for me.
jmcarthur
Colonel
 
Posts: 80
Joined: Fri Feb 05, 2010 3:41 pm


Return to Technical Issues

Who is online

Users browsing this forum: No registered users and 2 guests