Remove unnecessary semicolons
Removes semicolons after if {} blocks, function definitions, etc.
I was able to apply the large OMPT patch cleanly on top of this one
with no conflicts.
git-svn-id: https://llvm.org/svn/llvm-project/openmp/trunk@314340 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -435,7 +435,7 @@ void __kmp_terminate_thread(int gtid) {
|
||||
if (status != 0 && status != ESRCH) {
|
||||
__kmp_fatal(KMP_MSG(CantTerminateWorkerThread), KMP_ERR(status),
|
||||
__kmp_msg_null);
|
||||
}; // if
|
||||
}
|
||||
#endif
|
||||
__kmp_yield(TRUE);
|
||||
} //
|
||||
@@ -635,7 +635,7 @@ static void *__kmp_launch_monitor(void *thr) {
|
||||
if (__kmp_generate_warnings == kmp_warnings_off) {
|
||||
__kmp_str_free(&err_code.str);
|
||||
}
|
||||
}; // if
|
||||
}
|
||||
} else {
|
||||
// We cannot abort here, because number of CPUs may be enough for all
|
||||
// the threads, including the monitor thread, so application could
|
||||
@@ -643,8 +643,8 @@ static void *__kmp_launch_monitor(void *thr) {
|
||||
__kmp_msg(kmp_ms_warning, KMP_MSG(RunningAtMaxPriority),
|
||||
KMP_MSG(MonitorWillStarve), KMP_HNT(RunningAtMaxPriority),
|
||||
__kmp_msg_null);
|
||||
}; // if
|
||||
}; // if
|
||||
}
|
||||
}
|
||||
// AC: free thread that waits for monitor started
|
||||
TCW_4(__kmp_global.g.g_time.dt.t_value, 0);
|
||||
}
|
||||
@@ -698,9 +698,9 @@ static void *__kmp_launch_monitor(void *thr) {
|
||||
if (status != 0) {
|
||||
if (status != ETIMEDOUT && status != EINTR) {
|
||||
KMP_SYSFAIL("pthread_cond_timedwait", status);
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
status = pthread_mutex_unlock(&__kmp_wait_mx.m_mutex);
|
||||
KMP_CHECK_SYSFAIL("pthread_mutex_unlock", status);
|
||||
|
||||
@@ -799,7 +799,7 @@ void __kmp_create_worker(int gtid, kmp_info_t *th, size_t stack_size) {
|
||||
__kmp_set_stack_info(gtid, th);
|
||||
__kmp_check_stack_overlap(th);
|
||||
return;
|
||||
}; // if
|
||||
}
|
||||
|
||||
KA_TRACE(10, ("__kmp_create_worker: try to create thread (%d)\n", gtid));
|
||||
|
||||
@@ -809,11 +809,11 @@ void __kmp_create_worker(int gtid, kmp_info_t *th, size_t stack_size) {
|
||||
status = pthread_attr_init(&thread_attr);
|
||||
if (status != 0) {
|
||||
__kmp_fatal(KMP_MSG(CantInitThreadAttrs), KMP_ERR(status), __kmp_msg_null);
|
||||
}; // if
|
||||
}
|
||||
status = pthread_attr_setdetachstate(&thread_attr, PTHREAD_CREATE_JOINABLE);
|
||||
if (status != 0) {
|
||||
__kmp_fatal(KMP_MSG(CantSetWorkerState), KMP_ERR(status), __kmp_msg_null);
|
||||
}; // if
|
||||
}
|
||||
|
||||
/* Set stack size for this thread now.
|
||||
The multiple of 2 is there because on some machines, requesting an unusual
|
||||
@@ -840,13 +840,13 @@ void __kmp_create_worker(int gtid, kmp_info_t *th, size_t stack_size) {
|
||||
"bytes\n",
|
||||
gtid, KMP_DEFAULT_STKSIZE, __kmp_stksize, stack_size));
|
||||
status = pthread_attr_setstacksize(&thread_attr, stack_size);
|
||||
}; // if
|
||||
}; // if
|
||||
}
|
||||
}
|
||||
#endif /* KMP_BACKUP_STKSIZE */
|
||||
if (status != 0) {
|
||||
__kmp_fatal(KMP_MSG(CantSetWorkerStackSize, stack_size), KMP_ERR(status),
|
||||
KMP_HNT(ChangeWorkerStackSize), __kmp_msg_null);
|
||||
}; // if
|
||||
}
|
||||
#endif /* _POSIX_THREAD_ATTR_STACKSIZE */
|
||||
|
||||
#endif /* KMP_THREAD_ATTR */
|
||||
@@ -858,18 +858,18 @@ void __kmp_create_worker(int gtid, kmp_info_t *th, size_t stack_size) {
|
||||
if (status == EINVAL) {
|
||||
__kmp_fatal(KMP_MSG(CantSetWorkerStackSize, stack_size), KMP_ERR(status),
|
||||
KMP_HNT(IncreaseWorkerStackSize), __kmp_msg_null);
|
||||
};
|
||||
}
|
||||
if (status == ENOMEM) {
|
||||
__kmp_fatal(KMP_MSG(CantSetWorkerStackSize, stack_size), KMP_ERR(status),
|
||||
KMP_HNT(DecreaseWorkerStackSize), __kmp_msg_null);
|
||||
};
|
||||
}
|
||||
#endif /* _POSIX_THREAD_ATTR_STACKSIZE */
|
||||
if (status == EAGAIN) {
|
||||
__kmp_fatal(KMP_MSG(NoResourcesForWorkerThread), KMP_ERR(status),
|
||||
KMP_HNT(Decrease_NUM_THREADS), __kmp_msg_null);
|
||||
}; // if
|
||||
}
|
||||
KMP_SYSFAIL("pthread_create", status);
|
||||
}; // if
|
||||
}
|
||||
|
||||
th->th.th_info.ds.ds_thread = handle;
|
||||
|
||||
@@ -882,7 +882,7 @@ void __kmp_create_worker(int gtid, kmp_info_t *th, size_t stack_size) {
|
||||
if (__kmp_generate_warnings == kmp_warnings_off) {
|
||||
__kmp_str_free(&err_code.str);
|
||||
}
|
||||
}; // if
|
||||
}
|
||||
#endif /* KMP_THREAD_ATTR */
|
||||
|
||||
KMP_MB(); /* Flush all pending memory write invalidates. */
|
||||
@@ -928,11 +928,11 @@ void __kmp_create_monitor(kmp_info_t *th) {
|
||||
status = pthread_attr_init(&thread_attr);
|
||||
if (status != 0) {
|
||||
__kmp_fatal(KMP_MSG(CantInitThreadAttrs), KMP_ERR(status), __kmp_msg_null);
|
||||
}; // if
|
||||
}
|
||||
status = pthread_attr_setdetachstate(&thread_attr, PTHREAD_CREATE_JOINABLE);
|
||||
if (status != 0) {
|
||||
__kmp_fatal(KMP_MSG(CantSetMonitorState), KMP_ERR(status), __kmp_msg_null);
|
||||
}; // if
|
||||
}
|
||||
|
||||
#ifdef _POSIX_THREAD_ATTR_STACKSIZE
|
||||
status = pthread_attr_getstacksize(&thread_attr, &size);
|
||||
@@ -972,7 +972,7 @@ retry:
|
||||
if (__kmp_generate_warnings == kmp_warnings_off) {
|
||||
__kmp_str_free(&err_code.str);
|
||||
}
|
||||
}; // if
|
||||
}
|
||||
#endif /* _POSIX_THREAD_ATTR_STACKSIZE */
|
||||
|
||||
status =
|
||||
@@ -988,19 +988,19 @@ retry:
|
||||
__kmp_fatal(KMP_MSG(CantSetMonitorStackSize, __kmp_monitor_stksize),
|
||||
KMP_ERR(status), KMP_HNT(IncreaseMonitorStackSize),
|
||||
__kmp_msg_null);
|
||||
}; // if
|
||||
}
|
||||
if (status == ENOMEM) {
|
||||
__kmp_fatal(KMP_MSG(CantSetMonitorStackSize, __kmp_monitor_stksize),
|
||||
KMP_ERR(status), KMP_HNT(DecreaseMonitorStackSize),
|
||||
__kmp_msg_null);
|
||||
}; // if
|
||||
}
|
||||
#endif /* _POSIX_THREAD_ATTR_STACKSIZE */
|
||||
if (status == EAGAIN) {
|
||||
__kmp_fatal(KMP_MSG(NoResourcesForMonitorThread), KMP_ERR(status),
|
||||
KMP_HNT(DecreaseNumberOfThreadsInUse), __kmp_msg_null);
|
||||
}; // if
|
||||
}
|
||||
KMP_SYSFAIL("pthread_create", status);
|
||||
}; // if
|
||||
}
|
||||
|
||||
th->th.th_info.ds.ds_thread = handle;
|
||||
|
||||
@@ -1021,7 +1021,7 @@ retry:
|
||||
if (__kmp_generate_warnings == kmp_warnings_off) {
|
||||
__kmp_str_free(&err_code.str);
|
||||
}
|
||||
}; // if
|
||||
}
|
||||
#endif
|
||||
|
||||
KMP_MB(); /* Flush all pending memory write invalidates. */
|
||||
@@ -1054,7 +1054,7 @@ void __kmp_reap_monitor(kmp_info_t *th) {
|
||||
if (th->th.th_info.ds.ds_gtid != KMP_GTID_MONITOR) {
|
||||
KA_TRACE(10, ("__kmp_reap_monitor: monitor did not start, returning\n"));
|
||||
return;
|
||||
}; // if
|
||||
}
|
||||
|
||||
KMP_MB(); /* Flush all pending memory write invalidates. */
|
||||
|
||||
@@ -1138,7 +1138,7 @@ static void __kmp_team_handler(int signo) {
|
||||
case SIGTERM:
|
||||
if (__kmp_debug_buf) {
|
||||
__kmp_dump_debug_buffer();
|
||||
}; // if
|
||||
}
|
||||
KMP_MB(); // Flush all pending memory write invalidates.
|
||||
TCW_4(__kmp_global.g.g_abort, signo);
|
||||
KMP_MB(); // Flush all pending memory write invalidates.
|
||||
@@ -1150,8 +1150,8 @@ static void __kmp_team_handler(int signo) {
|
||||
__kmp_debug_printf("__kmp_team_handler: unknown signal type");
|
||||
#endif
|
||||
break;
|
||||
}; // switch
|
||||
}; // if
|
||||
}
|
||||
}
|
||||
} // __kmp_team_handler
|
||||
|
||||
static void __kmp_sigaction(int signum, const struct sigaction *act,
|
||||
@@ -1177,11 +1177,11 @@ static void __kmp_install_one_handler(int sig, sig_func_t handler_func,
|
||||
} else {
|
||||
// Restore/keep user's handler if one previously installed.
|
||||
__kmp_sigaction(sig, &old_action, NULL);
|
||||
}; // if
|
||||
}
|
||||
} else {
|
||||
// Save initial/system signal handlers to see if user handlers installed.
|
||||
__kmp_sigaction(sig, NULL, &__kmp_sighldrs[sig]);
|
||||
}; // if
|
||||
}
|
||||
KMP_MB(); // Flush all pending memory write invalidates.
|
||||
} // __kmp_install_one_handler
|
||||
|
||||
@@ -1198,10 +1198,10 @@ static void __kmp_remove_one_handler(int sig) {
|
||||
"restoring: sig=%d\n",
|
||||
sig));
|
||||
__kmp_sigaction(sig, &old, NULL);
|
||||
}; // if
|
||||
}
|
||||
sigdelset(&__kmp_sigset, sig);
|
||||
KMP_MB(); // Flush all pending memory write invalidates.
|
||||
}; // if
|
||||
}
|
||||
} // __kmp_remove_one_handler
|
||||
|
||||
void __kmp_install_signals(int parallel_init) {
|
||||
@@ -1225,7 +1225,7 @@ void __kmp_install_signals(int parallel_init) {
|
||||
#ifdef SIGPIPE
|
||||
__kmp_install_one_handler(SIGPIPE, __kmp_team_handler, parallel_init);
|
||||
#endif // SIGPIPE
|
||||
}; // if
|
||||
}
|
||||
} // __kmp_install_signals
|
||||
|
||||
void __kmp_remove_signals(void) {
|
||||
@@ -1233,7 +1233,7 @@ void __kmp_remove_signals(void) {
|
||||
KB_TRACE(10, ("__kmp_remove_signals()\n"));
|
||||
for (sig = 1; sig < NSIG; ++sig) {
|
||||
__kmp_remove_one_handler(sig);
|
||||
}; // for sig
|
||||
}
|
||||
} // __kmp_remove_signals
|
||||
|
||||
#endif // KMP_HANDLE_SIGNALS
|
||||
@@ -1374,7 +1374,7 @@ static void __kmp_suspend_initialize_thread(kmp_info_t *th) {
|
||||
KMP_CHECK_SYSFAIL("pthread_mutex_init", status);
|
||||
*(volatile int *)&th->th.th_suspend_init_count = __kmp_fork_count + 1;
|
||||
ANNOTATE_HAPPENS_BEFORE(&th->th.th_suspend_init_count);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
void __kmp_suspend_uninitialize_thread(kmp_info_t *th) {
|
||||
@@ -1386,11 +1386,11 @@ void __kmp_suspend_uninitialize_thread(kmp_info_t *th) {
|
||||
status = pthread_cond_destroy(&th->th.th_suspend_cv.c_cond);
|
||||
if (status != 0 && status != EBUSY) {
|
||||
KMP_SYSFAIL("pthread_cond_destroy", status);
|
||||
};
|
||||
}
|
||||
status = pthread_mutex_destroy(&th->th.th_suspend_mx.m_mutex);
|
||||
if (status != 0 && status != EBUSY) {
|
||||
KMP_SYSFAIL("pthread_mutex_destroy", status);
|
||||
};
|
||||
}
|
||||
--th->th.th_suspend_init_count;
|
||||
KMP_DEBUG_ASSERT(th->th.th_suspend_init_count == __kmp_fork_count);
|
||||
}
|
||||
@@ -1774,7 +1774,7 @@ static int __kmp_get_xproc(void) {
|
||||
} else {
|
||||
KMP_WARNING(CantGetNumAvailCPU);
|
||||
KMP_INFORM(AssumedNumCPU);
|
||||
}; // if
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
@@ -1807,12 +1807,12 @@ void __kmp_runtime_initialize(void) {
|
||||
|
||||
if (__kmp_init_runtime) {
|
||||
return;
|
||||
}; // if
|
||||
}
|
||||
|
||||
#if (KMP_ARCH_X86 || KMP_ARCH_X86_64)
|
||||
if (!__kmp_cpuinfo.initialized) {
|
||||
__kmp_query_cpuid(&__kmp_cpuinfo);
|
||||
}; // if
|
||||
}
|
||||
#endif /* KMP_ARCH_X86 || KMP_ARCH_X86_64 */
|
||||
|
||||
__kmp_xproc = __kmp_get_xproc();
|
||||
@@ -1862,7 +1862,7 @@ void __kmp_runtime_destroy(void) {
|
||||
|
||||
if (!__kmp_init_runtime) {
|
||||
return; // Nothing to do.
|
||||
};
|
||||
}
|
||||
|
||||
#if USE_ITT_BUILD
|
||||
__kmp_itt_destroy();
|
||||
@@ -1962,7 +1962,7 @@ int __kmp_is_address_mapped(void *addr) {
|
||||
rc = fscanf(file, "%p-%p %4s %*[^\n]\n", &beginning, &ending, perms);
|
||||
if (rc == EOF) {
|
||||
break;
|
||||
}; // if
|
||||
}
|
||||
KMP_ASSERT(rc == 3 &&
|
||||
KMP_STRLEN(perms) == 4); // Make sure all fields are read.
|
||||
|
||||
@@ -1972,11 +1972,10 @@ int __kmp_is_address_mapped(void *addr) {
|
||||
if (strcmp(perms, "rw") == 0) {
|
||||
// Memory we are looking for should be readable and writable.
|
||||
found = 1;
|
||||
}; // if
|
||||
}
|
||||
break;
|
||||
}; // if
|
||||
|
||||
}; // forever
|
||||
}
|
||||
}
|
||||
|
||||
// Free resources.
|
||||
fclose(file);
|
||||
@@ -1999,7 +1998,7 @@ int __kmp_is_address_mapped(void *addr) {
|
||||
if (rc == 0) {
|
||||
// Memory successfully read.
|
||||
found = 1;
|
||||
}; // if
|
||||
}
|
||||
|
||||
#elif KMP_OS_FREEBSD || KMP_OS_NETBSD
|
||||
|
||||
@@ -2097,11 +2096,11 @@ int __kmp_get_load_balance(int max) {
|
||||
if (permanent_error) {
|
||||
running_threads = -1;
|
||||
goto finish;
|
||||
}; // if
|
||||
}
|
||||
|
||||
if (max <= 0) {
|
||||
max = INT_MAX;
|
||||
}; // if
|
||||
}
|
||||
|
||||
// Open "/proc/" directory.
|
||||
proc_dir = opendir("/proc");
|
||||
@@ -2111,7 +2110,7 @@ int __kmp_get_load_balance(int max) {
|
||||
running_threads = -1;
|
||||
permanent_error = 1;
|
||||
goto finish;
|
||||
}; // if
|
||||
}
|
||||
|
||||
// Initialize fixed part of task_path. This part will not change.
|
||||
__kmp_str_buf_cat(&task_path, "/proc/", 6);
|
||||
@@ -2152,7 +2151,7 @@ int __kmp_get_load_balance(int max) {
|
||||
running_threads = -1;
|
||||
permanent_error = 1;
|
||||
goto finish;
|
||||
}; // if
|
||||
}
|
||||
} else {
|
||||
// Construct fixed part of stat file path.
|
||||
__kmp_str_buf_clear(&stat_path);
|
||||
@@ -2223,22 +2222,22 @@ int __kmp_get_load_balance(int max) {
|
||||
++running_threads;
|
||||
if (running_threads >= max) {
|
||||
goto finish;
|
||||
}; // if
|
||||
}; // if
|
||||
}; // if
|
||||
}; // if
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
close(stat_file);
|
||||
stat_file = -1;
|
||||
}; // if
|
||||
}; // if
|
||||
}
|
||||
}
|
||||
task_entry = readdir(task_dir);
|
||||
}; // while
|
||||
}
|
||||
closedir(task_dir);
|
||||
task_dir = NULL;
|
||||
}; // if
|
||||
}; // if
|
||||
}
|
||||
}
|
||||
proc_entry = readdir(proc_dir);
|
||||
}; // while
|
||||
}
|
||||
|
||||
// There _might_ be a timing hole where the thread executing this
|
||||
// code get skipped in the load balance, and running_threads is 0.
|
||||
@@ -2251,15 +2250,15 @@ int __kmp_get_load_balance(int max) {
|
||||
finish: // Clean up and exit.
|
||||
if (proc_dir != NULL) {
|
||||
closedir(proc_dir);
|
||||
}; // if
|
||||
}
|
||||
__kmp_str_buf_free(&task_path);
|
||||
if (task_dir != NULL) {
|
||||
closedir(task_dir);
|
||||
}; // if
|
||||
}
|
||||
__kmp_str_buf_free(&stat_path);
|
||||
if (stat_file != -1) {
|
||||
close(stat_file);
|
||||
}; // if
|
||||
}
|
||||
|
||||
glb_running_threads = running_threads;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user