Skip to content
Snippets Groups Projects
Commit cf7bb182 authored by Kurt A. O'Hearn's avatar Kurt A. O'Hearn
Browse files

PG-PuReMD: add missing dual QEq solver implementations for MPI.

parent 1ad26c47
No related branches found
No related tags found
No related merge requests found
......@@ -206,10 +206,12 @@ static void Deallocate_Workspace_Part2( control_params * const control,
sfree( workspace->d, "Deallocate_Workspace_Part2::workspace->d" );
sfree( workspace->q, "Deallocate_Workspace_Part2::workspace->q" );
sfree( workspace->p, "Deallocate_Workspace_Part2::workspace->p" );
#if defined(DUAL_SOLVER)
sfree( workspace->r2, "Deallocate_Workspace_Part2::workspace->r2" );
sfree( workspace->d2, "Deallocate_Workspace_Part2::workspace->d2" );
sfree( workspace->q2, "Deallocate_Workspace_Part2::workspace->q2" );
sfree( workspace->p2, "Deallocate_Workspace_Part2::workspace->p2" );
#endif
break;
case SDM_S:
......@@ -217,10 +219,12 @@ static void Deallocate_Workspace_Part2( control_params * const control,
sfree( workspace->d, "Deallocate_Workspace_Part2::workspace->d" );
sfree( workspace->q, "Deallocate_Workspace_Part2::workspace->q" );
sfree( workspace->p, "Deallocate_Workspace_Part2::workspace->p" );
#if defined(DUAL_SOLVER)
sfree( workspace->r2, "Deallocate_Workspace_Part2::workspace->r2" );
sfree( workspace->d2, "Deallocate_Workspace_Part2::workspace->d2" );
sfree( workspace->q2, "Deallocate_Workspace_Part2::workspace->q2" );
sfree( workspace->p2, "Deallocate_Workspace_Part2::workspace->p2" );
#endif
break;
case BiCGStab_S:
......@@ -233,6 +237,17 @@ static void Deallocate_Workspace_Part2( control_params * const control,
sfree( workspace->p, "Deallocate_Workspace_Part2::workspace->p" );
sfree( workspace->r_hat, "Deallocate_Workspace_Part2::workspace->r_hat" );
sfree( workspace->q_hat, "Deallocate_Workspace_Part2::workspace->q_hat" );
#if defined(DUAL_SOLVER)
sfree( workspace->y2, "Deallocate_Workspace_Part2::workspace->y2" );
sfree( workspace->g2, "Deallocate_Workspace_Part2::workspace->g2" );
sfree( workspace->z2, "Deallocate_Workspace_Part2::workspace->z2" );
sfree( workspace->r2, "Deallocate_Workspace_Part2::workspace->r2" );
sfree( workspace->d2, "Deallocate_Workspace_Part2::workspace->d2" );
sfree( workspace->q2, "Deallocate_Workspace_Part2::workspace->q2" );
sfree( workspace->p2, "Deallocate_Workspace_Part2::workspace->p2" );
sfree( workspace->r_hat2, "Deallocate_Workspace_Part2::workspace->r_hat2" );
sfree( workspace->q_hat2, "Deallocate_Workspace_Part2::workspace->q_hat2" );
#endif
break;
case PIPECG_S:
......@@ -245,6 +260,7 @@ static void Deallocate_Workspace_Part2( control_params * const control,
sfree( workspace->n, "Deallocate_Workspace_Part2::workspace->n" );
sfree( workspace->u, "Deallocate_Workspace_Part2::workspace->u" );
sfree( workspace->w, "Deallocate_Workspace_Part2::workspace->w" );
#if defined(DUAL_SOLVER)
sfree( workspace->z2, "Deallocate_Workspace_Part2::workspace->z2" );
sfree( workspace->r2, "Deallocate_Workspace_Part2::workspace->r2" );
sfree( workspace->d2, "Deallocate_Workspace_Part2::workspace->d2" );
......@@ -254,6 +270,7 @@ static void Deallocate_Workspace_Part2( control_params * const control,
sfree( workspace->n2, "Deallocate_Workspace_Part2::workspace->n2" );
sfree( workspace->u2, "Deallocate_Workspace_Part2::workspace->u2" );
sfree( workspace->w2, "Deallocate_Workspace_Part2::workspace->w2" );
#endif
break;
case PIPECR_S:
......@@ -266,6 +283,17 @@ static void Deallocate_Workspace_Part2( control_params * const control,
sfree( workspace->n, "Deallocate_Workspace_Part2::workspace->n" );
sfree( workspace->u, "Deallocate_Workspace_Part2::workspace->u" );
sfree( workspace->w, "Deallocate_Workspace_Part2::workspace->w" );
#if defined(DUAL_SOLVER)
sfree( workspace->z2, "Deallocate_Workspace_Part2::workspace->z2" );
sfree( workspace->r2, "Deallocate_Workspace_Part2::workspace->r2" );
sfree( workspace->d2, "Deallocate_Workspace_Part2::workspace->d2" );
sfree( workspace->q2, "Deallocate_Workspace_Part2::workspace->q2" );
sfree( workspace->p2, "Deallocate_Workspace_Part2::workspace->p2" );
sfree( workspace->m2, "Deallocate_Workspace_Part2::workspace->m2" );
sfree( workspace->n2, "Deallocate_Workspace_Part2::workspace->n2" );
sfree( workspace->u2, "Deallocate_Workspace_Part2::workspace->u2" );
sfree( workspace->w2, "Deallocate_Workspace_Part2::workspace->w2" );
#endif
break;
default:
......@@ -433,10 +461,12 @@ void Allocate_Workspace_Part2( reax_system * const system, control_params * cons
workspace->d = scalloc( total_cap, sizeof(real), "Allocate_Workspace_Part2::d" );
workspace->q = scalloc( total_cap, sizeof(real), "Allocate_Workspace_Part2::q" );
workspace->p = scalloc( total_cap, sizeof(real), "Allocate_Workspace_Part2::p" );
#if defined(DUAL_SOLVER)
workspace->r2 = scalloc( total_cap, sizeof(rvec2), "Allocate_Workspace_Part2::r2" );
workspace->d2 = scalloc( total_cap, sizeof(rvec2), "Allocate_Workspace_Part2::d2" );
workspace->q2 = scalloc( total_cap, sizeof(rvec2), "Allocate_Workspace_Part2::q2" );
workspace->p2 = scalloc( total_cap, sizeof(rvec2), "Allocate_Workspace_Part2::p2" );
#endif
break;
case SDM_S:
......@@ -444,10 +474,12 @@ void Allocate_Workspace_Part2( reax_system * const system, control_params * cons
workspace->d = scalloc( total_cap, sizeof(real), "Allocate_Workspace_Part2::d" );
workspace->q = scalloc( total_cap, sizeof(real), "Allocate_Workspace_Part2::q" );
workspace->p = scalloc( total_cap, sizeof(real), "Allocate_Workspace_Part2::p" );
#if defined(DUAL_SOLVER)
workspace->r2 = scalloc( total_cap, sizeof(rvec2), "Allocate_Workspace_Part2::r2" );
workspace->d2 = scalloc( total_cap, sizeof(rvec2), "Allocate_Workspace_Part2::d2" );
workspace->q2 = scalloc( total_cap, sizeof(rvec2), "Allocate_Workspace_Part2::q2" );
workspace->p2 = scalloc( total_cap, sizeof(rvec2), "Allocate_Workspace_Part2::p2" );
#endif
break;
case BiCGStab_S:
......@@ -460,6 +492,17 @@ void Allocate_Workspace_Part2( reax_system * const system, control_params * cons
workspace->p = scalloc( total_cap, sizeof(real), "Allocate_Workspace_Part2::p" );
workspace->r_hat = scalloc( total_cap, sizeof(real), "Allocate_Workspace_Part2::r_hat" );
workspace->q_hat = scalloc( total_cap, sizeof(real), "Allocate_Workspace_Part2::q_hat" );
#if defined(DUAL_SOLVER)
workspace->y2 = scalloc( total_cap, sizeof(rvec2), "Allocate_Workspace_Part2::y2" );
workspace->g2 = scalloc( total_cap, sizeof(rvec2), "Allocate_Workspace_Part2::g2" );
workspace->z2 = scalloc( total_cap, sizeof(rvec2), "Allocate_Workspace_Part2::z2" );
workspace->r2 = scalloc( total_cap, sizeof(rvec2), "Allocate_Workspace_Part2::r2" );
workspace->d2 = scalloc( total_cap, sizeof(rvec2), "Allocate_Workspace_Part2::d2" );
workspace->q2 = scalloc( total_cap, sizeof(rvec2), "Allocate_Workspace_Part2::q2" );
workspace->p2 = scalloc( total_cap, sizeof(rvec2), "Allocate_Workspace_Part2::p2" );
workspace->r_hat2 = scalloc( total_cap, sizeof(rvec2), "Allocate_Workspace_Part2::r_hat2" );
workspace->q_hat2 = scalloc( total_cap, sizeof(rvec2), "Allocate_Workspace_Part2::q_hat2" );
#endif
break;
case PIPECG_S:
......@@ -472,6 +515,7 @@ void Allocate_Workspace_Part2( reax_system * const system, control_params * cons
workspace->n = scalloc( total_cap, sizeof(real), "Allocate_Workspace_Part2::n" );
workspace->u = scalloc( total_cap, sizeof(real), "Allocate_Workspace_Part2::u" );
workspace->w = scalloc( total_cap, sizeof(real), "Allocate_Workspace_Part2::w" );
#if defined(DUAL_SOLVER)
workspace->z2 = scalloc( total_cap, sizeof(rvec2), "Allocate_Workspace_Part2::z2" );
workspace->r2 = scalloc( total_cap, sizeof(rvec2), "Allocate_Workspace_Part2::r2" );
workspace->d2 = scalloc( total_cap, sizeof(rvec2), "Allocate_Workspace_Part2::d2" );
......@@ -481,6 +525,7 @@ void Allocate_Workspace_Part2( reax_system * const system, control_params * cons
workspace->n2 = scalloc( total_cap, sizeof(rvec2), "Allocate_Workspace_Part2::n2" );
workspace->u2 = scalloc( total_cap, sizeof(rvec2), "Allocate_Workspace_Part2::u2" );
workspace->w2 = scalloc( total_cap, sizeof(rvec2), "Allocate_Workspace_Part2::w2" );
#endif
break;
case PIPECR_S:
......@@ -493,6 +538,17 @@ void Allocate_Workspace_Part2( reax_system * const system, control_params * cons
workspace->n = scalloc( total_cap, sizeof(real), "Allocate_Workspace_Part2::n" );
workspace->u = scalloc( total_cap, sizeof(real), "Allocate_Workspace_Part2::u" );
workspace->w = scalloc( total_cap, sizeof(real), "Allocate_Workspace_Part2::w" );
#if defined(DUAL_SOLVER)
workspace->z2 = scalloc( total_cap, sizeof(rvec2), "Allocate_Workspace_Part2::z2" );
workspace->r2 = scalloc( total_cap, sizeof(rvec2), "Allocate_Workspace_Part2::r2" );
workspace->d2 = scalloc( total_cap, sizeof(rvec2), "Allocate_Workspace_Part2::d2" );
workspace->q2 = scalloc( total_cap, sizeof(rvec2), "Allocate_Workspace_Part2::q2" );
workspace->p2 = scalloc( total_cap, sizeof(rvec2), "Allocate_Workspace_Part2::p2" );
workspace->m2 = scalloc( total_cap, sizeof(rvec2), "Allocate_Workspace_Part2::m2" );
workspace->n2 = scalloc( total_cap, sizeof(rvec2), "Allocate_Workspace_Part2::n2" );
workspace->u2 = scalloc( total_cap, sizeof(rvec2), "Allocate_Workspace_Part2::u2" );
workspace->w2 = scalloc( total_cap, sizeof(rvec2), "Allocate_Workspace_Part2::w2" );
#endif
break;
default:
......
......@@ -468,10 +468,8 @@ static void QEq( reax_system const * const system, control_params const * const
case SDM_S:
#if defined(DUAL_SOLVER)
fprintf( stderr, "[ERROR] Dual SDM solver for QEq not yet implemented. Terminating...\n" );
exit( INVALID_INPUT );
// iters = dual_SDM( system, control, data, workspace, &workspace->H, workspace->b,
// control->cm_solver_q_err, workspace->x, mpi_data, refactor );
iters = dual_SDM( system, control, data, workspace, &workspace->H, workspace->b,
control->cm_solver_q_err, workspace->x, mpi_data, refactor );
#else
iters = SDM( system, control, data, workspace, &workspace->H, workspace->b_s,
control->cm_solver_q_err, workspace->s, mpi_data, refactor );
......@@ -483,10 +481,8 @@ static void QEq( reax_system const * const system, control_params const * const
case BiCGStab_S:
#if defined(DUAL_SOLVER)
fprintf( stderr, "[ERROR] Dual BiCGStab solver for QEq not yet implemented. Terminating...\n" );
exit( INVALID_INPUT );
// iters = dual_BiCGStab( system, control, data, workspace, &workspace->H, workspace->b,
// control->cm_solver_q_err, workspace->x, mpi_data, refactor );
iters = dual_BiCGStab( system, control, data, workspace, &workspace->H, workspace->b,
control->cm_solver_q_err, workspace->x, mpi_data, refactor );
#else
iters = BiCGStab( system, control, data, workspace, &workspace->H, workspace->b_s,
control->cm_solver_q_err, workspace->s, mpi_data, refactor );
......@@ -511,10 +507,8 @@ static void QEq( reax_system const * const system, control_params const * const
case PIPECR_S:
#if defined(DUAL_SOLVER)
fprintf( stderr, "[ERROR] Dual PIPECR solver for QEq not yet implemented. Terminating...\n" );
exit( INVALID_INPUT );
// iters = dual_PIPECR( system, control, data, workspace, &workspace->H, workspace->b,
// control->cm_solver_q_err, workspace->x, mpi_data, refactor );
iters = dual_PIPECR( system, control, data, workspace, &workspace->H, workspace->b,
control->cm_solver_q_err, workspace->x, mpi_data, refactor );
#else
iters = PIPECR( system, control, data, workspace, &workspace->H, workspace->b_s,
control->cm_solver_q_err, workspace->s, mpi_data, refactor );
......
......@@ -881,10 +881,12 @@ static void Finalize_Workspace( reax_system * const system, control_params * con
sfree( workspace->d, "Finalize_Workspace::workspace->d" );
sfree( workspace->q, "Finalize_Workspace::workspace->q" );
sfree( workspace->p, "Finalize_Workspace::workspace->p" );
#if defined(DUAL_SOLVER)
sfree( workspace->r2, "Finalize_Workspace::workspace->r2" );
sfree( workspace->d2, "Finalize_Workspace::workspace->d2" );
sfree( workspace->q2, "Finalize_Workspace::workspace->q2" );
sfree( workspace->p2, "Finalize_Workspace::workspace->p2" );
#endif
break;
case SDM_S:
......@@ -892,10 +894,12 @@ static void Finalize_Workspace( reax_system * const system, control_params * con
sfree( workspace->d, "Finalize_Workspace::workspace->d" );
sfree( workspace->q, "Finalize_Workspace::workspace->q" );
sfree( workspace->p, "Finalize_Workspace::workspace->p" );
#if defined(DUAL_SOLVER)
sfree( workspace->r2, "Finalize_Workspace::workspace->r2" );
sfree( workspace->d2, "Finalize_Workspace::workspace->d2" );
sfree( workspace->q2, "Finalize_Workspace::workspace->q2" );
sfree( workspace->p2, "Finalize_Workspace::workspace->p2" );
#endif
break;
case BiCGStab_S:
......@@ -908,6 +912,17 @@ static void Finalize_Workspace( reax_system * const system, control_params * con
sfree( workspace->p, "Finalize_Workspace::workspace->p" );
sfree( workspace->r_hat, "Finalize_Workspace::workspace->r_hat" );
sfree( workspace->q_hat, "Finalize_Workspace::workspace->q_hat" );
#if defined(DUAL_SOLVER)
sfree( workspace->y2, "Finalize_Workspace::workspace->y2" );
sfree( workspace->g2, "Finalize_Workspace::workspace->g2" );
sfree( workspace->z2, "Finalize_Workspace::workspace->z2" );
sfree( workspace->r2, "Finalize_Workspace::workspace->r2" );
sfree( workspace->d2, "Finalize_Workspace::workspace->d2" );
sfree( workspace->q2, "Finalize_Workspace::workspace->q2" );
sfree( workspace->p2, "Finalize_Workspace::workspace->p2" );
sfree( workspace->r_hat2, "Finalize_Workspace::workspace->r_hat2" );
sfree( workspace->q_hat2, "Finalize_Workspace::workspace->q_hat2" );
#endif
break;
case PIPECG_S:
......@@ -920,6 +935,7 @@ static void Finalize_Workspace( reax_system * const system, control_params * con
sfree( workspace->n, "Finalize_Workspace::workspace->n" );
sfree( workspace->u, "Finalize_Workspace::workspace->u" );
sfree( workspace->w, "Finalize_Workspace::workspace->w" );
#if defined(DUAL_SOLVER)
sfree( workspace->z2, "Finalize_Workspace::workspace->z2" );
sfree( workspace->r2, "Finalize_Workspace::workspace->r2" );
sfree( workspace->d2, "Finalize_Workspace::workspace->d2" );
......@@ -929,6 +945,7 @@ static void Finalize_Workspace( reax_system * const system, control_params * con
sfree( workspace->n2, "Finalize_Workspace::workspace->n2" );
sfree( workspace->u2, "Finalize_Workspace::workspace->u2" );
sfree( workspace->w2, "Finalize_Workspace::workspace->w2" );
#endif
break;
case PIPECR_S:
......@@ -941,6 +958,17 @@ static void Finalize_Workspace( reax_system * const system, control_params * con
sfree( workspace->n, "Finalize_Workspace::workspace->n" );
sfree( workspace->u, "Finalize_Workspace::workspace->u" );
sfree( workspace->w, "Finalize_Workspace::workspace->w" );
#if defined(DUAL_SOLVER)
sfree( workspace->z2, "Finalize_Workspace::workspace->z2" );
sfree( workspace->r2, "Finalize_Workspace::workspace->r2" );
sfree( workspace->d2, "Finalize_Workspace::workspace->d2" );
sfree( workspace->q2, "Finalize_Workspace::workspace->q2" );
sfree( workspace->p2, "Finalize_Workspace::workspace->p2" );
sfree( workspace->m2, "Finalize_Workspace::workspace->m2" );
sfree( workspace->n2, "Finalize_Workspace::workspace->n2" );
sfree( workspace->u2, "Finalize_Workspace::workspace->u2" );
sfree( workspace->w2, "Finalize_Workspace::workspace->w2" );
#endif
break;
default:
......
This diff is collapsed.
......@@ -44,6 +44,11 @@ real sparse_approx_inverse( reax_system const * const,
storage * const, mpi_datatypes * const,
sparse_matrix * const, sparse_matrix * const, sparse_matrix * const, int );
int dual_SDM( reax_system const * const, control_params const * const,
simulation_data * const,
storage * const, sparse_matrix * const, rvec2 * const,
real, rvec2 * const, mpi_datatypes * const, int );
int SDM( reax_system const * const, control_params const * const,
simulation_data * const,
storage * const, sparse_matrix * const, real * const,
......@@ -59,6 +64,11 @@ int CG( reax_system const * const, control_params const * const,
storage * const, sparse_matrix * const, real * const,
real, real * const, mpi_datatypes * const, int );
int dual_BiCGStab( reax_system const * const, control_params const * const,
simulation_data * const,
storage * const, sparse_matrix * const, rvec2 * const,
real, rvec2 * const, mpi_datatypes * const, int );
int BiCGStab( reax_system const * const, control_params const * const,
simulation_data * const,
storage * const, sparse_matrix * const, real * const,
......@@ -74,6 +84,11 @@ int PIPECG( reax_system const * const, control_params const * const,
storage * const, sparse_matrix * const, real * const,
real, real * const, mpi_datatypes * const, int );
int dual_PIPECR( reax_system const * const, control_params const * const,
simulation_data * const,
storage * const, sparse_matrix * const, rvec2 * const,
real, rvec2 * const, mpi_datatypes * const, int );
int PIPECR( reax_system const * const, control_params const * const,
simulation_data * const,
storage * const, sparse_matrix * const, real * const,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment