void CChart::HandleMessage(SGUIMessage& Message) { // TODO: implement zoom switch (Message.type) { case GUIM_SETTINGS_UPDATED: { UpdateSeries(); break; } } }
int Action_NativeContacts::SyncAction() { // Make sure all time series are updated at this point. UpdateSeries(); // Get total number of frames. int N = (int)nframes_; int total_frames; trajComm_.ReduceMaster( &total_frames, &N, 1, MPI_INT, MPI_SUM ); if (trajComm_.Master()) nframes_ = (unsigned int)total_frames; // Should have the same number of contacts on each thread since reference is shared. for (contactListType::iterator it = nativeContacts_.begin(); it != nativeContacts_.end(); ++it) { double total[3], buf[3]; buf[0] = it->second.Avg(); buf[1] = it->second.Stdev(); buf[2] = (double)it->second.Nframes(); trajComm_.ReduceMaster( total, buf, 3, MPI_DOUBLE, MPI_SUM ); if (trajComm_.Master()) it->second.SetValues( total[0], total[1], (int)total[2] ); } return 0; }
// Action_NativeContacts::Print() void Action_NativeContacts::Print() { if (nativeMap_ != 0) { // Normalize maps by number of frames. double norm = 1.0 / (double)nframes_; for (DataSet_MatrixDbl::iterator m = nativeMap_->begin(); m != nativeMap_->end(); ++m) *m *= norm; for (DataSet_MatrixDbl::iterator m = nonnatMap_->begin(); m != nonnatMap_->end(); ++m) *m *= norm; } // Ensure all series have been updated for all frames. UpdateSeries(); if (!cfile_->IsStream()) { mprintf(" CONTACTS: %s: Writing native contacts to file '%s'\n", numnative_->Meta().Name().c_str(), cfile_->Filename().full()); cfile_->Printf("# Contacts: %s\n", numnative_->Meta().Name().c_str()); cfile_->Printf("# Native contacts determined from mask '%s'", Mask1_.MaskString()); if (Mask2_.MaskStringSet()) cfile_->Printf(" and mask '%s'", Mask2_.MaskString()); cfile_->Printf("\n"); } else mprintf(" CONTACTS: %s\n", numnative_->Meta().Name().c_str()); WriteContacts( nativeContacts_, true ); if (saveNonNative_) { if (!cfile_->IsStream()) { mprintf(" %s: Writing non-native contacts to file '%s'\n", numnative_->Meta().Name().c_str(), cfile_->Filename().full()); cfile_->Printf("# Non-native Contacts: %s\n", numnative_->Meta().Name().c_str()); } else mprintf(" ------- Non-native %s -------\n", numnative_->Meta().Name().c_str()); WriteContacts( nonNativeContacts_, false ); } // Break down contacts by atom, write to PDB. if (pfile_ != 0) WriteContactPDB( nativeContacts_, pfile_ ); if (nfile_ != 0) WriteContactPDB( nonNativeContacts_, nfile_ ); }