2 Date: Mon, 17 Oct 88 16:53:33 PDT
3 To: mike@wheaties.ai.mit.edu
4 cc: darin%pioneer@eos.arc.nasa.gov, luzmoor@violet.berkeley.edu
5 From: James A. Woods <jaw@eos.arc.nasa.gov>
6 Subject: README.cray for GNU e?grep
8 I just sent this out to comp.unix.cray:
10 -------------------------------------------------------------------
11 From: jaw@eos.UUCP (James A. Woods)
12 Newsgroups: comp.unix.cray
13 Subject: GNU e?grep on Cray machines
14 Message-ID: <1750@eos.UUCP>
15 Date: 17 Oct 88 23:47:29 GMT
16 Organization: NASA Ames Research Center, California
19 # "What comes after silicon? Oh, gallium arsenide, I'd guess. And after
20 that, there's a thing called indium phosphide."
21 -- Seymour Cray, Datamation interview, circa 1980
23 Now that most Cray software development is done on Crays themselves,
24 thanks to Unix, GNU e?grep should come in handy. Of course, if you're
25 scanning GENBANK for the Human Genome Project at 10 MB/second (the raw
26 X/MP Unix I/O rate), you really do need the speed.
28 Sample, from one of the Ames Cray 2 machines:
30 stokes> time ./egrep astrian web2 # GNU egrep
35 0.5980u 0.0772s 0:01 35%
36 stokes> time /usr/bin/egrep astrian web2 # ATT egrep
41 7.6765u 0.1373s 0:15 49%
43 (web2 is a 2.4 MB wordlist, standard on BSD Unix.)
45 To bring up GNU E?GREP, ftp Mike Haertel's version 1.1 package from
46 'prep.ai.mit.edu' or 'ames.arc.nasa.gov'. Mention -DUSG in the Makefile,
49 #define SIGN_EXTEND_CHAR(c) ((c)>(char)127?(c)-256:(c))
51 in regex.c. [Cray characters, like MIPS chars, are unsigned, but the
52 compiler won't allow ... #define SIGN_EXTEND_CHAR(c) ((signed char) (c))]
54 However, at least on the Cray 2, there's a compiler bug involving the
55 increment operator in complex expressions, which requires the following
56 modification (also in regex.c):
59 m->elems[m->nelem++].constraint |= s2->elems[j++].constraint;
61 m->elems[m->nelem].constraint |= s2->elems[j].constraint;
65 Thanks go to Darin Okuyama of NASA ARC for providing this workaround.
67 -- James A. Woods (ames!jaw)
68 NASA Ames Research Center
71 Though Crays are not at their best pushing bytes, the timing difference
72 is even more exaggerated with heavier regexpr processing, to wit:
74 time ./egrep -i 'as.*Trian' web2
76 0.7677u 0.0769s 0:01 44%
78 time /usr/bin/egrep -i 'as.*Trian' web2
80 16.1327u 0.1379s 0:32 49%
82 which is a mite unfair given a known System 5 egrep -i gaffe. You get
83 extra credit for vectorizing the inner loop of the Boyer/Moore/Gosper
84 code, though changing all chars to ints might help also.