=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/io/ox.c,v retrieving revision 1.34 retrieving revision 1.38 diff -u -p -r1.34 -r1.38 --- OpenXM_contrib2/asir2000/io/ox.c 2015/08/08 14:19:42 1.34 +++ OpenXM_contrib2/asir2000/io/ox.c 2016/08/24 00:52:50 1.38 @@ -44,7 +44,7 @@ * OF THE SOFTWARE HAS BEEN DEVELOPED BY A THIRD PARTY, THE THIRD PARTY * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. - * $OpenXM: OpenXM_contrib2/asir2000/io/ox.c,v 1.33 2015/08/06 10:01:52 fujimoto Exp $ + * $OpenXM: OpenXM_contrib2/asir2000/io/ox.c,v 1.37 2016/06/29 05:10:14 ohara Exp $ */ #include "ca.h" #include "parse.h" @@ -82,6 +82,7 @@ struct mathcap { unsigned int *smcap; int noxcap; struct oxcap *oxcap; + int no_ox_reset; }; struct oxcap *my_oxcap; @@ -94,7 +95,7 @@ void mclist_to_mc(LIST mclist,struct mathcap *mc); Obj asir_pop_one(); void asir_push_one(Obj); -#if defined(VISUAL) || defined(__MINGW32__) || defined(__MINGW64__) +#if defined(VISUAL) || defined(__MINGW32__) /* XXX : mainly used in engine2000/io.c, but declared here */ typedef void *HANDLE; HANDLE hStreamNotify,hStreamNotify_Ack; @@ -108,15 +109,21 @@ void cleanup_events() } #endif +/* 1 if no_ox_reset, 0 if ox_reset OK, -1 if invalid */ +int no_ox_reset(int s) +{ + if ( remote_mc && s >= 0 && s < remote_mc_len ) + return remote_mc[s].no_ox_reset; + else + return -1; +} + void ox_resetenv(char *s) { -#if defined(VISUAL) || defined(__MINGW32__) || defined(__MINGW64__) +#if defined(VISUAL) || defined(__MINGW32__) cleanup_events(); #endif fprintf(stderr,"%s\n",s); -#if defined(__MINGW32__) || defined(__MINGW64__) - fflush(stderr); -#endif LONGJMP(ox_env,1); } @@ -129,7 +136,7 @@ static int available_cmo[] = { CMO_RATIONAL, CMO_RECURSIVE_POLYNOMIAL, CMO_UNIVARIATE_POLYNOMIAL, CMO_INDETERMINATE, - CMO_TREE, CMO_BIGFLOAT, + CMO_TREE, CMO_BIGFLOAT32, CMO_COMPLEX, 0 }; @@ -303,6 +310,7 @@ void mclist_to_mc(LIST mclist,struct mathcap *mc) [o2,[n21,n22,...]], ... ] + (optional)[s1,s2,...] (no_ox_reset) ] */ n = BDY(mclist); @@ -335,6 +343,15 @@ void mclist_to_mc(LIST mclist,struct mathcap *mc) for ( t = cap, ptr = mc->oxcap[j].cap, i = 0; i < l; t = NEXT(t), i++ ) ptr[i] = BDY((USINT)BDY(t)); } + /* check of no_ox_reset */ + mc->no_ox_reset = 0; + n = BDY(mclist); + if ( length(n) >= 4 ) { + t = BDY((LIST)ARG3(n)); + for ( ; t; t = NEXT(t) ) + if ( !strcmp(BDY((STRING)BDY(t)),"no_ox_reset") ) + mc->no_ox_reset = 1; + } } int check_sm_by_mc(int s,unsigned int smtag) @@ -399,7 +416,7 @@ void end_critical() { critical_when_signal = 0; if ( ox_usr1_sent ) { ox_usr1_sent = 0; -#if !defined(VISUAL) && !defined(__MINGW32__) && !defined(__MINGW64__) +#if !defined(VISUAL) && !defined(__MINGW32__) ox_usr1_handler(SIGUSR1); #else ox_usr1_handler(0); @@ -416,7 +433,7 @@ void ox_usr1_handler(int sig) { NODE t; -#if !defined(VISUAL) && !defined(__MINGW32__) && !defined(__MINGW64__) +#if !defined(VISUAL) && !defined(__MINGW32__) signal(SIGUSR1,ox_usr1_handler); #endif if ( critical_when_signal ) { @@ -433,9 +450,6 @@ void ox_usr1_handler(int sig) } ox_resetenv("usr1 : return to toplevel by SIGUSR1"); } -#if defined(__MINGW32__) || defined(__MINGW64__) - fflush(stderr); -#endif } void clear_readbuffer() @@ -488,7 +502,7 @@ void wait_for_data(int s) int sock; if ( !FP_DATA_IS_AVAILABLE(iofp[s].in) ) { -#if defined(VISUAL) || defined(__MINGW32__) || defined(__MINGW64__) +#if defined(VISUAL) || defined(__MINGW32__) sock = iofp[s].in->fildes; FD_ZERO(&r); FD_SET((unsigned int)sock,&r); @@ -508,7 +522,7 @@ void wait_for_data_102(int rank) int sock; if ( !FP_DATA_IS_AVAILABLE(iofp_102[rank].in) ) { -#if defined(VISUAL) || defined(__MINGW32__) || defined(__MINGW64__) +#if defined(VISUAL) || defined(__MINGW32__) sock = iofp_102[rank].in->fildes; FD_ZERO(&r); FD_SET((unsigned int)sock,&r); @@ -881,7 +895,7 @@ int ox_check_cmo(int s, Obj obj) return check_by_mc(s,OX_DATA,CMO_ZZ); else return check_by_mc(s,OX_DATA,CMO_QQ); - case N_R: case N_B: + case N_R: case N_B: case N_C: return 1; default: return 0; @@ -944,7 +958,7 @@ void ox_flush_stream(int s) { if ( ox_batch ) return; -#if defined(VISUAL) || defined(__MINGW32__) || defined(__MINGW64__) +#if defined(VISUAL) || defined(__MINGW32__) if ( _fileno(&iofp[s].out->fp) < 0 ) cflush(iofp[s].out); else @@ -958,7 +972,7 @@ void ox_flush_stream(int s) void ox_flush_stream_force(int s) { -#if defined(VISUAL) || defined(__MINGW32__) || defined(__MINGW64__) +#if defined(VISUAL) || defined(__MINGW32__) if ( _fileno(&iofp[s].out->fp) < 0 ) cflush(iofp[s].out); else @@ -979,7 +993,7 @@ void ox_flush_stream_102(int rank) void ox_flush_stream_force_102(int rank) { if ( iofp_102[rank].out ) -#if defined(VISUAL) || defined(__MINGW32__) || defined(__MINGW64__) +#if defined(VISUAL) || defined(__MINGW32__) cflush(iofp_102[rank].out); #elif MPI cflush(iofp_102[rank].out);