diff options
| author | tgrogers <[email protected]> | 2018-04-05 11:27:17 -0400 |
|---|---|---|
| committer | tgrogers <[email protected]> | 2018-04-05 11:29:57 -0400 |
| commit | 913c8934d89068ea96729b238a42879d2e02e7f4 (patch) | |
| tree | 71c193d4856037a082e50939f2b91d6e624fdc57 /src | |
| parent | cfab001e7c65541eaf8f7573bbf4a2e5d69f296e (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.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gpgpusim_entrypoint.cc b/src/gpgpusim_entrypoint.cc index 64962ab..ede9f20 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,7 +172,6 @@ void *gpgpu_sim_thread_concurrent(void*) g_sim_active = false; pthread_mutex_unlock(&g_sim_lock); } while( !g_sim_done ); - printf("GPGPU-Sim: *** simulation thread exiting ***\n"); fflush(stdout); |
