[BACK]Return to ox.c CVS log [TXT][DIR] Up to [local] / OpenXM_contrib2 / asir2018 / io

Diff for /OpenXM_contrib2/asir2018/io/ox.c between version 1.5 and 1.6

version 1.5, 2020/03/29 17:01:55 version 1.6, 2020/10/06 06:31:20
Line 44 
Line 44 
  * OF THE SOFTWARE HAS BEEN DEVELOPED BY A THIRD PARTY, THE THIRD PARTY   * OF THE SOFTWARE HAS BEEN DEVELOPED BY A THIRD PARTY, THE THIRD PARTY
  * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE,   * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE,
  * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE.   * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE.
  * $OpenXM: OpenXM_contrib2/asir2018/io/ox.c,v 1.4 2020/02/02 05:13:30 ohara Exp $   * $OpenXM: OpenXM_contrib2/asir2018/io/ox.c,v 1.5 2020/03/29 17:01:55 fujimoto Exp $
 */  */
 #include "ca.h"  #include "ca.h"
 #include "parse.h"  #include "parse.h"
Line 204  void create_my_mathcap(char *system)
Line 204  void create_my_mathcap(char *system)
   /* sm tag */    /* sm tag */
   n0 = 0;    n0 = 0;
   if ( !strcmp(system,"asir") ) {    if ( !strcmp(system,"asir") ) {
     for ( i = 0; k = asir_available_sm[i]; i++ ) {      for ( i = 0; (k = asir_available_sm[i]) != 0; i++ ) {
       NEXTNODE(n0,n); MKUSINT(t,k); BDY(n) = (pointer)t;        NEXTNODE(n0,n); MKUSINT(t,k); BDY(n) = (pointer)t;
     }      }
   } else if ( !strcmp(system,"ox_asir") ) {    } else if ( !strcmp(system,"ox_asir") ) {
     for ( i = 0; k = ox_asir_available_sm[i]; i++ ) {      for ( i = 0; (k = ox_asir_available_sm[i]) != 0; i++ ) {
       NEXTNODE(n0,n); MKUSINT(t,k); BDY(n) = (pointer)t;        NEXTNODE(n0,n); MKUSINT(t,k); BDY(n) = (pointer)t;
     }      }
     NEXT(n) = 0;      NEXT(n) = 0;
   } else if ( !strcmp(system,"ox_plot") ) {    } else if ( !strcmp(system,"ox_plot") ) {
     for ( i = 0; k = ox_plot_available_sm[i]; i++ ) {      for ( i = 0; (k = ox_plot_available_sm[i]) != 0; i++ ) {
       NEXTNODE(n0,n); MKUSINT(t,k); BDY(n) = (pointer)t;        NEXTNODE(n0,n); MKUSINT(t,k); BDY(n) = (pointer)t;
     }      }
     NEXT(n) = 0;      NEXT(n) = 0;
Line 224  void create_my_mathcap(char *system)
Line 224  void create_my_mathcap(char *system)
   /* ox tag */    /* ox tag */
   MKUSINT(tag,OX_DATA);    MKUSINT(tag,OX_DATA);
   /* cmo tag */    /* cmo tag */
   for ( n0 = 0, i = 0; k = available_cmo[i]; i++ ) {    for ( n0 = 0, i = 0; (k = available_cmo[i]) != 0; i++ ) {
     NEXTNODE(n0,n); MKUSINT(t,k); BDY(n) = (pointer)t;      NEXTNODE(n0,n); MKUSINT(t,k); BDY(n) = (pointer)t;
   }    }
   NEXT(n) = 0; MKLIST(cmolist,n0);    NEXT(n) = 0; MKLIST(cmolist,n0);
Line 299  void mclist_to_mc(LIST mclist,struct mathcap *mc)
Line 299  void mclist_to_mc(LIST mclist,struct mathcap *mc)
 {  {
   int l,i,j;    int l,i,j;
   NODE n,t,oxcmo,cap;    NODE n,t,oxcmo,cap;
   int *ptr;    unsigned int *ptr;
   
   /*    /*
     [      [
Line 322  void mclist_to_mc(LIST mclist,struct mathcap *mc)
Line 322  void mclist_to_mc(LIST mclist,struct mathcap *mc)
   n = NEXT(n);    n = NEXT(n);
   t = BDY((LIST)BDY(n));    t = BDY((LIST)BDY(n));
   mc->nsmcap = length(t);    mc->nsmcap = length(t);
   mc->smcap = (int *)MALLOC_ATOMIC(mc->nsmcap*sizeof(int));    mc->smcap = (unsigned int *)MALLOC_ATOMIC(mc->nsmcap*sizeof(unsigned int));
   for ( j = 0, ptr = mc->smcap; j < mc->nsmcap; j++, t = NEXT(t) )    for ( j = 0, ptr = mc->smcap; j < mc->nsmcap; j++, t = NEXT(t) )
     ptr[j] = BDY((USINT)BDY(t));      ptr[j] = BDY((USINT)BDY(t));
   
Line 339  void mclist_to_mc(LIST mclist,struct mathcap *mc)
Line 339  void mclist_to_mc(LIST mclist,struct mathcap *mc)
     /* cap ->BDY(CMOlistj) */      /* cap ->BDY(CMOlistj) */
     l = length(cap);      l = length(cap);
     mc->oxcap[j].ncap = l;      mc->oxcap[j].ncap = l;
     mc->oxcap[j].cap = (unsigned int *)CALLOC(l+1,sizeof(unsigned int));      mc->oxcap[j].cap = (int *)CALLOC(l+1,sizeof(int));
     for ( t = cap, ptr = mc->oxcap[j].cap, i = 0; i < l; t = NEXT(t), i++ )      for ( t = cap, ptr = (unsigned int *)mc->oxcap[j].cap, i = 0; i < l; t = NEXT(t), i++ )
       ptr[i] = BDY((USINT)BDY(t));        ptr[i] = BDY((USINT)BDY(t));
   }    }
   /* check of no_ox_reset */    /* check of no_ox_reset */
Line 398  int check_by_mc(int s,unsigned int oxtag,unsigned int 
Line 398  int check_by_mc(int s,unsigned int oxtag,unsigned int 
   if ( i == noxcap )    if ( i == noxcap )
     return 0;      return 0;
   ncap = oxcap[i].ncap;    ncap = oxcap[i].ncap;
   cap = oxcap[i].cap;    cap = (unsigned int *)oxcap[i].cap;
   for ( j = 0; j < ncap; j++ )    for ( j = 0; j < ncap; j++ )
     if ( cap[j] == cmotag )      if ( cap[j] == cmotag )
       break;        break;
Line 719  void ox_send_local_ring_102(int rank,VL vl)
Line 719  void ox_send_local_ring_102(int rank,VL vl)
   
 unsigned int ox_recv(int s, int *id, Obj *p)  unsigned int ox_recv(int s, int *id, Obj *p)
 {  {
   unsigned int cmd,serial;    int cmd,serial;
   USINT ui;    USINT ui;
   
   wait_for_data(s);    wait_for_data(s);
Line 748  unsigned int ox_recv(int s, int *id, Obj *p)
Line 748  unsigned int ox_recv(int s, int *id, Obj *p)
   
 unsigned int ox_recv_102(int rank, int *id, Obj *p)  unsigned int ox_recv_102(int rank, int *id, Obj *p)
 {  {
   unsigned int cmd,serial;    int cmd,serial;
   USINT ui;    USINT ui;
   
   wait_for_data_102(rank);    wait_for_data_102(rank);
Line 802  void ox_get_result(int s,Obj *rp)
Line 802  void ox_get_result(int s,Obj *rp)
 void ox_read_int(int s, int *n)  void ox_read_int(int s, int *n)
 {  {
   ox_need_conv = iofp[s].conv;    ox_need_conv = iofp[s].conv;
   read_int((FILE *)iofp[s].in,n);    read_int((FILE *)iofp[s].in,(unsigned int *)n);
 }  }
   
 void ox_read_int_102(int rank, int *n)  void ox_read_int_102(int rank, int *n)
 {  {
   ox_need_conv = iofp_102[rank].conv;    ox_need_conv = iofp_102[rank].conv;
   read_int((FILE *)iofp_102[rank].in,n);    read_int((FILE *)iofp_102[rank].in,(unsigned int *)n);
 }  }
   
 void ox_read_cmo(int s, Obj *rp)  void ox_read_cmo(int s, Obj *rp)
Line 829  void ox_read_local(int s, Obj *rp)
Line 829  void ox_read_local(int s, Obj *rp)
   int id;    int id;
   
   ox_need_conv = iofp[s].conv;    ox_need_conv = iofp[s].conv;
   read_int((FILE *)iofp[s].in,&id);    read_int((FILE *)iofp[s].in,(unsigned int *)&id);
   switch ( id ) {    switch ( id ) {
     case ASIR_VL:      case ASIR_VL:
       loadvl((FILE *)iofp[s].in);        loadvl((FILE *)iofp[s].in);
Line 849  void ox_read_local_102(int rank, Obj *rp)
Line 849  void ox_read_local_102(int rank, Obj *rp)
   int id;    int id;
   
   ox_need_conv = iofp_102[rank].conv;    ox_need_conv = iofp_102[rank].conv;
   read_int((FILE *)iofp_102[rank].in,&id);    read_int((FILE *)iofp_102[rank].in,(unsigned int *)&id);
   switch ( id ) {    switch ( id ) {
     case ASIR_VL:      case ASIR_VL:
       loadvl((FILE *)iofp_102[rank].in);        loadvl((FILE *)iofp_102[rank].in);
Line 867  void ox_read_local_102(int rank, Obj *rp)
Line 867  void ox_read_local_102(int rank, Obj *rp)
 void ox_write_int(int s, int n)  void ox_write_int(int s, int n)
 {  {
   ox_need_conv = iofp[s].conv;    ox_need_conv = iofp[s].conv;
   write_int((FILE *)iofp[s].out,&n);    write_int((FILE *)iofp[s].out,(unsigned int *)&n);
 }  }
   
 void ox_write_int_102(int rank, int n)  void ox_write_int_102(int rank, int n)
 {  {
   ox_need_conv = iofp_102[rank].conv;    ox_need_conv = iofp_102[rank].conv;
   write_int((FILE *)iofp_102[rank].out,&n);    write_int((FILE *)iofp_102[rank].out,(unsigned int *)&n);
 }  }
   
 void ox_write_cmo(int s, Obj obj)  void ox_write_cmo(int s, Obj obj)

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>