Page 1 of 1
IvanHoe55
Posted: Fri Jul 02, 2010 9:47 am
by xshat
The new source has been released:
http://ippolit.wikispaces.com/file/deta ... m-Beta.tar
I will begin attempting to make a compile.
Re: IvanHoe55
Posted: Fri Jul 02, 2010 10:51 am
by Jeremy Bernstein
If your OS doesn't support pthread_spinlocks (OSX, for instance), you will need to reimplement them using pthread_mutexes or something. Arg...
Jeremy
Re: IvanHoe55
Posted: Fri Jul 02, 2010 11:02 am
by Jeremy Bernstein
Jeremy Bernstein wrote:
If your OS doesn't support pthread_spinlocks (OSX, for instance), you will need to reimplement them using pthread_mutexes or something. Arg...
Jeremy
In RobboTotalBase.h:
Code: Select all
#if 0 /* replace with a decent condition if you care */
#define ROBBO_LOCK_TYPE pthread_spinlock_t
#define ROBBO_LOCK_IT(x) pthread_spin_lock (x)
#define ROBBO_UNLOCK_IT(x) pthread_spin_unlock (x)
#define ROBBO_LOCK(tb, ind) pthread_spin_lock (&(tb->locks)[ind]);
#define ROBBO_UNLOCK(tb, ind) pthread_spin_unlock (&(tb->locks)[ind]);
#define ROBBO_LOCK_INIT(x) pthread_spin_init (x, 1) /* HACK */
#define ROBBO_LOCK_DESTROY(x) pthread_spin_destroy (x)
#else
#define ROBBO_LOCK_TYPE pthread_mutex_t
#define ROBBO_LOCK_IT(x) pthread_mutex_lock (x)
#define ROBBO_UNLOCK_IT(x) pthread_mutex_unlock (x)
#define ROBBO_LOCK(tb, ind) pthread_mutex_lock (&(tb->locks)[ind]);
#define ROBBO_UNLOCK(tb, ind) pthread_mutex_unlock (&(tb->locks)[ind]);
#define ROBBO_LOCK_INIT(x) pthread_mutex_init (x, NULL)
#define ROBBO_LOCK_DESTROY(x) pthread_mutex_destroy (x)
#endif
This crashes for me with a bus error, though, when I run the benchmark:
Code: Select all
...
Position 7: Nodes: 1308791 Time: 1005ms
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x0000000104931f50
0x0000000100029635 in Search (POSITION=0x1003ef2e0) at search.c:272
272 (p + 1)->move = 0;
Clearly a bad pointer access, but I don't know this code at all, so I'm not sure what's up here.
Code: Select all
{
boolean REPETITION;
for (p = POSITION->DYN - POSITION->DYN->reversible; p < POSITION->DYN; p++)
{
REPETITION = FALSE;
for (q = p + 2; q < POSITION->DYN; q += 2)
if (p->HASH == q->HASH)
{
REPETITION = TRUE;
break;
}
if (!REPETITION)
POSITION->STACK[p - POSITION->DYN + POSITION->DYN->reversible] = 0;
(p + 1)->move = 0;
}
}
Re: IvanHoe55
Posted: Fri Jul 02, 2010 3:13 pm
by Jeremy Bernstein
I replaced the repetition check code in 55 with the same code from 63 and the bad access goes away:
Code: Select all
if (ANALYSING)
{
boolean REPETITION;
for (p = POSITION->DYN_ROOT; p < POSITION->DYN; p++)
{
REPETITION = FALSE;
for (q = p + 2; q < POSITION->DYN; q += 2)
if (p->HASH == q->HASH)
{
REPETITION = TRUE;
break;
}
if (!REPETITION)
POSITION->STACK[p - POSITION->DYN_ROOT] = 0;
(p + 1)->move = 0;
}
}
Not sure what is really happening there, though -- what reversible is being used for -- so it's possible that my "fix" is no good. Compared to 63:
63:
Total Nodes: 21935784 Time: 16062ms
Total NPS: 1365000
55:
Total Nodes: 21277934 Time: 16056ms
Total NPS: 1325000