Skip to content

Commit

Permalink
Fixed a bug in the counstrained source term under MPI
Browse files Browse the repository at this point in the history
  • Loading branch information
wenqing committed Mar 18, 2016
1 parent 9255da9 commit ca06b3b
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion FEM/rf_pcs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
/*--------------------- MPI Parallel -------------------*/
#if defined(USE_MPI) || defined(USE_MPI_PARPROC) || defined(USE_MPI_REGSOIL)
#include <mpi.h>
#if defined (USE_MPI)
#include "SplitMPI_Communicator.h"
#endif
#endif
/*--------------------- MPI Parallel -------------------*/

Expand Down Expand Up @@ -8049,8 +8052,21 @@ double CRFProcess::evaluteSwitchBC(CBoundaryCondition const & bc, CBoundaryCondi

for (std::size_t temp_i(0); temp_i < m_st->getNumberOfConstrainedSTs(); temp_i++)
{
if (st_vector[cnodev->getSTVectorGroup()]->isCompleteConstrainST(temp_i)
int st_conditionst = (st_vector[cnodev->getSTVectorGroup()]->isCompleteConstrainST(temp_i)
&& st_vector[cnodev->getSTVectorGroup()]->getCompleteConstrainedSTStateOff(temp_i))
? 1 : 0;

#if defined(USE_MPI) || defined (USE_PETSC)
int int_buff = 0;
#ifdef USE_PETSC
MPI_Comm comm = MPI_COMM_WORLD;
#else
MPI_Comm comm = comm_DDC;
#endif
MPI_Allreduce(&st_conditionst, &int_buff, 1, MPI_INT, MPI_SUM, comm);
st_conditionst = int_buff;
#endif
if (st_conditionst > 0)
{
continue_bool = true;
break;
Expand Down

0 comments on commit ca06b3b

Please sign in to comment.