UPC Teams

From: James Dinan (dinan_at_cse.ohio-state.edu)
Date: Tue May 05 2009 - 09:26:02 PDT

  • Next message: Dan Bonachea: "Re: Overlapping put/get events"
    Hi,
    
    Does anyone know whether the proposed UPC teams/thread groups extensions 
    are available in Berkeley UPC?
    
    Also, I had a thought wrt how to use groups to enhance locality.  I'm 
    not sure if this has already been suggested, but here goes:
    
    The proposed extension contains a UPC_TEAM_ALL that contains all 
    threads.  I was thinking the runtime system could also provide something 
    like UPC_TEAM_LOCAL that allows the programmer to determine which UPC 
    threads are on the local SMP node in a cluster (this might need to be 
    more general to handle a variety of architectures but hear me out).
    
    In order to make better/frequent use of this, we might want more 
    convenient wrappers to map between a team and UPC_TEAM_ALL:
    
    int upc_team_global_id(upc_team_t *team, int local_id) {
       int trans_id;
       upc_group_translate_threads(upc_group_from_team(team),
         upc_group_from_threads(UPC_TEAM_ALL), &local_id, &trans_id, 1);
       return trans_id;
    }
    
    This would be a non-collective call that maps the local id of a team 
    member to their thread id in UPC_TEAM_ALL.
    
    int upc_team_local_id(upc_team_t *team, int global_id);
    
    This is also non-collective and tells us the local id of thread 
    global_id within the team.  If the thread is not in the team we get 
    UPC_THREAD_UNDEFINED.
    
    Using this we could write something like:
    
    int upc_islocal(shared void *ptr) {
       if (upc_team_local_id(UPC_TEAM_LOCAL, upc_threadof(ptr)) !=
           UPC_THREAD_UNDEFINED)
         return 1;
       else
         return 0;
    }
    
    One quick example of where we could use upc_islocal(), would be to 
    determine when element-wise access is ok and when we should do a bulk 
    transfer via upc_memget().
    
    Regards,
      ~Jim.
    

  • Next message: Dan Bonachea: "Re: Overlapping put/get events"