diff options
| author | Mahmoud <[email protected]> | 2018-05-15 20:03:45 -0400 |
|---|---|---|
| committer | Mahmoud <[email protected]> | 2018-05-15 20:03:45 -0400 |
| commit | a25caee6acbd801b055bdb1136b55ba09daff49b (patch) | |
| tree | 720cb17bdc3ec5f86de9231ea53c74c56d485317 /src/gpgpusim_entrypoint.cc | |
| parent | e06cd8efa02bf54f4788b0655930c9c6c0e12311 (diff) | |
| parent | ddf9da221c3e14e1e4204aba3fdaa59bca917ec6 (diff) | |
Merge branch 'dev-purdue-integration' of https://github.rcac.purdue.edu/abdallm/gpgpu-sim_distribution into dev-purdue-integration
Diffstat (limited to 'src/gpgpusim_entrypoint.cc')
| -rw-r--r-- | src/gpgpusim_entrypoint.cc | 15 |
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); |
