[Cbe-oss-dev] [PATCH] libmars: Detect all available SPEs

Prof. Dr. Peter Väterlein peter.vaeterlein at hs-esslingen.de
Sat Jul 12 00:16:51 EST 2008


From: Peter Vaeterlein <peter.vaeterlein at hs-esslingen.de>

The published versions of libmars only detect the SPEs within a single
Cell Chip. However, when using MARS on systems with more than one Cell
chip, it would be nice to be able to use all SPEs available within the
system.

Changing a single parameter within the num_mpus_max() function does the
trick. The patch was tested on a IBM QS22 Blade with excellent scaling up
to 16 SPEs.

Signed-off-by: Peter Vaeterlein <peter.vaeterlein at hs-esslingen.de>

---

diff --git a/src/host/lib/mars.c b/src/host/lib/mars.c
index cfd1253..4f6f74d 100644
--- a/src/host/lib/mars.c
+++ b/src/host/lib/mars.c
@@ -50,7 +50,7 @@ extern struct spe_program_handle mars_kernel_entry;

 static int num_mpus_max(void)
 {
-       return spe_cpu_info_get(SPE_COUNT_PHYSICAL_SPES, 0);
+       return spe_cpu_info_get(SPE_COUNT_PHYSICAL_SPES, -1);
 }

 static void *mpu_context_thread(void *arg)





More information about the cbe-oss-dev mailing list