{"action":"created","issue":{"url":"https://api.github.com/repos/kostrzewa/nyom/issues/2","repository_url":"https://api.github.com/repos/kostrzewa/nyom","labels_url":"https://api.github.com/repos/kostrzewa/nyom/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/kostrzewa/nyom/issues/2/comments","events_url":"https://api.github.com/repos/kostrzewa/nyom/issues/2/events","html_url":"https://github.com/kostrzewa/nyom/issues/2","id":192875992,"number":2,"title":"resulting correlation function seems to be empty","user":{"login":"kostrzewa","id":1325246,"avatar_url":"https://avatars.githubusercontent.com/u/1325246?v=3","gravatar_id":"","url":"https://api.github.com/users/kostrzewa","html_url":"https://github.com/kostrzewa","followers_url":"https://api.github.com/users/kostrzewa/followers","following_url":"https://api.github.com/users/kostrzewa/following{/other_user}","gists_url":"https://api.github.com/users/kostrzewa/gists{/gist_id}","starred_url":"https://api.github.com/users/kostrzewa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kostrzewa/subscriptions","organizations_url":"https://api.github.com/users/kostrzewa/orgs","repos_url":"https://api.github.com/users/kostrzewa/repos","events_url":"https://api.github.com/users/kostrzewa/events{/privacy}","received_events_url":"https://api.github.com/users/kostrzewa/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-12-01T15:24:20Z","updated_at":"2016-12-01T17:11:59Z","closed_at":null,"body":"@solomonik \r\nThanks a lot for getting me started with CTF at the time. Only now have I had the time to take another look at the problem that I want to solve using your framework.\r\n\r\nI have now implemented a sequence of contractions, getting rid of all uses of std::vector, thus using CTF tensors for all indices. This  can now be seen as exemplary for the kind of quantity that we would like to compute in lattice QCD or other distretized Euclidean (or otherwise) field theories.\r\n\r\nhttps://github.com/kostrzewa/nyom/blob/master/benchmarks/bench_ctf/bench_ctf.cpp\r\n\r\nUnfortunately, I've hit a bit of a problem again in that I get what appears to be an empty result vector after all the dust has settled. If you happen to have some time, I would very much appreciate if you could take a look to see if you spot anything obviously wrong.\r\n\r\nThanks a lot in advance!"},"comment":{"url":"https://api.github.com/repos/kostrzewa/nyom/issues/comments/264233141","html_url":"https://github.com/kostrzewa/nyom/issues/2#issuecomment-264233141","issue_url":"https://api.github.com/repos/kostrzewa/nyom/issues/2","id":264233141,"user":{"login":"solomonik","id":2350326,"avatar_url":"https://avatars.githubusercontent.com/u/2350326?v=3","gravatar_id":"","url":"https://api.github.com/users/solomonik","html_url":"https://github.com/solomonik","followers_url":"https://api.github.com/users/solomonik/followers","following_url":"https://api.github.com/users/solomonik/following{/other_user}","gists_url":"https://api.github.com/users/solomonik/gists{/gist_id}","starred_url":"https://api.github.com/users/solomonik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/solomonik/subscriptions","organizations_url":"https://api.github.com/users/solomonik/orgs","repos_url":"https://api.github.com/users/solomonik/repos","events_url":"https://api.github.com/users/solomonik/events{/privacy}","received_events_url":"https://api.github.com/users/solomonik/received_events","type":"User","site_admin":false},"created_at":"2016-12-01T17:11:59Z","updated_at":"2016-12-01T17:11:59Z","body":"Hi Bartosz,\r\n\r\nIt looks like the resulting vector is zero because S2_m2 was not computed (see diff below, not sure if its what was actually intended).  Also, in some places it seems like you should be using += rather than = (the latter will annihilate the previous elements of the tensor rather than accumulate).\r\n\r\nRegarding performance, I think the running time of this code will be dominated by S_tx*Phi_tx for sufficiently large problem sizes.  Indeed even small matrices are distributed by default over all processors, but the library should be smart enough to replicate them as necessary and not communicate the bigger tensors during a contraction.  Although it might transpose them locally in some cases, so the performance of a contraction with a small tensor will not necessarily be near peak (but scalability should be good).  Regardless though, if you have a larger contraction like S_tx*Phi_tx, it should dominate the execution time anyway and be executed more efficiently within CTF.\r\n\r\ndiff --git a/benchmarks/bench_ctf/bench_ctf.cpp b/benchmarks/bench_ctf/bench_ctf.cpp\r\nindex 371d9f6..a1f4a39 100644\r\n--- a/benchmarks/bench_ctf/bench_ctf.cpp\r\n+++ b/benchmarks/bench_ctf/bench_ctf.cpp\r\n@@ -159,8 +159,8 @@ int main(int argc, char ** argv) {\r\n   S1_m1[\"txyzfgjkab\"] = Tshift_m1[\"tT\"]*S1[\"Txyzfgjkab\"];\r\n   S1_m1[\"txyzfgjkab\"] = Tshift_m1[\"tT\"]*S2[\"Txyzfgjkab\"];\r\n \r\n-  S1_m2[\"txyzfgjkab\"] = Tshift_m2[\"tT\"]*S1[\"Txyzfgjkab\"];\r\n-  S1_m2[\"txyzfgjkab\"] = Tshift_m2[\"tT\"]*S2[\"Txyzfgjkab\"];\r\n+  S2_m2[\"txyzfgjkab\"] = Tshift_m2[\"tT\"]*S1[\"Txyzfgjkab\"];\r\n+  S2_m2[\"txyzfgjkab\"] = Tshift_m2[\"tT\"]*S2[\"Txyzfgjkab\"];\r\n \r\n   // now construct gamma^0\r\n   g0.read_local(&npair, &indices, &pairs);\r\n"}}
{"actor":{"display_login":"solomonik"}}