Actual source code: ex9.c

petsc-3.10.5 2019-03-28
Report Typos and Errors
  1: static char help[] = "Example for PetscOptionsInsertFileYAML\n";


  4:  #include <petscsys.h>
  5:  #include <petscviewer.h>

  7: int main(int argc,char **argv)
  8: {
  9:   PetscErrorCode  ierr;
 10:   char            filename[PETSC_MAX_PATH_LEN];
 11:   PetscBool       flg;

 13:   PetscInitialize(&argc,&argv,(char*)0,help);if (ierr) return ierr;
 14:   PetscOptionsGetString(NULL,NULL,"-f",filename,sizeof(filename),&flg);
 15:   if (flg) {
 16:     PetscOptionsInsertFileYAML(PETSC_COMM_WORLD,filename,PETSC_TRUE);
 17:   }
 18:   PetscOptionsView(NULL,PETSC_VIEWER_STDOUT_WORLD);
 19:   PetscFinalize();
 20:   return ierr;
 21: }



 25: /*TEST

 27:    build:
 28:       requires: yaml

 30:    test:
 31:       suffix: 1
 32:       requires: yaml
 33:       args: -f petsc.yml
 34:       filter:  grep -v saws_port_auto_select |grep -v malloc_dump | grep -v display
 35:       localrunfiles: petsc.yml

 37:    test:
 38:       suffix: 2
 39:       requires: yaml
 40:       filter:  grep -v saws_port_auto_select
 41:       args: -options_file_yaml petsc.yml |grep -v malloc_dump | grep -v display
 42:       localrunfiles: petsc.yml

 44: TEST*/