UPCR_GET_SHARED_VAL generated by UPC-to_c translator

From: ÌÆÉúÁÖ (tangshenglin_at_ict.ac.cn)
Date: Mon Dec 01 2008 - 19:27:54 PST

  • Next message: luxingjing: "(no subject)"
    I don't know how to write codes which can be translated into UPCR_GET_SHARED_VAL, who knows?
    
    Online translation was made bellow:
    ----------------source program----------------------
    #include <upc.h>
    #include <stdio.h>
    #include <stdlib.h>
    shared [2 ]int8_t a[100];
    
    int main(int argc, char **argv) {
      
      int8_t x = 100;
      a[9] = x;
      printf("%d\n", x);  
      return a[9];
    }
    --------------translated result----------------------
    extern int user_main(
      int argc,
      char ** argv)
    {
      UPCR_BEGIN_FUNCTION();
      signed char x;
      int _bupc_retspill0;
      upcr_shared_ptr_t _bupc_Mptra0;
      upcr_shared_ptr_t _bupc_Mptra1;
      signed char _bupc_spillld2;
      
      x = 100;
      _bupc_Mptra0 = UPCR_ADD_SHARED(a, 1, 9, 2);
      UPCR_PUT_SHARED_VAL(_bupc_Mptra0, 0, x, 1);    //UPCR_PUT_SHARED_VAL
      printf("%d\n", (int) x);
      _bupc_Mptra1 = UPCR_ADD_SHARED(a, 1, 9, 2);
      UPCR_GET_SHARED(&_bupc_spillld2, _bupc_Mptra1, 0, 1); //not UPCR_GET_SHARED_VAL, why?
      _bupc_retspill0 = _bupc_spillld2;
      UPCR_EXIT_FUNCTION();
      return _bupc_retspill0;
    } /* user_main */

  • Next message: luxingjing: "(no subject)"