{"action":"opened","issue":{"url":"https://api.github.com/repos/ornladios/ADIOS2/issues/576","repository_url":"https://api.github.com/repos/ornladios/ADIOS2","labels_url":"https://api.github.com/repos/ornladios/ADIOS2/issues/576/labels{/name}","comments_url":"https://api.github.com/repos/ornladios/ADIOS2/issues/576/comments","events_url":"https://api.github.com/repos/ornladios/ADIOS2/issues/576/events","html_url":"https://github.com/ornladios/ADIOS2/issues/576","id":316979322,"number":576,"title":"Fortran to C dimensions swapping not handled in SST","user":{"login":"pnorbert","id":3247149,"avatar_url":"https://avatars1.githubusercontent.com/u/3247149?v=4","gravatar_id":"","url":"https://api.github.com/users/pnorbert","html_url":"https://github.com/pnorbert","followers_url":"https://api.github.com/users/pnorbert/followers","following_url":"https://api.github.com/users/pnorbert/following{/other_user}","gists_url":"https://api.github.com/users/pnorbert/gists{/gist_id}","starred_url":"https://api.github.com/users/pnorbert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pnorbert/subscriptions","organizations_url":"https://api.github.com/users/pnorbert/orgs","repos_url":"https://api.github.com/users/pnorbert/repos","events_url":"https://api.github.com/users/pnorbert/events{/privacy}","received_events_url":"https://api.github.com/users/pnorbert/received_events","type":"User","site_admin":false},"labels":[{"id":495673065,"url":"https://api.github.com/repos/ornladios/ADIOS2/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"open","locked":false,"assignee":{"login":"eisenhauer","id":941977,"avatar_url":"https://avatars0.githubusercontent.com/u/941977?v=4","gravatar_id":"","url":"https://api.github.com/users/eisenhauer","html_url":"https://github.com/eisenhauer","followers_url":"https://api.github.com/users/eisenhauer/followers","following_url":"https://api.github.com/users/eisenhauer/following{/other_user}","gists_url":"https://api.github.com/users/eisenhauer/gists{/gist_id}","starred_url":"https://api.github.com/users/eisenhauer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eisenhauer/subscriptions","organizations_url":"https://api.github.com/users/eisenhauer/orgs","repos_url":"https://api.github.com/users/eisenhauer/repos","events_url":"https://api.github.com/users/eisenhauer/events{/privacy}","received_events_url":"https://api.github.com/users/eisenhauer/received_events","type":"User","site_admin":false},"assignees":[{"login":"eisenhauer","id":941977,"avatar_url":"https://avatars0.githubusercontent.com/u/941977?v=4","gravatar_id":"","url":"https://api.github.com/users/eisenhauer","html_url":"https://github.com/eisenhauer","followers_url":"https://api.github.com/users/eisenhauer/followers","following_url":"https://api.github.com/users/eisenhauer/following{/other_user}","gists_url":"https://api.github.com/users/eisenhauer/gists{/gist_id}","starred_url":"https://api.github.com/users/eisenhauer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eisenhauer/subscriptions","organizations_url":"https://api.github.com/users/eisenhauer/orgs","repos_url":"https://api.github.com/users/eisenhauer/repos","events_url":"https://api.github.com/users/eisenhauer/events{/privacy}","received_events_url":"https://api.github.com/users/eisenhauer/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2018-04-23T20:54:43Z","updated_at":"2018-04-23T20:54:43Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"In a Fortran to C staging, the C reader should get the dimensions in C order, because that's how it uses the read selections, then the actual reads should be converted back to Fortran dimension order. \r\n\r\nTo recreate the problem, use adiosvm Tutorial/heat2d which has Fortran and C++ codes. In fortran/ directory, edit adios2.xml to use BPFile or SST for the SimulationOutput as needed.\r\n\r\nBPFile run:\r\n```\r\nTutorial/heat2d/fortran$ mpirun -n 1 ./simulation/heatSimulation_adios2 sim 1 1 4 5   1 1 \r\nUsing BPFile engine for output\r\nProcess decomposition  : 1 x 1\r\nArray size per process : 4 x 5\r\nNumber of output steps : 1\r\nIterations per step    : 1\r\nSimulation step    0: initialization\r\nTotal runtime =  0.002s\r\n```\r\n\r\nNotice that the Fortran array size is 4 x 5. bpls, as a C tool, will show you this in C order, i.e., 5 x 4\r\n\r\n```\r\nTutorial/heat2d/fortran$ bpls -D sim.bp T\r\n  double   T     {5, 4}\r\n        step 0: \r\n          block 0: [0:4, 0:3]\r\n```\r\n\r\nRun the analysis C++ code:\r\n```\r\nTutorial/heat2d/fortran$ mpirun -n 1 ../cpp/heatAnalysis sim.bp a.bp 1 1\r\nUsing BPFile engine for input\r\nUsing BPFile engine for output\r\ngndx       = 5\r\ngndy       = 4\r\nrank 0 reads 2D slice 5 x 4 from offset (0,0)\r\nAnalysis step 0 processing simulation step 0\r\n\r\nTutorial/heat2d/fortran$ bpls -D a.bp \r\n  double   T     {5, 4}\r\n        step 0: \r\n          block 0: [0:4, 0:3]\r\n  double   dT    {5, 4}\r\n        step 0: \r\n          block 0: [0:4, 0:3]\r\n\r\n```\r\nNotice that the reader sees a 5 x 4 array and reads accordingly, then writes out a 5 x 4 C array to the a.bp file. \r\n\r\nSST run (use SST for SimulationOutput in adios2.xml)\r\n```\r\nTutorial/heat2d/fortran$ mpirun -n 1 ./simulation/heatSimulation_adios2 sim 1 1 4 5 1 1 : -n 1 ../cpp/heatAnalysis sim.bp sst.bp 1 1\r\nUsing SST engine for output\r\nProcess decomposition  : 1 x 1\r\nUsing SST engine for input\r\nUsing BPFile engine for output\r\nArray size per process : 4 x 5\r\nNumber of output steps : 1\r\nIterations per step    : 1\r\nSimulation step    0: initialization\r\ngndx       = 4\r\ngndy       = 5\r\nrank 0 reads 2D slice 4 x 5 from offset (0,0)\r\nAnalysis step 0 processing simulation step 0\r\nTotal runtime =  0.073s\r\n```\r\n\r\nNotice that the C++ reader thinks it reads a 4 x 5 array, but C readers should see 5 x 4.  The output of the C++ application has the wrong order:\r\n\r\n```\r\nTutorial/heat2d/fortran$ bpls -D sst.bp T\r\n  double   T     {4, 5}\r\n        step 0: \r\n          block 0: [0:3, 0:4]\r\n```"}}
{"actor":{"display_login":"pnorbert"}}