]> git.treefish.org Git - phys/latlib.git/blob - o815/obs.cpp
Fixed MPI cmake config.
[phys/latlib.git] / o815 / obs.cpp
1 #include "o815.h"
2
3 #include "latlib/hypercache.h"
4
5 #ifndef MPI_DISABLED
6 #include <mpi.h>
7 #endif
8
9 void o815::obs::finish() {
10   _finish();
11 }
12
13 void o815::obs::start() {
14   if(O815->rank==0) {
15     *out << "#" << O815->programid << "-" << obsid << obsidpostfix << O815->headMaster() << endl << flush;
16     *out << "#" << O815->programid << "-" << obsid << obsidpostfix << O815->headMaster() << "-" << datadesc << endl << flush;
17   }
18
19 #ifndef MPI_DISABLED
20   if (O815->comargs.outdir=="")
21     MPI_Barrier(MPI_COMM_WORLD);
22 #endif  
23
24   _start();
25 }
26
27 void o815::obs::meas(bool loadedobs, const int& nthmeas) {
28   _meas(loadedobs, nthmeas);
29 }
30
31 o815::obs::obs(const string& _obsid, const string& _datadesc, o815 *_O815, const int& obsmemSize, const string& _obsidpostfix) {
32   obsid = _obsid;
33   obsidpostfix = _obsidpostfix;
34   O815 = _O815;
35   datadesc = _datadesc;
36   O815->out->newsub(obsid+obsidpostfix);
37
38   out = O815->out->out[obsid+obsidpostfix];
39   log = O815->out->log;
40   paraQ = O815->paraQ;
41
42   ocid = hypercache::initO(O815->programid + "-" + obsid, O815->comargs.nequi, O815->comargs.nskip,
43                            O815->comargs.obscache.first, &obsMem, obsmemSize, O815->comargs.obscache.second, log);
44 }