[petsc-dev] plans for testing examples?
Barry Smith
bsmith at mcs.anl.gov
Mon Sep 17 09:44:40 CDT 2012
On Sep 17, 2012, at 9:36 AM, Jed Brown <jedbrown at mcs.anl.gov> wrote:
> On Mon, Sep 17, 2012 at 9:08 AM, Barry Smith <bsmith at mcs.anl.gov> wrote:
> How do you map the loops in some of the shell scripts in the makefiles?
>
> Not all the loop constructs are parsed now, but I can add that in an hour or so. It'll look like
>
> with Executable('ex19.c'):
> for mtype in 'aij baij sbaij'.split():
> for vecscatter in 'rsend ssend alltoall'.split():
> Test(id=('thename', mtype, vecscatter), args='-mat_type %s -vecscatter_%s' % (mtype,vecscatter), compare='ex19_thename')
>
> This registers "separate tests" for each, but they all compare against the same reference output. We can then run this group by globbing
>
> ./ptest.py test 'ex19_thename_*'
>
> or a single one by
>
> ./ptest.py test ex19_thename_baij_ssend
>
>
> Where are your magic scripts?
>
> I was just mirroring the makefiles, so src/ts/examples/tutorials/makefile was parsed and converted to src/ts/examples/tutorials/ptest.py (not a great name since it also says how to build executables).
>
> What if I proposed moving the Test(id='2', args='-da_grid_x 20 -da_grid_y 20 -boundary 0 -ts_max_steps 10 -Jtype 2', compare='ex15_1') type data into the examples and generating the makefiles for the example directories automatically? Then we'd have one set of scripts that could scarf info from the examples and it would put it into several formats.
>
> We could do this, but (especially if we are making something for users), there can be different ways to link based on configuration tests. Also, applications may use many sources. Putting that information inside whatever file contains main() is clutter, in my opinion, and harder to see what is going on. Of course the code that figures out what needs to be done (by looking in all the various places) could have nice output of what was happening and why, but I think it's no simpler.
One reason I like everything in one file/place is that now lots of "test" examples are in the "tutorial" directories. To move them requires:
1) hg move the example code
2) hg move several output/* files
3) edit the "tutorials" makefile to remove stuff
4) edit the "test" makefile to add the stuff
and plus since there will be name conflicts for source code names one will also need to change, for example, ex1.c to ex37.c in all these places.
If everything was in one file I could just hg move that one file to the new location (changing the name of the file if needed). Sooo much easier. Why do you think no one has fixed the cluster fuck we have currently.
Barry
More information about the petsc-dev
mailing list