2016년 10월 16일 일요일

OpenMP 예제: For loop iterations w/ no data dependency

Notes:

1. Visual Studio 2015 setting은:

2. #include <omp.h>
  • omp_get_thread_num()를 위해 필요함.

3. OpenMP constructs:
  • #pragma omp parallel for
  • #pragma omp critical
    • Optional name을 이용해서 서로 다른 여러 개의 critical section을 정의할 수 있음:
      #pragma omp critical (name_of_the_critical_section)
    • All CRITICAL sections which are unnamed, are treated as the same section (https://computing.llnl.gov/tutorials/openMP/#CRITICAL).

4. 참고로, #include "Windows.h"Sleep()을 위한 것임 (OpenMP와 상관 없음).

#include <iostream>

#include <omp.h>

#include "Windows.h"

using namespace std;

void First();
void Second();
void Third();

int main() {
#pragma omp parallel for
  for (int i = 0; i < 100; ++i) {
    const int tid = omp_get_thread_num();
#pragma omp critical
    cout << tid << ": * Processing: " << i << endl;

#pragma omp critical
    cout << tid << ":   1. The first job" << endl;
    First();

#pragma omp critical
    cout << tid << ":   2. The second job" << endl;
    Second();

#pragma omp critical
    cout << tid << ":   3. The third job" << endl;
    Third();

    cout << endl;
  }

  return 0;
}

void First()  { Sleep(1000); }
void Second() { Sleep(500);  }
void Third()  { Sleep(2000); }

2016년 10월 5일 수요일

Windows 10 - KB3194496 update 설치 실패 해결

Microsoft community의 [이 글]에 따르면, 아래와 같이 두 가지 방법이 있음:
  1. Bypass Windows Update by installing the latest version directly [Simple]
    Solution posted by Sean8102 on October 1st (page 16)
    Go to the Get Windows 10 webpage and click download tool now.  When you run the tool, select "Upgrade This PC Now" and choose to keep everything (files, apps, and settings).  This will apply the update directly without impacting any of your installed programs at all.  You can also use the tool to create a bootable USB stick and install from that, but no USB stick is necessary if you use the "Upgrade This PC Now" option.
  2. Remove Tasks and Registry for Tasks that that Block The Update [Advanced]
    Solution posted by TomislavRex on October 3rd (page 23 with additional details on page 29)
    Deleted all references to task  \Microsoft\XblGameSave\XblGameSaveTask in the System32 folder, AND all traces of them from the registry (in the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache tree.  Noted that deleting some of these involved changing ownership of the keys. The tasks have been recreated during the installation of the update.
이 글에서는 더 쉬운 방법인 1번 방법을 설명함.

[해결 방법 1]

1. [이 글]에 가서 "Download tool now"를 click하여 "MediaCreationTool.exe" file을 받는다. 

2. Download 받은 file을 실행하면 Windows 10 download가 시작된다: 

3. 아래 화면에서 "동의"를 click:

4. 다음과 같이 update가 download된다:

5. "설치 준비 완료" 화면에서 "개인 파일, 앱을 유지합니다."가 check된 것을 확인한 후에 "설치"를 click한다:
(만약 check가 안 되어 있다면 "유지할 항목 변경"에서 설정한다.)

6. 몇 번의 재 booting을 통해 Windows가 설치된다.

7. 설치가 끝나고 update를 확인해보면 다음과 같이 (KB3194496를 포함하는) 모든 update가 설치된 것을 확인할 수 있다: