Re: Change the affinity of a shared variable

From: Paul H. Hargrove (PHHargrove_at_lbl_dot_gov)
Date: Mon Mar 29 2010 - 09:03:11 PDT

  • Next message: Debabrata Midya: "UPC on Windows"
    Ravin,
    
      If by "change" you mean that at runtime you want to move the storage 
    of a variable from one node's memory to another, than that is not 
    possible.  However, if dealing with pointers you can change a 
    "shared"-qualified pointer type to point anywhere in memory.
    
      When dealing with statical allocated shared variables there is not 
    control over their placement in memory.  They are either on thread 0 or 
    distributed over all threads as determined by the blocking factor for 
    arrays.
    
      When dealing with dynamically allocated variables you should look at 
    section 7.2.2 of the UPC specification for the allocation functions.  In 
    particular you are probably looking for upc_alloc() which will allocate 
    memory with affinity to the calling thread.
    
    -Paul
    
    
    Ravin Gunasekera wrote:
    > Hi,
    > I'm relatively new to UPC language and i want to know how can i change 
    > the affinity of shared variable. For a example if i want to store a 
    > particular shared variable in, say number 3 machine's memory, how can 
    > i achieve it.
    > Really appreciate your help.
    > thank you.
    >
    > Ravin.
    
    
    -- 
    Paul H. Hargrove                          PHHargrove_at_lbl_dot_gov
    Future Technologies Group                 Tel: +1-510-495-2352
    HPC Research Department                   Fax: +1-510-486-6900
    Lawrence Berkeley National Laboratory     
    

  • Next message: Debabrata Midya: "UPC on Windows"