Changeset 3046 for trunk/src


Ignore:
Timestamp:
08/07/15 17:55:07 (9 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: Yes CAS-7764

Ready for Test: Yes

Interface Changes: Yes/No

What Interface Changed: Please list interface changes

Test Programs: List test programs

Put in Release Notes: Yes/No

Module(s): Module Names change impacts.

Description:


Release GIL in some time-consuming functions. Currently the following functions releases GIL:


  • MSFiller::fill
  • MSWriter::write
  • Scantable::applyBaselineTable
  • Scantable::subBaseline
  • CalibrationManager::calibrate
  • CalibrationManager::apply
Location:
trunk/src
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/MSFillerWrapper.h

    r2482 r3046  
    2424#include "ScantableWrapper.h"
    2525#include "MSFiller.h"
     26#include "GILHandler.h"
    2627
    2728namespace asap
     
    6364  void fill()
    6465  {
     66    GILHandler scopedRelease;
     67
    6568    if ( attached_ ) {
    6669      filler_->fill() ;
  • trunk/src/MSWriterWrapper.h

    r1974 r3046  
    2424#include "ScantableWrapper.h"
    2525#include "MSWriter.h"
     26#include "GILHandler.h"
    2627
    2728namespace asap
     
    3940  void write(const std::string& filename, const casa::Record& rec)
    4041  {
     42    GILHandler scopedRelease;
     43
    4144    casa::File file( filename ) ;
    4245    writer_ = new MSWriter( stable_ ) ;
  • trunk/src/ScantableWrapper.h

    r2888 r3046  
    2424#include "STFit.h"
    2525#include "STFitEntry.h"
     26#include "GILHandler.h"
    2627
    2728namespace asap {
     
    291292
    292293  std::vector<std::string> applyBaselineTable(const std::string& bltable, const bool returnfitresult, const std::string& outbltable, const bool outbltableexists, const bool overwrite)
    293   { return table_->applyBaselineTable(bltable, returnfitresult, outbltable, outbltableexists, overwrite); }
     294  {
     295    GILHandler scopedRelease;
     296    return table_->applyBaselineTable(bltable, returnfitresult, outbltable, outbltableexists, overwrite);
     297  }
    294298  std::vector<std::string> subBaseline(const std::vector<std::string>& blinfo, const bool returnfitresult, const std::string& outbltable, const bool outbltableexists, const bool overwrite)
    295   { return table_->subBaseline(blinfo, returnfitresult, outbltable, outbltableexists, overwrite); }
     299  {
     300    GILHandler scopedRelease;
     301    return table_->subBaseline(blinfo, returnfitresult, outbltable, outbltableexists, overwrite);
     302  }
    296303  void polyBaseline(const std::vector<bool>& mask, int order, float clipthresh, int clipniter, bool getresidual=true, const std::string& showprogress="true,1000", const bool outlog=false, const std::string& blfile="", const std::string& bltable="")
    297304  { table_->polyBaseline(mask, order, clipthresh, clipniter, getresidual, showprogress, outlog, blfile, bltable); }
  • trunk/src/python_CalibrationManager.cpp

    r2922 r3046  
    88#include <vector>
    99
    10 #include "CalibrationManager.h"
     10#include "CalibrationManagerWrapper.h"
    1111#include "ScantableWrapper.h"
    1212
     
    1717
    1818void python_CalibrationManager() {
    19   class_<CalibrationManager>("_calmanager")
     19  class_<CalibrationManagerWrapper>("_calmanager")
    2020    .def( init <> () )
    21     .def("set_data", &CalibrationManager::setScantable)
    22     .def("set_data", &CalibrationManager::setScantableByName)
    23     .def("add_applytable", &CalibrationManager::addApplyTable)
    24     .def("add_skytable", &CalibrationManager::addSkyTable)
    25     .def("add_tsystable", &CalibrationManager::addTsysTable)
    26     .def("set_calmode", &CalibrationManager::setMode)
    27     .def("set_time_interpolation", &CalibrationManager::setTimeInterpolation,
     21    .def("set_data", &CalibrationManagerWrapper::setScantable)
     22    .def("set_data", &CalibrationManagerWrapper::setScantableByName)
     23    .def("add_applytable", &CalibrationManagerWrapper::addApplyTable)
     24    .def("add_skytable", &CalibrationManagerWrapper::addSkyTable)
     25    .def("add_tsystable", &CalibrationManagerWrapper::addTsysTable)
     26    .def("set_calmode", &CalibrationManagerWrapper::setMode)
     27    .def("set_time_interpolation", &CalibrationManagerWrapper::setTimeInterpolation,
    2828         (boost::python::arg("interp"),
    2929          boost::python::arg("order")=-1))
    30     .def("set_freq_interpolation", &CalibrationManager::setFrequencyInterpolation,
     30    .def("set_freq_interpolation", &CalibrationManagerWrapper::setFrequencyInterpolation,
    3131         (boost::python::arg("interp"),
    3232          boost::python::arg("order")=-1))
    33     .def("set_calibration_options", &CalibrationManager::setCalibrationOptions)
    34     .def("reset", &CalibrationManager::reset)
    35     .def("set_tsys_spw", &CalibrationManager::setTsysSpw)
    36     .def("set_tsys_spw_withrange", &CalibrationManager::setTsysSpwWithRange,
     33    .def("set_calibration_options", &CalibrationManagerWrapper::setCalibrationOptions)
     34    .def("reset", &CalibrationManagerWrapper::reset)
     35    .def("set_tsys_spw", &CalibrationManagerWrapper::setTsysSpw)
     36    .def("set_tsys_spw_withrange", &CalibrationManagerWrapper::setTsysSpwWithRange,
    3737         (boost::python::arg("spwlist"),
    3838          boost::python::arg("average")=false))
    39     .def("set_tsys_transfer", &CalibrationManager::setTsysTransfer)
    40     .def("calibrate", &CalibrationManager::calibrate)
    41     .def("apply", &CalibrationManager::apply,
     39    .def("set_tsys_transfer", &CalibrationManagerWrapper::setTsysTransfer)
     40    .def("calibrate", &CalibrationManagerWrapper::calibrate)
     41    .def("apply", &CalibrationManagerWrapper::apply,
    4242         (boost::python::arg("insitu")=false,
    4343          boost::python::arg("filltsys")=true))
    44     .def("save_caltable", &CalibrationManager::saveCaltable)
    45     .def("split", &CalibrationManager::split)
     44    .def("save_caltable", &CalibrationManagerWrapper::saveCaltable)
     45    .def("split", &CalibrationManagerWrapper::split)
    4646    ;
    4747   
Note: See TracChangeset for help on using the changeset viewer.