Skip to content

Commit

Permalink
Refs #10456. Added parallel and serial macros for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
quantumsteve committed Nov 3, 2014
1 parent a62386e commit 4f77432
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions Code/Mantid/Framework/Algorithms/src/BinaryOperation.cpp
Expand Up @@ -480,7 +480,8 @@ namespace Mantid
if (m_eout)
{
// ---- The output is an EventWorkspace ------
BEGIN_PARALLEL_FOR(THREADSAFE(m_lhs,m_rhs,m_out),0,numHists,i)
//BEGIN_PARALLEL_FOR(THREADSAFE(m_lhs,m_rhs,m_out),0,numHists,i)
BEGIN_PARALLEL_FOR(false,0,numHists,i)
{
PARALLEL_START_INTERUPT_REGION
m_out->setX(i, m_lhs->refX(i));
Expand All @@ -494,7 +495,8 @@ namespace Mantid
else
{
// ---- Histogram Output -----
BEGIN_PARALLEL_FOR(THREADSAFE(m_lhs,m_rhs,m_out),0,numHists,i)
//BEGIN_PARALLEL_FOR(THREADSAFE(m_lhs,m_rhs,m_out),0,numHists,i)
BEGIN_PARALLEL_FOR(false,0,numHists,i)
{
PARALLEL_START_INTERUPT_REGION
m_out->setX(i,m_lhs->refX(i));
Expand Down Expand Up @@ -527,7 +529,8 @@ namespace Mantid
if (m_eout)
{
// ---- The output is an EventWorkspace ------
BEGIN_PARALLEL_FOR(THREADSAFE(m_lhs,m_rhs,m_out),0,numHists,i)
//BEGIN_PARALLEL_FOR(THREADSAFE(m_lhs,m_rhs,m_out),0,numHists,i)
BEGIN_PARALLEL_FOR(false,0,numHists,i)
{
PARALLEL_START_INTERUPT_REGION
const double rhsY = m_rhs->readY(i)[0];
Expand All @@ -548,6 +551,7 @@ namespace Mantid
{
// ---- Histogram Output -----
BEGIN_PARALLEL_FOR(THREADSAFE(m_lhs,m_rhs,m_out),0,numHists,i)
//BEGIN_PARALLEL_FOR(false,0,numHists,i)
{
PARALLEL_START_INTERUPT_REGION
const double rhsY = m_rhs->readY(i)[0];
Expand Down Expand Up @@ -600,6 +604,7 @@ namespace Mantid
// Now loop over the spectra of the left hand side calling the virtual function
const std::size_t numHists = m_lhs->getNumberHistograms();
BEGIN_PARALLEL_FOR(THREADSAFE(m_lhs,m_rhs,m_out),0,numHists,i)
//BEGIN_PARALLEL_FOR(false,0,numHists,i)
{
PARALLEL_START_INTERUPT_REGION
//m_out->setX(i,m_lhs->refX(i)); //unnecessary - that was copied before.
Expand All @@ -623,6 +628,7 @@ namespace Mantid
// Now loop over the spectra of the left hand side calling the virtual function
const std::size_t numHists = m_lhs->getNumberHistograms();
BEGIN_PARALLEL_FOR(THREADSAFE(m_lhs,m_rhs,m_out),0,numHists,i)
//BEGIN_PARALLEL_FOR(false,0,numHists,i)
{
PARALLEL_START_INTERUPT_REGION
//m_out->setX(i,m_lhs->refX(i)); //unnecessary - that was copied before.
Expand All @@ -649,6 +655,7 @@ namespace Mantid
// Now loop over the spectra of the left hand side calling the virtual function
const std::size_t numHists = m_lhs->getNumberHistograms();
BEGIN_PARALLEL_FOR(THREADSAFE(m_lhs,m_rhs,m_out),0,numHists,i)
//BEGIN_PARALLEL_FOR(false,0,numHists,i)
{
PARALLEL_START_INTERUPT_REGION
m_out->setX(i,m_lhs->refX(i));
Expand Down Expand Up @@ -696,6 +703,7 @@ namespace Mantid
// Now loop over the spectra of each one calling the virtual function
const std::size_t numHists = m_lhs->getNumberHistograms();
BEGIN_PARALLEL_FOR(THREADSAFE(m_lhs,m_rhs,m_out),0,numHists,i)
//BEGIN_PARALLEL_FOR(false,0,numHists,i)
{
PARALLEL_START_INTERUPT_REGION
m_progress->report(this->name());
Expand Down Expand Up @@ -735,6 +743,7 @@ namespace Mantid
// Now loop over the spectra of each one calling the virtual function
const std::size_t numHists = m_lhs->getNumberHistograms();
BEGIN_PARALLEL_FOR(THREADSAFE(m_lhs,m_rhs,m_out),0,numHists,i)
//BEGIN_PARALLEL_FOR(false,0,numHists,i)
{
PARALLEL_START_INTERUPT_REGION
m_progress->report(this->name());
Expand Down Expand Up @@ -777,6 +786,7 @@ namespace Mantid
// Now loop over the spectra of each one calling the virtual function
const std::size_t numHists = m_lhs->getNumberHistograms();
BEGIN_PARALLEL_FOR(THREADSAFE(m_lhs,m_rhs,m_out),0,numHists,i)
//BEGIN_PARALLEL_FOR(false,0,numHists,i)
{
PARALLEL_START_INTERUPT_REGION
m_progress->report(this->name());
Expand Down Expand Up @@ -855,6 +865,7 @@ namespace Mantid
ParameterMap &pmap = out->instrumentParameters();
Mutex BinaryOperation_masking;
BEGIN_PARALLEL_FOR(THREADSAFE(out),0,m_indicesToMask.size(),i)
//BEGIN_PARALLEL_FOR(false,0,m_indicesToMask.size(),i)
{
if (!m_parallelException && !m_cancel)
{
Expand Down Expand Up @@ -1024,6 +1035,7 @@ namespace Mantid
const detid2index_map rhs_det_to_wi = rhs->getDetectorIDToWorkspaceIndexMap();

BEGIN_PARALLEL_FOR(true,0,lhs_nhist,lhsWI)
//BEGIN_PARALLEL_FOR(false,0,lhs_nhist,lhsWI)
{
bool done=false;

Expand Down

0 comments on commit 4f77432

Please sign in to comment.