#!/bin/sh
# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other
# HYPRE Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

#=============================================================================
# struct: Run SMG-CG, PFMG-CG, DSCG, CG, and Hybrid.
#=============================================================================

mpirun -np 3 ./struct -P 1 1 3 -solver 10 -tol 1.0e-4 > solvers_struct.out.0
mpirun -np 3 ./struct -P 1 3 1 -solver 11 -tol 1.0e-4 > solvers_struct.out.1
mpirun -np 3 ./struct -P 3 1 1 -solver 17 -tol 1.0e-4 > solvers_struct.out.2
mpirun -np 1 ./struct -P 1 1 1 -solver 18 -tol 1.0e-4 > solvers_struct.out.3
mpirun -np 1 ./struct -P 1 1 1 -solver 19 -tol 1.0e-4 > solvers_struct.out.4


#=============================================================================
# Run default case with all available PCG preconditioners (solvers): 
#    10: SMG (default)
#    11: PFMG
#    17: 2-step Jacobi
#    18: Diagonal scaling
#    19: none
#=============================================================================

# PCG run... LOBPCG with one eigenpair .... LOBPCG with 3 eigenpairs
mpirun -np 2 ./struct -solver 10 -tol 1.e-4 > solvers_struct.out.10.lobpcg
mpirun -np 2 ./struct -lobpcg -solver 10 -tol 1.e-4 -pcgitr 0 -seed 1 -vrand 1 > solvers_struct.out.10.lobpcg.1
mpirun -np 2 ./struct -lobpcg -solver 10 -tol 1.e-4 -pcgitr 0  -seed 1 -vrand 3  > solvers_struct.out.10.lobpcg.3

# PCG run... LOBPCG with one eigenpair .... LOBPCG with 3 eigenpairs
mpirun -np 2 ./struct -solver 11 -tol 1.e-4  > solvers_struct.out.11.lobpcg
mpirun -np 2 ./struct -lobpcg -solver 11 -tol 1.e-4  -pcgitr 0 -seed 1 -vrand 1  > solvers_struct.out.11.lobpcg.1
mpirun -np 2 ./struct -lobpcg -solver 11 -tol 1.e-4  -pcgitr 0 -seed 1 -vrand 3  > solvers_struct.out.11.lobpcg.3

# PCG run... LOBPCG with one eigenpair .... LOBPCG with 3 eigenpairs
mpirun -np 2 ./struct -solver 17  > solvers_struct.out.17.lobpcg
mpirun -np 2 ./struct -lobpcg -solver 17 -tol 1.e-4  -pcgitr 10 -seed 1 -vrand 1  > solvers_struct.out.17.lobpcg.1
mpirun -np 2 ./struct -lobpcg -solver 17 -tol 1.e-4  -pcgitr 10 -seed 1 -vrand 3  > solvers_struct.out.17.lobpcg.3

# PCG run... LOBPCG with one eigenpair .... LOBPCG with 3 eigenpairs
mpirun -np 2 ./struct -solver 18  > solvers_struct.out.18.lobpcg
mpirun -np 2 ./struct -lobpcg -solver 18 -tol 1.e-4  -pcgitr 10 -seed 1 -vrand 1  > solvers_struct.out.18.lobpcg.1
mpirun -np 2 ./struct -lobpcg -solver 18 -tol 1.e-4  -pcgitr 10 -seed 1 -vrand 3  > solvers_struct.out.18.lobpcg.3

# PCG run... LOBPCG with one eigenpair .... LOBPCG with 3 eigenpairs
mpirun -np 2 ./struct -solver 19 -tol 1.e-4  > solvers_struct.out.19.lobpcg
mpirun -np 2 ./struct -lobpcg -solver 19 -tol 1.e-4  -pcgitr 10 -seed 1 -vrand 1  > solvers_struct.out.19.lobpcg.1
mpirun -np 2 ./struct -lobpcg -solver 19 -tol 1.e-4  -pcgitr 10 -seed 1 -vrand 3  > solvers_struct.out.19.lobpcg.3
