void seissol::checkpoint::mpio::Wavefield::load(double &time, int ×tepWaveField) { logInfo(rank()) << "Loading wave field checkpoint"; seissol::checkpoint::CheckPoint::load(); MPI_File file = open(); if (file == MPI_FILE_NULL) logError() << "Could not open checkpoint file"; // Read and broadcast header checkMPIErr(setHeaderView(file)); Header header; if (rank() == 0) checkMPIErr(MPI_File_read(file, &header, 1, headerType(), MPI_STATUS_IGNORE)); MPI_Bcast(&header, 1, headerType(), 0, comm()); time = header.time; timestepWaveField = header.timestepWavefield; // Read dofs checkMPIErr(setDataView(file)); checkMPIErr(MPI_File_read_all(file, dofs(), numDofs(), MPI_DOUBLE, MPI_STATUS_IGNORE)); // Close the file checkMPIErr(MPI_File_close(&file)); }
bool seissol::checkpoint::mpio::Wavefield::validate(MPI_File file) const { if (setHeaderView(file) != 0) { logWarning() << "Could not set checkpoint header view"; return false; } int result = true; if (rank() == 0) { Header header; // Check the header MPI_File_read(file, &header, 1, headerType(), MPI_STATUS_IGNORE); if (header.identifier != identifier()) { logWarning() << "Checkpoint identifier does match"; result = false; } else if (header.partitions != partitions()) { logWarning() << "Number of partitions in checkpoint does not match"; result = false; } } // Make sure everybody knows the result of the validation MPI_Bcast(&result, 1, MPI_INT, 0, comm()); return result; }
void seissol::checkpoint::mpio::Wavefield::load(real* dofs) { logInfo(rank()) << "Loading wave field checkpoint"; seissol::checkpoint::CheckPoint::setLoaded(); MPI_File file = open(); if (file == MPI_FILE_NULL) logError() << "Could not open checkpoint file"; // Read and broadcast header checkMPIErr(setHeaderView(file)); if (rank() == 0) checkMPIErr(MPI_File_read(file, header().data(), 1, headerType(), MPI_STATUS_IGNORE)); MPI_Bcast(header().data(), 1, headerType(), 0, comm()); // Read dofs checkMPIErr(setDataView(file)); checkMPIErr(MPI_File_read_all(file, dofs, numDofs(), MPI_DOUBLE, MPI_STATUS_IGNORE)); // Close the file checkMPIErr(MPI_File_close(&file)); }
void seissol::checkpoint::mpio::Wavefield::writeHeader(const void* header, size_t headerSize) { SCOREP_USER_REGION("checkpoint_write_header", SCOREP_USER_REGION_TYPE_FUNCTION); checkMPIErr(setHeaderView(file())); if (rank() == 0) checkMPIErr(MPI_File_write(file(), const_cast<void*>(header), 1, headerType(), MPI_STATUS_IGNORE)); }
RadioView::RadioView(QWidget *parent) : MPDSongView(parent) { Q_ASSERT(m_menu); setObjectName("radioview"); setHeaderView(new RadiolistHeader(this)); m_menu->addSeparator(); m_addAction = addMenuAction("newStationAction", this, SLOT(newStation()), false); m_deleteAction = addMenuAction("deleteAction", this, SLOT(deleteStation())); m_deleteAction->setShortcut(Qt::Key_Delete); m_deleteAction->setShortcutContext(Qt::WidgetShortcut); addAction(m_deleteAction); // Needed for shortcut key to work connect(MPDConnection::instance(), SIGNAL(connected(const ServerInfo &)), this, SLOT(connected())); connect(MPDConnection::instance(), SIGNAL(disconnected(const QString &)), this, SLOT(disconnected())); }
void seissol::checkpoint::mpio::Wavefield::writeHeader(double time, int timestepWaveField) { EPIK_TRACER("checkpoint_write_header"); SCOREP_USER_REGION("checkpoint_write_header", SCOREP_USER_REGION_TYPE_FUNCTION); checkMPIErr(setHeaderView(file())); if (rank() == 0) { Header header; header.identifier = identifier(); header.partitions = partitions(); header.time = time; header.timestepWavefield = timestepWaveField; checkMPIErr(MPI_File_write(file(), &header, 1, headerType(), MPI_STATUS_IGNORE)); } }