summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortgrogers <[email protected]>2018-04-05 11:27:17 -0400
committertgrogers <[email protected]>2018-04-05 11:27:17 -0400
commitd2ae7fb6889cf622673ce1c0d6696d2984963946 (patch)
tree263411d824b6673583998dc57b6e00bc5813f58e /src
parent21dae0d20e12018f1a9283596cf79be85b25341c (diff)
Nice to know when the simulaton thread actually gets the exit call under normal operation. This helps immensely in a clustered environmrnt where jobs randomly fail
Diffstat (limited to 'src')
-rw-r--r--src/gpgpusim_entrypoint.cc15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/gpgpusim_entrypoint.cc b/src/gpgpusim_entrypoint.cc
index dac9fd8..52e2f5e 100644
--- a/src/gpgpusim_entrypoint.cc
+++ b/src/gpgpusim_entrypoint.cc
@@ -93,8 +93,15 @@ bool g_sim_active = false;
bool g_sim_done = true;
bool break_limit = false;
+static void termination_callback()
+{
+ printf("GPGPU-Sim: *** exit detected ***\n");
+ fflush(stdout);
+}
+
void *gpgpu_sim_thread_concurrent(void*)
{
+ atexit(termination_callback);
// concurrent kernel execution simulation thread
do {
if(g_debug_execution >= 3) {
@@ -165,10 +172,10 @@ void *gpgpu_sim_thread_concurrent(void*)
g_sim_active = false;
pthread_mutex_unlock(&g_sim_lock);
} while( !g_sim_done );
- if(g_debug_execution >= 3) {
- printf("GPGPU-Sim: *** simulation thread exiting ***\n");
- fflush(stdout);
- }
+
+ printf("GPGPU-Sim: *** simulation thread exiting ***\n");
+ fflush(stdout);
+
if(break_limit) {
printf("GPGPU-Sim: ** break due to reaching the maximum cycles (or instructions) **\n");
exit(1);