Distribute 2D array row wise among Locales in Chapel












5














I am learning Chapel and have worked with blockdist but I can't figure out how can I distribute a 2-dimension array in row wise fashion among locales.










share|improve this question



























    5














    I am learning Chapel and have worked with blockdist but I can't figure out how can I distribute a 2-dimension array in row wise fashion among locales.










    share|improve this question

























      5












      5








      5







      I am learning Chapel and have worked with blockdist but I can't figure out how can I distribute a 2-dimension array in row wise fashion among locales.










      share|improve this question













      I am learning Chapel and have worked with blockdist but I can't figure out how can I distribute a 2-dimension array in row wise fashion among locales.







      chapel






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 19 '18 at 6:17









      Robin Sharma

      606




      606
























          1 Answer
          1






          active

          oldest

          votes


















          4














          The key is to pass a reshaped Locales array as the targetLocales argument to Block. This is explained further below.



          Here's a simple example of distributing a 2D array in a row-wise fashion:



          use BlockDist;

          // Using a 2D targetLocales rather than the default 1D Locales argument
          var targetLocales = reshape(Locales, {0..#numLocales, 0..0});

          const Space = {1..4, 1..4};
          const D: domain(2) dmapped Block(boundingBox=Space, targetLocales=targetLocales) = Space;
          var A: [D] int;

          forall a in A do
          a = a.locale.id;

          writeln(A);


          Sample outputs:



           ./row-wise -nl 4

          0 0 0 0
          1 1 1 1
          2 2 2 2
          3 3 3 3

          ./row-wise -nl 2

          0 0 0 0
          0 0 0 0
          1 1 1 1
          1 1 1 1


          By default, distributions will use the built-in Locales array as the targetLocales argument, which specifies how to paritition the elements of an array across the locales within a particular domain map, e.g. Block.



          Since Locales is a 1D array, and you're distributing a 2D array, the Block distribution wraps Locales like so:



          1D targetLocales:

          0 1 2 3 -> 0 1
          2 3


          So an array of shape (4,4) would get mapped to 4 locales as:



            0 0 1 1
          0 0 1 1
          2 2 3 3
          2 2 3 3


          By providing a 2D targetLocales argument, we can tell Block explicitly how we'd like the elements to be mapped to locales, rather than rely on the wrapping. Passing a targetLocales array of locales with a shape of (4,1), will result in the desired row-wise distribution:



          2D targetLocales:

          0
          1
          2
          3


          So an array of shape (4,4) would get mapped to 4 locales as:



           0 0 0 0
          1 1 1 1
          2 2 2 2
          3 3 3 3


          This concept applies to other distributions as well.






          share|improve this answer





















          • Dear Ben, thank you for the explanation. I understand it very well now. I have one more question to ask regarding figuring out the range of indices for on locales. I tried below thing: I took a 10x10 array and experiment with distributing it over locals from range of 1 to 10. But unlike MPI, I can't find a fix pattern for range of indices which can be calculated on each locale.
            – Robin Sharma
            Nov 23 '18 at 4:28










          • For #locales = 2 pattern was 5 rows on locale - 1, 5 rows on locale - 2, #locales = 3 pattern was 4 rows on locale - 1, 3 rows on locale - 2, 3 rows on locale - 3, #locales = 4 pattern was 3 rows on locale - 1, 2 rows on locale - 2, 3 rows on locale - 3, 2 rows on locale - 4, #locales = 8 pattern was 2 rows on locale - 1, 1 row on locale - 2, 1 row on locale - 3, 1 row on locale - 4, 2 rows on locale - 5, 1 row on locale - 6, 1 row on locale - 7, 1 row on locale - 8. The pattern changes as the #locales increases.
            – Robin Sharma
            Nov 23 '18 at 4:28










          • I am very much used to of the MPI so I was wondering if there is a way I can decide on that I want to distribute all the array rows among locales as in #rows / #locales and the remaining rows on the last locales. Any pointers in this direction will be much appreciated. thanks
            – Robin Sharma
            Nov 23 '18 at 4:28










          • its there a build in function which can provide me the index of first and last row index mapped to a locale? I am trying to implement stencil program for multi locale using local memory.
            – Robin Sharma
            Nov 23 '18 at 5:11










          • Hi Robin - For fine grained control of the distribution of rows to locales, you can make your targetLocales be Nx1 for an NxN matrix, instead of numLocales x 1. This way, you can explicitly set the locale for each row. The RangeChunk library provides some library functions for chunking up the elements automatically with a few different remainder policies: chapel-lang.org/docs/modules/packages/RangeChunk.html
            – bencray
            Nov 24 '18 at 16:10











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53369244%2fdistribute-2d-array-row-wise-among-locales-in-chapel%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          4














          The key is to pass a reshaped Locales array as the targetLocales argument to Block. This is explained further below.



          Here's a simple example of distributing a 2D array in a row-wise fashion:



          use BlockDist;

          // Using a 2D targetLocales rather than the default 1D Locales argument
          var targetLocales = reshape(Locales, {0..#numLocales, 0..0});

          const Space = {1..4, 1..4};
          const D: domain(2) dmapped Block(boundingBox=Space, targetLocales=targetLocales) = Space;
          var A: [D] int;

          forall a in A do
          a = a.locale.id;

          writeln(A);


          Sample outputs:



           ./row-wise -nl 4

          0 0 0 0
          1 1 1 1
          2 2 2 2
          3 3 3 3

          ./row-wise -nl 2

          0 0 0 0
          0 0 0 0
          1 1 1 1
          1 1 1 1


          By default, distributions will use the built-in Locales array as the targetLocales argument, which specifies how to paritition the elements of an array across the locales within a particular domain map, e.g. Block.



          Since Locales is a 1D array, and you're distributing a 2D array, the Block distribution wraps Locales like so:



          1D targetLocales:

          0 1 2 3 -> 0 1
          2 3


          So an array of shape (4,4) would get mapped to 4 locales as:



            0 0 1 1
          0 0 1 1
          2 2 3 3
          2 2 3 3


          By providing a 2D targetLocales argument, we can tell Block explicitly how we'd like the elements to be mapped to locales, rather than rely on the wrapping. Passing a targetLocales array of locales with a shape of (4,1), will result in the desired row-wise distribution:



          2D targetLocales:

          0
          1
          2
          3


          So an array of shape (4,4) would get mapped to 4 locales as:



           0 0 0 0
          1 1 1 1
          2 2 2 2
          3 3 3 3


          This concept applies to other distributions as well.






          share|improve this answer





















          • Dear Ben, thank you for the explanation. I understand it very well now. I have one more question to ask regarding figuring out the range of indices for on locales. I tried below thing: I took a 10x10 array and experiment with distributing it over locals from range of 1 to 10. But unlike MPI, I can't find a fix pattern for range of indices which can be calculated on each locale.
            – Robin Sharma
            Nov 23 '18 at 4:28










          • For #locales = 2 pattern was 5 rows on locale - 1, 5 rows on locale - 2, #locales = 3 pattern was 4 rows on locale - 1, 3 rows on locale - 2, 3 rows on locale - 3, #locales = 4 pattern was 3 rows on locale - 1, 2 rows on locale - 2, 3 rows on locale - 3, 2 rows on locale - 4, #locales = 8 pattern was 2 rows on locale - 1, 1 row on locale - 2, 1 row on locale - 3, 1 row on locale - 4, 2 rows on locale - 5, 1 row on locale - 6, 1 row on locale - 7, 1 row on locale - 8. The pattern changes as the #locales increases.
            – Robin Sharma
            Nov 23 '18 at 4:28










          • I am very much used to of the MPI so I was wondering if there is a way I can decide on that I want to distribute all the array rows among locales as in #rows / #locales and the remaining rows on the last locales. Any pointers in this direction will be much appreciated. thanks
            – Robin Sharma
            Nov 23 '18 at 4:28










          • its there a build in function which can provide me the index of first and last row index mapped to a locale? I am trying to implement stencil program for multi locale using local memory.
            – Robin Sharma
            Nov 23 '18 at 5:11










          • Hi Robin - For fine grained control of the distribution of rows to locales, you can make your targetLocales be Nx1 for an NxN matrix, instead of numLocales x 1. This way, you can explicitly set the locale for each row. The RangeChunk library provides some library functions for chunking up the elements automatically with a few different remainder policies: chapel-lang.org/docs/modules/packages/RangeChunk.html
            – bencray
            Nov 24 '18 at 16:10
















          4














          The key is to pass a reshaped Locales array as the targetLocales argument to Block. This is explained further below.



          Here's a simple example of distributing a 2D array in a row-wise fashion:



          use BlockDist;

          // Using a 2D targetLocales rather than the default 1D Locales argument
          var targetLocales = reshape(Locales, {0..#numLocales, 0..0});

          const Space = {1..4, 1..4};
          const D: domain(2) dmapped Block(boundingBox=Space, targetLocales=targetLocales) = Space;
          var A: [D] int;

          forall a in A do
          a = a.locale.id;

          writeln(A);


          Sample outputs:



           ./row-wise -nl 4

          0 0 0 0
          1 1 1 1
          2 2 2 2
          3 3 3 3

          ./row-wise -nl 2

          0 0 0 0
          0 0 0 0
          1 1 1 1
          1 1 1 1


          By default, distributions will use the built-in Locales array as the targetLocales argument, which specifies how to paritition the elements of an array across the locales within a particular domain map, e.g. Block.



          Since Locales is a 1D array, and you're distributing a 2D array, the Block distribution wraps Locales like so:



          1D targetLocales:

          0 1 2 3 -> 0 1
          2 3


          So an array of shape (4,4) would get mapped to 4 locales as:



            0 0 1 1
          0 0 1 1
          2 2 3 3
          2 2 3 3


          By providing a 2D targetLocales argument, we can tell Block explicitly how we'd like the elements to be mapped to locales, rather than rely on the wrapping. Passing a targetLocales array of locales with a shape of (4,1), will result in the desired row-wise distribution:



          2D targetLocales:

          0
          1
          2
          3


          So an array of shape (4,4) would get mapped to 4 locales as:



           0 0 0 0
          1 1 1 1
          2 2 2 2
          3 3 3 3


          This concept applies to other distributions as well.






          share|improve this answer





















          • Dear Ben, thank you for the explanation. I understand it very well now. I have one more question to ask regarding figuring out the range of indices for on locales. I tried below thing: I took a 10x10 array and experiment with distributing it over locals from range of 1 to 10. But unlike MPI, I can't find a fix pattern for range of indices which can be calculated on each locale.
            – Robin Sharma
            Nov 23 '18 at 4:28










          • For #locales = 2 pattern was 5 rows on locale - 1, 5 rows on locale - 2, #locales = 3 pattern was 4 rows on locale - 1, 3 rows on locale - 2, 3 rows on locale - 3, #locales = 4 pattern was 3 rows on locale - 1, 2 rows on locale - 2, 3 rows on locale - 3, 2 rows on locale - 4, #locales = 8 pattern was 2 rows on locale - 1, 1 row on locale - 2, 1 row on locale - 3, 1 row on locale - 4, 2 rows on locale - 5, 1 row on locale - 6, 1 row on locale - 7, 1 row on locale - 8. The pattern changes as the #locales increases.
            – Robin Sharma
            Nov 23 '18 at 4:28










          • I am very much used to of the MPI so I was wondering if there is a way I can decide on that I want to distribute all the array rows among locales as in #rows / #locales and the remaining rows on the last locales. Any pointers in this direction will be much appreciated. thanks
            – Robin Sharma
            Nov 23 '18 at 4:28










          • its there a build in function which can provide me the index of first and last row index mapped to a locale? I am trying to implement stencil program for multi locale using local memory.
            – Robin Sharma
            Nov 23 '18 at 5:11










          • Hi Robin - For fine grained control of the distribution of rows to locales, you can make your targetLocales be Nx1 for an NxN matrix, instead of numLocales x 1. This way, you can explicitly set the locale for each row. The RangeChunk library provides some library functions for chunking up the elements automatically with a few different remainder policies: chapel-lang.org/docs/modules/packages/RangeChunk.html
            – bencray
            Nov 24 '18 at 16:10














          4












          4








          4






          The key is to pass a reshaped Locales array as the targetLocales argument to Block. This is explained further below.



          Here's a simple example of distributing a 2D array in a row-wise fashion:



          use BlockDist;

          // Using a 2D targetLocales rather than the default 1D Locales argument
          var targetLocales = reshape(Locales, {0..#numLocales, 0..0});

          const Space = {1..4, 1..4};
          const D: domain(2) dmapped Block(boundingBox=Space, targetLocales=targetLocales) = Space;
          var A: [D] int;

          forall a in A do
          a = a.locale.id;

          writeln(A);


          Sample outputs:



           ./row-wise -nl 4

          0 0 0 0
          1 1 1 1
          2 2 2 2
          3 3 3 3

          ./row-wise -nl 2

          0 0 0 0
          0 0 0 0
          1 1 1 1
          1 1 1 1


          By default, distributions will use the built-in Locales array as the targetLocales argument, which specifies how to paritition the elements of an array across the locales within a particular domain map, e.g. Block.



          Since Locales is a 1D array, and you're distributing a 2D array, the Block distribution wraps Locales like so:



          1D targetLocales:

          0 1 2 3 -> 0 1
          2 3


          So an array of shape (4,4) would get mapped to 4 locales as:



            0 0 1 1
          0 0 1 1
          2 2 3 3
          2 2 3 3


          By providing a 2D targetLocales argument, we can tell Block explicitly how we'd like the elements to be mapped to locales, rather than rely on the wrapping. Passing a targetLocales array of locales with a shape of (4,1), will result in the desired row-wise distribution:



          2D targetLocales:

          0
          1
          2
          3


          So an array of shape (4,4) would get mapped to 4 locales as:



           0 0 0 0
          1 1 1 1
          2 2 2 2
          3 3 3 3


          This concept applies to other distributions as well.






          share|improve this answer












          The key is to pass a reshaped Locales array as the targetLocales argument to Block. This is explained further below.



          Here's a simple example of distributing a 2D array in a row-wise fashion:



          use BlockDist;

          // Using a 2D targetLocales rather than the default 1D Locales argument
          var targetLocales = reshape(Locales, {0..#numLocales, 0..0});

          const Space = {1..4, 1..4};
          const D: domain(2) dmapped Block(boundingBox=Space, targetLocales=targetLocales) = Space;
          var A: [D] int;

          forall a in A do
          a = a.locale.id;

          writeln(A);


          Sample outputs:



           ./row-wise -nl 4

          0 0 0 0
          1 1 1 1
          2 2 2 2
          3 3 3 3

          ./row-wise -nl 2

          0 0 0 0
          0 0 0 0
          1 1 1 1
          1 1 1 1


          By default, distributions will use the built-in Locales array as the targetLocales argument, which specifies how to paritition the elements of an array across the locales within a particular domain map, e.g. Block.



          Since Locales is a 1D array, and you're distributing a 2D array, the Block distribution wraps Locales like so:



          1D targetLocales:

          0 1 2 3 -> 0 1
          2 3


          So an array of shape (4,4) would get mapped to 4 locales as:



            0 0 1 1
          0 0 1 1
          2 2 3 3
          2 2 3 3


          By providing a 2D targetLocales argument, we can tell Block explicitly how we'd like the elements to be mapped to locales, rather than rely on the wrapping. Passing a targetLocales array of locales with a shape of (4,1), will result in the desired row-wise distribution:



          2D targetLocales:

          0
          1
          2
          3


          So an array of shape (4,4) would get mapped to 4 locales as:



           0 0 0 0
          1 1 1 1
          2 2 2 2
          3 3 3 3


          This concept applies to other distributions as well.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 19 '18 at 14:50









          bencray

          1,158416




          1,158416












          • Dear Ben, thank you for the explanation. I understand it very well now. I have one more question to ask regarding figuring out the range of indices for on locales. I tried below thing: I took a 10x10 array and experiment with distributing it over locals from range of 1 to 10. But unlike MPI, I can't find a fix pattern for range of indices which can be calculated on each locale.
            – Robin Sharma
            Nov 23 '18 at 4:28










          • For #locales = 2 pattern was 5 rows on locale - 1, 5 rows on locale - 2, #locales = 3 pattern was 4 rows on locale - 1, 3 rows on locale - 2, 3 rows on locale - 3, #locales = 4 pattern was 3 rows on locale - 1, 2 rows on locale - 2, 3 rows on locale - 3, 2 rows on locale - 4, #locales = 8 pattern was 2 rows on locale - 1, 1 row on locale - 2, 1 row on locale - 3, 1 row on locale - 4, 2 rows on locale - 5, 1 row on locale - 6, 1 row on locale - 7, 1 row on locale - 8. The pattern changes as the #locales increases.
            – Robin Sharma
            Nov 23 '18 at 4:28










          • I am very much used to of the MPI so I was wondering if there is a way I can decide on that I want to distribute all the array rows among locales as in #rows / #locales and the remaining rows on the last locales. Any pointers in this direction will be much appreciated. thanks
            – Robin Sharma
            Nov 23 '18 at 4:28










          • its there a build in function which can provide me the index of first and last row index mapped to a locale? I am trying to implement stencil program for multi locale using local memory.
            – Robin Sharma
            Nov 23 '18 at 5:11










          • Hi Robin - For fine grained control of the distribution of rows to locales, you can make your targetLocales be Nx1 for an NxN matrix, instead of numLocales x 1. This way, you can explicitly set the locale for each row. The RangeChunk library provides some library functions for chunking up the elements automatically with a few different remainder policies: chapel-lang.org/docs/modules/packages/RangeChunk.html
            – bencray
            Nov 24 '18 at 16:10


















          • Dear Ben, thank you for the explanation. I understand it very well now. I have one more question to ask regarding figuring out the range of indices for on locales. I tried below thing: I took a 10x10 array and experiment with distributing it over locals from range of 1 to 10. But unlike MPI, I can't find a fix pattern for range of indices which can be calculated on each locale.
            – Robin Sharma
            Nov 23 '18 at 4:28










          • For #locales = 2 pattern was 5 rows on locale - 1, 5 rows on locale - 2, #locales = 3 pattern was 4 rows on locale - 1, 3 rows on locale - 2, 3 rows on locale - 3, #locales = 4 pattern was 3 rows on locale - 1, 2 rows on locale - 2, 3 rows on locale - 3, 2 rows on locale - 4, #locales = 8 pattern was 2 rows on locale - 1, 1 row on locale - 2, 1 row on locale - 3, 1 row on locale - 4, 2 rows on locale - 5, 1 row on locale - 6, 1 row on locale - 7, 1 row on locale - 8. The pattern changes as the #locales increases.
            – Robin Sharma
            Nov 23 '18 at 4:28










          • I am very much used to of the MPI so I was wondering if there is a way I can decide on that I want to distribute all the array rows among locales as in #rows / #locales and the remaining rows on the last locales. Any pointers in this direction will be much appreciated. thanks
            – Robin Sharma
            Nov 23 '18 at 4:28










          • its there a build in function which can provide me the index of first and last row index mapped to a locale? I am trying to implement stencil program for multi locale using local memory.
            – Robin Sharma
            Nov 23 '18 at 5:11










          • Hi Robin - For fine grained control of the distribution of rows to locales, you can make your targetLocales be Nx1 for an NxN matrix, instead of numLocales x 1. This way, you can explicitly set the locale for each row. The RangeChunk library provides some library functions for chunking up the elements automatically with a few different remainder policies: chapel-lang.org/docs/modules/packages/RangeChunk.html
            – bencray
            Nov 24 '18 at 16:10
















          Dear Ben, thank you for the explanation. I understand it very well now. I have one more question to ask regarding figuring out the range of indices for on locales. I tried below thing: I took a 10x10 array and experiment with distributing it over locals from range of 1 to 10. But unlike MPI, I can't find a fix pattern for range of indices which can be calculated on each locale.
          – Robin Sharma
          Nov 23 '18 at 4:28




          Dear Ben, thank you for the explanation. I understand it very well now. I have one more question to ask regarding figuring out the range of indices for on locales. I tried below thing: I took a 10x10 array and experiment with distributing it over locals from range of 1 to 10. But unlike MPI, I can't find a fix pattern for range of indices which can be calculated on each locale.
          – Robin Sharma
          Nov 23 '18 at 4:28












          For #locales = 2 pattern was 5 rows on locale - 1, 5 rows on locale - 2, #locales = 3 pattern was 4 rows on locale - 1, 3 rows on locale - 2, 3 rows on locale - 3, #locales = 4 pattern was 3 rows on locale - 1, 2 rows on locale - 2, 3 rows on locale - 3, 2 rows on locale - 4, #locales = 8 pattern was 2 rows on locale - 1, 1 row on locale - 2, 1 row on locale - 3, 1 row on locale - 4, 2 rows on locale - 5, 1 row on locale - 6, 1 row on locale - 7, 1 row on locale - 8. The pattern changes as the #locales increases.
          – Robin Sharma
          Nov 23 '18 at 4:28




          For #locales = 2 pattern was 5 rows on locale - 1, 5 rows on locale - 2, #locales = 3 pattern was 4 rows on locale - 1, 3 rows on locale - 2, 3 rows on locale - 3, #locales = 4 pattern was 3 rows on locale - 1, 2 rows on locale - 2, 3 rows on locale - 3, 2 rows on locale - 4, #locales = 8 pattern was 2 rows on locale - 1, 1 row on locale - 2, 1 row on locale - 3, 1 row on locale - 4, 2 rows on locale - 5, 1 row on locale - 6, 1 row on locale - 7, 1 row on locale - 8. The pattern changes as the #locales increases.
          – Robin Sharma
          Nov 23 '18 at 4:28












          I am very much used to of the MPI so I was wondering if there is a way I can decide on that I want to distribute all the array rows among locales as in #rows / #locales and the remaining rows on the last locales. Any pointers in this direction will be much appreciated. thanks
          – Robin Sharma
          Nov 23 '18 at 4:28




          I am very much used to of the MPI so I was wondering if there is a way I can decide on that I want to distribute all the array rows among locales as in #rows / #locales and the remaining rows on the last locales. Any pointers in this direction will be much appreciated. thanks
          – Robin Sharma
          Nov 23 '18 at 4:28












          its there a build in function which can provide me the index of first and last row index mapped to a locale? I am trying to implement stencil program for multi locale using local memory.
          – Robin Sharma
          Nov 23 '18 at 5:11




          its there a build in function which can provide me the index of first and last row index mapped to a locale? I am trying to implement stencil program for multi locale using local memory.
          – Robin Sharma
          Nov 23 '18 at 5:11












          Hi Robin - For fine grained control of the distribution of rows to locales, you can make your targetLocales be Nx1 for an NxN matrix, instead of numLocales x 1. This way, you can explicitly set the locale for each row. The RangeChunk library provides some library functions for chunking up the elements automatically with a few different remainder policies: chapel-lang.org/docs/modules/packages/RangeChunk.html
          – bencray
          Nov 24 '18 at 16:10




          Hi Robin - For fine grained control of the distribution of rows to locales, you can make your targetLocales be Nx1 for an NxN matrix, instead of numLocales x 1. This way, you can explicitly set the locale for each row. The RangeChunk library provides some library functions for chunking up the elements automatically with a few different remainder policies: chapel-lang.org/docs/modules/packages/RangeChunk.html
          – bencray
          Nov 24 '18 at 16:10


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53369244%2fdistribute-2d-array-row-wise-among-locales-in-chapel%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Can a sorcerer learn a 5th-level spell early by creating spell slots using the Font of Magic feature?

          Does disintegrating a polymorphed enemy still kill it after the 2018 errata?

          A Topological Invariant for $pi_3(U(n))$