[petsc-dev] plans for testing examples?

Jed Brown jedbrown at mcs.anl.gov
Mon Sep 17 09:36:36 CDT 2012


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20120917/cc0d3177/attachment.html>


More information about the petsc-dev mailing list