Skip to content

Commit

Permalink
Merge branch 'master' into install-test
Browse files Browse the repository at this point in the history
  • Loading branch information
ellert committed Feb 4, 2016
2 parents fdbcd5e + ef7dbb3 commit 394129a
Show file tree
Hide file tree
Showing 68 changed files with 2,630 additions and 2,453 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,9 @@ if(WIN32)
DEPENDS root.exe Cling Hist Tree Gpad Graf HistPainter move_artifacts)
else()
add_custom_command(OUTPUT tutorials/hsimple.root
COMMAND ROOTIGNOREPREFIX=1 $<TARGET_FILE:root> -l -q -b -n -x hsimple.C -e return
COMMAND ROOTIGNOREPREFIX=1 $<TARGET_FILE:root.exe> -l -q -b -n -x hsimple.C -e return
WORKING_DIRECTORY tutorials
DEPENDS root root.exe Cling Hist Tree Gpad Graf HistPainter move_artifacts)
DEPENDS root.exe Cling Hist Tree Gpad Graf HistPainter move_artifacts)
endif()
install(FILES ${CMAKE_BINARY_DIR}/tutorials/hsimple.root DESTINATION ${CMAKE_INSTALL_TUTDIR} COMPONENT tests)

Expand Down
9 changes: 7 additions & 2 deletions README/ReleaseNotes/v608/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ Exceptions are now caught in the interactive ROOT session, instead of terminatin
Three methods have been added to manage implicit multi-threading in ROOT: ROOT::EnableImplicitMT(numthreads), ROOT::DisableImplicitMT and ROOT::IsImplicitMTEnabled. They can be used to enable, disable and check the status of the global implicit multi-threading in ROOT, respectively.

## I/O Libraries
Custom streamers need to #include TBuffer.h explicitly (see
* Custom streamers need to #include TBuffer.h explicitly (see
[section Core Libraries](#core-libs))
* Check and flag short reads as errors in the xroot plugins. This fixes [ROOT-3341].


## TTree Libraries
Expand Down Expand Up @@ -123,7 +124,11 @@ Custom streamers need to #include TBuffer.h explicitly (see
head, which is usually not what one wants.
The arrow tip is now drawn using a continuous line.
* It is now possible to select an histogram on a canvas by clicking on the vertical
lines of the bins boundaries. This problem was reported [here](https://sft.its.cern.ch/jira/browse/ROOT-6649?).
lines of the bins boundaries.
This problem was reported [here](https://sft.its.cern.ch/jira/browse/ROOT-6649).
* When using time format in axis, `TGaxis::PaintAxis()` may in some cases call
`strftime()` with invalid parameter causing a crash.
This problem was reported [here](https://sft.its.cern.ch/jira/browse/ROOT-7689).

## 3D Graphics Libraries

Expand Down
17 changes: 14 additions & 3 deletions bindings/pyroot/src/Executors.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ static inline rtype GILCall##tcode( \
PYROOT_IMPL_GILCALL( void, V )
PYROOT_IMPL_GILCALL( UChar_t, B )
PYROOT_IMPL_GILCALL( Char_t, C )
//PYROOT_IMPL_GILCALL( Short_t, H )
PYROOT_IMPL_GILCALL( Short_t, H )
PYROOT_IMPL_GILCALL( Int_t, I )
PYROOT_IMPL_GILCALL( Long_t, L )
PYROOT_IMPL_GILCALL( Long64_t, LL )
Expand All @@ -86,7 +86,8 @@ static inline Cppyy::TCppObject_t GILCallConstructor(
}

static inline PyObject* PyROOT_PyUnicode_FromInt( Int_t c ) {
if ( c < 0 ) return PyInt_FromLong( c ); // python chars are range(256)
// python chars are range(256)
if ( c < 0 ) return PyROOT_PyUnicode_FromFormat( "%c", 256 - std::abs(c));
return PyROOT_PyUnicode_FromFormat( "%c", c );
}

Expand Down Expand Up @@ -166,6 +167,15 @@ PyObject* PyROOT::TIntExecutor::Execute(
return PyInt_FromLong( (Int_t)GILCallI( method, self, ctxt ) );
}

////////////////////////////////////////////////////////////////////////////////
/// execute <method> with argument <self, ctxt>, construct python int return value

PyObject* PyROOT::TShortExecutor::Execute(
Cppyy::TCppMethod_t method, Cppyy::TCppObject_t self, TCallContext* ctxt )
{
return PyInt_FromLong( (Short_t)GILCallH( method, self, ctxt ) );
}

////////////////////////////////////////////////////////////////////////////////
/// execute <method> with argument <self, ctxt>, construct python long return value

Expand Down Expand Up @@ -750,6 +760,7 @@ namespace {
PYROOT_EXECUTOR_FACTORY( UChar )
PYROOT_EXECUTOR_FACTORY( UCharRef )
PYROOT_EXECUTOR_FACTORY( UCharConstRef )
PYROOT_EXECUTOR_FACTORY( Short )
PYROOT_EXECUTOR_FACTORY( ShortRef )
PYROOT_EXECUTOR_FACTORY( UShortRef )
PYROOT_EXECUTOR_FACTORY( Int )
Expand Down Expand Up @@ -804,7 +815,7 @@ namespace {
NFp_t( "const char&", &CreateCharConstRefExecutor ),
NFp_t( "const signed char&", &CreateCharConstRefExecutor ),
NFp_t( "const unsigned char&", &CreateUCharConstRefExecutor ),
NFp_t( "short", &CreateIntExecutor ),
NFp_t( "short", &CreateShortExecutor ),
NFp_t( "short&", &CreateShortRefExecutor ),
NFp_t( "unsigned short", &CreateIntExecutor ),
NFp_t( "unsigned short&", &CreateUShortRefExecutor ),
Expand Down
1 change: 1 addition & 0 deletions bindings/pyroot/src/Executors.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ namespace PyROOT {
PYROOT_DECLARE_BASIC_EXECUTOR( CharConstRef );
PYROOT_DECLARE_BASIC_EXECUTOR( UChar );
PYROOT_DECLARE_BASIC_EXECUTOR( UCharConstRef );
PYROOT_DECLARE_BASIC_EXECUTOR( Short );
PYROOT_DECLARE_BASIC_EXECUTOR( Int );
PYROOT_DECLARE_BASIC_EXECUTOR( Long );
PYROOT_DECLARE_BASIC_EXECUTOR( ULong );
Expand Down
5 changes: 3 additions & 2 deletions cmake/modules/RootNewMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ endmacro()
# STAGE1 LINKDEF linkdef OPTIONS opt1 opt2 ...)
#---------------------------------------------------------------------------------------------------
function(ROOT_GENERATE_DICTIONARY dictionary)
CMAKE_PARSE_ARGUMENTS(ARG "STAGE1;MULTIDICT" "MODULE" "LINKDEF;OPTIONS;DEPENDENCIES" ${ARGN})
CMAKE_PARSE_ARGUMENTS(ARG "STAGE1;MULTIDICT;NOINSTALL" "MODULE" "LINKDEF;OPTIONS;DEPENDENCIES" ${ARGN})

#---roottest compability---------------------------------
if(CMAKE_ROOTTEST_DICT)
Expand Down Expand Up @@ -301,6 +301,7 @@ function(ROOT_GENERATE_DICTIONARY dictionary)
endif()
else()
set(library_name ${libprefix}${deduced_arg_module}${libsuffix})
set(newargs -s ${library_output_dir}/${library_name})
set(pcm_name ${library_output_dir}/${libprefix}${deduced_arg_module}_rdict.pcm)
set(rootmap_name ${library_output_dir}/${libprefix}${deduced_arg_module}.rootmap)
endif()
Expand Down Expand Up @@ -349,7 +350,7 @@ function(ROOT_GENERATE_DICTIONARY dictionary)
get_filename_component(dictname ${dictionary} NAME)

#---roottest compability
if(CMAKE_ROOTTEST_DICT OR (NOT DEFINED CMAKE_LIBRARY_OUTPUT_DIRECTORY))
if(ARG_NOINSTALL OR CMAKE_ROOTTEST_DICT OR (NOT DEFINED CMAKE_LIBRARY_OUTPUT_DIRECTORY))
add_custom_target(${dictname} DEPENDS ${dictionary}.cxx)
else()
add_custom_target(${dictname} DEPENDS ${dictionary}.cxx)
Expand Down
2 changes: 1 addition & 1 deletion cmake/modules/RootTestDriver.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ if(CMD)
file(WRITE ${ERR} "${_errvar}")
endif()

if(DEFINED RC AND (NOT _rc EQUAL RC))
if(DEFINED RC AND (NOT "${_rc}" STREQUAL "${RC}"))
message(FATAL_ERROR "error code: ${_rc}")
elseif(NOT DEFINED RC AND _rc)
message(FATAL_ERROR "error code: ${_rc}")
Expand Down
6 changes: 6 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -7375,6 +7375,9 @@ fi
if test ! "x$macosx106" = "x"; then
rm -f bin/python64 bin/ruby64
fi
if test -f lib/libXrdProofd.so ; then
mv lib/libXrdProofd.so lib/-libXrdProofd.so
fi
rm -f lib/libRXML* bin/libRXML* etc/system.rootmap \
etc/svninfo.txt lib/libProofGui* bin/libProofGui* \
lib/libMySQL* bin/libMySQL* lib/libGedOld* bin/libGedOld* \
Expand Down Expand Up @@ -7440,6 +7443,9 @@ rm -f lib/libRXML* bin/libRXML* etc/system.rootmap \
bin/drop_from_path bin/genreflex bin/genreflex.bat bin/genreflex-rootcint \
bin/genreflex-rootcint.bat \
include/TListOfTypes.h lib/*_RootCling.rootmap bin/rlibmap
if test -f lib/-libXrdProofd.so ; then
mv lib/-libXrdProofd.so lib/libXrdProofd.so
fi

# if previous build was in non-c++11 mode, run "make maintainer-clean" first
run_maintainer_clean="no"
Expand Down
3 changes: 0 additions & 3 deletions core/base/Module.mk
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,3 @@ $(COREDO): CXXFLAGS += $(PCREINC)
ifeq ($(ARCH),linuxicc)
$(COREDO): CXXFLAGS += -wd191
endif

# rebuild after reconfigure
$(call stripsrc,$(BASEDIRS)/TROOT.o): config/Makefile.config
7 changes: 6 additions & 1 deletion core/base/src/TRegexp.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,12 @@ Bool_t TString::Tokenize(TString &tok, Ssiz_t &from, const char *delim) const
if (len <= 0 || from > (len - 1) || from < 0)
return found;

TRegexp rg(delim);
// Ensure backward compatibility to allow one or more times the delimiting character
TString rdelim(delim);
if(rdelim.Length() == 1) {
rdelim = "[" + rdelim + "]+";
}
TRegexp rg(rdelim);

// Find delimiter
Int_t ext = 0;
Expand Down
9 changes: 9 additions & 0 deletions core/cont/inc/ROOT/TSeq.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/* @(#)root/core/cont:$Id$ */
// Author: Danilo Piparo November 2015

#ifndef ROOT_TSeq
#define ROOT_TSeq

Expand Down Expand Up @@ -102,6 +105,12 @@ namespace ROOT {
T operator-(int v) {
return fCounter - v;
}
T operator+(const iterator &other) {
return fCounter + other.fCounter;
}
T operator-(const iterator &other) {
return fCounter - other.fCounter;
}
iterator &operator--() {
fCounter -= fStep;
return *this;
Expand Down
28 changes: 26 additions & 2 deletions core/multiproc/inc/PoolUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace PoolCode {
//////////////////////////////////////////////////////////////////////////

enum EPoolCode : unsigned {
//not an enum class because we want to be able to easily cast back and forth from unsigned
//not an enum class because we want to be able to easily cast back and forth from unsigned
/* TPool::Map */
kExecFunc = 0, ///< Execute function without arguments
kExecFuncWithArg, ///< Execute function with the argument contained in the message
Expand All @@ -50,7 +50,31 @@ namespace PoolCode {
///
//////////////////////////////////////////////////////////////////////////
namespace PoolUtils {
TObject* ReduceObjects(const std::vector<TObject *>& objs);
TObject *ReduceObjects(const std::vector<TObject *> &objs);
}

namespace ROOT {
namespace Internal {
namespace PoolUtils {
template <class O, class F>
class ResultCaster {
public:
static O CastIfNeeded(O &&obj)
{
return obj;
}
};
template <class F>
class ResultCaster<TObject *, F> {
public:
static typename std::enable_if<std::is_pointer<F>::value, F>::type CastIfNeeded(TObject *obj)
{
return static_cast<F>(obj);
}
};
}
}
}


#endif
4 changes: 3 additions & 1 deletion core/multiproc/inc/TPoolWorker.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ class TPoolWorker : public TMPWorker {
MPSend(s, PoolCode::kIdling);
// reduce arguments if possible
if (fCanReduce) {
fReducedResult = fRedFunc({res, fReducedResult}); //TODO try not to copy these into a vector, do everything by ref. std::vector<T&>?
using FINAL = decltype(fReducedResult);
using ORIGINAL = decltype(fRedFunc({res, fReducedResult}));
fReducedResult = ROOT::Internal::PoolUtils::ResultCaster<ORIGINAL, FINAL>::CastIfNeeded(fRedFunc({res, fReducedResult})); //TODO try not to copy these into a vector, do everything by ref. std::vector<T&>?
} else {
fCanReduce = true;
fReducedResult = res;
Expand Down
16 changes: 8 additions & 8 deletions core/multiproc/inc/TProcPool.h
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,7 @@ auto TProcPool::MapReduce(F func, T &args, R redfunc) -> decltype(++(args.begin(
std::make_move_iterator(std::begin(args)),
std::make_move_iterator(std::end(args))
);
const auto &reslist = MapReduce(func, vargs, redfunc);
return reslist;
return MapReduce(func, vargs, redfunc);
}

/// \cond doxygen should ignore these methods
Expand All @@ -330,15 +329,16 @@ template<class F, class T, class R>
auto TProcPool::MapReduce(F func, std::initializer_list<T> args, R redfunc) -> decltype(func(*args.begin()))
{
std::vector<T> vargs(std::move(args));
const auto &reslist = MapReduce(func, vargs, redfunc);
return reslist;
return MapReduce(func, vargs, redfunc);
}


template<class F, class T, class R>
auto TProcPool::MapReduce(F func, std::vector<T> &args, R redfunc) -> decltype(func(args.front()))
{
using retType = decltype(func(args.front()));
using retTypeCand = decltype(func(args.front()));
using retTypeCandNoPtr = typename std::remove_pointer<retTypeCand>::type;
using TObjType = typename std::conditional<std::is_pointer<retTypeCand>::value, TObject*, TObject>::type;
using retType = typename std::conditional<std::is_base_of<TObject, retTypeCandNoPtr>::value, TObjType, retTypeCand>::type;
//prepare environment
Reset();
fTask = ETask::kMapRedWithArg;
Expand All @@ -352,7 +352,7 @@ auto TProcPool::MapReduce(F func, std::vector<T> &args, R redfunc) -> decltype(f
SetNWorkers(oldNWorkers);
if (!ok) {
std::cerr << "[E][C] Could not fork. Aborting operation\n";
return retType();
return retTypeCand();
}

//give workers their first task
Expand All @@ -368,7 +368,7 @@ auto TProcPool::MapReduce(F func, std::vector<T> &args, R redfunc) -> decltype(f

ReapWorkers();
fTask = ETask::kNoTask;
return redfunc(reslist);
return ROOT::Internal::PoolUtils::ResultCaster<retType, retTypeCand>::CastIfNeeded(redfunc(reslist));
}
/// \endcond

Expand Down
7 changes: 4 additions & 3 deletions core/multiproc/src/MPSendRecv.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ MPCodeBufPair MPRecv(TSocket *s)
delete [] rawbuf;

//receive object size
rawbuf = new char[sizeof(ULong_t)];
s->RecvRaw(rawbuf, sizeof(ULong_t));
bufReader.SetBuffer(rawbuf, sizeof(ULong_t), false);
//ULong_t is sent as 8 bytes irrespective of the size of the type
rawbuf = new char[8];
s->RecvRaw(rawbuf, 8);
bufReader.SetBuffer(rawbuf, 8, false);
ULong_t classBufSize;
bufReader.ReadULong(classBufSize);
delete [] rawbuf;
Expand Down
2 changes: 1 addition & 1 deletion core/rint/inc/TRint.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class TRint : public TApplication {
TString fDefaultPrompt; // default prompt: "root [%d] "
char fPrompt[64]; // interpreter prompt
Bool_t fInterrupt; // if true macro execution will be stopped
Bool_t fCaughtException; // TRint just caught an exception or signal
Int_t fCaughtSignal; // TRint just caught a signal
TFileHandler *fInputHandler; // terminal input handler

TRint(const TRint&); // not implemented
Expand Down
23 changes: 13 additions & 10 deletions core/rint/src/TRint.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ ClassImp(TRint)
TRint::TRint(const char *appClassName, Int_t *argc, char **argv, void *options,
Int_t numOptions, Bool_t noLogo):
TApplication(appClassName, argc, argv, options, numOptions),
fCaughtException(kFALSE)
fCaughtSignal(0)
{
fNcmd = 0;
fDefaultPrompt = "root [%d] ";
Expand Down Expand Up @@ -415,20 +415,20 @@ void TRint::Run(Bool_t retrn)
// to call Getlinem(kInit, GetPrompt());
needGetlinemInit = kTRUE;

if (error != 0 || fCaughtException) break;
if (error != 0 || fCaughtSignal) break;
}
} ENDTRY;

if (QuitOpt()) {
if (retrn) return;
if (error) {
retval = error;
} else if (fCaughtException) {
retval = 1;
} else if (fCaughtSignal) {
retval = fCaughtSignal + 128;
}
// Bring retval into sensible range, 0..125.
if (retval < 0) retval = 1;
else if (retval > 125) retval = 1;
// Bring retval into sensible range, 0..255.
if (retval < 0 || retval > 255)
retval = 255;
Terminate(retval);
}

Expand All @@ -444,11 +444,14 @@ void TRint::Run(Bool_t retrn)
if (QuitOpt()) {
printf("\n");
if (retrn) return;
Terminate(fCaughtException ? 1 : 0);
Terminate(fCaughtSignal ? fCaughtSignal + 128 : 0);
}

TApplication::Run(retrn);

// Reset to happiness.
fCaughtSignal = 0;

Getlinem(kCleanUp, 0);
}

Expand Down Expand Up @@ -634,13 +637,13 @@ Bool_t TRint::HandleTermInput()
}

////////////////////////////////////////////////////////////////////////////////
/// Handle exceptions (kSigBus, kSigSegmentationViolation,
/// Handle signals (kSigBus, kSigSegmentationViolation,
/// kSigIllegalInstruction and kSigFloatingException) trapped in TSystem.
/// Specific TApplication implementations may want something different here.

void TRint::HandleException(Int_t sig)
{
fCaughtException = kTRUE;
fCaughtSignal = sig;
if (TROOT::Initialized()) {
if (gException) {
Getlinem(kCleanUp, 0);
Expand Down
Binary file added documentation/doxygen/images/geom_browser.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documentation/doxygen/images/geom_frame0.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documentation/doxygen/images/geom_frame1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documentation/doxygen/images/geom_frameexp.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documentation/doxygen/images/geom_graf.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documentation/doxygen/images/geom_mgr.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documentation/doxygen/images/geom_random1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documentation/doxygen/images/geom_random2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 394129a

Please sign in to comment.