Hm - petscrc in the run dir works for me. [and the other modes aswell]
Satish
-------
balay@msnehalem2 ~/petsc.clone/src/ksp/ksp/examples/tutorials
$ make ex2
/home/balay/petsc.clone/bin/win32fe/win32fe cl -o ex2.o -c -MT -wd4996 -Z7
-I/home/balay/petsc.clone/include -I/home/balay/petsc.clone/arch-win32/include
-I/home/balay/petsc.clone/include/mpiuni `pwd`/ex2.c
ex2.c
/home/balay/petsc.clone/bin/win32fe/win32fe cl -MT -wd4996 -Z7 -o ex2 ex2.o
-L/home/balay/petsc.clone/arch-win32/lib -lpetsc -lflapack -lfblas Gdi32.lib
User32.lib Advapi32.lib Kernel32.lib Ws2_32.lib
/usr/bin/rm -f ex2.o
balay@msnehalem2 ~/petsc.clone/src/ksp/ksp/examples/tutorials
$ ./ex2
Norm of error 0.000156044 iterations 6
balay@msnehalem2 ~/petsc.clone/src/ksp/ksp/examples/tutorials
$ echo "-ksp_view" > petscrc
balay@msnehalem2 ~/petsc.clone/src/ksp/ksp/examples/tutorials
$ cat petscrc
-ksp_view
balay@msnehalem2 ~/petsc.clone/src/ksp/ksp/examples/tutorials
$ ./ex2
KSP Object: 1 MPI processes
type: gmres
GMRES: restart=30, using Classical (unmodified) Gram-Schmidt
Orthogonalization with no iterative refinement
GMRES: happy breakdown tolerance 1e-030
maximum iterations=10000, initial guess is zero
tolerances: relative=0.000138889, absolute=1e-050, divergence=10000
left preconditioning
using PRECONDITIONED norm type for convergence test
PC Object: 1 MPI processes
type: icc
0 levels of fill
tolerance for zero pivot 2.22045e-014
using Manteuffel shift [POSITIVE_DEFINITE]
matrix ordering: natural
factor fill ratio given 1, needed 1
Factored matrix follows:
Mat Object: 1 MPI processes
type: seqsbaij
rows=56, cols=56
package used to perform factorization: petsc
total: nonzeros=153, allocated nonzeros=153
total number of mallocs used during MatSetValues calls =0
block size is 1
linear system matrix = precond matrix:
Mat Object: 1 MPI processes
type: seqaij
rows=56, cols=56
total: nonzeros=250, allocated nonzeros=280
total number of mallocs used during MatSetValues calls =0
not using I-node routines
Norm of error 0.000156044 iterations 6
balay@msnehalem2 ~/petsc.clone/src/ksp/ksp/examples/tutorials
$
On Wed, 11 Dec 2013, Qin Lu wrote:
> Satish,
>
> I tried both ways that you suggested in Win-7 (and I tried to put the petscrc
> file in either the directory of executable or the directory where I run the
> executable), but it did not work. Note that I have to use file name "petscrc"
> instead of ".petscrc" since Windows does not allow the file name start with
> "."
>
> The content of the file is very simple:
> -pc_type jacobi
>
>
>
>
> On Wednesday, December 11, 2013 1:26 PM, Qin Lu <[email protected]> wrote:
>
> Thanks, Satish!
>
> Qin
>
>
>
> On Wednesday, December 11, 2013 12:27 PM, Satish Balay <[email protected]>
> wrote:
>
> On Wed, 11 Dec 2013, Qin Lu wrote:
>
>
> > Hello,
> >
> > PETSc can read options from .petscrc file at home
> directory in Linux. Can it do the same thing in Windows? What is the file
> name and where the file should be placed?
>
> On windows - one can emulate this by setting "HOME" env variable to the
> location where you have .petscrc
>
> Also one can have .petscrc [or petscrc] in the location from which you run
> the petsc executable.
>
> Satish
>
>
>
> Any suggestion?
>
> Thanks,
> Qin