From 65c0d007dc8e91104f3fef4d83dcc25f0ec356b6 Mon Sep 17 00:00:00 2001 From: adash Date: Tue, 21 Apr 2009 00:27:09 +0000 Subject: [PATCH] print better error messages --- Robust/src/Benchmarks/SingleTM/KMeans/KMeans.java | 3 +++ Robust/src/Runtime/runtime.c | 6 ++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Robust/src/Benchmarks/SingleTM/KMeans/KMeans.java b/Robust/src/Benchmarks/SingleTM/KMeans/KMeans.java index 041db950..50156284 100644 --- a/Robust/src/Benchmarks/SingleTM/KMeans/KMeans.java +++ b/Robust/src/Benchmarks/SingleTM/KMeans/KMeans.java @@ -289,6 +289,9 @@ public class KMeans extends Thread { km.usage(); } } + if(km.nthreads == 0 || km.filename == null) { + km.usage(); + } } /** diff --git a/Robust/src/Runtime/runtime.c b/Robust/src/Runtime/runtime.c index dfd8cf89..8a68ee51 100644 --- a/Robust/src/Runtime/runtime.c +++ b/Robust/src/Runtime/runtime.c @@ -193,8 +193,7 @@ void CALL11(___Barrier______setBarrier____I, int nthreads, int nthreads) { // Barrier initialization int ret; if((ret = pthread_barrier_init(&barrier, NULL, nthreads)) != 0) { - printf("%s() Could not create a barrier: error %d\n", __func__, errno); - perror(""); + printf("%s() Could not create a barrier: numthreads = 0 in %s\n", __func__, __FILE__); exit(-1); } #ifdef PRECISE_GC @@ -207,8 +206,7 @@ void CALL00(___Barrier______enterBarrier____) { int ret; ret = pthread_barrier_wait(&barrier); if(ret != 0 && ret != PTHREAD_BARRIER_SERIAL_THREAD) { - printf("%s() Could not wait on barrier: error %d\n", __func__, errno); - perror(""); + printf("%s() Could not wait on barrier: error %d in %s\n", __func__, errno, __FILE__); exit(-1); } } -- 2.34.1