#include "MPIFileIOStream.h"
#include "ThirdPartyHeadersBegin.h"
#include <iostream>
#include "ThirdPartyHeadersEnd.h"
#include "FileIOStatistics.h"
using namespace tecplot::teciompi; struct MPIFileIOStream::Impl { std::string             ___2461; MPI_Comm                m_comm; MPI_File                m_fileHandle; ___372               m_isAscii; DataFileType_e          m_dataFileType; ___3933::FileIOStatistics m_statistics; Impl(std::string const& ___1394, MPI_Comm comm) : ___2461(___1394) , m_comm(comm) , m_fileHandle(NULL) , m_isAscii(___1305) , m_dataFileType(___845) {} }; tecplot::teciompi::MPIFileIOStream::MPIFileIOStream(std::string const& ___1394, MPI_Comm comm) : m_impl(new Impl(___1394, comm)) {} tecplot::teciompi::MPIFileIOStream::~MPIFileIOStream() {} ___372 MPIFileIOStream::___2041() const { return m_impl->m_fileHandle != NULL; } ___372 tecplot::teciompi::MPIFileIOStream::close(bool ___3361) { ___372 ___3358 = ___4226; if (___2041()) { (void)MPI_File_sync(m_impl->m_fileHandle); ___3358 = (MPI_File_close(&m_impl->m_fileHandle) == MPI_SUCCESS); m_impl->m_fileHandle = NULL; if (!___3361) { int ___2676; (void)MPI_Comm_rank(m_impl->m_comm, &___2676); if (___2676 == 0) (void)MPI_File_delete(const_cast<char*>(___1394().c_str()), MPI_INFO_NULL); } } ENSURE(!___2041()); ENSURE(VALID_BOOLEAN(___3358)); return ___3358; } tecplot::___3933::___1393 tecplot::teciompi::MPIFileIOStream::fileLoc() { REQUIRE(___2041()); MPI_Offset mpiOffset = 0; (void)MPI_File_get_position(m_impl->m_fileHandle, &mpiOffset); return static_cast<___3933::___1393>(mpiOffset); } ___372 tecplot::teciompi::MPIFileIOStream::___3460() { REQUIRE(___2041()); MPI_Offset mpiOffset = 0; ___372 ___3358 = (MPI_File_seek(m_impl->m_fileHandle, mpiOffset, MPI_SEEK_SET)== MPI_SUCCESS); ENSURE(VALID_BOOLEAN(___3358)); return ___3358; } ___372 tecplot::teciompi::MPIFileIOStream::___3459(___3933::___1393 fileLoc) { REQUIRE(___2041()); MPI_Offset mpiOffset = static_cast<MPI_Offset>(fileLoc); ___372 ___3358 = (MPI_File_seek(m_impl->m_fileHandle, mpiOffset, MPI_SEEK_SET) == MPI_SUCCESS); ENSURE(VALID_BOOLEAN(___3358)); return ___3358; } ___372 tecplot::teciompi::MPIFileIOStream::seekToFileEnd() { REQUIRE(___2041()); MPI_Offset mpiOffset = 0; ___372 ___3358 = (MPI_File_seek(m_impl->m_fileHandle, mpiOffset, MPI_SEEK_END) == MPI_SUCCESS); ENSURE(VALID_BOOLEAN(___3358)); return ___3358; } std::string const& tecplot::teciompi::MPIFileIOStream::___1394() const { return m_impl->___2461; } void tecplot::teciompi::MPIFileIOStream::___3494(___372 ___2002) { REQUIRE(VALID_BOOLEAN(___2002)); m_impl->m_isAscii = ___2002; } ___372 tecplot::teciompi::MPIFileIOStream::___2002() const { return m_impl->m_isAscii; } void tecplot::teciompi::MPIFileIOStream::setDataFileType(DataFileType_e ___844) { REQUIRE(VALID_ENUM(___844, DataFileType_e)); m_impl->m_dataFileType = ___844; } DataFileType_e tecplot::teciompi::MPIFileIOStream::___844() const { return m_impl->m_dataFileType; } tecplot::___3933::FileIOStatistics& tecplot::teciompi::MPIFileIOStream::statistics() { return m_impl->m_statistics; } MPI_File tecplot::teciompi::MPIFileIOStream::fileHandle() const { return m_impl->m_fileHandle; } MPI_Comm tecplot::teciompi::MPIFileIOStream::comm() const { return m_impl->m_comm; } ___372 MPIFileIOStream::open(int ___2504) { REQUIRE(!___2041()); int mpiResult = MPI_File_open(m_impl->m_comm, const_cast<char*>(___1394().c_str()), ___2504, MPI_INFO_NULL, &m_impl->m_fileHandle); ___372 ___3358 = (mpiResult == MPI_SUCCESS); if (!___3358) { m_impl->m_fileHandle = NULL; char msg[MPI_MAX_ERROR_STRING]; int resultlen; MPI_Error_string(mpiResult, msg, &resultlen); std::cout << "Error opening file: " << msg << std::endl; } ENSURE(VALID_BOOLEAN(___3358)); return ___3358; }
