Skip to content

Commit

Permalink
Merge pull request #58 from Argonne-National-Laboratory/multiple-rhs-…
Browse files Browse the repository at this point in the history
…ma57

Multiple rhs ma57
  • Loading branch information
cnpetra authored Aug 17, 2019
2 parents 981392c + 4360238 commit e1f4252
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
22 changes: 16 additions & 6 deletions PIPS-NLP/Core/LinearSolvers/Ma57Solver/Ma57Solver.C
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ extern int gOoqpPrintLevel;
extern int gOuterSolve;
extern int separateHandDiag;


extern double gHSL_PivotLV;
extern double gMA57_Ordering;

Expand Down Expand Up @@ -330,7 +329,6 @@ void Ma57Solver::solve( OoqpVector& rhs_in )
SimpleVector & rhs = dynamic_cast<SimpleVector &>(rhs_in);

double * drhs = rhs.elements();

int * iwork = new int[5*n];
double * work = new double[n];

Expand Down Expand Up @@ -410,10 +408,22 @@ void Ma57Solver::solve(GenMatrix& rhs_in)
assert(n==N);

// we need checks on the residuals, can't do that with multiple RHS
for (int i = 0; i < NRHS; i++) {
SimpleVector v(rhs[i],N);
solve(v);
}

double *drhs = rhs.elements();
//std::cout << "[MA57] N: " << N << " NRHS: " << NRHS << std::endl;
int job = 1; // Solve using A
int one = 1;

int *iwork = new int[n];
double *work = new double[NRHS*n];
int lwork=NRHS*N;
FNAME(ma57cd)( &job, &n,
fact, &lfact, ifact, &lifact,
&NRHS, drhs, &n,
work, &lwork, iwork,
icntl, info );
delete [] iwork;
delete [] work;
}

int* Ma57Solver::new_iworkn(int dim)
Expand Down
1 change: 0 additions & 1 deletion PIPS-NLP/Core/LinearSolvers/MumpsSolver/MumpsSolver.C
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,6 @@ void MumpsDenseSolver::sysMatToSpTriplet()
int MumpsSolver::matrixChanged()
{
if(mumpsMpiComm!=MPI_COMM_NULL) {
printf("mumps Rank %d says hello\n", my_mumps_rank_);
#ifndef WITHOUT_PIPS
if(Msys!=NULL)
sysMatToSpTriplet();
Expand Down
6 changes: 3 additions & 3 deletions PIPS-NLP/Core/NlpStoch/sLinsysRoot.C
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ void sLinsysRoot::afterFactor()
{
int mype; MPI_Comm_rank(mpiComm, &mype);

//if( (mype/256)*256==mype)
if( 0==mype)
{

for (size_t c=0; c<children.size(); c++) {
Expand Down Expand Up @@ -407,7 +407,7 @@ void sLinsysRoot::Ltsolve( sData *prob, OoqpVector& x )
#ifdef TIMING
int myRank; MPI_Comm_rank(MPI_COMM_WORLD, &myRank);

//if(256*(myRank/256) == myRank)
if(0 == myRank)
{
double tTotResChildren=0.0;
for(size_t it=0; it<children.size(); it++) {
Expand Down Expand Up @@ -755,7 +755,7 @@ int sLinsysRoot::factorizeKKT()
//MPI_Barrier(mpiComm);
int mype; MPI_Comm_rank(mpiComm, &mype);
// note, this will include noop scalapack processors
//if( (mype/256)*256==mype )
if( 0==mype )
printf(" rank %d 1stSTAGE FACT %g SEC ITER %d\n", mype, st, (int)g_iterNumber);
#endif
return negEValTemp;
Expand Down

0 comments on commit e1f4252

Please sign in to comment.