Revision 544 trunk/src/nh99/parallel.cpp

parallel.cpp (revision 544)
2 2
 * $Id$
3 3
 *
4 4
 * Author: David Fournier
5
 * Copyright (c) 2008-2012 Regents of the University of California 
5
 * Copyright (c) 2008-2012 Regents of the University of California
6 6
 */
7 7
#include <admodel.h>
8 8

  
9
#if defined(linux) && !defined(__WIN32) && !defined(__MINGW64__)
9
#if defined(linux) && !defined(__WIN32) && !defined(__MINGW64__) && !defined(__CYGWIN__)
10 10
#include <ctype.h>
11 11
    void strlwr(char * s)
12 12
    {
13 13
      if (s)
14
      {	      
15
        int n=strlen(s);	    
14
      {
15
        int n=strlen(s);
16 16
	for (int i=0;i<n;i++)
17 17
        {
18 18
          if (isupper(s[i]))
19
          {		  
19
          {
20 20
	    s[i]=tolower(s[i]);
21
          }  
22
        }	  
23
      }		
24
    }	    
25
#endif    
21
          }
22
        }
23
      }
24
    }
25
#endif
26 26
typedef char * pchar;
27 27
  // dvar_vector get_x_from_master(void)
28 28
  // {
......
30 30
  //   int ptid=pvm_parent();
31 31
  //   // ***************  begin variable receive block *********************
32 32
  //   adpvm_slave_vrecv(ptid);
33
  //   adpvm_unpack(x);  
33
  //   adpvm_unpack(x);
34 34
  //   adpvm_slave_end_vreceive();
35 35
  //   // ***************  end receive block ***********************************
36 36
  //   return x;
37 37
  // }
38
  //   
39
  // 
38
  //
39
  //
40 40
  // void send_f_to_master(const dvariable& f)
41 41
  // {
42 42
  //   // ***************  begin send block ***********************************
43 43
  //   int ptid=pvm_parent();
44
  //   adpvm_slave_vinitsend(PvmDataDefault);/* allocate message buffer */	
44
  //   adpvm_slave_vinitsend(PvmDataDefault);/* allocate message buffer */
45 45
  //   adpvm_pack(f);
46 46
  //   adpvm_slave_vsend(ptid);/* send buffer to master */
47 47
  //   // ***************  end send block ***********************************
48 48
  // }
49
  // 
49
  //
50 50
#if defined(USE_ADPVM)
51 51
#include "adpvm2.h"
52 52

  
......
71 71
  printf("I found the following hosts in your virtual machine\n");
72 72
  int i;
73 73
  for (i = 0; i < nhost; i++)
74
  { 
74
  {
75 75
    printf("    %s\n", hostp[i].hi_name);
76 76
  }
77 77
  //id.allocate(0,nhost);
......
88 88
    int on1,nopt1;
89 89
    if ( (on1=option_match(ad_comm::argc,ad_comm::argv,"-exec",nopt1))>-1)
90 90
    {
91
      if (nopt1 !=1)	    
91
      if (nopt1 !=1)
92 92
      {
93 93
        cerr << "Wrong number of options to -exec -- must be 1"
94
          " you have " << nopt1 << endl;		
94
          " you have " << nopt1 << endl;
95 95
        ad_exit(1);
96
      }	
96
      }
97 97
      slave_names+= ad_comm::argv[on1+1];
98
    }   
98
    }
99 99
    else
100 100
    {
101
      slave_names+="test"; 
101
      slave_names+="test";
102 102
    }
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff