在OpenMP线程之间进行通信(Communicating between OpenMP threads)
我有一个OpenMP循环,我希望在任何其他线程继续之前完成第一次迭代。 我已经尝试使用全局变量,初始化为'false',当第一次迭代结束时设置为'true',但这似乎没有按预期工作(我陷入无限循环)。
例如:
bool FirstDone = false; // This is a global variable ... #pragma omp parallel for for(int i=0;i<max;i++) { while(!FirstDone && i>0){} if(i==0) { // Do something FirstDone = true; } }
任何人都可以阐明为什么这不起作用?
I have an OpenMP loop where I want the first iteration to complete before any of the other threads continue. I've tried using a global variable, initialized to 'false', which is set to 'true' when the first iteration finishes, but this doesn't appear to work as expected (I get stuck in an infinite loop).
For example:
bool FirstDone = false; // This is a global variable ... #pragma omp parallel for for(int i=0;i<max;i++) { while(!FirstDone && i>0){} if(i==0) { // Do something FirstDone = true; } }
Can anyone shed light on why this isn't working?
原文:https://stackoverflow.com/questions/19356500
最满意答案
您需要在WAMP环境中设置新的root密码。 它有一个与XAMPP中不同的MySQL实例,因此它不会获取相同的root密码。 更改root密码并再次尝试连接,这应该有效。
You need to set a new root password within your WAMP environment. It has a different instance of MySQL to the one in XAMPP, so it won't pick up the same root password. Change the root password and try connecting again, that should work.
相关问答
更多-
wamp如何连接mysql数据库[2022-07-27]
建议你重新配置 wamp 网上有完整的教程 再如果数据库连接出错就是你的网站源码问题。 -
错误'C:/ wamp / www'@'localhost'告诉你试图连接的用户是'C:/ wamp / www',而不是'root'。 你可以通过打印出来来检查$ dbconfig中的内容吗? 在phpmyadmin配置中更改密码实际上并不会从数据库本身更改密码。 Phpmyadmin只是一个客户端,而不是数据库。 要更改数据库中的密码,您应该使用任何客户端(如phpmyadmin)在'mysql'数据库'用户'表中更改它: 从phpmyadmin配置中删除用户名和密码 - 它将允许您使用网络形式登录。 ...
-
您需要在WAMP环境中设置新的root密码。 它有一个与XAMPP中不同的MySQL实例,因此它不会获取相同的root密码。 更改root密码并再次尝试连接,这应该有效。 You need to set a new root password within your WAMP environment. It has a different instance of MySQL to the one in XAMPP, so it won't pick up the same root password. Ch ...
-
phpMyAdmin访问被拒绝(phpMyAdmin access denied)[2022-06-11]
在你的phpmyadmin config.inc.php中尝试这个: - $cfg['Servers'][$i]['verbose'] = 'localhost'; $cfg['Servers'][$i]['host'] = 'localhost'; $cfg['Servers'][$i]['port'] = '3306'; $cfg['Servers'][$i]['socket'] = ''; $cfg['Servers'][$i]['connect_type'] ... -
wamp服务器本地拒绝?(wamp server locally denied?)[2023-03-15]
在这里看到我的老指导,我的许多朋友有这个错误,这个指南的工程http://www.hieule.info/site/web/solve-the-denied-access-problem-when-using-wamp-server-2 -on-windows-8-希望这也适用于你。 See my old guide here, many of my friend has this error and this guide works http://www.hieule.info/site/web/solv ... -
php wamp;(php wamp; forbidden folder in www)[2023-10-10]
检查错误的步骤: 1)检查您的apache配置:检查目标目录及以上目录条目。 注意订单和允许 (或要求 2.4+) 2)检查目标目录或以上是否有.htaccess文件。 再次,注意Allow / Deny和Require 。 3)检查403是否由apache或您的应用程序发出:在应用程序逻辑的最顶层添加一些调试消息(通常是某种index.php)。 Steps to check what's wrong: 1) Check your apache config: Check Directory-entrie ... -
拒绝访问mysql(Access denied to mysql)[2021-12-19]
它不是特别安全,但如果您将帐户名称添加到my.ini文件以及密码,它将适合您 # The following options will be passed to all MySQL clients [client] user = "Fred" password = "Bloggs" port = 3306 socket = /tmp/mysql.sock ... Its not particularly secure but if you add the acc ... -
问题得到解决。 在我的Windows上运行另一个php服务阻止了wamp服务器php服务。 所以我刚刚卸载了我不需要的服务。 The problem was fixed. There was an another php service running on my windows that blocked the wamp server php service. So i just unninstalled the service which i do not need.
-
所以我在谷歌上搜索,但我没有尝试过。 所以我继续Youtube,在那里我找到了答案。 我会在这里发布Youtube密码视频链接,因为它比解释更容易,但我会给出一个简短的总结。 它是通过命令行完成的,并生成一个名为“mysql-init.txt”的.txt文件。 所以我必须创建一个.txt文件,其中包含使用mysql的命令并更新mysql.user表,并更新密码,然后刷新权限。 然后不得不关闭mysql服务器服务。 之后,我将“my.ini”文件移动到mysql服务器的文件夹中(对我来说是“MySQL Ser ...
-
WAMP服务器访问被拒绝(WAMP server Access Denied)[2023-10-10]
编辑config.inc.php文件。 $cfg['Servers'][$i]['verbose'] = 'localhost'; $cfg['Servers'][$i]['host'] = 'localhost'; $cfg['Servers'][$i]['port'] = '3306'; $cfg['Servers'][$i]['socket'] = ''; $cfg['Servers'][$i]['connect_type'] = 'tcp'; $cfg['Servers'][$i]['extensi ...