~ubuntu-branches/ubuntu/wily/boinc-app-seti/wily-proposed

« back to all changes in this revision

Viewing changes to client/worker.cpp

  • Committer: Package Import Robot
  • Author(s): Gianfranco Costamagna
  • Date: 2014-04-14 00:10:11 UTC
  • mfrom: (1.1.11)
  • Revision ID: package-import@ubuntu.com-20140414001011-uos97gr5k8imsx8e
Tags: 7.28~svn2203-1
* New upstream release, patch refresh.
* Drop fix-armel.patch and fix-ftbfs-arm64.patch, addressed
  upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
68
68
 
69
69
// this gets called first on all platforms
70
70
int common_init() {
71
 
 
 
71
#ifdef USE_MANUAL_CALLSTACK
 
72
  call_stack.enter("common_init()");
 
73
#endif 
72
74
#ifdef ALLOW_CFFT_FILE
73
75
  FILE* f;
74
76
  f = boinc_fopen(CFFT_FILENAME, "r");
77
79
    fclose(f);
78
80
  }
79
81
#endif
80
 
 
81
 
 
 
82
#ifdef USE_MANUAL_CALLSTACK
 
83
  call_stack.exit();
 
84
#endif 
82
85
  return 0;
83
86
}
84
87
 
85
88
// Do this when start on a work unit for the first time.
86
89
// Creates result header file.
87
90
static int initialize_for_wu() {
 
91
#ifdef USE_MANUAL_CALLSTACK
 
92
  call_stack.enter("initialize_for_wu()");
 
93
#endif 
88
94
  int retval = 0;
89
95
  FILE* f;
90
96
  string path;
96
102
  fprintf(f, "<result>\n");
97
103
  retval = seti_write_wu_header(f, 1);
98
104
  fclose(f);
 
105
#ifdef USE_MANUAL_CALLSTACK
 
106
  call_stack.exit();
 
107
#endif 
99
108
 
100
109
  return retval;
101
110
}
103
112
// parse input and state files
104
113
//
105
114
static int read_wu_state() {
 
115
#ifdef USE_MANUAL_CALLSTACK
 
116
    call_stack.enter("read_wu_state()");
 
117
#endif 
106
118
    FILE* f;
107
119
    int retval=0;
108
120
    string path;
137
149
    }
138
150
 
139
151
    boinc_fraction_done(progress*remaining+(1.0-remaining)*(1.0-remaining));
 
152
#ifdef USE_MANUAL_CALLSTACK
 
153
    call_stack.exit();
 
154
#endif 
140
155
    return 0;
141
156
}
142
157
 
144
159
  int retval=0;
145
160
  run_stage=POSTINIT;
146
161
  FORCE_FRAME_POINTER;
 
162
#ifdef USE_MANUAL_CALLSTACK
 
163
  call_stack.enter("worker()");
 
164
#endif 
147
165
#if defined(__GNUC__) && defined (__i386__)
148
166
  __asm__ __volatile__ ("andl $-16, %esp");
149
167
#endif
150
168
 
151
169
// Set up the FPU if necessary.
 
170
#if 0
152
171
#ifdef __arm__
153
 
  controlfp(_RC_NEAREST|_NAN_DEFAULT|_FLUSH_TO_ZERO,_MCW_EM|_MCW_RC|_MCW_NAN|_MCW_FLUSH_TO_ZERO);
 
172
  controlfp(0,0xc00000);
 
173
#endif
154
174
#endif
155
175
 
156
176
  try {
179
199
        boinc_fraction_done(progress);
180
200
        checkpoint(true);      // force a checkpoint
181
201
        boinc_finish(0);
 
202
#ifdef USE_MANUAL_CALLSTACK
 
203
        call_stack.exit();
 
204
#endif 
182
205
        exit(0);            // an overflow is not an app error
183
206
    } else {
184
207
        fprintf(stderr,"E: printing backtrace\n");
185
208
        e.print();
 
209
#ifdef USE_MANUAL_CALLSTACK
 
210
        call_stack.exit();
 
211
#endif 
186
212
        exit(static_cast<int>(e));
187
213
    }
188
214
  }
 
215
#ifdef USE_MANUAL_CALLSTACK
 
216
  call_stack.exit();
 
217
#endif 
189
218
}
190
219