{"action":"created","comment":{"url":"https://api.github.com/repos/mantidproject/mantid/pulls/comments/146773649","pull_request_review_id":71762927,"id":146773649,"diff_hunk":"@@ -0,0 +1,99 @@\n+#ifndef MANTID_PARALLEL_PULSETIMEGENERATOR_H_\n+#define MANTID_PARALLEL_PULSETIMEGENERATOR_H_\n+\n+#include \"MantidParallel/DllConfig.h\"\n+#include \"MantidTypes/Core/DateAndTime.h\"\n+\n+namespace Mantid {\n+namespace Parallel {\n+namespace IO {\n+\n+/** Generator for pulse times based in input from an NXevent_data entry from a\n+  Nexus file. Used to generate a sequence of pulse times for a series of events\n+  by doing a lookup of the event in the event_index field and returning the\n+  corresponding pulse time obtained from event_time_zero combined with the\n+  optional offset parameter.\n+\n+  @author Simon Heybrock\n+  @date 2017\n+\n+  Copyright &copy; 2017 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge\n+  National Laboratory & European Spallation Source\n+\n+  This file is part of Mantid.\n+\n+  Mantid is free software; you can redistribute it and/or modify\n+  it under the terms of the GNU General Public License as published by\n+  the Free Software Foundation; either version 3 of the License, or\n+  (at your option) any later version.\n+\n+  Mantid is distributed in the hope that it will be useful,\n+  but WITHOUT ANY WARRANTY; without even the implied warranty of\n+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+  GNU General Public License for more details.\n+\n+  You should have received a copy of the GNU General Public License\n+  along with this program.  If not, see <http://www.gnu.org/licenses/>.\n+\n+  File change history is stored at: <https://github.com/mantidproject/mantid>\n+  Code Documentation is available at: <http://doxygen.mantidproject.org>\n+*/\n+template <class IndexType, class TimeZeroType> class PulseTimeGenerator {\n+public:\n+  PulseTimeGenerator() = default;\n+\n+  /// Constructor based on entries in NXevent_data.\n+  PulseTimeGenerator(std::vector<IndexType> event_index,\n+                     std::vector<TimeZeroType> event_time_zero,\n+                     const int64_t event_time_zero_offset)\n+      : m_index(std::move(event_index)), m_timeZero(std::move(event_time_zero)),\n+        m_timeZeroOffset(event_time_zero_offset) {}\n+\n+  /// Seek to given event index.\n+  void seek(const size_t event) {\n+    if (m_index.size() == 0)\n+      throw std::runtime_error(\"Empty event index in PulseTimeGenerator\");\n+    if (static_cast<IndexType>(event) < m_event)\n+      m_pulse = 0;\n+    m_event = static_cast<IndexType>(event);\n+    for (; m_pulse < m_index.size() - 1; ++m_pulse)\n+      if (m_event < m_index[m_pulse + 1])\n+        break;\n+    m_pulseTime = getPulseTime(m_timeZeroOffset, m_timeZero[m_pulse]);\n+  }\n+\n+  /// Return pulse time for next event, and advance. Must call seek() first, at\n+  /// least once.\n+  Types::Core::DateAndTime next() {\n+    while (m_pulse < m_index.size() - 1 && m_event == m_index[m_pulse + 1]) {\n+      ++m_pulse;\n+      m_pulseTime = getPulseTime(m_timeZeroOffset, m_timeZero[m_pulse]);\n+    }\n+    ++m_event;\n+    return m_pulseTime;\n+  }\n+\n+private:\n+  int64_t cast(const uint64_t time) const { return static_cast<int64_t>(time); }\n+  int64_t cast(const int64_t time) const { return static_cast<int64_t>(time); }\n+  int64_t cast(const uint32_t time) const { return static_cast<int64_t>(time); }\n+  int64_t cast(const int32_t time) const { return static_cast<int64_t>(time); }\n+  double cast(const double time) const { return static_cast<double>(time); }","path":"Framework/Parallel/inc/MantidParallel/IO/PulseTimeGenerator.h","position":81,"original_position":81,"commit_id":"aa4a43ba939865e53d3e236b831666719c583d0f","original_commit_id":"aa4a43ba939865e53d3e236b831666719c583d0f","user":{"login":"LamarMoore","id":15360272,"avatar_url":"https://avatars1.githubusercontent.com/u/15360272?v=4","gravatar_id":"","url":"https://api.github.com/users/LamarMoore","html_url":"https://github.com/LamarMoore","followers_url":"https://api.github.com/users/LamarMoore/followers","following_url":"https://api.github.com/users/LamarMoore/following{/other_user}","gists_url":"https://api.github.com/users/LamarMoore/gists{/gist_id}","starred_url":"https://api.github.com/users/LamarMoore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LamarMoore/subscriptions","organizations_url":"https://api.github.com/users/LamarMoore/orgs","repos_url":"https://api.github.com/users/LamarMoore/repos","events_url":"https://api.github.com/users/LamarMoore/events{/privacy}","received_events_url":"https://api.github.com/users/LamarMoore/received_events","type":"User","site_admin":false},"body":"👍 ","created_at":"2017-10-25T07:29:16Z","updated_at":"2017-10-25T07:29:16Z","html_url":"https://github.com/mantidproject/mantid/pull/20942#discussion_r146773649","pull_request_url":"https://api.github.com/repos/mantidproject/mantid/pulls/20942","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/mantidproject/mantid/pulls/comments/146773649"},"html":{"href":"https://github.com/mantidproject/mantid/pull/20942#discussion_r146773649"},"pull_request":{"href":"https://api.github.com/repos/mantidproject/mantid/pulls/20942"}},"in_reply_to_id":146511448},"pull_request":{"url":"https://api.github.com/repos/mantidproject/mantid/pulls/20942","id":147047353,"html_url":"https://github.com/mantidproject/mantid/pull/20942","diff_url":"https://github.com/mantidproject/mantid/pull/20942.diff","patch_url":"https://github.com/mantidproject/mantid/pull/20942.patch","issue_url":"https://api.github.com/repos/mantidproject/mantid/issues/20942","number":20942,"state":"closed","locked":false,"title":"Integrate parallel event loader","user":{"login":"SimonHeybrock","id":12912489,"avatar_url":"https://avatars1.githubusercontent.com/u/12912489?v=4","gravatar_id":"","url":"https://api.github.com/users/SimonHeybrock","html_url":"https://github.com/SimonHeybrock","followers_url":"https://api.github.com/users/SimonHeybrock/followers","following_url":"https://api.github.com/users/SimonHeybrock/following{/other_user}","gists_url":"https://api.github.com/users/SimonHeybrock/gists{/gist_id}","starred_url":"https://api.github.com/users/SimonHeybrock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SimonHeybrock/subscriptions","organizations_url":"https://api.github.com/users/SimonHeybrock/orgs","repos_url":"https://api.github.com/users/SimonHeybrock/repos","events_url":"https://api.github.com/users/SimonHeybrock/events{/privacy}","received_events_url":"https://api.github.com/users/SimonHeybrock/received_events","type":"User","site_admin":false},"body":"Put together some previously implemented pieces into a parallel event loader used in `LoadEventNexus`.\r\n\r\nThis adds a new parallel loader for events in `LoadEventNexus`. It is always disabled for non-MPI builds, i.e., does not influence anyone since we are not providing MPI builds yet.\r\n\r\n**To test:**\r\n\r\nCore review.\r\n\r\nFixes #20887. <!-- and fix #xxxx or close #xxxx xor resolves #xxxx -->\r\n\r\n---\r\n\r\n#### Reviewer ####\r\n\r\nPlease comment on the following ([full description](http://www.mantidproject.org/Individual_Ticket_Testing)):\r\n\r\n##### Code Review #####\r\n\r\n- [ ] Is the code of an acceptable quality?\r\n- [ ] Does the code conform to the [coding standards](http://www.mantidproject.org/Coding_Standards)?\r\n- [ ] Are the unit tests small and test the class in isolation?\r\n- [ ] If there are changes in the release notes then do they describe the changes appropriately?\r\n\r\n##### Functional Tests #####\r\n\r\n- [ ] Do changes function as described? Add comments below that describe the tests performed?\r\n- [ ] Do the changes handle unexpected situations, e.g. bad input?\r\n- [ ] Has the relevant (user and developer) documentation been added/updated?\r\n\r\nDoes everything look good? Mark the review as **Approve**. A member of `@mantidproject/gatekeepers` will take care of it.\r\n","created_at":"2017-10-17T14:01:11Z","updated_at":"2017-10-25T07:29:16Z","closed_at":"2017-10-24T09:08:25Z","merged_at":"2017-10-24T09:08:25Z","merge_commit_sha":"302bb13ebef7a6d69187845711e2a8c36b16396f","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":{"url":"https://api.github.com/repos/mantidproject/mantid/milestones/65","html_url":"https://github.com/mantidproject/mantid/milestone/65","labels_url":"https://api.github.com/repos/mantidproject/mantid/milestones/65/labels","id":2590252,"number":65,"title":"Release 3.12","description":"","creator":{"login":"NickDraper","id":1017173,"avatar_url":"https://avatars1.githubusercontent.com/u/1017173?v=4","gravatar_id":"","url":"https://api.github.com/users/NickDraper","html_url":"https://github.com/NickDraper","followers_url":"https://api.github.com/users/NickDraper/followers","following_url":"https://api.github.com/users/NickDraper/following{/other_user}","gists_url":"https://api.github.com/users/NickDraper/gists{/gist_id}","starred_url":"https://api.github.com/users/NickDraper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NickDraper/subscriptions","organizations_url":"https://api.github.com/users/NickDraper/orgs","repos_url":"https://api.github.com/users/NickDraper/repos","events_url":"https://api.github.com/users/NickDraper/events{/privacy}","received_events_url":"https://api.github.com/users/NickDraper/received_events","type":"User","site_admin":false},"open_issues":229,"closed_issues":202,"state":"open","created_at":"2017-06-19T08:22:22Z","updated_at":"2017-10-25T06:48:37Z","due_on":"2018-02-05T08:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/mantidproject/mantid/pulls/20942/commits","review_comments_url":"https://api.github.com/repos/mantidproject/mantid/pulls/20942/comments","review_comment_url":"https://api.github.com/repos/mantidproject/mantid/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mantidproject/mantid/issues/20942/comments","statuses_url":"https://api.github.com/repos/mantidproject/mantid/statuses/aa4a43ba939865e53d3e236b831666719c583d0f","head":{"label":"mantidproject:20887_integrate_parallel_event_loader","ref":"20887_integrate_parallel_event_loader","sha":"aa4a43ba939865e53d3e236b831666719c583d0f","user":{"login":"mantidproject","id":671496,"avatar_url":"https://avatars0.githubusercontent.com/u/671496?v=4","gravatar_id":"","url":"https://api.github.com/users/mantidproject","html_url":"https://github.com/mantidproject","followers_url":"https://api.github.com/users/mantidproject/followers","following_url":"https://api.github.com/users/mantidproject/following{/other_user}","gists_url":"https://api.github.com/users/mantidproject/gists{/gist_id}","starred_url":"https://api.github.com/users/mantidproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mantidproject/subscriptions","organizations_url":"https://api.github.com/users/mantidproject/orgs","repos_url":"https://api.github.com/users/mantidproject/repos","events_url":"https://api.github.com/users/mantidproject/events{/privacy}","received_events_url":"https://api.github.com/users/mantidproject/received_events","type":"Organization","site_admin":false},"repo":{"id":2594116,"name":"mantid","full_name":"mantidproject/mantid","owner":{"login":"mantidproject","id":671496,"avatar_url":"https://avatars0.githubusercontent.com/u/671496?v=4","gravatar_id":"","url":"https://api.github.com/users/mantidproject","html_url":"https://github.com/mantidproject","followers_url":"https://api.github.com/users/mantidproject/followers","following_url":"https://api.github.com/users/mantidproject/following{/other_user}","gists_url":"https://api.github.com/users/mantidproject/gists{/gist_id}","starred_url":"https://api.github.com/users/mantidproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mantidproject/subscriptions","organizations_url":"https://api.github.com/users/mantidproject/orgs","repos_url":"https://api.github.com/users/mantidproject/repos","events_url":"https://api.github.com/users/mantidproject/events{/privacy}","received_events_url":"https://api.github.com/users/mantidproject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mantidproject/mantid","description":"Main repository for Mantid code","fork":false,"url":"https://api.github.com/repos/mantidproject/mantid","forks_url":"https://api.github.com/repos/mantidproject/mantid/forks","keys_url":"https://api.github.com/repos/mantidproject/mantid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mantidproject/mantid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mantidproject/mantid/teams","hooks_url":"https://api.github.com/repos/mantidproject/mantid/hooks","issue_events_url":"https://api.github.com/repos/mantidproject/mantid/issues/events{/number}","events_url":"https://api.github.com/repos/mantidproject/mantid/events","assignees_url":"https://api.github.com/repos/mantidproject/mantid/assignees{/user}","branches_url":"https://api.github.com/repos/mantidproject/mantid/branches{/branch}","tags_url":"https://api.github.com/repos/mantidproject/mantid/tags","blobs_url":"https://api.github.com/repos/mantidproject/mantid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mantidproject/mantid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mantidproject/mantid/git/refs{/sha}","trees_url":"https://api.github.com/repos/mantidproject/mantid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mantidproject/mantid/statuses/{sha}","languages_url":"https://api.github.com/repos/mantidproject/mantid/languages","stargazers_url":"https://api.github.com/repos/mantidproject/mantid/stargazers","contributors_url":"https://api.github.com/repos/mantidproject/mantid/contributors","subscribers_url":"https://api.github.com/repos/mantidproject/mantid/subscribers","subscription_url":"https://api.github.com/repos/mantidproject/mantid/subscription","commits_url":"https://api.github.com/repos/mantidproject/mantid/commits{/sha}","git_commits_url":"https://api.github.com/repos/mantidproject/mantid/git/commits{/sha}","comments_url":"https://api.github.com/repos/mantidproject/mantid/comments{/number}","issue_comment_url":"https://api.github.com/repos/mantidproject/mantid/issues/comments{/number}","contents_url":"https://api.github.com/repos/mantidproject/mantid/contents/{+path}","compare_url":"https://api.github.com/repos/mantidproject/mantid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mantidproject/mantid/merges","archive_url":"https://api.github.com/repos/mantidproject/mantid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mantidproject/mantid/downloads","issues_url":"https://api.github.com/repos/mantidproject/mantid/issues{/number}","pulls_url":"https://api.github.com/repos/mantidproject/mantid/pulls{/number}","milestones_url":"https://api.github.com/repos/mantidproject/mantid/milestones{/number}","notifications_url":"https://api.github.com/repos/mantidproject/mantid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mantidproject/mantid/labels{/name}","releases_url":"https://api.github.com/repos/mantidproject/mantid/releases{/id}","deployments_url":"https://api.github.com/repos/mantidproject/mantid/deployments","created_at":"2011-10-17T19:07:38Z","updated_at":"2017-09-24T10:34:08Z","pushed_at":"2017-10-25T06:48:37Z","git_url":"git://github.com/mantidproject/mantid.git","ssh_url":"git@github.com:mantidproject/mantid.git","clone_url":"https://github.com/mantidproject/mantid.git","svn_url":"https://github.com/mantidproject/mantid","homepage":"www.mantidproject.org","size":449470,"stargazers_count":63,"watchers_count":63,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":44,"mirror_url":null,"archived":false,"open_issues_count":1671,"forks":44,"open_issues":1671,"watchers":63,"default_branch":"master"}},"base":{"label":"mantidproject:parallel_event_loader","ref":"parallel_event_loader","sha":"9c76b9a45b595b13cc3c26b06a81125dc9976607","user":{"login":"mantidproject","id":671496,"avatar_url":"https://avatars0.githubusercontent.com/u/671496?v=4","gravatar_id":"","url":"https://api.github.com/users/mantidproject","html_url":"https://github.com/mantidproject","followers_url":"https://api.github.com/users/mantidproject/followers","following_url":"https://api.github.com/users/mantidproject/following{/other_user}","gists_url":"https://api.github.com/users/mantidproject/gists{/gist_id}","starred_url":"https://api.github.com/users/mantidproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mantidproject/subscriptions","organizations_url":"https://api.github.com/users/mantidproject/orgs","repos_url":"https://api.github.com/users/mantidproject/repos","events_url":"https://api.github.com/users/mantidproject/events{/privacy}","received_events_url":"https://api.github.com/users/mantidproject/received_events","type":"Organization","site_admin":false},"repo":{"id":2594116,"name":"mantid","full_name":"mantidproject/mantid","owner":{"login":"mantidproject","id":671496,"avatar_url":"https://avatars0.githubusercontent.com/u/671496?v=4","gravatar_id":"","url":"https://api.github.com/users/mantidproject","html_url":"https://github.com/mantidproject","followers_url":"https://api.github.com/users/mantidproject/followers","following_url":"https://api.github.com/users/mantidproject/following{/other_user}","gists_url":"https://api.github.com/users/mantidproject/gists{/gist_id}","starred_url":"https://api.github.com/users/mantidproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mantidproject/subscriptions","organizations_url":"https://api.github.com/users/mantidproject/orgs","repos_url":"https://api.github.com/users/mantidproject/repos","events_url":"https://api.github.com/users/mantidproject/events{/privacy}","received_events_url":"https://api.github.com/users/mantidproject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mantidproject/mantid","description":"Main repository for Mantid code","fork":false,"url":"https://api.github.com/repos/mantidproject/mantid","forks_url":"https://api.github.com/repos/mantidproject/mantid/forks","keys_url":"https://api.github.com/repos/mantidproject/mantid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mantidproject/mantid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mantidproject/mantid/teams","hooks_url":"https://api.github.com/repos/mantidproject/mantid/hooks","issue_events_url":"https://api.github.com/repos/mantidproject/mantid/issues/events{/number}","events_url":"https://api.github.com/repos/mantidproject/mantid/events","assignees_url":"https://api.github.com/repos/mantidproject/mantid/assignees{/user}","branches_url":"https://api.github.com/repos/mantidproject/mantid/branches{/branch}","tags_url":"https://api.github.com/repos/mantidproject/mantid/tags","blobs_url":"https://api.github.com/repos/mantidproject/mantid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mantidproject/mantid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mantidproject/mantid/git/refs{/sha}","trees_url":"https://api.github.com/repos/mantidproject/mantid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mantidproject/mantid/statuses/{sha}","languages_url":"https://api.github.com/repos/mantidproject/mantid/languages","stargazers_url":"https://api.github.com/repos/mantidproject/mantid/stargazers","contributors_url":"https://api.github.com/repos/mantidproject/mantid/contributors","subscribers_url":"https://api.github.com/repos/mantidproject/mantid/subscribers","subscription_url":"https://api.github.com/repos/mantidproject/mantid/subscription","commits_url":"https://api.github.com/repos/mantidproject/mantid/commits{/sha}","git_commits_url":"https://api.github.com/repos/mantidproject/mantid/git/commits{/sha}","comments_url":"https://api.github.com/repos/mantidproject/mantid/comments{/number}","issue_comment_url":"https://api.github.com/repos/mantidproject/mantid/issues/comments{/number}","contents_url":"https://api.github.com/repos/mantidproject/mantid/contents/{+path}","compare_url":"https://api.github.com/repos/mantidproject/mantid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mantidproject/mantid/merges","archive_url":"https://api.github.com/repos/mantidproject/mantid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mantidproject/mantid/downloads","issues_url":"https://api.github.com/repos/mantidproject/mantid/issues{/number}","pulls_url":"https://api.github.com/repos/mantidproject/mantid/pulls{/number}","milestones_url":"https://api.github.com/repos/mantidproject/mantid/milestones{/number}","notifications_url":"https://api.github.com/repos/mantidproject/mantid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mantidproject/mantid/labels{/name}","releases_url":"https://api.github.com/repos/mantidproject/mantid/releases{/id}","deployments_url":"https://api.github.com/repos/mantidproject/mantid/deployments","created_at":"2011-10-17T19:07:38Z","updated_at":"2017-09-24T10:34:08Z","pushed_at":"2017-10-25T06:48:37Z","git_url":"git://github.com/mantidproject/mantid.git","ssh_url":"git@github.com:mantidproject/mantid.git","clone_url":"https://github.com/mantidproject/mantid.git","svn_url":"https://github.com/mantidproject/mantid","homepage":"www.mantidproject.org","size":449470,"stargazers_count":63,"watchers_count":63,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":44,"mirror_url":null,"archived":false,"open_issues_count":1671,"forks":44,"open_issues":1671,"watchers":63,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mantidproject/mantid/pulls/20942"},"html":{"href":"https://github.com/mantidproject/mantid/pull/20942"},"issue":{"href":"https://api.github.com/repos/mantidproject/mantid/issues/20942"},"comments":{"href":"https://api.github.com/repos/mantidproject/mantid/issues/20942/comments"},"review_comments":{"href":"https://api.github.com/repos/mantidproject/mantid/pulls/20942/comments"},"review_comment":{"href":"https://api.github.com/repos/mantidproject/mantid/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mantidproject/mantid/pulls/20942/commits"},"statuses":{"href":"https://api.github.com/repos/mantidproject/mantid/statuses/aa4a43ba939865e53d3e236b831666719c583d0f"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"LamarMoore"}}