Adds helper program for reading max_vcores
authorBarret Rhoden <brho@cs.berkeley.edu>
Sat, 4 May 2013 05:51:35 +0000 (22:51 -0700)
committerBarret Rhoden <brho@cs.berkeley.edu>
Sat, 4 May 2013 05:51:35 +0000 (22:51 -0700)
This is used by shell scripts to get max_vcores.  We don't have pipes
working yet, so the answer is passed via the return value.  You can do
something like:

maxvcores
MAXVC=$?
pthread_test $MAXVC 9999999999999999 $MAXVC &

to launch pthread test so that it will run forever and want all of the
cores available.

tests/max_vcores.c [new file with mode: 0644]

diff --git a/tests/max_vcores.c b/tests/max_vcores.c
new file mode 100644 (file)
index 0000000..ff9c095
--- /dev/null
@@ -0,0 +1,10 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <parlib.h>
+#include <vcore.h>
+
+/* Ghetto, sets its retval to max_vc to communicate without pipes */
+int main(int argc, char** argv)
+{
+       return max_vcores();
+}