message: Fixed derivative of TACSBuckling when using mpi
diff: @@ -371,10 +371,10 @@ void TACSLinearBuckling::evalEigenDVSens( int n,
  // Zero the derivative
  memset(fdvSens, 0, numDVs*sizeof(TacsScalar));
  - // // Copy over the values of the stiffness matrix, factor
  - // // the stiffness matrix.
  - // aux_mat->copyValues(kmat);
  - // pc->factor();
  + // Copy over the values of the stiffness matrix, factor
  + // the stiffness matrix.
  + aux_mat->copyValues(kmat);
  + pc->factor();
  // Get the eigenvalue and eigenvector
  TacsScalar error;
  @@ -383,6 +383,8 @@ void TACSLinearBuckling::evalEigenDVSens( int n,
  // Evaluate the partial derivative for the stiffness matrix
  tacs->addMatDVSensInnerProduct(1.0, STIFFNESS_MATRIX,
  eigvec, eigvec, fdvSens, numDVs);
  + int mpi_rank;
  + MPI_Comm_rank(tacs->getMPIComm(),&mpi_rank);
  // Evaluate the derivative of the geometric stiffness matrix
  tacs->addMatDVSensInnerProduct(TacsRealPart(eig), GEOMETRIC_STIFFNESS_MATRIX,
  @@ -403,10 +405,6 @@ void TACSLinearBuckling::evalEigenDVSens( int n,
  gmat->mult(eigvec, res);
  TacsScalar scale = res->dot(eigvec);
  - // All reduce across the processors
  - MPI_Allreduce(MPI_IN_PLACE, fdvSens, numDVs, MPI_INT,
  - MPI_SUM, tacs->getMPIComm());
  -
  // Prepare to scale the final result
  scale = -1.0/scale;
  