Skip to content

Commit

Permalink
Ensure 'average' broadcasts the final average coords set to non-master
Browse files Browse the repository at this point in the history
ranks for future use. Addresses Amber-MD#1096.
  • Loading branch information
drroe committed Nov 5, 2024
1 parent 6f41b31 commit a6a6fb3
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Action_Average.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,20 @@ int Action_Average::SyncAction() {
AvgFrame_.SumToMaster(trajComm_);
if (trajComm_.Master())
Nframes_ = total_frames;
// If setting up a COORDS set, do it here for non-master ranks since Print()
// is only called by the master.
if (crdset_ != 0) {
trajComm_.MasterBcast( &Nframes_, 1, MPI_INT );
AvgFrame_.BcastFrame( trajComm_ );
// Do non-master rank setup of the DataSet here. Master will still do it
// in Print().
if (!trajComm_.Master()) {
AvgFrame_.Divide( (double)Nframes_ );
DataSet_Coords_REF& ref = static_cast<DataSet_Coords_REF&>( *crdset_ );
ref.CoordsSetup( AvgParm_, CoordinateInfo() ); // Coords Only
ref.AddFrame( AvgFrame_ );
}
}
return 0;
}
#endif
Expand Down

0 comments on commit a6a6fb3

Please sign in to comment.