Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
project(casarest)
enable_language(CXX Fortran)
cmake_minimum_required(VERSION 3.3.0)
cmake_minimum_required(VERSION 3.14.0)
include(CheckCXXCompilerFlag)
#list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/cmake)
set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")

# Require a C++17 compatible compiler
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)


# rpath setup for libraries

SET(CMAKE_SKIP_BUILD_RPATH FALSE)
Expand All @@ -24,7 +29,7 @@ endif(HDF5_ROOT_DIR)
# project version
set( ${PROJECT_NAME}_MAJOR_VERSION 1 )
set( ${PROJECT_NAME}_MINOR_VERSION 9 )
set( ${PROJECT_NAME}_PATCH_LEVEL 0 )
set( ${PROJECT_NAME}_PATCH_LEVEL 1 )

if (UseCasaNamespace)
add_definitions (-DUseCasaNamespace)
Expand Down
18 changes: 9 additions & 9 deletions flagging/Flagging/Flagger.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1654,9 +1654,9 @@ namespace casacore {

sprintf(subtitle,"pass %d (data)",npass+1);

std::auto_ptr<ProgressMeter> progmeter(NULL);
std::unique_ptr<ProgressMeter> progmeter;
if (chunk.num(TIME) > progmeter_limit) {
progmeter = std::auto_ptr<ProgressMeter>(new ProgressMeter(1.0,static_cast<Double>(chunk.num(TIME)+0.001),title+subtitle,"","","",True,pm_update_freq));
progmeter.reset(new ProgressMeter(1.0,static_cast<Double>(chunk.num(TIME)+0.001),title+subtitle,"","","",True,pm_update_freq));
}

// start pass for all active agents
Expand All @@ -1670,7 +1670,7 @@ namespace casacore {
// iterate over visbuffers
for( vi.origin(); vi.more() && nactive; vi++,itime++ ) {

if (progmeter.get() != NULL) {
if (progmeter) {
progmeter->update(itime);
}
chunk.newTime();
Expand Down Expand Up @@ -1755,17 +1755,17 @@ namespace casacore {
sprintf(subtitle,"pass %d (dry)",npass+1);
//cout << "-----------subtitle=" << subtitle << endl;

std::auto_ptr<ProgressMeter> progmeter(NULL);
std::unique_ptr<ProgressMeter> progmeter;
if (chunk.num(TIME) > progmeter_limit) {
progmeter = std::auto_ptr<ProgressMeter>(new ProgressMeter (1.0,static_cast<Double>(chunk.num(TIME)+0.001),title+subtitle,"","","",True,pm_update_freq));
progmeter.reset(new ProgressMeter (1.0,static_cast<Double>(chunk.num(TIME)+0.001),title+subtitle,"","","",True,pm_update_freq));
}
// start pass for all active agents
for( uInt ival = 0; ival<acc.size(); ival++ )
if ( iter_mode(ival) == RFA::DRY )
acc[ival]->startDry(new_field_spw);
for( uInt itime=0; itime<chunk.num(TIME) && ndry; itime++ )
{
if (progmeter.get() != NULL) {
if (progmeter) {
progmeter->update(itime);
}
// now, call individual VisBuffer iterators
Expand Down Expand Up @@ -1799,16 +1799,16 @@ namespace casacore {
sprintf(subtitle,"pass (flag)");
//cout << "-----------subtitle=" << subtitle << endl;

std::auto_ptr<ProgressMeter> progmeter(NULL);
std::unique_ptr<ProgressMeter> progmeter;
if (chunk.num(TIME) > progmeter_limit) {
progmeter = std::auto_ptr<ProgressMeter>(new ProgressMeter(1.0,static_cast<Double>(chunk.num(TIME)+0.001),title+"storing flags","","","",True,pm_update_freq));
progmeter.reset(new ProgressMeter(1.0,static_cast<Double>(chunk.num(TIME)+0.001),title+"storing flags","","","",True,pm_update_freq));
}
for (uInt i = 0; i<acc.size(); i++)
if (active_init(i))
acc[i]->startFlag(new_field_spw);
uInt itime=0;
for( vi.origin(); vi.more(); vi++,itime++ ) {
if (progmeter.get() != NULL) {
if (progmeter) {
progmeter->update(itime);
}

Expand Down
6 changes: 4 additions & 2 deletions flagging/Flagging/RFFlagCube.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// MV: Is this file unused? I tried to remove usage of auto_ptr throughout the code but in the process noticed that this file is not compiled
// It is included in the CMakefile at least. Leave it as is for now.

//# RFFlagCube.cc: this defines RFFlagCube
//# Copyright (C) 2000,2001,2002
Expand Down Expand Up @@ -432,12 +434,12 @@ void RFFlagCube::getMSFlags(uInt it)
in_flags_flushed = false;
}

auto_ptr<FlagVector> fl_row(NULL);
std::unique_ptr<FlagVector> fl_row;
FlagVector *flr = NULL;

// FlagVector fl_row;//(flagrow.column(pos_get_flag));
if (!kiss) {
fl_row = auto_ptr<FlagVector>(new FlagVector(flagrow.column(pos_get_flag)));
fl_row.reset(new FlagVector(flagrow.column(pos_get_flag)));
flr = fl_row.get();
}

Expand Down
29 changes: 0 additions & 29 deletions msvis/MSVis/SubMS.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@
#include <casacore/casa/Logging/LogIO.h>
#include <casacore/casa/OS/File.h>
#include <casacore/casa/OS/HostInfo.h>
#include <casacore/casa/OS/Memory.h> // Can be commented out along with
// // Memory:: calls.

//#ifdef COPYTIMER
#include <casacore/casa/OS/Timer.h>
Expand Down Expand Up @@ -6813,11 +6811,6 @@ Bool SubMS::fillAverMainTable(const Vector<MS::PredefinedColumns>& colNames)
{
LogIO os(LogOrigin("SubMS", "fillAverMainTable()"));

os << LogIO::DEBUG1 // helpdesk ticket in from Oleg Smirnov (ODU-232630)
<< "Before fillAntIndexer(): "
<< Memory::allocatedMemoryInBytes() / (1024.0 * 1024.0) << " MB"
<< LogIO::POST;

// fill time and timecentroid and antennas
if(fillAntIndexer(mscIn_p, antIndexer_p) < 1)
return False;
Expand Down Expand Up @@ -7817,10 +7810,6 @@ Bool SubMS::doChannelMods(const Vector<MS::PredefinedColumns>& datacols)
//ROTiledStManAccessor tacc(mssel_p, cdesc.dataManagerGroup());
//tacc.showCacheStatistics(cerr); // A 99.x% hit rate is good. 0% is bad.

os << LogIO::DEBUG1 // helpdesk ticket in from Oleg Smirnov (ODU-232630)
<< "Post binning memory: " << Memory::allocatedMemoryInBytes() / (1024.0 * 1024.0) << " MB"
<< LogIO::POST;

return True;
}

Expand Down Expand Up @@ -8029,11 +8018,6 @@ Bool SubMS::doTimeAver(const Vector<MS::PredefinedColumns>& dataColNames)
if(stateRemapper_p.size() < 1)
make_map(mscIn_p->stateId(), stateRemapper_p);

os << LogIO::DEBUG1 // helpdesk ticket from Oleg Smirnov (ODU-232630)
<< "Before msOut_p.addRow(): "
<< Memory::allocatedMemoryInBytes() / (1024.0 * 1024.0) << " MB"
<< LogIO::POST;

Vector<MS::PredefinedColumns> cmplxColLabels;
const Bool doFloat = sepFloat(dataColNames, cmplxColLabels);
const uInt nCmplx = cmplxColLabels.nelements();
Expand Down Expand Up @@ -8237,10 +8221,6 @@ Bool SubMS::doTimeAver(const Vector<MS::PredefinedColumns>& dataColNames)
//ROTiledStManAccessor tacc(mssel_p, cdesc.dataManagerGroup());
//tacc.showCacheStatistics(cerr); // A 99.x% hit rate is good. 0% is bad.

os << LogIO::DEBUG1 // helpdesk ticket in from Oleg Smirnov (ODU-232630)
<< "Post binning memory: " << Memory::allocatedMemoryInBytes() / (1024.0 * 1024.0) << " MB"
<< LogIO::POST;

if(rowsdone < 1){
os << LogIO::WARN
<< "No rows were written. Is all the selected input flagged?"
Expand All @@ -8265,11 +8245,6 @@ Bool SubMS::doTimeAverVisIterator(const Vector<MS::PredefinedColumns>& dataColNa
if(stateRemapper_p.size() < 1)
make_map(mscIn_p->stateId(), stateRemapper_p);

os << LogIO::DEBUG1 // helpdesk ticket from Oleg Smirnov (ODU-232630)
<< "Before msOut_p.addRow(): "
<< Memory::allocatedMemoryInBytes() / (1024.0 * 1024.0) << " MB"
<< LogIO::POST;

Vector<MS::PredefinedColumns> cmplxColLabels;
const Bool doFloat = sepFloat(dataColNames, cmplxColLabels);
const uInt nCmplx = cmplxColLabels.nelements();
Expand Down Expand Up @@ -8463,10 +8438,6 @@ Bool SubMS::doTimeAverVisIterator(const Vector<MS::PredefinedColumns>& dataColNa
} // End of for(vi.originChunks(); vi.moreChunks(); vi.nextChunk())
os << LogIO::NORMAL << "Data binned." << LogIO::POST;

os << LogIO::DEBUG1 // helpdesk ticket in from Oleg Smirnov (ODU-232630)
<< "Post binning memory: " << Memory::allocatedMemoryInBytes() / (1024.0 * 1024.0) << " MB"
<< LogIO::POST;

if(rowsdone < 1){
os << LogIO::WARN
<< "No rows were written. Is all the selected input flagged?"
Expand Down
10 changes: 5 additions & 5 deletions msvis/MSVis/UtilJ.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ template <typename F, typename S>
const F & first (const std::pair<F,S> & pair) { return pair.first;}

template <typename F, typename S>
class FirstFunctor : public std::unary_function<std::pair<F,S>, F>{
class FirstFunctor : public std::function<F(std::pair<F,S>)>{
public:
F & operator() (std::pair<F,S> & p) { return p.first; }
const F & operator() (const std::pair<F,S> & p) { return p.first; }
Expand Down Expand Up @@ -196,7 +196,7 @@ template <typename F, typename S>
const F & second (const std::pair<F,S> & pair) { return pair.second;}

template <typename F, typename S>
class SecondFunctor : public std::unary_function<std::pair<F,S>, F>{
class SecondFunctor : public std::function<S(std::pair<F,S>)>{
public:
S & operator() (std::pair<F,S> & p) { return p.second; }
};
Expand Down Expand Up @@ -428,7 +428,7 @@ class DeltaThreadTimes : private ThreadTimes {

/*

Example of using composer and unary. The composed functors have to be derived from std::unary_function
Example of using composer and unary.

int f(int x) { return x*x;}
int g(int x) { return 2 * x;}
Expand Down Expand Up @@ -457,7 +457,7 @@ Example of using composer and unary. The composed functors have to be derived f
*/

template <typename F, typename G>
class ComposedFunctor : public std::unary_function <typename G::argument_type, typename F::result_type> {
class ComposedFunctor : public std::function <typename F::result_type (typename G::argument_type)> {

public:

Expand All @@ -479,7 +479,7 @@ compose (F f, G g)
}

template <typename D, typename R>
class UnaryFunctor : public std::unary_function<D,R> {
class UnaryFunctor : public std::function<R(D)> {
public:
typedef R (* F) (D);

Expand Down
7 changes: 3 additions & 4 deletions msvis/MSVis/test/tVisibilityIteratorAsync.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
#include <casacore/casa/Arrays/ArrayMath.h>
#include <casacore/casa/BasicSL/Constants.h>
#include <memory>
using std::auto_ptr;

#include <casacore/tables/DataMan/ForwardCol.h>

Expand Down Expand Up @@ -72,7 +71,7 @@ main(int argc, char **argv)
ROVisibilityIteratorAsync::prefetchColumns(VIA::Ant1, VIA::Ant2, VIA::Freq, VIA::Time,
VIA::ObservedCube, VIA::Sigma, VIA::Flag, VIA::Uvw,
-1);
auto_ptr<ROVisibilityIterator> syniter (ROVisibilityIteratorAsync::create (synms,prefetchColumns, bi));
std::unique_ptr<ROVisibilityIterator> syniter (ROVisibilityIteratorAsync::create (synms,prefetchColumns, bi));
VisBufferAutoPtr vb (syniter.get());

// set iterator to start of data
Expand Down Expand Up @@ -136,7 +135,7 @@ main(int argc, char **argv)

cout << " Now try to iterate in time-intervals of 10s"<<endl;

auto_ptr <ROVisibilityIterator>
std::unique_ptr <ROVisibilityIterator>
syniter2 (ROVisibilityIteratorAsync::create (synms,prefetchColumns, bi,10.));

VisBufferAutoPtr vb2 (* syniter2);
Expand All @@ -163,7 +162,7 @@ main(int argc, char **argv)
ROVisibilityIteratorAsync::PrefetchColumns prefetchColumns =
ROVisibilityIteratorAsync::prefetchColumns(VIA::Time, -1);

auto_ptr <ROVisibilityIterator>
std::unique_ptr <ROVisibilityIterator>
syniter3 (ROVisibilityIteratorAsync::create(synms,prefetchColumns, bi,10.));

syniter3->setInterval(1000.);
Expand Down
1 change: 0 additions & 1 deletion synthesis/MeasurementEquations/SkyEquation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@
#include <casacore/casa/System/ProgressMeter.h>

#include <memory>
using std::auto_ptr;

namespace casacore { //# NAMESPACE CASACORE - BEGIN

Expand Down
Loading