Skip to content

Commit

Permalink
refs #6449 now it should fix Unix hung-up (fixed other bug introduced)
Browse files Browse the repository at this point in the history
  • Loading branch information
abuts committed Apr 16, 2013
1 parent 8690743 commit 3b5c31c
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Code/Mantid/Framework/MDEvents/src/BoxControllerNeXusIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ namespace MDEvents
/** Load free space blocks from the data file or create the NeXus place to read/write them*/
void BoxControllerNeXusIO::getDiskBufferFileData()
{
Poco::ScopedLock<Poco::FastMutex> _lock(m_fileMutex);

std::vector<uint64_t> freeSpaceBlocks;
this->getFreeSpaceVector(freeSpaceBlocks);
if (freeSpaceBlocks.empty())
Expand Down Expand Up @@ -310,6 +310,8 @@ namespace MDEvents
}
}


//-------------------------------------------------------------------------------------------------------------------------------------
/** Save generc data block on specific position within properly opened NeXus data array
*@param DataBlock -- the vector with data to write
*@param blockPosition -- The starting place to save data to */
Expand All @@ -321,13 +323,13 @@ namespace MDEvents

// Specify the dimensions
std::vector<int64_t> dims(m_BlockSize);
dims[0] = int64_t(DataBlock.size()/this->getNDataColums());

Poco::ScopedLock<Poco::FastMutex> _lock(m_fileMutex);
dims[0] = int64_t(DataBlock.size()/this->getNDataColums());

// ugly cast but why would putSlab change the data?. This is NeXus bug which makes putSlab method non-constant
std::vector<Type> &mData = const_cast<std::vector<Type>& >(DataBlock);

Poco::ScopedLock<Poco::FastMutex> _lock(m_fileMutex);
{
m_File->putSlab<Type>(mData,start,dims);

Expand All @@ -337,6 +339,7 @@ namespace MDEvents


}

/** Save float data block on specific position within properly opened NeXus data array
*@param DataBlock -- the vector with data to write
*@param blockPosition -- The starting place to save data to */
Expand Down Expand Up @@ -377,6 +380,7 @@ namespace MDEvents


}

/** Helper funcion which allows to convert one data fomat into another */
template<typename FROM,typename TO>
void convertFormats(const std::vector<FROM> &inData,std::vector<TO> &outData)
Expand Down Expand Up @@ -433,6 +437,9 @@ void BoxControllerNeXusIO::loadBlock(std::vector<double> & Block, const uint64_t
throw Kernel::Exception::FileError(" Attempt to read double data from unsupported file format",m_fileName);
}
}

//-------------------------------------------------------------------------------------------------------------------------------------

/// Clear NeXus internal cache
void BoxControllerNeXusIO::flushData()const
{
Expand Down

0 comments on commit 3b5c31c

Please sign in to comment.