{"action":"opened","issue":{"url":"https://api.github.com/repos/xianyi/OpenBLAS/issues/882","repository_url":"https://api.github.com/repos/xianyi/OpenBLAS","labels_url":"https://api.github.com/repos/xianyi/OpenBLAS/issues/882/labels{/name}","comments_url":"https://api.github.com/repos/xianyi/OpenBLAS/issues/882/comments","events_url":"https://api.github.com/repos/xianyi/OpenBLAS/issues/882/events","html_url":"https://github.com/xianyi/OpenBLAS/issues/882","id":155464228,"number":882,"title":"Questions about computing confusion for multi-thread program","user":{"login":"AlfredXiangWu","id":6490849,"avatar_url":"https://avatars.githubusercontent.com/u/6490849?v=3","gravatar_id":"","url":"https://api.github.com/users/AlfredXiangWu","html_url":"https://github.com/AlfredXiangWu","followers_url":"https://api.github.com/users/AlfredXiangWu/followers","following_url":"https://api.github.com/users/AlfredXiangWu/following{/other_user}","gists_url":"https://api.github.com/users/AlfredXiangWu/gists{/gist_id}","starred_url":"https://api.github.com/users/AlfredXiangWu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlfredXiangWu/subscriptions","organizations_url":"https://api.github.com/users/AlfredXiangWu/orgs","repos_url":"https://api.github.com/users/AlfredXiangWu/repos","events_url":"https://api.github.com/users/AlfredXiangWu/events{/privacy}","received_events_url":"https://api.github.com/users/AlfredXiangWu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-18T10:10:28Z","updated_at":"2016-05-18T10:10:28Z","closed_at":null,"body":"I implement a machine learning algorithm based on OpenBLAS and I encouter some problems about multi-thread program. The inputs of the promgram are two images and the output is a score.\r\n\r\nIf I use compile commands\r\n\r\n1. \"make FC=gfortran NUM_THREADS=64 USE_OPENMP=1\"\r\nFor single thread implementation, the time consuming is about **100ms**. For 8 threads, the total time consuming is about **450ms**. However, for multi-thread implementation, **the scores are different from the single thread results.** \r\n\r\n2. \"make FC=gfortran NUM_THREADS=64 USE_OPENMP=0\"\r\nFor single thread, the time is about **120ms** and the total time is about **1s** for 8 threads. The scores are equal to the single thread results. \r\n\r\n3. \"make FC=gfortran NUM_THREADS=64 USE_THREAD=0 USE_OPENMP=1\"\r\nFor single thread, the time is about **162ms** and the total time is about **260ms** for 8 threads. The scores are equal to the single thread results. \r\n\r\n4. \"make FC=gfortran NUM_THREADS=64 USE_THREAD=0 USE_OPENMP=0\"\r\nFor single thread, the time is about **140ms** and the total time is about **260ms** for 8 threads. The scores are equal to the single thread results. \r\n\r\n\r\nI have some questions\r\n\r\n1. I want to imporve both single thread and multi-thread efficiency. How do I select the compile command?\r\n\r\n2. Why does the command \"make FC=gfortran NUM_THREADS=64 USE_OPENMP=1\" make the difference between single thread and multi thread implementation?\r\n\r\n3. What difference between \"USE_THREAD\" and \"USE_OPENMP\"?\r\n\r\nThanks!\r\n\r\n"}}