Revision 1088

branches/threaded2/examples/threaded/multisimple/msimple.tpl (revision 1088)
16 16
      gradient_structure::set_MAX_NVAR_OFFSET(10000);
17 17
      gradient_structure::set_GRADSTACK_BUFFER_SIZE(20000000);
18 18
      gradient_structure::set_CMPDIF_BUFFER_SIZE   (20000000);
19
      gradient_structure gs(20000000);
19
      gradient_structure gs(30000000);
20 20
   
21 21
      // get the thread number
22 22
      ad_comm::pthread_manager->set_slave_number(tptr->thread_no);
......
91 91
    Y += 5.0*err;
92 92
    chunk_size = nobs/nthread;
93 93

  
94
    /*
95
    cout << "chunk_size = " << chunk_size << endl;
96
    int end_pos = 0;
97
    for (int kk=1;kk<=nthread;kk++)
98
    {
99
       int start_pos = end_pos + 1;
100
       end_pos = start_pos+chunk_size-1;
101
       if (kk == nthread)
102
           end_pos = nobs;
103
        cout << " * * * chunk " << kk << " from " << start_pos << " to " << end_pos << endl;
104
       dvector t = x(start_pos,end_pos);
105
       cout << "       t runs from " << t.indexmin() << " to " << t.indexmax() << endl;
106
    } 
107
    if (1) exit(1);
108
    */
109

  
110

  
94 111
PARAMETER_SECTION
95 112
  init_number a   
96 113
  init_number b   
......
132 149
  {
133 150
     int start_pos = end_pos + 1;
134 151
     end_pos = start_pos+chunk_size-1;
135
     if (end_pos > nobs)
152
     if (kk == nthread)
136 153
         end_pos = nobs;
137 154
     cerr << " * * * chunk " << kk << " from " << start_pos << " to " << end_pos << endl;
138 155

  
......
179 196
REPORT_SECTION
180 197
  report << "A = " << A << "; B = " << B <<endl;
181 198
  report << "a = " << a << "; b = " << b <<endl;
199
  report << "f = " << f <<endl;
200
  report << "nobs = " << nobs << endl;
201
  report << "number of threads = " << nthread << endl;
202
  report << "chunk size = " << chunk_size << " elements" << endl;
203
  report << "           = " << chunk_size*sizeof(double) << " bytes" << endl;
182 204

  
183 205
  /*
184 206
  removed until pthread_manger destructor finalized
branches/threaded2/examples/threaded/multisimple/msimple.dat (revision 1088)
1 1
# $Id: msimple.dat 3054M 2013-01-10 23:50:00Z (local) $
2 2
# nobs     threads
3
1000000     7
3
1000003     8

Also available in: Unified diff