{"action":"created","comment":{"url":"https://api.github.com/repos/Parallel-in-Time/PFASST/pulls/comments/38125847","id":38125847,"diff_hunk":"@@ -1,49 +1,173 @@\n #include \"pfasst/controller/sdc.hpp\"\n \n+#include <stdexcept>\n+using namespace std;\n+\n+#include \"pfasst/util.hpp\"\n+#include \"pfasst/config.hpp\"\n+#include \"pfasst/logging.hpp\"\n+\n \n namespace pfasst\n {\n-  /**\n-   * For each time step at most a total of Controller::get_max_iterations() iterations will be done\n-   * on the configured sweeper (which happens to be the only in Controller::levels).\n-   *\n-   * On the first iteration on a time step, ISweeper::predict() will get called and\n-   * ISweeper::sweep() on all subsequent iterations on the same time step.\n-   * After each ISweeper::post_predict() or ISweeper::post_sweep() call ISweeper::converged() will\n-   * get checked to shortcut the iterations.\n-   * The next iteration is introduced by Controller::advance_iteration().\n-   *\n-   * Once the maximum number of iterations is reached (or the sweeper has converged before) that,\n-   * the ISweeper::post_step() hook is triggered followed by ISweeper::advance() to complete the\n-   * time step and advance to the next via Controller::advance_time() until Controller::get_time()\n-   * is equal or greater Controller::get_end_time().\n-   */\n-  template<typename time>\n-  void SDC<time>::run()\n-  {\n-    auto sweeper = this->get_level(0);\n-\n-    for (; this->get_time() < this->get_end_time(); this->advance_time()) {\n-      bool initial = this->get_step() == 0;\n-      for (this->set_iteration(0);\n-           this->get_iteration() < this->get_max_iterations();\n-           this->advance_iteration()) {\n-        bool predict = this->get_iteration() == 0;\n-        if (predict) {\n-          sweeper->predict(initial);\n-          sweeper->post_predict();\n+  template<class TransferT>\n+  SDC<TransferT>::SDC()\n+    : Controller<TransferT>()\n+  {\n+    SDC<TransferT>::init_loggers();\n+    this->set_logger_id(\"SDC\");\n+  }\n+\n+  template<class TransferT>\n+  void\n+  SDC<TransferT>::init_loggers()\n+  {\n+    log::add_custom_logger(\"SDC\");\n+  }\n+\n+  template<class TransferT>\n+  size_t\n+  SDC<TransferT>::get_num_levels() const\n+  {\n+    return ((this->_sweeper != nullptr) ? 1 : 0);\n+  }\n+\n+  template<class TransferT>\n+  template<class SweeperT>\n+  void\n+  SDC<TransferT>::add_sweeper(shared_ptr<SweeperT> sweeper, const bool as_coarse)\n+  {\n+    UNUSED(as_coarse);\n+    this->add_sweeper(sweeper);\n+  }\n+\n+  template<class TransferT>\n+  template<class SweeperT>\n+  void\n+  SDC<TransferT>::add_sweeper(shared_ptr<SweeperT> sweeper)\n+  {\n+    static_assert(is_same<SweeperT, typename TransferT::traits::fine_sweeper_type>::value,\n+                  \"Sweeper must be a Fine Sweeper Type.\");\n+\n+    this->_sweeper = sweeper;\n+  }\n+\n+  template<class TransferT>\n+  void\n+  SDC<TransferT>::add_transfer(shared_ptr<TransferT> transfer)\n+  {","path":"src/pfasst/controller/sdc_impl.hpp","position":87,"original_position":87,"commit_id":"7f5d131dfaab752c9dd95d28ad9975158eb9f969","original_commit_id":"7f5d131dfaab752c9dd95d28ad9975158eb9f969","user":{"login":"torbjoernk","id":1336965,"avatar_url":"https://avatars.githubusercontent.com/u/1336965?v=3","gravatar_id":"","url":"https://api.github.com/users/torbjoernk","html_url":"https://github.com/torbjoernk","followers_url":"https://api.github.com/users/torbjoernk/followers","following_url":"https://api.github.com/users/torbjoernk/following{/other_user}","gists_url":"https://api.github.com/users/torbjoernk/gists{/gist_id}","starred_url":"https://api.github.com/users/torbjoernk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/torbjoernk/subscriptions","organizations_url":"https://api.github.com/users/torbjoernk/orgs","repos_url":"https://api.github.com/users/torbjoernk/repos","events_url":"https://api.github.com/users/torbjoernk/events{/privacy}","received_events_url":"https://api.github.com/users/torbjoernk/received_events","type":"User","site_admin":false},"body":"Correct. Will fix that.","created_at":"2015-08-27T17:59:11Z","updated_at":"2015-08-27T17:59:11Z","html_url":"https://github.com/Parallel-in-Time/PFASST/pull/220#discussion_r38125847","pull_request_url":"https://api.github.com/repos/Parallel-in-Time/PFASST/pulls/220","_links":{"self":{"href":"https://api.github.com/repos/Parallel-in-Time/PFASST/pulls/comments/38125847"},"html":{"href":"https://github.com/Parallel-in-Time/PFASST/pull/220#discussion_r38125847"},"pull_request":{"href":"https://api.github.com/repos/Parallel-in-Time/PFASST/pulls/220"}}},"pull_request":{"url":"https://api.github.com/repos/Parallel-in-Time/PFASST/pulls/220","id":43487809,"html_url":"https://github.com/Parallel-in-Time/PFASST/pull/220","diff_url":"https://github.com/Parallel-in-Time/PFASST/pull/220.diff","patch_url":"https://github.com/Parallel-in-Time/PFASST/pull/220.patch","issue_url":"https://api.github.com/repos/Parallel-in-Time/PFASST/issues/220","number":220,"state":"open","locked":false,"title":"Complete Rewrite of PFASST++","user":{"login":"torbjoernk","id":1336965,"avatar_url":"https://avatars.githubusercontent.com/u/1336965?v=3","gravatar_id":"","url":"https://api.github.com/users/torbjoernk","html_url":"https://github.com/torbjoernk","followers_url":"https://api.github.com/users/torbjoernk/followers","following_url":"https://api.github.com/users/torbjoernk/following{/other_user}","gists_url":"https://api.github.com/users/torbjoernk/gists{/gist_id}","starred_url":"https://api.github.com/users/torbjoernk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/torbjoernk/subscriptions","organizations_url":"https://api.github.com/users/torbjoernk/orgs","repos_url":"https://api.github.com/users/torbjoernk/repos","events_url":"https://api.github.com/users/torbjoernk/events{/privacy}","received_events_url":"https://api.github.com/users/torbjoernk/received_events","type":"User","site_admin":false},"body":"This is a complete rewrite of PFASST++.\r\n\r\nThe main reasons for this effort are:\r\n* unreliable behaviour on larger parallel runs (np > 8)\r\n* unsafe usage of `dynamic_pointer_cast` as a result of unnecessary dynamic polymorphism\r\n\r\nBoth things bugged be a lot and I sat down to redesign the whole library from scratch. That was not possible without using a few more template expressions.\r\n\r\nThe current state of the rewritten library is almost where we were with v0.5.0.\r\n- [x] Advection-Diffusion example\r\n- [x] a new purely diffusive Heat-1D example (almost identical to AdvecDiff)\r\n- [x] a lot more test cases\r\n- [x] more flexible logging capabilities including readable distinction of fine and coarse sweeper in MLSDC runs\r\n- [x] simple CMake parameter to instrument the MPI builds with Score-P\r\n\r\nA few ToDos will be tackled in the near future:\r\n- [ ] get the documentation up to date\r\n- [ ] adjust and test quadrature\r\n- [ ] implement convergence tests for IMEX sweeper\r\n- [ ] re-implement a purely implicit sweeper\r\n- [ ] get back on the big machines after bugging the sysadmins to get appropriate software working\r\n\r\nThanks to @f-koehler for dealing with some nasty CMake stuff.\n\n<!-- Reviewable:start -->\n[<img src=\"https://reviewable.io/review_button.png\" height=40 alt=\"Review on Reviewable\"/>](https://reviewable.io/reviews/parallel-in-time/pfasst/220)\n<!-- Reviewable:end -->\n","created_at":"2015-08-27T07:42:09Z","updated_at":"2015-08-27T17:59:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"96cc8a3cf473686cab50c1a7a9c8404729b58469","assignee":null,"milestone":{"url":"https://api.github.com/repos/Parallel-in-Time/PFASST/milestones/7","html_url":"https://github.com/Parallel-in-Time/PFASST/milestones/Polishing%20Rewritten%20Library%20(v0.90.0)","labels_url":"https://api.github.com/repos/Parallel-in-Time/PFASST/milestones/7/labels","id":1275442,"number":7,"title":"Polishing Rewritten Library (v0.90.0)","description":"","creator":{"login":"torbjoernk","id":1336965,"avatar_url":"https://avatars.githubusercontent.com/u/1336965?v=3","gravatar_id":"","url":"https://api.github.com/users/torbjoernk","html_url":"https://github.com/torbjoernk","followers_url":"https://api.github.com/users/torbjoernk/followers","following_url":"https://api.github.com/users/torbjoernk/following{/other_user}","gists_url":"https://api.github.com/users/torbjoernk/gists{/gist_id}","starred_url":"https://api.github.com/users/torbjoernk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/torbjoernk/subscriptions","organizations_url":"https://api.github.com/users/torbjoernk/orgs","repos_url":"https://api.github.com/users/torbjoernk/repos","events_url":"https://api.github.com/users/torbjoernk/events{/privacy}","received_events_url":"https://api.github.com/users/torbjoernk/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":0,"state":"open","created_at":"2015-08-27T07:42:51Z","updated_at":"2015-08-27T07:43:02Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/Parallel-in-Time/PFASST/pulls/220/commits","review_comments_url":"https://api.github.com/repos/Parallel-in-Time/PFASST/pulls/220/comments","review_comment_url":"https://api.github.com/repos/Parallel-in-Time/PFASST/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Parallel-in-Time/PFASST/issues/220/comments","statuses_url":"https://api.github.com/repos/Parallel-in-Time/PFASST/statuses/7f5d131dfaab752c9dd95d28ad9975158eb9f969","head":{"label":"torbjoernk:feature/complete-rewrite","ref":"feature/complete-rewrite","sha":"7f5d131dfaab752c9dd95d28ad9975158eb9f969","user":{"login":"torbjoernk","id":1336965,"avatar_url":"https://avatars.githubusercontent.com/u/1336965?v=3","gravatar_id":"","url":"https://api.github.com/users/torbjoernk","html_url":"https://github.com/torbjoernk","followers_url":"https://api.github.com/users/torbjoernk/followers","following_url":"https://api.github.com/users/torbjoernk/following{/other_user}","gists_url":"https://api.github.com/users/torbjoernk/gists{/gist_id}","starred_url":"https://api.github.com/users/torbjoernk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/torbjoernk/subscriptions","organizations_url":"https://api.github.com/users/torbjoernk/orgs","repos_url":"https://api.github.com/users/torbjoernk/repos","events_url":"https://api.github.com/users/torbjoernk/events{/privacy}","received_events_url":"https://api.github.com/users/torbjoernk/received_events","type":"User","site_admin":false},"repo":{"id":20109754,"name":"PFASST","full_name":"torbjoernk/PFASST","owner":{"login":"torbjoernk","id":1336965,"avatar_url":"https://avatars.githubusercontent.com/u/1336965?v=3","gravatar_id":"","url":"https://api.github.com/users/torbjoernk","html_url":"https://github.com/torbjoernk","followers_url":"https://api.github.com/users/torbjoernk/followers","following_url":"https://api.github.com/users/torbjoernk/following{/other_user}","gists_url":"https://api.github.com/users/torbjoernk/gists{/gist_id}","starred_url":"https://api.github.com/users/torbjoernk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/torbjoernk/subscriptions","organizations_url":"https://api.github.com/users/torbjoernk/orgs","repos_url":"https://api.github.com/users/torbjoernk/repos","events_url":"https://api.github.com/users/torbjoernk/events{/privacy}","received_events_url":"https://api.github.com/users/torbjoernk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/torbjoernk/PFASST","description":"C++ PFASST","fork":true,"url":"https://api.github.com/repos/torbjoernk/PFASST","forks_url":"https://api.github.com/repos/torbjoernk/PFASST/forks","keys_url":"https://api.github.com/repos/torbjoernk/PFASST/keys{/key_id}","collaborators_url":"https://api.github.com/repos/torbjoernk/PFASST/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/torbjoernk/PFASST/teams","hooks_url":"https://api.github.com/repos/torbjoernk/PFASST/hooks","issue_events_url":"https://api.github.com/repos/torbjoernk/PFASST/issues/events{/number}","events_url":"https://api.github.com/repos/torbjoernk/PFASST/events","assignees_url":"https://api.github.com/repos/torbjoernk/PFASST/assignees{/user}","branches_url":"https://api.github.com/repos/torbjoernk/PFASST/branches{/branch}","tags_url":"https://api.github.com/repos/torbjoernk/PFASST/tags","blobs_url":"https://api.github.com/repos/torbjoernk/PFASST/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/torbjoernk/PFASST/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/torbjoernk/PFASST/git/refs{/sha}","trees_url":"https://api.github.com/repos/torbjoernk/PFASST/git/trees{/sha}","statuses_url":"https://api.github.com/repos/torbjoernk/PFASST/statuses/{sha}","languages_url":"https://api.github.com/repos/torbjoernk/PFASST/languages","stargazers_url":"https://api.github.com/repos/torbjoernk/PFASST/stargazers","contributors_url":"https://api.github.com/repos/torbjoernk/PFASST/contributors","subscribers_url":"https://api.github.com/repos/torbjoernk/PFASST/subscribers","subscription_url":"https://api.github.com/repos/torbjoernk/PFASST/subscription","commits_url":"https://api.github.com/repos/torbjoernk/PFASST/commits{/sha}","git_commits_url":"https://api.github.com/repos/torbjoernk/PFASST/git/commits{/sha}","comments_url":"https://api.github.com/repos/torbjoernk/PFASST/comments{/number}","issue_comment_url":"https://api.github.com/repos/torbjoernk/PFASST/issues/comments{/number}","contents_url":"https://api.github.com/repos/torbjoernk/PFASST/contents/{+path}","compare_url":"https://api.github.com/repos/torbjoernk/PFASST/compare/{base}...{head}","merges_url":"https://api.github.com/repos/torbjoernk/PFASST/merges","archive_url":"https://api.github.com/repos/torbjoernk/PFASST/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/torbjoernk/PFASST/downloads","issues_url":"https://api.github.com/repos/torbjoernk/PFASST/issues{/number}","pulls_url":"https://api.github.com/repos/torbjoernk/PFASST/pulls{/number}","milestones_url":"https://api.github.com/repos/torbjoernk/PFASST/milestones{/number}","notifications_url":"https://api.github.com/repos/torbjoernk/PFASST/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/torbjoernk/PFASST/labels{/name}","releases_url":"https://api.github.com/repos/torbjoernk/PFASST/releases{/id}","created_at":"2014-05-23T18:28:09Z","updated_at":"2015-08-27T06:56:13Z","pushed_at":"2015-08-27T14:05:16Z","git_url":"git://github.com/torbjoernk/PFASST.git","ssh_url":"git@github.com:torbjoernk/PFASST.git","clone_url":"https://github.com/torbjoernk/PFASST.git","svn_url":"https://github.com/torbjoernk/PFASST","homepage":null,"size":6295,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Parallel-in-Time:development","ref":"development","sha":"6edd80f6b4a8576806cb075973172edd6c184941","user":{"login":"Parallel-in-Time","id":7485951,"avatar_url":"https://avatars.githubusercontent.com/u/7485951?v=3","gravatar_id":"","url":"https://api.github.com/users/Parallel-in-Time","html_url":"https://github.com/Parallel-in-Time","followers_url":"https://api.github.com/users/Parallel-in-Time/followers","following_url":"https://api.github.com/users/Parallel-in-Time/following{/other_user}","gists_url":"https://api.github.com/users/Parallel-in-Time/gists{/gist_id}","starred_url":"https://api.github.com/users/Parallel-in-Time/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Parallel-in-Time/subscriptions","organizations_url":"https://api.github.com/users/Parallel-in-Time/orgs","repos_url":"https://api.github.com/users/Parallel-in-Time/repos","events_url":"https://api.github.com/users/Parallel-in-Time/events{/privacy}","received_events_url":"https://api.github.com/users/Parallel-in-Time/received_events","type":"Organization","site_admin":false},"repo":{"id":20095204,"name":"PFASST","full_name":"Parallel-in-Time/PFASST","owner":{"login":"Parallel-in-Time","id":7485951,"avatar_url":"https://avatars.githubusercontent.com/u/7485951?v=3","gravatar_id":"","url":"https://api.github.com/users/Parallel-in-Time","html_url":"https://github.com/Parallel-in-Time","followers_url":"https://api.github.com/users/Parallel-in-Time/followers","following_url":"https://api.github.com/users/Parallel-in-Time/following{/other_user}","gists_url":"https://api.github.com/users/Parallel-in-Time/gists{/gist_id}","starred_url":"https://api.github.com/users/Parallel-in-Time/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Parallel-in-Time/subscriptions","organizations_url":"https://api.github.com/users/Parallel-in-Time/orgs","repos_url":"https://api.github.com/users/Parallel-in-Time/repos","events_url":"https://api.github.com/users/Parallel-in-Time/events{/privacy}","received_events_url":"https://api.github.com/users/Parallel-in-Time/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Parallel-in-Time/PFASST","description":"PFASST++ is a C++ implementation of the \"parallel full approximation scheme in space and time\" (PFASST) algorithm","fork":false,"url":"https://api.github.com/repos/Parallel-in-Time/PFASST","forks_url":"https://api.github.com/repos/Parallel-in-Time/PFASST/forks","keys_url":"https://api.github.com/repos/Parallel-in-Time/PFASST/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Parallel-in-Time/PFASST/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Parallel-in-Time/PFASST/teams","hooks_url":"https://api.github.com/repos/Parallel-in-Time/PFASST/hooks","issue_events_url":"https://api.github.com/repos/Parallel-in-Time/PFASST/issues/events{/number}","events_url":"https://api.github.com/repos/Parallel-in-Time/PFASST/events","assignees_url":"https://api.github.com/repos/Parallel-in-Time/PFASST/assignees{/user}","branches_url":"https://api.github.com/repos/Parallel-in-Time/PFASST/branches{/branch}","tags_url":"https://api.github.com/repos/Parallel-in-Time/PFASST/tags","blobs_url":"https://api.github.com/repos/Parallel-in-Time/PFASST/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Parallel-in-Time/PFASST/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Parallel-in-Time/PFASST/git/refs{/sha}","trees_url":"https://api.github.com/repos/Parallel-in-Time/PFASST/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Parallel-in-Time/PFASST/statuses/{sha}","languages_url":"https://api.github.com/repos/Parallel-in-Time/PFASST/languages","stargazers_url":"https://api.github.com/repos/Parallel-in-Time/PFASST/stargazers","contributors_url":"https://api.github.com/repos/Parallel-in-Time/PFASST/contributors","subscribers_url":"https://api.github.com/repos/Parallel-in-Time/PFASST/subscribers","subscription_url":"https://api.github.com/repos/Parallel-in-Time/PFASST/subscription","commits_url":"https://api.github.com/repos/Parallel-in-Time/PFASST/commits{/sha}","git_commits_url":"https://api.github.com/repos/Parallel-in-Time/PFASST/git/commits{/sha}","comments_url":"https://api.github.com/repos/Parallel-in-Time/PFASST/comments{/number}","issue_comment_url":"https://api.github.com/repos/Parallel-in-Time/PFASST/issues/comments{/number}","contents_url":"https://api.github.com/repos/Parallel-in-Time/PFASST/contents/{+path}","compare_url":"https://api.github.com/repos/Parallel-in-Time/PFASST/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Parallel-in-Time/PFASST/merges","archive_url":"https://api.github.com/repos/Parallel-in-Time/PFASST/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Parallel-in-Time/PFASST/downloads","issues_url":"https://api.github.com/repos/Parallel-in-Time/PFASST/issues{/number}","pulls_url":"https://api.github.com/repos/Parallel-in-Time/PFASST/pulls{/number}","milestones_url":"https://api.github.com/repos/Parallel-in-Time/PFASST/milestones{/number}","notifications_url":"https://api.github.com/repos/Parallel-in-Time/PFASST/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Parallel-in-Time/PFASST/labels{/name}","releases_url":"https://api.github.com/repos/Parallel-in-Time/PFASST/releases{/id}","created_at":"2014-05-23T10:08:41Z","updated_at":"2015-07-11T22:05:25Z","pushed_at":"2015-08-27T14:04:54Z","git_url":"git://github.com/Parallel-in-Time/PFASST.git","ssh_url":"git@github.com:Parallel-in-Time/PFASST.git","clone_url":"https://github.com/Parallel-in-Time/PFASST.git","svn_url":"https://github.com/Parallel-in-Time/PFASST","homepage":"","size":6540,"stargazers_count":8,"watchers_count":8,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":13,"forks":8,"open_issues":13,"watchers":8,"default_branch":"development"}},"_links":{"self":{"href":"https://api.github.com/repos/Parallel-in-Time/PFASST/pulls/220"},"html":{"href":"https://github.com/Parallel-in-Time/PFASST/pull/220"},"issue":{"href":"https://api.github.com/repos/Parallel-in-Time/PFASST/issues/220"},"comments":{"href":"https://api.github.com/repos/Parallel-in-Time/PFASST/issues/220/comments"},"review_comments":{"href":"https://api.github.com/repos/Parallel-in-Time/PFASST/pulls/220/comments"},"review_comment":{"href":"https://api.github.com/repos/Parallel-in-Time/PFASST/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Parallel-in-Time/PFASST/pulls/220/commits"},"statuses":{"href":"https://api.github.com/repos/Parallel-in-Time/PFASST/statuses/7f5d131dfaab752c9dd95d28ad9975158eb9f969"}}}}