Revision 1040

branches/threaded2/examples/threaded_tag3.cpp (revision 1040)
1
#include "all.hpp"
2
#include "threaded_tag3.h"
3

  
4

  
5
#ifdef __MSC__
6
  double mfexp(const double& );
7
  dvariable mfexp(const prevariable& );
8
  dvar_vector mfexp(const dvar_vector& );
9
  dvector mfexp(const dvector& );
10
#else
11
  double mfexp(double& );
12
  dvariable mfexp(BOR_CONST prevariable& );
13
  //dvar_vector mfexp(dvar_vector& );
14
  //dvector mfexp(dvector& );
15
#endif
16

  
17
#ifdef __MSVC32__
18
  dvariable age_at_length_calcxx(double& v,dvar_vector& gml,int nslots);
19
#else
20
  dvariable age_at_length_calcxx(const dvariable& v,dvar_vector& gml,int nslots);
21
#endif
22
#include <adthread.h>
23
extern mf_pvm_manager * mf_pvm;
24

  
25
 
26
double mmaxZ[5];
27

  
28
void xxxtags::allocate(void)
29
{
30
 initial_tag_release_by_age.allocate(1,num_tag_releases,1,nage);
31
 initial_tag_release_by_age.initialize();
32
 tagcatch.allocate(1,num_tag_releases,1,num_regions,initial_tag_period,
33
   terminal_tag_period,
34
   1,num_tagfish_incidents,min_tag_age4,nage);
35

  
36

  
37
  if (!age_flags(96)) 
38
  {
39
    cout << " initial_tag_year(2) "  << initial_tag_year(2)  << endl;
40
    tagN.allocate(1,num_tag_releases,1,num_regions,
41
      index_type(initial_tag_year),nyears,min_tag_age1,nage);
42
    tagnum_fish.allocate(1,num_tag_releases,1,num_regions,initial_tag_period,
43
      imatrix(1,num_tag_releases,num_fish_periods),min_tag_age,nage);
44
  }
45
  else
46
  {
47
    tagN.allocate(1,num_tag_releases,1,num_regions,
48
      index_type(initial_tag_year),index_type(terminal_tag_year),
49
      min_tag_age6,nage);
50
    tagnum_fish.allocate(1,num_tag_releases,1,num_regions,initial_tag_period,
51
      terminal_tag_period,min_tag_age5,nage);
52
    pooledtagN.allocate(1,num_regions,min_tag_year,nyears,1,nage);
53
    pooledobstagcatch.allocate(1,num_regions,
54
      minttp+1,num_fish_periods,
55
      1,num_pooledtagfish_incidents,1,nage);
56
      
57
    pooled_tagnum_fish.allocate(1,num_regions,minttp+1,num_fish_periods,
58
       1,nage);
59
    epooled_tagnum_fish_recr.allocate(1,num_regions,minttp+1,num_fish_periods,
60
       1,nage);
61
    pooled_tagcatch.allocate(1,num_regions,minttp+1,
62
      num_fish_periods,
63
      1,num_pooledtagfish_incidents,1,nage);
64

  
65
  } 
66
    
67
  obstagcatch1.allocate(1,num_tag_releases,1,num_regions,
68
    initial_tag_period, terminal_tag_period,
69
    1,num_tagfish_incidents,min_tag_age4,nage);
70

  
71
  obstagcatch.allocate(1,num_tag_releases,1,num_regions,
72
    initial_tag_period, terminal_tag_period,
73
    1,num_tagfish_incidents,min_tag_age4,nage);
74
}
75

  
76
int xxxtags::get_variables_from_master1(void)
77
{
78
  int tn=0;  // from master
79
  ad_comm::pthread_manager->read_lock_buffer(tn);
80
  cout << "start getting stuff from master" << endl;
81
  int flag=ad_comm::pthread_manager->get_int(tn);
82
  if (flag)
83
    return 1;
84
  rep_rate=ad_comm::pthread_manager->get_dvar3_array(tn);
85
  nat_mort=ad_comm::pthread_manager->get_dvar_matrix(tn); 
86
  fraction=ad_comm::pthread_manager->get_dvar_matrix(tn);
87
  incident_sel=ad_comm::pthread_manager->get_dvar4_array(tn);
88
  tot_mort=ad_comm::pthread_manager->get_dvar3_array(tn); 
89
 // tagnum_fish=ad_comm::pthread_manager->get_dvar4_array(tn);
90
 // tagN=ad_comm::pthread_manager->get_dvar4_array(tn);
91
  nrtm=ad_comm::pthread_manager->get_dvar4_array(tn);
92
  Dad=ad_comm::pthread_manager->get_dvar4_array(tn); 
93
  nrfm=ad_comm::pthread_manager->get_dvar5_array(tn);
94
  nrsurv=ad_comm::pthread_manager->get_dvar4_array(tn);
95
  //tagcatch=ad_comm::pthread_manager->get_dvar5_array(tn); 
96
  fish_mort_calcs=ad_comm::pthread_manager->get_dvar4_array(tn); 
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff