{"blog_title":"yohhoy\u306e\u65e5\u8a18","title":"OpenMP\u4e26\u5217for\u30eb\u30fc\u30d7\u306e\u4e2d\u65ad\u51e6\u7406","url":"https://yohhoy.hatenadiary.jp/entry/20150513/p1","categories":["OpenMP","C","C++"],"version":"1.0","provider_url":"https://hatena.blog","author_name":"yohhoy","type":"rich","published":"2015-05-13 00:00:00","blog_url":"https://yohhoy.hatenadiary.jp/","author_url":"https://blog.hatena.ne.jp/yohhoy/","provider_name":"Hatena Blog","image_url":null,"html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fyohhoy.hatenadiary.jp%2Fentry%2F20150513%2Fp1\" title=\"OpenMP\u4e26\u5217for\u30eb\u30fc\u30d7\u306e\u4e2d\u65ad\u51e6\u7406 - yohhoy\u306e\u65e5\u8a18\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","width":"100%","description":"OpenMP\u306b\u3088\u308b\u4e26\u5217for\u30eb\u30fc\u30d7\u306b\u304a\u3044\u3066\u3001\u8a72\u5f53\u30eb\u30fc\u30d7\u306e\u51e6\u7406\u9014\u4e2d\u3067\u4e2d\u65ad\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u3002OpenMP\u3067\u306f\u4e26\u5217for\u30eb\u30fc\u30d7\u5185\u304b\u3089\u306e break \u306f\u7981\u6b62\u3055\u308c\u308b\u305f\u3081\u3001\u30d5\u30e9\u30b0\u5909\u6570\u3092\u7528\u3044\u305f\u30eb\u30fc\u30d7\u5185\u51e6\u7406\u30b9\u30ad\u30c3\u30d7\u3067\u4ee3\u7528\u3059\u308b\u3002\u4e26\u5217\u30ea\u30fc\u30b8\u30e7\u30f3\u3067\u306e\u30d5\u30e9\u30b0\u5909\u6570\u30a2\u30af\u30bb\u30b9\u306f\u3001\u5168\u3066\u30af\u30ea\u30c6\u30a3\u30ab\u30eb\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u4fdd\u8b77\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002\u4e0b\u8a18\u30b3\u30fc\u30c9\u3067\u306f critical \u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30c8\u3092\u5229\u7528\u3057\u3066\u3044\u308b\u304c\u3001omp_lock_t\u3092\u7528\u3044\u305f\u660e\u793a\u7684\u30ed\u30c3\u30af\uff0f\u30a2\u30f3\u30ed\u30c3\u30af\u64cd\u4f5c\u3067\u3082\u826f\u3044\u3002 int break_loop = 0; // \u30eb\u30fc\u30d7\u4e2d\u65ad\u30d5\u30e9\u30b0 #pragma omp parallel for for (int i = 0; i < N; i++)\u2026","height":"190"}