Revision 1108 trunk/src/nh99/pvmvar1.cpp

pvmvar1.cpp (revision 1108)
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

  
......
11 11
 int pvm_params::num_pvm_params=0;
12 12
 const int pvm_params::maxnum_pvm_params=50;
13 13
 pvm_params * pvm_params::varsptr[pvm_params::maxnum_pvm_params+1];
14
    
14

  
15 15
  void pvm_int::assign(const ivector& u)
16 16
  {
17 17
    if(ad_comm::pvm_manager)
......
30 30
      d=u(0);
31 31
    }
32 32
  }
33
  pvm_int::operator int() 
34
  { 
33
  pvm_int::operator int()
34
  {
35 35
    return d;
36 36
  }
37 37
  pvm_number::operator double() { return d;}
......
58 58
  void pvm_params::send_all_to_slaves(void)
59 59
  {
60 60
    for (int i=0;i<num_pvm_params;i++)
61
    { 
61
    {
62 62
      varsptr[i]->send_to_slaves();
63 63
    }
64
  } 
64
  }
65 65

  
66 66
  void pvm_params::get_all_from_master(void)
67 67
  {
68 68
    for (int i=0;i<num_pvm_params;i++)
69
    { 
69
    {
70 70
      varsptr[i]->get_from_master();
71 71
    }
72 72
  }
......
90 90
        " objects" << endl;
91 91
      ad_exit(1);
92 92
    }
93
    varsptr[num_pvm_params++]= this; // this is the list of 
93
    varsptr[num_pvm_params++]= this; // this is the list of
94 94
                                         // fundamental objects
95 95
  }
96 96

  
......
140 140
  int ptid=pvm_parent();
141 141
  // ***************  begin constant receive block *********************
142 142
  adpvm_slave_crecv(ptid);
143
  adpvm_unpack(x);  
143
  adpvm_unpack(x);
144 144
  adpvm_slave_end_creceive();
145 145
  // ***************  end receive block ***********************************
146 146
  d=x;
147 147
}
148
  
148

  
149 149
void pvm_number::get_from_master(void)
150 150
{
151 151
  double x;
152 152
  int ptid=pvm_parent();
153 153
  // ***************  begin constant receive block *********************
154 154
  adpvm_slave_crecv(ptid);
155
  adpvm_unpack(x);  
155
  adpvm_unpack(x);
156 156
  adpvm_slave_end_creceive();
157 157
  // ***************  end receive block ***********************************
158 158
  d=x;
159 159
}
160
  
161 160
#endif //  #if defined(USE_ADPVM)
162

  

Also available in: Unified diff