Commit 5fa62236 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Added a timer for th rebuild flag communications. Make the analysis script...

Added a timer for th rebuild flag communications. Make the analysis script look for more timers in stdout.
parent 9dddef19
......@@ -52,8 +52,9 @@ labels = ['Gpart assignment', 'Mesh comunication', 'Forward Fourier transform',
'Making gravity tasks', 'Splitting tasks', 'Counting and linking tasks', 'Setting super-pointers', 'Linking gravity tasks',
'Creating send tasks', 'Exchanging cell tags', 'Creating recv tasks', 'Setting unlocks', 'Ranking the tasks', 'scheduler_reweight:',
'space_rebuild:', 'engine_drift_all:', 'engine_unskip:', 'engine_collect_end_of_step:', 'engine_launch:', 'writing particle properties',
'engine_repartition:', 'engine_exchange_cells:', 'Dumping restart files', 'engine_print_stats:', 'engine_marktasks:']
is_rebuild = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1]
'engine_repartition:', 'engine_exchange_cells:', 'Dumping restart files', 'engine_print_stats:', 'engine_marktasks:',
'Reading initial conditions', 'engine_print_task_counts:', 'engine_drift_top_multipoles:', 'Communicating rebuild flag']
is_rebuild = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0]
times = np.zeros(len(labels))
counts = np.zeros(len(labels))
......@@ -81,7 +82,7 @@ for i in range(num_files):
# Extract the different blocks
if re.search("%s took"%labels[i], line):
counts[i] += 1.
times[i] += float(re.findall(r'[+-]?([0-9]*[.])?[0-9]+', line)[-1])
times[i] += float(re.findall(r'[+-]?((\d+\.?\d*)|(\.\d+))', line)[-1][0])
# Find the last line with meaningful output (avoid crash report, batch system stuf....)
if re.findall(r'\[[0-9]{4}\][ ]\[*', line) or re.findall(r'^\[[0-9]*[.][0-9]+\][ ]', line):
......
......@@ -4460,11 +4460,17 @@ void engine_prepare(struct engine *e) {
/* Unskip active tasks and check for rebuild */
if (!e->forcerebuild && !e->forcerepart && !e->restarting) engine_unskip(e);
const ticks tic2 = getticks();
#ifdef WITH_MPI
MPI_Allreduce(MPI_IN_PLACE, &e->forcerebuild, 1, MPI_INT, MPI_MAX,
MPI_COMM_WORLD);
#endif
if (e->verbose)
message("Communicating rebuild flag took %.3f %s.",
clocks_from_ticks(getticks() - tic2), clocks_getunit());
/* Do we need repartitioning ? */
if (e->forcerepart) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment