Responding to myself: - the attached patch (yaml-3.patch) replaces the first one I sent yesterday and adds fortran binding for PetscOptionsInsertFile_YAML
- The reason why calling PetscOptionsInsertFile_YAML is not working when called from inside PetscInitialize is that I use PetscViewerStringOpen to print the generated options list to a string then MPI_Bcast it, but PetscViewerStringOpen is not available until after PetscInitialize. I have modified pinit.c and options.c so that PetscOptionsInsertFile_YAML is called later on, after logging has been enabled. This is enabled in yaml-4.patch Are these patches suitable? Blaise -------------- next part -------------- A non-text attachment was scrubbed... Name: yaml-3.patch Type: application/octet-stream Size: 46685 bytes Desc: not available URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20120724/b81fb51b/attachment-0002.obj> -------------- next part -------------- A non-text attachment was scrubbed... Name: yaml-4.patch Type: application/octet-stream Size: 1538 bytes Desc: not available URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20120724/b81fb51b/attachment-0003.obj> -------------- next part -------------- On Jul 23, 2012, at 11:39 PM, Blaise Bourdin wrote: > Hi, > > After trying to get the current yaml parser in petsc to work, I finally gave > up and rewrote a very basic one. It supports only a subset of the standard > and lacks support or sequences and aliases , for instance (would that be > JSON?). Would you consider applying this patch (yaml-1.patch) to 3.3 and dev? > The fortran binding also does not work, I think that I am still missing the > proper headers in include/finclude, but I am getting a bit lost. > > I also tried to modify options.c in order to add a global flag -yaml_file > (this is probably a bad name, I agree), but I can't figure out why it doesn't > work (I can't even get a stack trace). The changes are in yaml-2.patch > (gdb) run -yaml_file petsc.yaml > Starting program: /opt/HPC/petsc-3.3/src/sys/examples/tutorials/ex79 > -yaml_file petsc.yaml > Reading symbols for shared libraries > ++++++++++++++++++++++............................ done > PETSC ERROR: Logging has not been enabled. > You might have forgotten to call PetscInitialize(). > application called MPI_Abort(MPI_COMM_WORLD, 56) - process 0 > [unset]: aborting job: > application called MPI_Abort(MPI_COMM_WORLD, 56) - process 0 > > Program exited with code 070. > (gdb) where > No stack. > > Would anybody be willing to have a look at the second patch? > > Regards, > > Blaise > <yaml-1.patch><yaml-2.patch> > -- > Department of Mathematics and Center for Computation & Technology > Louisiana State University, Baton Rouge, LA 70803, USA > Tel. +1 (225) 578 1612, Fax +1 (225) 578 4276 > http://www.math.lsu.edu/~bourdin > > > > > > > -- Department of Mathematics and Center for Computation & Technology Louisiana State University, Baton Rouge, LA 70803, USA Tel. +1 (225) 578 1612, Fax +1 (225) 578 4276 http://www.math.lsu.edu/~bourdin