Skip to content
Snippets Groups Projects
Commit 24b8b517 authored by Giovanni La Mura's avatar Giovanni La Mura
Browse files

Update comments in CLUSTER and return MPI_Init() result as exit code

parent 3cac3298
No related branches found
No related tags found
No related merge requests found
......@@ -228,7 +228,6 @@ void cluster(const string& config_file, const string& data_file, const string& o
int nsph = gconf->number_of_spheres;
// Sanity check on number of sphere consistency, should always be verified
if (s_nsph == nsph) {
// Shortcuts to variables stored in configuration objects
ScatteringAngles *p_scattering_angles = new ScatteringAngles(gconf);
double wp = sconf->wp;
// ClusterOutputInfo : Thread 0 of MPI process 0 allocates the memory to
......@@ -297,8 +296,8 @@ void cluster(const string& config_file, const string& data_file, const string& o
#pragma omp single
{
jer = cluster_jxi488_cycle(jxi488, sconf, gconf, p_scattering_angles, cid, p_output, output_path, vtppoanp);
}
}
} // OMP sinlge
} // OMP parallel
#ifdef USE_NVTX
nvtxRangePop();
#endif
......@@ -544,7 +543,7 @@ void cluster(const string& config_file, const string& data_file, const string& o
time_logger->log(message);
fclose(timing_file);
delete time_logger;
} // end instructions block of MPI process 0
} // end of instruction block for MPI process 0
//===============================
// instruction block for MPI processes different from 0
......@@ -738,6 +737,8 @@ int cluster_jxi488_cycle(int jxi488, ScattererConfiguration *sconf, GeometryConf
if (jer != 0) {
output->vec_ier[jindex - 1] = 1;
output->vec_jxi[jindex - 1] = -jxi488;
logger->log("Error in HJV for scale " + to_string(jxi488) + "!", LOG_ERRO);
delete logger;
return jer;
// break; // rewrite this to go to the end of the function, to free locally allocated variables and return jer
}
......
......@@ -70,8 +70,9 @@ extern void cluster(const string& config_file, const string& data_file, const st
* \return result: `int` An exit code passed to the OS (0 for succesful execution).
*/
int main(int argc, char **argv) {
int ierr = 0;
#ifdef MPI_VERSION
int ierr = MPI_Init(&argc, &argv);
ierr = MPI_Init(&argc, &argv);
// create and initialise class with essential MPI data
mixMPI *mpidata = new mixMPI(MPI_COMM_WORLD);
#else
......@@ -91,5 +92,5 @@ int main(int argc, char **argv) {
MPI_Finalize();
#endif
delete mpidata;
return 0;
return ierr;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment