2 Replies Latest reply on Jun 9, 2011 1:41 AM by saibbot

    Create a new communicator

    Hayder

      Hello to everyone,

       

      I have some confusion when I use RCCE_comm_split routine.
      Can anyone to explain me the features and how to using this function?
      What is happening when make Multiple calls to RCCE_comm_split? 

       

      Thanks in advance

       

      Hayder

        • 1. Re: Create a new communicator
          tedk

          Have you tried using this function and is it not operating as you expect? It's similar but simpler than MPI_COMM_SPLIT().

           

          Basically it's creating an instance of RCCE_COMM based on the color() function. Look at how RCCE_V_color is defined. That's a color function that specifies the cores in the voltage domain for the core that called the RCCE_comm_split(). So then a core gets a communicator called RCCE_V_COMM for the cores in its voltage domain.

           

          There's a special communicator called RCCE_COMM_WORLD. That's all the cores. When you call a RCCE_barrier(), if you want all the cores to obey that barrier, you specify this global communicator ... as in RCCE_barrier(&RCCE_COMM_WORLD). Think about what happens if you did a RCCE_barrier(&RCCE_V_COMM).

           

          So you can call comm split several times with different color functions and create different communicators. Call it with the same color function and you just redefine the communicator, or if you specified a new communicator with the same color function,then you just have two identical communicators with different names.

          • 2. Re: Create a new communicator
            saibbot

            An sime example of using the split is:

             

            RCCE_COMM RCCE_COMM_ODD;                                           
            RCCE_comm_split(odd, NULL, &RCCE_COMM_ODD);

             

            where function odd is defined as:

             

            /*returns "true" (1) for odd core ids, "false" (0) otherwise*/
            int odd(int id, void *aux) {
            return (id % 2);
            }

            and defines a communicator to be used to synchronise the cores with an odd core id (1, 3, 5, ...).