<commit_before>/*
 * DelayTestProbe.cpp
 *
 *  Created on: October 1, 2013
 *      Author: wchavez
 */

#include "DelayTestProbe.hpp"
#include <include/pv_arch.h> 
#include <layers/HyPerLayer.hpp>
#include <string.h>
#include <assert.h>

namespace PV {

DelayTestProbe::DelayTestProbe(const char * filename, HyPerLayer * layer, const char * msg)
: StatsProbe(filename, layer, msg)
{
}

DelayTestProbe::DelayTestProbe(HyPerLayer * layer, const char * msg)
: StatsProbe(layer, msg)
{
}

DelayTestProbe::~DelayTestProbe() {}


int DelayTestProbe::outputState(double timed)
{
	int status = StatsProbe::outputState(timed);
#ifdef PV_USE_MPI
   InterColComm * icComm = getTargetLayer()->getParent()->icCommunicator();
   const int rcvProc = 0;
   if( icComm->commRank() != rcvProc ) {
      return 0;
   }
#endif // PV_USE_MPI
   const PVLayerLoc * loc = getTargetLayer()->getLayerLoc();
   const int rows = getTargetLayer()->getParent()->icCommunicator()->numCommRows();
   const int cols = getTargetLayer()->getParent()->icCommunicator()->numCommColumns();

      int nx = loc->nx;
      int ny = loc->ny;
      int nf = loc->nf;

      assert((avg == timed/nf)&&(avg == double(nnz)/((nx*rows)*(ny*cols)*nf)));

      return status;
}


} /* namespace PV */<commit_msg>Changed assertions to match Movie layer update. (Line 52: timed-1 instead of timed)<commit_after>/*
 * DelayTestProbe.cpp
 *
 *  Created on: October 1, 2013
 *      Author: wchavez
 */

#include "DelayTestProbe.hpp"
#include <include/pv_arch.h> 
#include <layers/HyPerLayer.hpp>
#include <string.h>
#include <assert.h>

namespace PV {

DelayTestProbe::DelayTestProbe(const char * filename, HyPerLayer * layer, const char * msg)
: StatsProbe(filename, layer, msg)
{
}

DelayTestProbe::DelayTestProbe(HyPerLayer * layer, const char * msg)
: StatsProbe(layer, msg)
{
}

DelayTestProbe::~DelayTestProbe() {}


int DelayTestProbe::outputState(double timed)
{
	int status = StatsProbe::outputState(timed);
#ifdef PV_USE_MPI
   InterColComm * icComm = getTargetLayer()->getParent()->icCommunicator();
   const int rcvProc = 0;
   if( icComm->commRank() != rcvProc ) {
      return 0;
   }
#endif // PV_USE_MPI
   const PVLayerLoc * loc = getTargetLayer()->getLayerLoc();
   const int rows = getTargetLayer()->getParent()->icCommunicator()->numCommRows();
   const int cols = getTargetLayer()->getParent()->icCommunicator()->numCommColumns();

      int nx = loc->nx;
      int ny = loc->ny;
      int nf = loc->nf;
    
    if (timed==0) {
        assert((avg == (timed)/nf)&&(avg == double(nnz)/((nx*rows)*(ny*cols)*nf)));
    }
    
    else {
        assert((avg == (timed-1)/nf)&&(avg == double(nnz)/((nx*rows)*(ny*cols)*nf)));
    }
      return status;
}


} /* namespace PV */
{'fraction_non_alphanumeric': 0.16380882889456402, 'fraction_numerical': 0.006931776723823422, 'mean_word_length': 4.021978021978022, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3210057', 'n_tokens_mistral': 996, 'n_tokens_neox': 936, 'n_words': 198}