• tforth, a Transputer Forth
  • finding 32 bits factors.
  • finding factors of very large numbers.
  • Transputer project hcc dagen 96
  • Configuration program for Parsytec Supercluster

  • a Transputer Forth

    The programs on this page assume tForth, a transputer Forth. It is available here. Running it requires, in practice, having an expansion card in a PC. I'm only aware of cards for the ISA.

    Finding 32 bits factors

    tForth is a 32 bits Forth. Whereas the example program pipi.exe can only analyse numbers up till 30,000 (single precision signed 16 bit integer). tForth can go as far as 2,000,000,000 with the same program. The double precision version pipid.frt handles numbers up till 8,000,000,000,000,000,000 (double precision signed 32 bit integer) on tForth. That is somewhere near the current world record, but it finishes beyond the end of times. The 64-bit precision DLOCAL variables make this program non portable, however.
    Note: If you really want to go for large numbers, this program is not really what you need.

    Hcc dagen 1993 factoring by MPQS

    In order to show the parallel processing capability of transputers, a workgroup of the Forth gg implemented the mpqs (multiple polynomial quadratic sieve) algorithm for factoring very large numbers.
    This algorithm needs a lot of sieving that can be done in parallel, and a central computer to combine results. This implementation of mpqs was limited in the sense that only transputers directly connected to the main computer could be used for sieving, so three sieves was the maximum. Moreover a naive implementation of mpqs resulted in an abyssmal performance, so some more advanced proposals for the polynomials were copied from a UBASIC program, without much understanding of the reasons for using those polynomials.
    The 6th version of this program is pretty stable. It is unlikely that you can run it, but it does contain an implementation of a big number package that may be of interest.

    Hcc dagen 1996 Twin primes

    The Forth gg undertook, in cooperation with the 68000 gg, to establish a new world record twin prime counting . The first attempt was at the Dutch computer fair 1996 of the HCC (hcc-dagen 1996). At the time we had available the 16 transputers of a deceased Atari workstation that were my personal property and some fifteen more, made available to the 68000 user group by Shell. The latter however were not connected. During the year 1997 numerous improvements were made to the program, including the crucial speed up for large prime factors. A nasty bug plagued the program until October. At that time I finally decided to write a symbolic debugger. Although it has all the crucial features it took me a mere evening to write it. After that finding the problem was a snap. It turned out to be not so much insidious as well unexpected: an array was allocated in the middle of some other array. Remember, all the linking and allocation, writing of binary images to disk and such was part of this project and not available prior.
    Just before the fair of 1997 it became clear that I could conquer the then world record of 137 trillion (137.10^12). It would take three months with 16 transputers with 1 megabyte, 9 with 2 megabytes, 6 with 4 megabytes, and 1 one with 8 megabytes and a 90 MHz Pentium (with 96 megabytes) for a dumb server... Knowing this, Jan Vytopil of the University of Nijmegen lent me their 64 transputer by 4 megabytes Parsytec Supercluster. Connecting it however did not succeed.
    The program that run at the 1997 HCC-fair is available for download. At the 1998 fair we could demonstrate the LED's on the front panel, but it lasted until the 1999 HCC-fair before we could run it. The sophisticated configuring software would not run until I hacked the hardware a bit to match the assumptions of the software. Thanks to Wim Huiskamp of TNO-FEL, who lent us another 90 transputers in 3 boxes, we had a grand total of 190 transputers in 7 boxes working on sieves.

    Almost a record

    The 1999 program had been improved to store two times as much numbers in one sieve. Too bad the world record had been improved to above 2*10^15.
    I had it calculate until 10^15, so at last I reached my original goal. at the expense of a few months of noisy nights, and a couple of hundred euro's electricity. This had to be done in winter, because in the summer things ran too hot, and fuses tended to blow. Unfortunately, checking the results against those of internet sources , reveals that the program gives wrong results above 60*10^12.

    Here follows an overview of the program.
    The main transputer has only Forth code and tForth based parallelism. Separate processes control pipelines of sieving transputers. The main transputer runs a regular tForth that uses a MS-Windows pc as a server. Three links remain to have a pipeline running off it. There is no limit to the length of a pipeline, but all twin primes found in a pipeline are counted together. Batches of primes to use in sieving are sent down the pipelines. It is essential that sieving transputers have approximately the same amount of work, so they must be of the same speed, and have equal amounts of memory. Each transputer of a pipeline runs what basically is an assembler program, with three processes: a calculation process and two communication processes, one down, one up the pipe. The assembler program has a separate part that copies itself down the pipeline. The communication processes handle some debugging. If you want to understand what is happening on one of the sieving transputers, study the source TWIN.FRT

    Configuration program for Parsytec Supercluster

    An NCM program is absolutely necessary to run a Parsytec Supercluster, because you can only build a network of transputers via this program. (Short of dismantling the Supercluster and eliminating the boards with the C004 - chips.) I am the proud owner of the last 5" floppy to contain the NCM program running on a MS-DOS PC. This makes me morally responsible to make this program available to mankind.

    You can download this program , provided you have authorisation from Parsytec to use it.

    You can comment via email

    Other number theoretical stuff
    Go to the home page of Albert van der Horst