home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / gnuch40.zip / gnuchess-4.0.pl79 / doc / PORTING < prev    next >
Text File  |  1998-09-28  |  2KB  |  46 lines

  1. This is a note how to port gnuchess to machines with scarce memory:
  2. gnuchess minimal requirements are:
  3.  - approximately 100 kByte memory for the executable program.
  4.  - at least 200 kByte for data structures.
  5. You dont want to port gnuchess to a machine with less memory than that.
  6.  
  7. gnuchess is optmized for speed and that means that memory has been used
  8. when there has been a tradeoff between memory usage and speed. If you intend
  9. to run gnuchess on a machine with less than 2 Mbyte memory the size of some
  10. data structures have to be reduced. Here is a list of the largest data
  11. structures in gnuchess, their sizes and a small comment on what can
  12. be done to reduce their size:
  13.  
  14. The size of these tables is defined in gnuchess.h and can be changed there.
  15.  
  16. ttable:        4.8    MByte    (#define vttblsz <something small>) size is: 2 * 12 * vttblsz
  17. etab:        2.6    MByte   (Can be reduced to any size > 101) size is:  2 * 136 * ETABLE
  18. Tree:        20     kByte    ( can be made smaller ~1000) size is 12 * TREE
  19. GameList    12.8    kBytes  (default is 200 moves per side, can be less)
  20.  
  21. nextpos:    32    kByte    (nothing save rewiting all move generation)
  22. nextdir:    32    kByte    (nothing save rewiting all move generation)
  23. history:    8    kByte   (default is 0 size: can be removed)
  24. distdata:    8    kByte    (can be changed to a macro)
  25. taxidata:    8    kByte    (can be changed to a macro)
  26. hashcode:    7    kByte   (#define ttblsz 0)
  27.  
  28. First of all, start by reducing the transposition table and static evaluation 
  29. cache size, this is done by setting vttblsz and ETABLE in (gnuchess.h). 
  30. If they do not fit entiely in memory it will have a detrimental effect on performance. 
  31.  
  32. etab caches the static evaluations, it can be made smaller too but should not
  33. be zero.
  34.  
  35. If this isn`t enough, reconsider if you really want to do this port.
  36. There is`nt really that much to gain by changing the other
  37. data structures. 
  38.  
  39. Here are the macros:
  40. #define taxicab(a,b) (abs(column (a) - column (b)) + abs (row (a) - row (b)))
  41. #define distance(a,b) \
  42.     ((abs(column (a) - column (b)) > abs (row (a) - row (b)))
  43.     ? abs(column (a) - column (b)) : abs (row (a) - row (b)))
  44.  
  45.  
  46.