commit 34293c22d92672147d245e4c7b00816066d2d2eb
parent 2905793c247efa1ae8b7c8e60ff16fb568a71252
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Wed, 13 Dec 2023 17:10:37 +0100
Fixed sdis_solve_probe_list function with low workload
The function would fail if the process had no probes to calculate. Now
such a process simply signals that it has finished and goes straight to
the synchronization barrier.
Diffstat:
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/src/sdis_solve_probe_Xd.h b/src/sdis_solve_probe_Xd.h
@@ -600,16 +600,25 @@ XD(solve_probe_list)
/* Synchronise the processes */
process_barrier(scn->dev);
+ /* Define the range of probes to manage in this process */
+ process_nprobes = compute_process_index_range
+ (scn->dev, args->nprobes, process_probes);
+
#define PROGRESS_MSG "Solving probes: "
print_progress(scn->dev, progress, PROGRESS_MSG);
+ /* If there is no work to be done on this process (i.e. no probe to
+ * calculate), simply print its completion and go straight to the
+ * synchronization barrier.*/
+ if(process_nprobes == 0) {
+ progress[0] = 100;
+ print_progress_update(scn->dev, progress, PROGRESS_MSG);
+ goto post_sync;
+ }
+
/* Begin time registration of the computation */
time_current(&time0);
- /* Define the range of probes to manage in this process */
- process_nprobes = compute_process_index_range
- (scn->dev, args->nprobes, process_probes);
-
/* Allocate the list of accumulators per probe. On the master process,
* allocate a complete list in which the accumulators of all processes will be
* stored. */
@@ -668,6 +677,7 @@ XD(solve_probe_list)
}
}
+post_sync:
/* Synchronise processes */
process_barrier(scn->dev);