diff --git a/pb_utils/pb_submitter/.gitignore b/pb_utils/pb_submitter/.gitignore index 6d5984422b4055f069478d08dc77eb1d5405b1de..95e7a412722c9bf1d8c3bf7da408e0ac278b3c27 100644 --- a/pb_utils/pb_submitter/.gitignore +++ b/pb_utils/pb_submitter/.gitignore @@ -1,2 +1,4 @@ pb_submitter test_prog +task_long +sysc_long diff --git a/pb_utils/pb_submitter/example_plan b/pb_utils/pb_submitter/example_plan index 93cbfb92e6c06a5dd76f0523e1e169c14f90e7c3..59f67b1330062a02098499cc71bd680fbc59e5f6 100644 --- a/pb_utils/pb_submitter/example_plan +++ b/pb_utils/pb_submitter/example_plan @@ -1,100 +1,100 @@ -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 -560000 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 +400800 diff --git a/pb_utils/pb_submitter/sysc_long b/pb_utils/pb_submitter/sysc_long deleted file mode 100755 index 841ec848ca83a0816237c4ca39b0c7ca19818fd8..0000000000000000000000000000000000000000 Binary files a/pb_utils/pb_submitter/sysc_long and /dev/null differ diff --git a/pb_utils/pb_submitter/syscall_long_test.c b/pb_utils/pb_submitter/syscall_long_test.c index 820fec2b2128a698b050740889f27e2226b30519..8e0f933c028e24f6bea31167b00510e6314e55a3 100644 --- a/pb_utils/pb_submitter/syscall_long_test.c +++ b/pb_utils/pb_submitter/syscall_long_test.c @@ -3,18 +3,25 @@ int main(void) { + int i; + int j; + // Make sure program is not finished before pb scheduler takes control sleep(1); - int b = 0; - for (;b < 100; b++) { - int a = 0; - int c = 0; - for (;a < 100000; a++){c = c + a;} - // check if program runs - printf("loop run: %d, c = %d \n", b, c); - // syscall to switch tasks - usleep(10000); + + // this outer for loop is around 8 instructions per iteration + for (i = 0; i < 100; i++) { + // this for loop results in 4 cpu instructions per iteration + // nop, add, compare, jmp + for (j = 0; j < 100000; j++){ + __asm__ volatile("nop"); + } + + // check if program runs && syscall to switch tasks + printf("run #%d completed\n", i); + usleep(10000); } + + printf("main end\n"); return 0; } - diff --git a/pb_utils/pb_submitter/task_long b/pb_utils/pb_submitter/task_long deleted file mode 100755 index 6be357d1ed5369230eda8442a249b09a3e4e1f37..0000000000000000000000000000000000000000 Binary files a/pb_utils/pb_submitter/task_long and /dev/null differ diff --git a/pb_utils/pb_submitter/task_long_test.c b/pb_utils/pb_submitter/task_long_test.c index 0a96cbd83de4fb64bd20ae37256f8f78571655e8..009357c4e36044d1f4347679b0dcb594dcd4bb23 100644 --- a/pb_utils/pb_submitter/task_long_test.c +++ b/pb_utils/pb_submitter/task_long_test.c @@ -3,18 +3,25 @@ int main(void) { + int i; + int j; + // Make sure program is not finished before pb scheduler takes control sleep(1); - int b = 0; - for (;b < 100; b++) { - int a = 0; - int c = 0; - for (;a < 10000000; a++){c = c + a;} - // check if program runs - printf("loop run: %d, c = %d \n", b, c); - // syscall to switch tasks - usleep(1); + + // this outer for loop is around 8 instructions per iteration + for (i = 0; i < 100; i++) { + // this for loop results in 4 cpu instructions per iteration + // nop, add, compare, jmp + for (j = 0; j < 10000000; j++){ + __asm__ volatile("nop"); + } + + // check if program runs && syscall to switch tasks + printf("run #%d completed\n", i); + usleep(1); } + + printf("main end\n"); return 0; } - diff --git a/pb_utils/pb_submitter/test_prog.c b/pb_utils/pb_submitter/test_prog.c index 11c4bcb587b52f9479cc54fdf99113755e6c6cb8..98e6bece6dc9aa24c774aa8af1145379c5f40ec0 100644 --- a/pb_utils/pb_submitter/test_prog.c +++ b/pb_utils/pb_submitter/test_prog.c @@ -3,18 +3,25 @@ int main(void) { + int i; + int j; + // Make sure program is not finished before pb scheduler takes control sleep(1); - int b = 0; - for (;b < 100; b++) { - int a = 0; - int c = 0; - for (;a < 100000; a++){c = c + a;} - // check if program runs - printf("loop run: %d, c = %d \n", b, c); - // syscall to switch tasks - usleep(1); + + // this outer for loop is around 8 instructions per iteration + for (i = 0; i < 100; i++) { + // this for loop results in 4 cpu instructions per iteration + // nop, add, compare, jmp + for (j = 0; j < 100000; j++){ + __asm__ volatile("nop"); + } + + // check if program runs && syscall to switch tasks + printf("run #%d completed\n", i); + usleep(1); } + + printf("main end\n"); return 0; } -