Yes, bash.
I copied the line from Bradleys mail, but I was wondering about the same thing, as well. I am not really sure what the expansion-option means in Gambit.
Petter
Den 17. aug. 2008 kl. 16.41 skrev Christian Jaeger:
Hans Petter Egesund wrote:
I did a: time gsc -keep-c -expansion ssax-sxml > ! expansion.scm
Wondering: is this in bash? If so, why are you putting the ! there, do you want to capture the expansion in the "!" file? What is expansion.scm, a previous expansion?
Afficher les réponses par date
Hans Petter Egesund wrote:
Yes, bash.
I copied the line from Bradleys mail, but I was wondering about the same thing, as well.
Hm that looks like a typo from him. He seems to have redirected to expansion.scm, so no ! necessary.
Anyway, bash regards ! just as output file in this case, and does call gsc with both arguments, ssax-sxml and expansion.scm; so if expansion.scm didn't exist, that should just lead to gsc saying it failed to open that file, and in any case it should wait until the first file finished compilation in gcc, so this shouldn't change the outcome. (You could use the usual tools like top and ps auxwwf to verify that it's gcc which is swapping.)
But gcc releases vary in the algorithms they use to compile functions, and since with --single-host Gambit creates one big function, the required memory is very dependent on those algorithms. Brad already mentioned that an improvement to a regression in this area is waiting for release. So you could try different gcc versions, or ask Brad which version he's using.
Christian.
On Aug 17, 2008, at 10:46 AM, Hans Petter Egesund wrote:
Den 17. aug. 2008 kl. 16.41 skrev Christian Jaeger:
Hans Petter Egesund wrote:
I did a: time gsc -keep-c -expansion ssax-sxml > ! expansion.scm
Sorry, I was using tcsh, this will work just as well:
time gsc ssax-sxml
The -expansion options writes to stdout the scheme source with all macros expanded, all functions inlined, all specializations made, ..., and the exclamation point saves the redirect in expansion.scm even if expansion.scm already exists (I run my shell with noclobber set). The -keep-c option saves the C file. I wanted the expanded version and the C file to check that the changes I was making were actually being used.
On my machine, it took roughly 6.3GB of memory at one point for gcc to compiler the C file; it was this version of gcc:
frying-pan:~/programs/gambc-v4_2_3/ssax-sxml> gcc -v Using built-in specs. Target: x86_64-linux-gnu Configured with: ../src/configure -v --enable-languages=c,c+ +,fortran,objc,obj-c++,treelang --prefix=/usr --enable-shared --with- system-zlib --libexecdir=/usr/lib --without-included-gettext --enable- threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/ 4.2 --program-suffix=-4.2 --enable-clocale=gnu --enable-libstdcxx- debug --enable-objc-gc --enable-mpfr --enable-checking=release -- build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 4.2.3 (Ubuntu 4.2.3-2ubuntu7)
my computer (64-bit ADM, 8GB ram, Ubuntu) is still trying to compile the file. It has been running for 6 hours or so, and is swapping a lot.
I don't know what else you have running; what does top tell you about the cc1 process (gcc's back end program).
Brad
On Aug 17, 2008, at 2:01 PM, Bradley Lucier wrote:
I don't know what else you have running; what does top tell you about the cc1 process (gcc's back end program).
I configured gambit with --enable-single-host but not with --enable- gcc-opts; using the latter would increase compilation memory and time requirements.
How large is your ssax-sxml.c? I get
frying-pan:~/programs/gambc-v4_2_3/ssax-sxml> wc ssax-sxml.c 191030 214064 7476011 ssax-sxml.c
Brad
Hi,
new gcc solved the case. I am now able to compile the module, and parsing time went down from 50 to 40 seconds. My gambit is configured with both of the options that you mentioned.
Thanks,
Petter
Den 17. aug. 2008 kl. 20.20 skrev Bradley Lucier:
On Aug 17, 2008, at 2:01 PM, Bradley Lucier wrote:
I don't know what else you have running; what does top tell you about the cc1 process (gcc's back end program).
I configured gambit with --enable-single-host but not with --enable- gcc-opts; using the latter would increase compilation memory and time requirements.
How large is your ssax-sxml.c? I get
frying-pan:~/programs/gambc-v4_2_3/ssax-sxml> wc ssax-sxml.c 191030 214064 7476011 ssax-sxml.c
Brad
Bradley Lucier wrote:
I guess any improvement from here on will require access to the data and profiling.
Someone should write a wiki page explaining profiling of Gambit code. Here's a link which shows the two variants I'm aware of:
https://webmail.iro.umontreal.ca/pipermail/gambit-list/2006-January/000568.h...
Christian.
Christian Jaeger wrote:
Bradley Lucier wrote:
I guess any improvement from here on will require access to the data and profiling.
Someone should write a wiki page explaining profiling of Gambit code. Here's a link which shows the two variants I'm aware of:
https://webmail.iro.umontreal.ca/pipermail/gambit-list/2006-January/000568.h...
Sorry, hit the send button too soon.
This assumes how the old gsc worked (it did just generate the .c files at that time):
$ gsc -track-scheme proftest.scm $ gcc -fprofile-arcs -ftest-coverage -D___SINGLE_HOST proftest.c proftest_.c -lgambc
This is how you should be able to do it nowadays:
$ gsc -track-scheme -cc-options "-fprofile-arcs -ftest-coverage" proftest.scm
Christian.
Nice, will be interesting to see where where ssax is spending the time.
Petter
Den 17. aug. 2008 kl. 23.05 skrev Christian Jaeger:
Christian Jaeger wrote:
Bradley Lucier wrote:
I guess any improvement from here on will require access to the data and profiling.
Someone should write a wiki page explaining profiling of Gambit code. Here's a link which shows the two variants I'm aware of:
https://webmail.iro.umontreal.ca/pipermail/gambit-list/2006- January/000568.html
Sorry, hit the send button too soon.
This assumes how the old gsc worked (it did just generate the .c files at that time):
$ gsc -track-scheme proftest.scm $ gcc -fprofile-arcs -ftest-coverage -D___SINGLE_HOST proftest.c proftest_.c -lgambc
This is how you should be able to do it nowadays:
$ gsc -track-scheme -cc-options "-fprofile-arcs -ftest-coverage" proftest.scm
Christian.