ibis.h
Go to the documentation of this file.
00001 // $Id$
00002 //      Author: John Wu <John.Wu at ACM.org>
00003 //              Lawrence Berkeley National Laboratory
00004 //      Copyright 2000-2011 the Regents of the University of California
00005 #ifndef IBIS_H
00006 #define IBIS_H
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 #include "countQuery.h"         // ibis::countQuery
00017 #include "meshQuery.h"          // ibis::meshQuery
00018 #include "resource.h"           // ibis::gParameters
00019 #include "bundle.h"             // ibis::bundle
00020 #include "quaere.h"             // ibis::quaere
00021 #include "query.h"              // ibis::query
00022 #include "part.h"               // ibis::part, ibis::column, ibis::table
00023 #include "rids.h"               // ibis::ridHandler
00024 
00238 
00239 
00240 
00241 
00242 namespace ibis {
00291     inline void init(const char* rcfile=0,
00292                      const char* mesgfile=0) {
00293 #if defined(DEBUG) || defined(_DEBUG)
00294         if (gVerbose <= 0) {
00295 #if DEBUG + 0 > 10 || _DEBUG + 0 > 10
00296             gVerbose = INT_MAX;
00297 #elif DEBUG + 0 > 0
00298             gVerbose += 7 * DEBUG;
00299 #elif _DEBUG + 0 > 0
00300             gVerbose += 5 * _DEBUG;
00301 #else
00302             gVerbose += 3;
00303 #endif
00304         }
00305 #endif
00306 #if defined(PTW32_STATIC_LIB)
00307         if (ibis::util::envLock == PTHREAD_MUTEX_INITIALIZER) {
00308             int ierr = pthread_mutex_init(&ibis::util::envLock, 0);
00309             if (ierr != 0)
00310                 throw "ibis::init failed to initialize ibis::util::envLock";
00311         }
00312 #endif
00313         if (mesgfile != 0 && *mesgfile != 0) {
00314             int ierr = ibis::util::setLogFileName(mesgfile);
00315             if (ierr < 0 && ibis::gVerbose >= 0) {
00316                 std::cerr << "ibis::init failed to set log file to "
00317                           << mesgfile << std::endl;
00318              }
00319         }
00320 
00321         if (0 != atexit(ibis::util::closeLogFile)) {
00322             if (ibis::gVerbose >= 0)
00323                 std::cerr << "ibis::init failed to register the function "
00324                     "ibis::util::closeLogFile with atexit" << std::endl;
00325         }
00326         // if (0 != atexit(ibis::util::clearDatasets)) {
00327         //     if (ibis::gVerbose >= 0)
00328         //      std::cerr << "ibis::init failed to register the function "
00329         //          "ibis::util::clearDatasets with atexit" << std::endl;
00330         // }
00331 
00332         if (rcfile != 0 && *rcfile != 0)
00333             ibis::gParameters().read(rcfile);
00334         (void) ibis::fileManager::instance(); // initialize the file manager
00335         if (! ibis::gParameters().empty())
00336             (void) ibis::util::gatherParts(ibis::datasets, ibis::gParameters());
00337 #if defined(_WIN32) && defined(_MSC_VER) && (defined(_DEBUG) || defined(DEBUG))
00338         std::cout << "DEBUG - WIN32 related macros";
00339 #ifdef NTDDI_VERSION
00340         std::cout << "\nNTDDI_VERSION=" << std::hex << NTDDI_VERSION
00341                   << std::dec;
00342 #endif
00343 #ifdef NTDDI_WINVISTA
00344         std::cout << "\nNTDDI_WINVISTA=" << std::hex << NTDDI_WINVISTA
00345                   << std::dec;
00346 #endif
00347 #ifdef WINVER
00348         std::cout << "\nWINVER=" << std::hex << WINVER << std::dec;
00349 #endif
00350 #if defined(HAVE_WIN_ATOMIC32)
00351         std::cout << "\nHAVE_WIN_ATOMIC32 true";
00352 #else
00353         std::cout << "\nHAVE_WIN_ATOMIC32 flase";
00354 #endif
00355 #if defined(HAVE_WIN_ATOMIC64)
00356         std::cout << "\nHAVE_WIN_ATOMIC64 true";
00357 #else
00358         std::cout << "\nHAVE_WIN_ATOMIC64 flase";
00359 #endif
00360         std::cout << std::endl;
00361 #endif
00362     }
00363 }
00364 #endif // IBIS_H

Make It A Bit Faster
Contact us
Disclaimers
FastBit source code
FastBit mailing list archive