// To test parallelism, I will now start feeding this function with "clean" copies of the parameters, so that they will not be changed by previous iterations, and each one will behave as the first one. Define all (empty) variables here, so they have the correct scope, then they get different definitions depending on thread number
// To test parallelism, I will now start feeding this function with "clean" copies of the parameters, so that they will not be changed by previous iterations, and each one will behave as the first one. Define all (empty) variables here, so they have the correct scope, then they get different definitions depending on thread number
ClusterIterationData*cid_2=NULL;
ClusterIterationData*cid_2=NULL;
//FILE *output_2 = NULL;
VirtualAsciiFile*p_output_2=NULL;
VirtualAsciiFile*p_output_2=NULL;
VirtualBinaryFile*vtppoanp_2=NULL;
VirtualBinaryFile*vtppoanp_2=NULL;
// fstream *tppoanp_2 = NULL;
// for threads other than the 0, create distinct copies of all relevant data, while for thread 0 just define new references / pointers to the original ones
// for threads other than the 0, create distinct copies of all relevant data, while for thread 0 just define new references / pointers to the original ones
if(myompthread==0){
if(myompthread==0){
cid_2=cid;
cid_2=cid;
// output_2 = output;
// tppoanp_2 = tppoanp;
}else{
}else{
// this is not thread 0, so do create fresh copies of all local variables
// this is not thread 0, so do create fresh copies of all local variables
// make sure all threads align here: I don't want the following loop to accidentally start for thread 0, possibly modifying some variables before they are copied by all other threads
// make sure all threads align here: I don't want the following loop to accidentally start for thread 0, possibly modifying some variables before they are copied by all other threads
#pragma omp barrier
#pragma omp barrier
if(myompthread==0)logger->log("Syncing OpenMP threads and starting the loop on wavelengths\n");
if(myompthread==0)logger->log("Syncing OpenMP threads and starting the loop on wavelengths\n");