aesop Repository branch, master, updated. 3d521de5c3f9a46431f06993a440babd0ae1c2be
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "aesop Repository". The branch, master has been updated via 3d521de5c3f9a46431f06993a440babd0ae1c2be (commit) from a2c2dccfc702bbd41fb16172faa1f1e2d3f04ebf (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 3d521de5c3f9a46431f06993a440babd0ae1c2be Author: Phil Carns <[email protected]> Date: Tue Feb 21 10:58:03 2012 -0500 update timer tests to use aesop_main_set() ----------------------------------------------------------------------- Summary of changes: resources/timer/test/pthread-compare.ae | 37 ++++------------------------ resources/timer/test/timer-cancel.ae | 40 ++++--------------------------- resources/timer/test/timer1.ae | 39 +++--------------------------- resources/timer/test/timer2.ae | 37 ++++------------------------ 4 files changed, 19 insertions(+), 134 deletions(-) Diff of changes: diff --git a/resources/timer/test/pthread-compare.ae b/resources/timer/test/pthread-compare.ae index 181b891..a3f2321 100644 --- a/resources/timer/test/pthread-compare.ae +++ b/resources/timer/test/pthread-compare.ae @@ -24,16 +24,6 @@ static __blocking int triton_dosleep(void) return 0; } -static int done = 0; -static int dosleep_ret; -static void done_cb(void *up, int ret) -{ - ae_context_t ctx = (ae_context_t)up; - dosleep_ret = ret; - done = 1; - ae_poll_break(ctx); -} - static void *threadfun(void *cb) { sleep(1); @@ -65,30 +55,13 @@ static void thread_dosleep(void) -int main(int argc, char *argv[]) +__blocking int aesop_main(int argc, char **argv) { - int ret; - ae_op_id_t op_id; - ae_context_t ctx; - ae_hints_t hints; + int dosleep_ret; struct timeval t1, t2, diff; - triton_timer_init(); - - ae_context_create(&ctx, "timer"); - gettimeofday(&t1, NULL); - ae_hints_init(&hints); - ret = ae_post_blocking(triton_dosleep, done_cb, ctx, &hints, ctx, &op_id, &dosleep_ret); - if(ret == AE_SUCCESS) - { - while (done == 0) - { - ae_poll(ctx, 10); - } - } - aesop_error_assert(ret); - ae_hints_destroy(&hints); + dosleep_ret = triton_dosleep(); gettimeofday(&t2, NULL); diff.tv_sec = t2.tv_sec - t1.tv_sec; diff.tv_usec = t2.tv_usec - t1.tv_usec; @@ -111,11 +84,11 @@ int main(int argc, char *argv[]) } printf("thread time: %d.%06d secs\n", (int)diff.tv_sec, (int)diff.tv_usec); - ae_context_destroy(ctx); - triton_timer_finalize(); return dosleep_ret; } +aesop_main_set(aesop_main); + /* * Local variables: * c-indent-level: 4 diff --git a/resources/timer/test/timer-cancel.ae b/resources/timer/test/timer-cancel.ae index 804aaee..f38c6a5 100644 --- a/resources/timer/test/timer-cancel.ae +++ b/resources/timer/test/timer-cancel.ae @@ -31,47 +31,17 @@ static __blocking int dotimer(void) return 0; } -int done = 0; -int dotimer_ret; - -static void done_callback(void *up, int ret) -{ - ae_context_t ctx = (ae_context_t)up; - done = 1; - dotimer_ret = ret; - ae_poll_break(ctx); -} - -int main(int argc, char *argv[]) +__blocking int aesop_main(int argc, char **argv) { - int ret; - ae_context_t ctx; - ae_hints_t hints; - int pc = 0; - ae_op_id_t op_id; + int dotimer_ret; - triton_timer_init(); - ae_context_create(&ctx, "timer"); - - ae_hints_init(&hints); - ret = ae_post_blocking(dotimer, done_callback, ctx, &hints, ctx, &op_id, &dotimer_ret); - if(ret == AE_SUCCESS) - { - while(done == 0) - { - ae_poll(ctx, 10); - /* printf("polled %d times\n", ++pc); */ - } - } - aesop_error_assert(ret); - - ae_hints_destroy(&hints); - ae_context_destroy(ctx); - triton_timer_finalize(); + dotimer_ret = dotimer(); return dotimer_ret; } +aesop_main_set(aesop_main); + /* * Local variables: * c-indent-level: 4 diff --git a/resources/timer/test/timer1.ae b/resources/timer/test/timer1.ae index 09a657e..77a5b63 100644 --- a/resources/timer/test/timer1.ae +++ b/resources/timer/test/timer1.ae @@ -31,47 +31,16 @@ static __blocking int dotimer(void) return 0; } -int done = 0; -int dotimer_ret; - -static void done_callback(void *up, int ret) +__blocking int aesop_main(int argc, char **argv) { - ae_context_t ctx = (ae_context_t)up; - done = 1; - dotimer_ret = ret; - ae_poll_break(ctx); -} - -int main(int argc, char *argv[]) -{ - int ret; - ae_hints_t hints; - ae_context_t ctx; - int pc = 0; - ae_op_id_t op_id; - - triton_timer_init(); - ae_context_create(&ctx, "timer"); - - ae_hints_init(&hints); - ret = ae_post_blocking(dotimer, done_callback, ctx, &hints, ctx, &op_id, &dotimer_ret); - if(ret == AE_SUCCESS) - { - while(done == 0) - { - ae_poll(ctx, 10); - printf("polled %d times\n", ++pc); - } - } - aesop_error_assert(ret); + int dotimer_ret; - ae_hints_destroy(&hints); - ae_context_destroy(ctx); - triton_timer_finalize(); + dotimer_ret = dotimer(); return dotimer_ret; } +aesop_main_set(aesop_main); /* * Local variables: * c-indent-level: 4 diff --git a/resources/timer/test/timer2.ae b/resources/timer/test/timer2.ae index 26283d8..b62bc90 100644 --- a/resources/timer/test/timer2.ae +++ b/resources/timer/test/timer2.ae @@ -37,48 +37,21 @@ static __blocking int receiver() return 0; } -int done = 0; -int receiver_ret; - -static void done_callback(void *user_ptr, int ret) -{ - ae_context_t ctx = (ae_context_t)user_ptr; - done = 1; - receiver_ret = ret; - ae_poll_break(ctx); -} - -int main(int argc, char *argv[]) +__blocking int aesop_main(int argc, char **argv) { - int ret; - ae_op_id_t op_id; - ae_context_t ctx; - ae_hints_t hints; - - triton_timer_init(); - - ae_context_create(&ctx, "timer"); + int receiver_ret; printf("ready\n"); - ae_hints_init(&hints); - ret = ae_post_blocking(receiver, done_callback, ctx, &hints, ctx, &op_id, &receiver_ret); - if(ret == AE_SUCCESS) - { - while (done == 0) - { - ae_poll(ctx, 10); - } - } - aesop_error_assert(ret); - ae_hints_destroy(&hints); + receiver_ret = receiver(); printf("done\n"); - ae_context_destroy(ctx); return receiver_ret; } +aesop_main_set(aesop_main); + /* * Local Variables: * c-basic-offset: 4 hooks/post-receive -- aesop Repository
participants (1)
-
noreply@mcs.anl.gov