[ET Trac] [Einstein Toolkit] #1568: Reduce overhead of Formaline
Einstein Toolkit
trac-noreply at einsteintoolkit.org
Wed Mar 26 11:09:00 CDT 2014
#1568: Reduce overhead of Formaline
--------------------------+-------------------------------------------------
Reporter: hinder | Owner:
Type: enhancement | Status: new
Priority: major | Milestone:
Component: Cactus | Version: development version
Resolution: | Keywords:
--------------------------+-------------------------------------------------
Comment (by rhaas):
You can actually generate the tarfiles etc on the fly whithout having to
write C code:
{{{
tar c foo bar | od -to1 -v | awk '
BEGIN {
print "const unsigned char *SpEC_tarball_data = "
}
{
printf "\"";
for(i = 2 ; i <= NF ; i++) {
printf "\\%s",$$i; sz++
}
print "\""
}
END {
print ";\nint SpEC_tarball_size = ",sz,";"
}' ) | gcc -O0 -o SpEC-tarball.o -xc -c -
}}}
does the trick without any intermediate files. This was an attempt to
include tarballs in SpEC which so far is stalled due to it being hard to
decide which files to include.
icc can also be made to use pipes though I think we can safely rely on gcc
being around. With this the C code in Formaline sees a char* pointer
SpEC_tarball_data pointing to the tarball data and SpEC_tarball_size lists
its size so a simple fwrite(SpEC_tarball_data, SpEC_tarball_size, 1,
stdout) can write the tarball. This only uses POSIX tools I think so
should work on all machines.
--
Ticket URL: <https://trac.einsteintoolkit.org/ticket/1568#comment:4>
Einstein Toolkit <http://einsteintoolkit.org>
The Einstein Toolkit
More information about the Trac
mailing list