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

« back to all changes in this revision

Viewing changes to src/pvmdshmem.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: pvmdshmem.c,v 1.17 1999/07/08 19:00:11 kohl Exp $";
 
3
        "$Id: pvmdshmem.c,v 1.21 2004/01/14 18:51:02 pvmsrc Exp $";
4
4
 
5
5
/*
6
6
 *         PVM version 3.4:  Parallel Virtual Machine System
36
36
 * Shared-memory MPP interface.
37
37
 *
38
38
 * $Log: pvmdshmem.c,v $
 
39
 * Revision 1.21  2004/01/14 18:51:02  pvmsrc
 
40
 * Added new AIX5* arches.
 
41
 * (Spanker=kohl)
 
42
 *
 
43
 * Revision 1.20  2002/02/21 23:18:41  pvmsrc
 
44
 * Added new (not to be documented!) PVM_MAX_TASKS env var support.
 
45
 *      - for Mahir Lokvancic <mahir@math.ufl.edu>.
 
46
 *      - forcefully limits the number of tasks that can attach to a
 
47
 *              pvmd, required on Solaris in rare circumstances when hard
 
48
 *              FD_SETSIZE limit is reached, and all hell breaks loose...
 
49
 *      - check return for task_new() call, can now produce NULL ptr,
 
50
 *              indicating PvmOutOfRes...
 
51
 * (Spanker=kohl)
 
52
 *
 
53
 * Revision 1.19  2001/09/25 21:21:04  pvmsrc
 
54
 * Yanked "char *pvmgettmp();" decl - now in pvm3.h...
 
55
 * (Spanker=kohl)
 
56
 *
 
57
 * Revision 1.18  2000/02/10 20:45:33  pvmsrc
 
58
 * Replaced hard-coded /tmp usage.
 
59
 *      - use pvmgettmp() routine now to determine PVM temp dir.
 
60
 * (Spanker=kohl)
 
61
 *
39
62
 * Revision 1.17  1999/07/08 19:00:11  kohl
40
63
 * Fixed "Log" keyword placement.
41
64
 *      - indent with " * " for new CVS.
331
354
ppi_init()
332
355
{
333
356
        struct pidtidhdr *pvminfo;
 
357
        char *pvmtmp = pvmgettmp();
334
358
        char *p;
335
359
        int key;
336
360
 
340
364
#ifdef IMA_CSPP
341
365
        int scid = get_scid();
342
366
        if (scid > 1)
343
 
#ifdef SAFETMP
344
 
                sprintf(fname, PVMTMPDIR "/shmem.%d", pvm_useruid, scid);
345
 
#else
346
 
                sprintf(fname, "/tmp/pvmt.%d.%d", pvm_useruid, scid);
347
 
#endif
 
367
                sprintf(fname, "%s/pvmt.%d.%d", pvmtmp, pvm_useruid, scid);
348
368
        else
349
369
#else
350
 
#ifdef SAFETMP
351
 
        sprintf(fname, PVMTMPDIR "/shmem", pvm_useruid);
352
 
#else
353
 
        sprintf(fname, "/tmp/pvmt.%d", pvm_useruid);
354
 
#endif
 
370
        sprintf(fname, "%s/pvmt.%d", pvmtmp, pvm_useruid);
355
371
#endif
356
372
        logfp = fopen(fname, "w");
357
373
        fclose(logfp);
554
570
                                        pvmlogerror("mpp_input() out of tids?\n");
555
571
                                        continue;
556
572
                                }
557
 
                                tp = task_new(tid);
 
573
                                if ((tp = task_new(tid)) == NULL) {
 
574
                                        pvmlogerror("mpp_input() too many tasks?\n");
 
575
                                        continue;
 
576
                                }
558
577
                                task_setpid(tp, src);
559
578
                                mpp_conn(tp);
560
579
 
706
725
 
707
726
                        if (dboxp->mb_sleep) {
708
727
 
709
 
/* #if defined(IMA_SUNMP) || defined(IMA_RS6KMP) || defined(IMA_AIX4MP) */
 
728
/* #if defined(IMA_SUNMP) || defined(IMA_RS6KMP) || defined(IMA_AIX4MP) || defined(IMA_AIX5MP) */
710
729
#ifdef PVMUSEMUTEX
711
730
#ifdef  IMA_SUNMP
712
731
                                cond_signal(&dboxp->mb_cond);
713
732
#endif
714
 
#if defined(IMA_RS6KMP) || defined(IMA_AIX4MP)
 
733
#if defined(IMA_RS6KMP) || defined(IMA_AIX4MP) || defined(IMA_AIX5MP)
715
734
                                pthread_cond_signal(&dboxp->mb_cond);
716
735
#endif
717
736
#else