Commit 13eb6a9e authored by Mulas, Giacomo's avatar Mulas, Giacomo
Browse files

move checks on skip_flag into *OutputInfo::insert() methods

parent 86e5b842
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -453,9 +453,7 @@ void cluster(const string& config_file, const string& data_file, const string& o
	  // threads different from 0 append their virtual files to the one of thread 0, and delete them
	  if (myompthread == 0) {
	    for (int ti=1; ti<ompnumthreads; ti++) {
	      if (p_outarray[ti]->skip_flag != 1) {
	      p_outarray[0]->insert(*(p_outarray[ti]));
	      }
	      delete p_outarray[ti];
	      p_outarray[ti] = NULL;
	      vtppoanarray[0]->append(*(vtppoanarray[ti]));
@@ -635,9 +633,7 @@ void cluster(const string& config_file, const string& data_file, const string& o
	// threads different from 0 append their virtual files to the one of thread 0, and delete them
	if (myompthread == 0) {
	  for (int ti=1; ti<ompnumthreads; ti++) {
	    if (p_outarray[ti]->skip_flag != 1) {
	    p_outarray[0]->insert(*(p_outarray[ti]));
	    }
	    delete p_outarray[ti];
	    p_outarray[ti] = NULL;
	    vtppoanarray[0]->append(*(vtppoanarray[ti]));
+2 −6
Original line number Diff line number Diff line
@@ -449,9 +449,7 @@ void inclusion(const string& config_file, const string& data_file, const string&
	  // threads different from 0 append their virtual files to the one of thread 0, and delete them
	  if (myompthread == 0) {
	    for (int ti=1; ti<ompnumthreads; ti++) {
	      if (p_outarray[ti]->skip_flag != 1) {
	      p_outarray[0]->insert(*(p_outarray[ti]));
	      }
	      delete p_outarray[ti];
	      p_outarray[ti] = NULL;
	      vtppoanarray[0]->append(*(vtppoanarray[ti]));
@@ -631,9 +629,7 @@ void inclusion(const string& config_file, const string& data_file, const string&
	// threads different from 0 append their virtual files to the one of thread 0, and delete them
	if (myompthread == 0) {
	  for (int ti=1; ti<ompnumthreads; ti++) {
	    if (p_outarray[ti]->skip_flag != 1) {
	    p_outarray[0]->insert(*(p_outarray[ti]));
	    }
	    delete p_outarray[ti];
	    p_outarray[ti] = NULL;
	    vtppoanarray[0]->append(*(vtppoanarray[ti]));
+377 −371
Original line number Diff line number Diff line
@@ -977,6 +977,7 @@ long ClusterOutputInfo::compute_size() {

int ClusterOutputInfo::insert(const ClusterOutputInfo &rhs) {
  int result = 0;
  if (rhs.skip_flag != 1) {
    result += (rhs.nsph == nsph) ? 0 : 1;
    result += (rhs.inpol == inpol) ? 0 : 1;
    result += (rhs.iavm == iavm) ? 0 : 1;
@@ -1154,6 +1155,7 @@ int ClusterOutputInfo::insert(const ClusterOutputInfo &rhs) {
      memcpy(vec_dir_mulc + 16 * offset, rhs.vec_dir_mulc, 16 * chunk_size * sizeof(double));
      memcpy(vec_dir_mulclr + 16 * offset, rhs.vec_dir_mulclr, 16 * chunk_size * sizeof(double));
    }
  }
  return result;
}

@@ -3480,6 +3482,7 @@ long InclusionOutputInfo::compute_size(

int InclusionOutputInfo::insert(const InclusionOutputInfo &rhs) {
  int result = 0;
  if (rhs.skip_flag != 1) {
    result += (rhs.nsph == nsph) ? 0 : 1;
    result += (rhs.inpol == inpol) ? 0 : 1;
    result += (rhs.iavm == iavm) ? 0 : 1;
@@ -3613,6 +3616,7 @@ int InclusionOutputInfo::insert(const InclusionOutputInfo &rhs) {
      memcpy(vec_dir_mull + 16 * offset, rhs.vec_dir_mull, 16 * chunk_size * sizeof(double));
      memcpy(vec_dir_mulllr + 16 * offset, rhs.vec_dir_mulllr, 16 * chunk_size * sizeof(double));
    }
  }
  return result;
}

@@ -5269,6 +5273,7 @@ long SphereOutputInfo::compute_size() {

int SphereOutputInfo::insert(const SphereOutputInfo &rhs) {
  int result = 0;
  if (rhs.skip_flag != 1) {
    result += (rhs.nsph == nsph) ? 0 : 1;
    result += (rhs.inpol == inpol) ? 0 : 1;
    result += (rhs.isam == isam) ? 0 : 1;
@@ -5338,6 +5343,7 @@ int SphereOutputInfo::insert(const SphereOutputInfo &rhs) {
      memcpy(vec_dir_fz + offset, rhs.vec_dir_fz, chunk_size * sizeof(double));
      // TODO: fix the vector sizes in HDF5 writer and MPI communicators
    }
  }
  return result;
}

+2 −6
Original line number Diff line number Diff line
@@ -338,9 +338,7 @@ void sphere(const string& config_file, const string& data_file, const string& ou
	  // threads different from 0 append their virtual files to the one of thread 0, and delete them
	  if (myompthread == 0) {
	    for (int ti=1; ti<ompnumthreads; ti++) {
	      if (p_outarray[ti]->skip_flag != 1) {
	      p_outarray[0]->insert(*(p_outarray[ti]));
	      }
	      delete p_outarray[ti];
	      p_outarray[ti] = NULL;
	      vtppoanarray[0]->append(*(vtppoanarray[ti]));
@@ -499,9 +497,7 @@ void sphere(const string& config_file, const string& data_file, const string& ou
	// threads different from 0 append their virtual files to the one of thread 0, and delete them
	if (myompthread == 0) {
	  for (int ti=1; ti<ompnumthreads; ti++) {
	    if (p_outarray[ti]->skip_flag != 1) {
	    p_outarray[0]->insert(*(p_outarray[ti]));
	    }
	    delete p_outarray[ti];
	    p_outarray[ti] = NULL;
	    vtppoanarray[0]->append(*(vtppoanarray[ti]));