@@ -92,6 +92,9 @@ t8_forest_partition_create_offsets (t8_forest_t forest)
9292{
9393 if (forest->profile != NULL ) {
9494 /* If profiling is enabled, we measure the runtime of partition */
95+ #if T8_ENABLE_PROFILE_BARRIER
96+ sc_MPI_Barrier (forest->mpicomm );
97+ #endif
9598 forest->profile ->forest_offsets_runtime = -sc_MPI_Wtime ();
9699 }
97100
@@ -120,6 +123,9 @@ t8_forest_partition_create_offsets (t8_forest_t forest)
120123 t8_shmem_array_end_writing (forest->element_offsets );
121124 if (forest->profile != NULL ) {
122125 /* If profiling is enabled, we measure the runtime of partition */
126+ #if T8_ENABLE_PROFILE_BARRIER
127+ sc_MPI_Barrier (forest->mpicomm );
128+ #endif
123129 forest->profile ->forest_offsets_runtime += sc_MPI_Wtime ();
124130 }
125131}
@@ -266,6 +272,9 @@ t8_forest_partition_create_first_desc (t8_forest_t forest)
266272{
267273 if (forest->profile != NULL ) {
268274 /* If profiling is enabled, we measure the runtime of partition */
275+ #if T8_ENABLE_PROFILE_BARRIER
276+ sc_MPI_Barrier (forest->mpicomm );
277+ #endif
269278 forest->profile ->first_descendant_runtime = -sc_MPI_Wtime ();
270279 }
271280 sc_MPI_Comm comm;
@@ -348,6 +357,9 @@ t8_forest_partition_create_first_desc (t8_forest_t forest)
348357 #endif
349358 if (forest->profile != NULL ) {
350359 /* If profiling is enabled, we measure the runtime of partition */
360+ #if T8_ENABLE_PROFILE_BARRIER
361+ sc_MPI_Barrier (forest->mpicomm );
362+ #endif
351363 forest->profile ->first_descendant_runtime += sc_MPI_Wtime ();
352364 }
353365}
@@ -358,6 +370,9 @@ t8_forest_partition_create_tree_offsets (t8_forest_t forest)
358370
359371 if (forest->profile != NULL ) {
360372 /* If profiling is enabled, we measure the runtime of partition */
373+ #if T8_ENABLE_PROFILE_BARRIER
374+ sc_MPI_Barrier (forest->mpicomm );
375+ #endif
361376 forest->profile ->cmesh_offsets_runtime = -sc_MPI_Wtime ();
362377 }
363378
@@ -426,6 +441,9 @@ t8_forest_partition_create_tree_offsets (t8_forest_t forest)
426441 }
427442 if (forest->profile != NULL ) {
428443 /* If profiling is enabled, we measure the runtime of partition */
444+ #if T8_ENABLE_PROFILE_BARRIER
445+ sc_MPI_Barrier (forest->mpicomm );
446+ #endif
429447 forest->profile ->cmesh_offsets_runtime += sc_MPI_Wtime ();
430448 }
431449}
@@ -1209,6 +1227,9 @@ t8_forest_partition (t8_forest_t forest)
12091227
12101228 if (forest->profile != NULL ) {
12111229 /* If profiling is enabled, we measure the runtime of partition */
1230+ #if T8_ENABLE_PROFILE_BARRIER
1231+ sc_MPI_Barrier (forest->mpicomm );
1232+ #endif
12121233 forest->profile ->partition_runtime = sc_MPI_Wtime ();
12131234
12141235 /* DO NOT DELETE THE FOLLOWING line.
@@ -1239,6 +1260,9 @@ t8_forest_partition (t8_forest_t forest)
12391260
12401261 if (forest->profile != NULL ) {
12411262 /* If profiling is enabled, we measure the runtime of partition */
1263+ #if T8_ENABLE_PROFILE_BARRIER
1264+ sc_MPI_Barrier (forest->mpicomm );
1265+ #endif
12421266 forest->profile ->partition_runtime = sc_MPI_Wtime () - forest->profile ->partition_runtime ;
12431267
12441268 /* DO NOT DELETE THE FOLLOWING line.
0 commit comments