=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/io/tcpf.c,v retrieving revision 1.37 retrieving revision 1.42 diff -u -p -r1.37 -r1.42 --- OpenXM_contrib2/asir2000/io/tcpf.c 2003/02/14 22:29:15 1.37 +++ OpenXM_contrib2/asir2000/io/tcpf.c 2003/09/19 02:33:14 1.42 @@ -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/tcpf.c,v 1.36 2003/01/24 08:01:25 noro Exp $ + * $OpenXM: OpenXM_contrib2/asir2000/io/tcpf.c,v 1.41 2003/05/23 00:11:58 noro Exp $ */ #include "ca.h" #include "parse.h" @@ -119,6 +119,7 @@ void Pgenerate_port(),Ptry_bind_listen(),Ptry_connect( void Pregister_server(); void Pox_get_serverinfo(); void Pox_mpi_myid(), Pox_mpi_nprocs(); +void Pnd_exec_f4_red(); void ox_launch_generic(); @@ -173,7 +174,9 @@ struct ftab tcp_tab[] = { {"ox_execute_string",Pox_execute_string,2}, {"ox_execute_function",Pox_execute_function,3}, + {"nd_exec_f4_red",Pnd_exec_f4_red,0}, + {0,0,0}, }; @@ -183,6 +186,12 @@ extern int ox_exchange_mathcap; char *getenv(); +void Pnd_exec_f4_red(Q *rp) +{ + nd_exec_f4_red_dist(); + *rp = 0; +} + #if defined(MPI) extern int mpi_myid, mpi_nprocs; @@ -425,17 +434,23 @@ void ox_launch_generic(char *host,char *launcher,char generate_port(use_unix,server_port_str); if ( !conn_to_serv ) { cs = try_bind_listen(use_unix,control_port_str); + if ( cs < 0 ) continue; ss = try_bind_listen(use_unix,server_port_str); + if ( ss < 0 ) continue; } spawn_server(host,launcher,server, use_unix,use_ssh,use_x,conn_to_serv, control_port_str,server_port_str); if ( conn_to_serv ) { cs = try_connect(use_unix,host,control_port_str); + if ( cs < 0 ) continue; ss = try_connect(use_unix,host,server_port_str); + if ( ss < 0 ) continue; } else { cs = try_accept(use_unix,cs); + if ( cs < 0 ) continue; ss = try_accept(use_unix,ss); + if ( ss < 0 ) continue; } } while ( cs < 0 || ss < 0 ); @@ -884,8 +899,11 @@ void Pox_push_local(NODE arg,Obj *rp) int s; struct oLIST dummy; VL vl; - int index = QTOS((Q)ARG0(arg)); + int index; + if ( !arg ) + error("ox_push_local : too few arguments."); + index = QTOS((Q)ARG0(arg)); valid_mctab_index(index); s = m_c_tab[index].c; arg = NEXT(arg); @@ -901,8 +919,11 @@ void Pox_push_local(NODE arg,Obj *rp) void Pox_push_cmo(NODE arg,Obj *rp) { int s; - int index = QTOS((Q)ARG0(arg)); + int index; + if ( !arg ) + error("ox_push_cmo : too few arguments."); + index = QTOS((Q)ARG0(arg)); valid_mctab_index(index); s = m_c_tab[index].c; arg = NEXT(arg); for ( ; arg; arg = NEXT(arg) ) @@ -1282,4 +1303,10 @@ int validate_ox_plot_stream(int index) ox_flush_stream_force(m_c_tab[i].c); #endif return i; +} + +int get_ox_server_id(int index) +{ + valid_mctab_index(index); + return m_c_tab[index].c; }