<div class="gmail_quote"><div class="gmail_quote">Builder does some of this, but I think not all, and I don't think it's as convenient. The differences are partly syntactic. First, to add a test, you have to add lines to a single global file (currently 1500 lines). By creating the dictionary globally, we can't do consistency checks when the test is declared, instead you only do it later once you have lost line number information. You also can't build in the source directory, or anything similar, which makes it hard for a user to split an example out into their own toy project. Since you mess around with stdout, we are losing warning messages (including color) and lose some Emacs M-x compile convenience. (this can be fixed easily enough).</div>
<div class="gmail_quote"><br></div><div class="gmail_quote">Note that my suggestion does not _prevent_ using a global script, but it localizes the declaration and would make it possible to run locally.</div></div><div class="gmail_quote">
<br></div><div class="gmail_quote">On Thu, Jul 26, 2012 at 11:37 AM, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb adM"><div class="im"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>./test.py build ex19</div></blockquote></div></div>
</div></blockquote><div><br></div><div><div>$ config/builder2.py buildExample src/snes/examples/tutorials/ex19.c</div><div>Namespace(files=['src/snes/examples/tutorials/ex19.c'], func=<function buildExample at 0x1fa56e0>)</div>
<div>Building ['/home/jed/petsc/src/snes/examples/tutorials/ex19.c']</div><div>ERROR IN LINK ******************************                                                                                                                              /usr/bin/ld: cannot find -lpetsc                                                                                                                                          collect2: error: ld returned 1 exit status </div>
</div><div><br></div><div>(maybe it doesn't work --with-single-library=0)</div><div><br></div><div><div>$ PETSC_ARCH=mpich-singlelib config/builder2.py buildExample src/snes/examples/tutorials/ex19.c</div><div>Namespace(files=['src/snes/examples/tutorials/ex19.c'], func=<function buildExample at 0x25dd6e0>)</div>
<div>Building ['/home/jed/petsc/src/snes/examples/tutorials/ex19.c']</div></div><div><br></div><div>(hmm, where is the executable anyway)</div><div><div><br></div><div>$ ls -ltr | tail -3</div><div>lrwxrwxrwx 1 jed users       35 Jul 26 11:57 make.log.bkp -> /home/jed/petsc/mpich/conf/make.log</div>
<div>lrwxrwxrwx 1 jed users       45 Jul 26 11:58 make.log -> /home/jed/petsc/mpich-singlelib/conf/make.log</div><div>-rw-r--r-- 1 jed users  5271714 Jul 26 11:58 RDict.log</div></div><div><br></div><div>(oh cool, it overwrote my library build with the make.log from this example)</div>
<div><br></div><div><div>$ cat make.log</div><div>  Loaded configure to cache: size 298004</div><div>Building ['/home/jed/petsc/src/snes/examples/tutorials/ex19.c']</div><div>  Compiling C files ['/home/jed/petsc/src/snes/examples/tutorials/ex19.c']</div>
<div>        Pushing language C</div><div>/opt/mpich2/bin/mpicc -c -I/home/jed/petsc/mpich-singlelib/include -I/home/jed/petsc/include -I/home/jed/petsc/mpich-singlelib/include -I/home/jed/usr/elemental-mpich/include -I/usr/include -I/opt/mpich2/include  -fPIC -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -g3 -fno-inline -O0     -MMD -D__INSDIR__= /home/jed/petsc/src/snes/examples/tutorials/ex19.c</div>
<div>sh: /opt/mpich2/bin/mpicc -c -I/home/jed/petsc/mpich-singlelib/include -I/home/jed/petsc/include -I/home/jed/petsc/mpich-singlelib/include -I/home/jed/usr/elemental-mpich/include -I/usr/include -I/opt/mpich2/include  -fPIC -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -g3 -fno-inline -O0     -MMD -D__INSDIR__= /home/jed/petsc/src/snes/examples/tutorials/ex19.c</div>
<div>Executing: /opt/mpich2/bin/mpicc -c -I/home/jed/petsc/mpich-singlelib/include -I/home/jed/petsc/include -I/home/jed/petsc/mpich-singlelib/include -I/home/jed/usr/elemental-mpich/include -I/usr/include -I/opt/mpich2/include  -fPIC -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -g3 -fno-inline -O0     -MMD -D__INSDIR__= /home/jed/petsc/src/snes/examples/tutorials/ex19.c</div>
<div>sh: </div><div>        Popping language C</div><div>        Moving ex19.o to /home/jed/petsc/mpich-singlelib/lib/ex19-obj/ex19.o</div><div>        Moving ex19.d to /home/jed/petsc/mpich-singlelib/lib/ex19-obj/ex19.d</div>
<div>Linking object ['/home/jed/petsc/mpich-singlelib/lib/ex19-obj/ex19.o'] into /home/jed/petsc/mpich-singlelib/lib/ex19-obj/ex19</div><div>    Pushing language C</div><div>                                Pushing language C</div>
<div>                                Popping language C</div><div>                                Pushing language CUDA</div><div>                                Popping language CUDA</div><div>                                Pushing language Cxx</div>
<div>                                Popping language Cxx</div><div>                                Pushing language FC</div><div>                                Popping language FC</div><div>        Pushing language C</div>
<div>        Popping language C</div><div>sh: /opt/mpich2/bin/mpicc  -o /home/jed/petsc/mpich-singlelib/lib/ex19-obj/ex19    -fPIC -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -g3 -fno-inline -O0 /home/jed/petsc/mpich-singlelib/lib/ex19-obj/ex19.o -L/home/jed/petsc/mpich-singlelib/lib -lpetsc -Wl,-rpath,/home/jed/petsc/mpich-singlelib/lib -L/home/jed/petsc/mpich-singlelib/lib -ltriangle -lX11 -lchaco -lparmetis -lmetis -Wl,-rpath,/home/jed/usr/elemental-mpich/lib -L/home/jed/usr/elemental-mpich/lib -lelemental -lplcg -lpmrrr -lamspub -lml -Wl,-rpath,/opt/mpich2/lib -L/opt/mpich2/lib -Wl,-rpath,/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1 -L/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1 -lmpichcxx -lstdc++ -lpthread -lblacs -lHYPRE -lmpichcxx -lstdc++ -Wl,-rpath,/usr/lib -L/usr/lib -lcholmod -lamd -lcolamd -lcamd -lccolamd -lumfpack -lcholmod -lcamd -lccolamd -lcolamd -lamd -llapack -lblas -lm -L/usr/local/cuda/lib -Wl,-rpath,/opt/mpich2/lib -L/opt/mpich2/lib -Wl,-rpath,/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1 -L/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1 -ldl -Wl,-rpath,/opt/mpich2/lib -lmpich -lopa -lmpl -lpthread -lrt -lgcc_s -ldl </div>
<div>Executing: /opt/mpich2/bin/mpicc  -o /home/jed/petsc/mpich-singlelib/lib/ex19-obj/ex19    -fPIC -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -g3 -fno-inline -O0 /home/jed/petsc/mpich-singlelib/lib/ex19-obj/ex19.o -L/home/jed/petsc/mpich-singlelib/lib -lpetsc -Wl,-rpath,/home/jed/petsc/mpich-singlelib/lib -L/home/jed/petsc/mpich-singlelib/lib -ltriangle -lX11 -lchaco -lparmetis -lmetis -Wl,-rpath,/home/jed/usr/elemental-mpich/lib -L/home/jed/usr/elemental-mpich/lib -lelemental -lplcg -lpmrrr -lamspub -lml -Wl,-rpath,/opt/mpich2/lib -L/opt/mpich2/lib -Wl,-rpath,/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1 -L/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1 -lmpichcxx -lstdc++ -lpthread -lblacs -lHYPRE -lmpichcxx -lstdc++ -Wl,-rpath,/usr/lib -L/usr/lib -lcholmod -lamd -lcolamd -lcamd -lccolamd -lumfpack -lcholmod -lcamd -lccolamd -lcolamd -lamd -llapack -lblas -lm -L/usr/local/cuda/lib -Wl,-rpath,/opt/mpich2/lib -L/opt/mpich2/lib -Wl,-rpath,/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1 -L/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1 -ldl -Wl,-rpath,/opt/mpich2/lib -lmpich -lopa -lmpl -lpthread -lrt -lgcc_s -ldl </div>
<div>sh: </div><div>    Popping language C</div></div><div><br></div><div>(the above output loses warnings)</div><div><br></div><div>$ mpich-singlelib/lib/ex19-obj/ex19 -happy-running</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb adM"><div class="im"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><br></div><div>./test.py check ex19_fas</div></blockquote>
</div></div></div></blockquote><div><br></div><div><div>$ PETSC_ARCH=mpich-singlelib config/builder2.py check --testnum 5 src/snes/examples/tutorials/ex19.c</div><div>Namespace(args=[], files=['src/snes/examples/tutorials/ex19.c'], func=<function check at 0xfe17d0>, retain=False, testnum=5)</div>
<div>All tests pass</div></div><div><br></div><div>(edit file, insert syntax error, re-run)</div><div><br></div><div>[same output as above]</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb adM"><div class="im"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><br></div><div>./test.py check ex19_\* # run all the ex19 tests</div>
<div><br></div><div>./test.py check -n 16 --if '(X || Fortran) && !Complex'<br></div></blockquote></div></div></div></blockquote><div><br></div><div>How?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb adM"><div class="im"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>

<br></div><div>The last line would mean to run all tests requiring X or Fortran, but not complex, using up to 16 MPI processes total.</div><div><br></div><div>We could preserve "make runex19_fas" in the transition period, but I'd like to be able to do everything from test.py.</div>


</blockquote></div><br></div></div>builder already does all of this, and more stuff for code generation.</blockquote></div><br>