Added more apps to the test case application.

This commit is contained in:
Jacek Galowicz 2012-09-17 14:51:10 +02:00
parent 36477f214a
commit 51a4f5a7a7
3 changed files with 43 additions and 14 deletions

View file

@ -28,7 +28,7 @@
#include "tests.h"
#ifdef START_KERNEL_JACOBI
#if defined(START_KERNEL_JACOBI) || defined(START_CHIEFTEST)
#define MATRIX_SIZE 256
#define MAXVALUE 1337
@ -353,14 +353,17 @@ int jacobi(void* argv)
* check the result
* X[i] have to be 1
*/
int err=0;
for(i=0; i<MATRIX_SIZE; i++) {
double diff = X[i] - 1.0;
error = fabs(diff);
if (max < error)
max = error;
if (error > 0.01)
if (error > 0.01) {
kprintf("Result is on position %d wrong (%d/10000 != 1.0, error %d/10000)\n", i, (int) (10000.0*X[i]), (int) (10000.0*error));
err = 1;
}
}
kprintf("maximal error is %d/10000\n", (int) (10000.0*max));
@ -368,7 +371,7 @@ int jacobi(void* argv)
kprintf("number of iterations: %d\n", iterations);
kprintf("Calculation time: %llu ms (%llu ticks)\n", (stop-start)/(1000ULL*get_cpu_frequency()), stop-start);
return 0;
return err;
}
#endif

View file

@ -48,7 +48,7 @@
/* See http://www.nwlab.net/art/netio/netio.html to get the netio tool */
#if defined(START_NETIO) && defined(CONFIG_LWIP)
#if (defined(START_NETIO) || defined(START_CHIEFTEST)) && defined(CONFIG_LWIP)
#ifdef CONFIG_ROCKCREEK
#if USE_SOCKET_BYPASSING // for socket bypassing
#include <lwip/opt.h>

View file

@ -127,7 +127,7 @@ static int foo(void* arg)
}
#endif
#ifdef START_MAIL_PING
#if defined(START_MAIL_PING) || defined(START_CHIEFTEST)
static int mail_ping(void* arg) {
int i;
@ -151,7 +151,7 @@ static int mail_noise(void*arg) {
}
#endif
#ifdef START_SVM_TEST
#if defined(START_SVM_TEST) || defined(START_CHIEFTEST)
/* N has to be multiple of UEs */
@ -192,6 +192,8 @@ static int svm_test(void *arg)
if (!my_ue) {
// allocate and initialize SVM region
A[0] = (int*) kmalloc(3*N*N*sizeof(int));
if (!A[0])
return 1; // Let the others hang in the barrier. People will notice that things went wrong.
memset((void*) A[0], 0x00, 3*N*N*sizeof(int));
// initialize matrices
@ -222,7 +224,6 @@ static int svm_test(void *arg)
}
}
end = rdtsc();
kprintf("Calculation time (seq): %llu ms (%llu ticks)\n", (end-start)/(1000ULL*get_cpu_frequency()), end-start);
@ -241,6 +242,8 @@ static int svm_test(void *arg)
kputs("Use Strong Release consistency!\n");
A[0] = (int*) svm_malloc(3*N*N*sizeof(int), svm_flags);
if (!A[0])
return 1;
#if 1
if (!my_ue)
@ -300,9 +303,8 @@ static int svm_test(void *arg)
kputs("Check results...\n");
uint32_t err = 0; // Be paranoid for a test case. return != 0 if calculation was not correct.
if (!my_ue) {
uint32_t err = 0;
svm_invalidate();
for(i=0; (i<N) && (err < 32); i++) {
for(j=0; (j<N) && (err < 32); j++) {
@ -322,11 +324,11 @@ static int svm_test(void *arg)
svm_statistics();
return 0;
return err;
}
#endif
#ifdef START_SVM_BENCH
#if defined(START_SVM_BENCH) || defined(START_CHIEFTEST)
static int svm_bench(void *arg)
{
volatile uint32_t* array = NULL;
@ -347,6 +349,8 @@ static int svm_bench(void *arg)
start = rdtsc();
start = rdtsc();
array = (volatile uint32_t*) svm_malloc(size, svm_flags);
if (!array)
return -1;
end = rdtsc();
if (BUILTIN_EXPECT(!array, 0)) {
@ -405,6 +409,18 @@ static int svm_bench(void *arg)
return 0;
}
static int testcase_svm_bench(void)
{
if (RCCE_IAM > 1) {
int i;
for (i=0; i < 6; i++)
// Need as many barriers for the other cores as they occur in the benchmark.
svm_barrier(SVM_TYPE);
return 0;
}
return svm_bench(NULL);
}
#endif
#if defined(START_JOIN_TEST) || defined(START_CHIEFTEST)
@ -534,7 +550,14 @@ struct testcase_t testcases[] = {
USERSPACE_TC("/bin/tests", "Tests user space app"),
USERSPACE_TC("/bin/hello", "Hello userspace app"),
KERNELSPACE_TC(producer_consumer, "Producer consumer kernel space test"),
KERNELSPACE_TC(join_test, "Join kernel space test")
KERNELSPACE_TC(join_test, "Join kernel space test"),
#ifdef CONFIG_ROCKCREEK
KERNELSPACE_TC(svm_test, "SVM Test kernel space test"),
KERNELSPACE_TC(testcase_svm_bench, "SVM Bench kernel space test"),
KERNELSPACE_TC(mail_ping, "Mail Ping kernel space test"),
// KERNELSPACE_TC(jacobi, "Jacobi kernel space test"),
KERNELSPACE_TC(netio_init, "NetIO kernel space test")
#endif
};
static int chiefmastertest(void)
@ -545,11 +568,14 @@ static int chiefmastertest(void)
tid_t id, ret;
struct testcase_t* current;
kprintf("Starting Chiefmaster test: %d test cases.\n", tests);
kprintf("Starting chief master test: %d test cases.\n", tests);
for (i = 0; i < tests; i++) {
current = &testcases[i];
#ifdef CONFIG_ROCKCREEK
RCCE_barrier(&RCCE_COMM_WORLD);
#endif
kprintf("Starting testcase: %s\n", current->testcase_name);
if (current->kernelspace_ep == NULL &&
@ -569,7 +595,7 @@ static int chiefmastertest(void)
ret = wait(&result);
} while(ret != current->tid);
kprintf("Testcase %s returned %d\n", current->testcase_name, result);
kprintf("Testcase %s returned %d %s\n", current->testcase_name, result, result ? ":(" : ":)");
current->retval = result;
}