~ubuntu-branches/ubuntu/trusty/pvm/trusty-proposed

« back to all changes in this revision

Viewing changes to pvmgs/pvmgsu_core.c

  • Committer: Bazaar Package Importer
  • Author(s): Steinar H. Gunderson
  • Date: 2006-08-09 00:00:40 UTC
  • mfrom: (2.1.5 dapper)
  • Revision ID: james.westby@ubuntu.com-20060809000040-16kh33tmxx2em716
Tags: 3.4.5-7
Build with SHELL=/bin/bash in debian/rules; fixes FTBFS when /bin/sh
isn't bash. (Closes: #379543)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
 
2
2
static char rcsid[] =
3
 
        "$Id: pvmgsu_core.c,v 1.14 1997/10/22 22:14:17 pvmsrc Exp $";
 
3
        "$Id: pvmgsu_core.c,v 1.17 2001/11/30 20:33:12 pvmsrc Exp $";
4
4
 
5
5
/*
6
6
 *         PVM version 3.4:  Parallel Virtual Machine System
89
89
        
90
90
static GROUP_LIST sgroup_list[HASHSIZE];
91
91
static int ngroups = -1;
 
92
 
 
93
/* Set PVM Group Server Timeout (if any), In Seconds */
 
94
#ifndef PVMGSTIMEOUT
 
95
struct timeval *pvmgs_tmout = (struct timeval *) NULL;
 
96
#else
 
97
struct timeval pvmgs_tmout_struct = { PVMGSTIMEOUT, 0 };
 
98
struct timeval *pvmgs_tmout = &pvmgs_tmout_struct;
 
99
#endif
 
100
 
92
101
/* ================ gs_getgstid() ====================================     */
93
102
/* int info = getgstid()                                                   */
94
103
/*   gs_getgstid returns the tid of the group server, starts the server    */
562
571
int optarg;
563
572
{
564
573
        int len;
565
 
        int mytid;
566
574
        int rbuf;
567
575
        int sbuf,stid;
568
576
        int state;
570
578
 
571
579
        GROUP_STRUCT_PTR sgroup;
572
580
 
573
 
        mytid = pvm_mytid();
 
581
        pvm_mytid();
574
582
 
575
 
        if (group == (char*)0)
 
583
        if (group == (char*)0 || *group == '\0')
576
584
                return  (*rvalue = PvmNullGroup);
577
585
 
578
586
        if ( (stid = gs_getgstid()) < 0)  /* find the server's tid         */
610
618
        
611
619
        if (request == BARRIERV) request = BARRIER; 
612
620
        {
613
 
                if (pvm_recv(stid, request) < 0)
 
621
                if (pvm_trecv(stid, request, pvmgs_tmout) <= 0)
614
622
                        pvm_perror(caller);
615
623
        }
616
624
 
655
663
int **tids; 
656
664
int holes_not_allowed;
657
665
{
 
666
        int cc;
658
667
        int i;
659
668
        int len;
660
 
        int mytid;
661
669
        int rbuf;
662
670
        int sbuf, state, stid;
663
671
        int savectx;
664
672
 
665
673
        GROUP_STRUCT_PTR sgroup;
666
674
 
667
 
        if ( group == (char*)0 ) 
 
675
        if ( group == (char*)0 || *group == '\0' ) 
668
676
                return(PvmNullGroup);
669
677
 
670
678
        /* look up to see if the information is held locally               */
711
719
        if (holes_not_allowed)  
712
720
        {
713
721
                pvm_send(stid, TIDLIST);       /* e.g. scatter, gather         */
714
 
                pvm_recv(stid, TIDLIST); 
 
722
                cc = pvm_trecv(stid, TIDLIST, pvmgs_tmout); 
715
723
        }
716
724
        else 
717
725
        {
718
726
                pvm_send(stid, BCAST);         /* e.g. bcast                   */
719
 
                pvm_recv(stid, BCAST); 
 
727
                cc = pvm_trecv(stid, BCAST, pvmgs_tmout); 
720
728
        } 
721
729
 
 
730
        /* Catch pvmgs timeout... */
 
731
        if ( cc <= 0 )
 
732
                return(PvmSysErr);
 
733
 
722
734
        /* restore user context */
723
735
        pvm_setcontext( savectx );
724
736
 
883
895
        GROUP_STRUCT_PTR sgroup;
884
896
        int foo;
885
897
        int info;
886
 
        int mytid;
887
898
        int rbuf, rc;
888
899
        int sbuf, state, stid;
889
900
        int x;
920
931
                if ((info = pvm_send(stid,HOSTCHAR)) < 0)
921
932
                        goto cleanup;
922
933
 
923
 
                if ((info = pvm_recv(stid,HOSTCHAR)) < 0)
 
934
                if ((info = pvm_trecv(stid,HOSTCHAR,pvmgs_tmout)) <= 0)
924
935
                        goto cleanup;
925
936
 
926
937
                if ((info = pvm_upkint(nhosts,1,1)) < 0) 
978
989
{
979
990
        int foo;
980
991
        int info;
981
 
        int mytid;
982
992
        int rbuf, rc;
983
993
        int sbuf, state, stid;
984
994
        int x;
1014
1024
                if ((info = pvm_send(stid,HOSTCHARV)) < 0) 
1015
1025
                        goto cleanup;
1016
1026
 
1017
 
                if ((info = pvm_recv(stid,HOSTCHARV)) < 0) 
 
1027
                if ((info = pvm_trecv(stid,HOSTCHARV,pvmgs_tmout)) <= 0) 
1018
1028
                        goto cleanup;
1019
1029
 
1020
1030
                if ((info = pvm_upkint(nhosts,1,1)) < 0)