upc_mem* functions

From: Venelin Mitov (vmitov_at_gmail_dot_com)
Date: Wed Jan 05 2005 - 08:19:13 PST

  • Next message: Dan Bonachea: "Re: upc_mem* functions"
    Hello, 
    Can somebody explain me how exactly the 
    upc_memget, upc_memput and upc_memcpy functions work by specification and
    implementation? I'm interested in what they do when the shared memory
    block to copy from/to is not local to only one thread only. Are those
    functions written in upc(can we see their code)?
    
    THREADS = 2
    #define N (4*THREADS)
    
    shared[N/THREADS] int P[2][N];
    int begin = 0, end = 6;
    
    int* p = (int*)malloc((end-begin)*sizeof(int));
          if(p == NULL)
                upc_global_exit(3);
    
           //upc_memget(p, &P[idx][begin], (end-begin)*sizeof(int));
    
           for(i = 0; i < end - begin; i++)
                p[i] = P[idx][begin+i];
    
    When to apply a for cycle or a upc_mem* function?
    
    Regards, 
    Venelin Mitov
    

  • Next message: Dan Bonachea: "Re: upc_mem* functions"