Code indexing in gitaly is broken and leads to code not being visible to the user. We work on the issue with highest priority.

Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • OPAL/src
  • zheng_d/src
  • ext-rogers_c/src
  • ext-wang_c/src
  • cortes_c/src
  • ext-calvo_p/src
  • ext-edelen_a/src
  • albajacas_a/src
  • kraus/src
  • snuverink_j/OPAL-src
  • adelmann/src
  • muralikrishnan/src
  • wyssling_t/src
  • gsell/src
  • ext-piot_p/src
  • OPAL/opal-src-4-opalx-debug
  • winkle_m/src
17 results
Show changes
Commits on Source (56)
Showing
with 60 additions and 71 deletions
cmake_minimum_required (VERSION 3.12)
cmake_policy(VERSION 3.12)
project (OPAL VERSION 2022.2.99)
project (OPAL VERSION 2024.2)
set (PROJECT_BUGREPORT opal@lists.psi.ch)
string (REGEX REPLACE "\\.([0-9])\\." ".0\\1." PACKAGE_VERSION ${PROJECT_VERSION})
......@@ -62,8 +62,12 @@ add_compile_options (-funroll-loops)
add_compile_options (-fstrict-aliasing)
option (WILL_BUILD_STATIC_LIBRARY "Building static library" ON)
option (BUILD_OPAL_PYTHON "Building Python interface for OPAL" OFF)
option (WILL_BUILD_SHARED_LIBRARY "Building python hooks - requires dynamic libs" OFF)
if (BUILD_OPAL_PYTHON)
option (WILL_BUILD_SHARED_LIBRARY "Building python hooks - requires dynamic libs" ON)
if (NOT WILL_BUILD_SHARED_LIBRARY)
message (FATAL_ERROR "For building python hooks you have to enable WILL_BUILD_SHARED_LIBRARY")
endif()
find_package (Python3 COMPONENTS Development REQUIRED)
endif ()
......@@ -98,6 +102,9 @@ elseif (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
# is using this visibility setting.
add_compile_options (-fvisibility=hidden)
add_compile_options (-fvisibility-inlines-hidden)
add_compile_options (-Wno-deprecated-declarations)
add_compile_options (-Wno-deprecated-builtins)
add_compile_options (-Wno-deprecated-copy)
if (ENABLE_OpenMP)
if (CMAKE_HOST_APPLE)
message(FATAL_ERROR "Apple Clang does not support OpenMP!")
......@@ -113,9 +120,10 @@ elseif (${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
# See issue 587 and corresponding merge request 415.
# Clang does not support this flag!
add_compile_options (-fno-aggressive-loop-optimizations)
add_compile_options (-Wno-error=cpp)
if (${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS "4.7.3")
message (FATAL_ERROR "To build OPAL you need GCC version 4.7.3 or greater")
if (${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS "9.5.0")
message (FATAL_ERROR "To build OPAL you need GCC version 9.5.0 or greater")
endif ()
# Warning flags
......@@ -142,9 +150,6 @@ if (CMAKE_Fortran_COMPILER)
if (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
set (Fortran_LIBS "-lgfortran")
endif ()
# CMake issue. Missing library libmpi_mpifh in MPI_Fortran_LINRARIES.
# See issue 587 and corresponding merge request 415.
set (Fortran_LIBS "${Fortran_LIBS} -lmpi_mpifh")
else ()
message (STATUS "No Fortran compiler found (optional)")
if (ENABLE_AMR)
......@@ -173,7 +178,7 @@ if (NOT ${WILL_BUILD_SHARED_LIBRARY})
endif ()
set (Boost_USE_MULTITHREADED OFF)
set (Boost_USE_STATIC_RUNTIME OFF)
set (Boost_LIBS chrono filesystem iostreams regex serialization system timer)
set (Boost_LIBS filesystem iostreams regex serialization system timer)
find_package (Boost 1.66.0
REQUIRED COMPONENTS ${Boost_LIBS})
if(UNIX AND NOT APPLE)
......@@ -306,9 +311,6 @@ endif ()
set (OPAL_CXX_FLAGS ${OPAL_CXX_FLAGS}
CACHE INTERNAL "" FORCE
)
set (OPAL_LIBS ${OPAL_LIBS}
CACHE INTERNAL "" FORCE
)
# configure file
configure_file (
......@@ -320,4 +322,4 @@ install (
FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config_install.cmake
DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/cmake/${PROJECT_NAME}"
RENAME ${PROJECT_NAME}Config.cmake
)
\ No newline at end of file
)
......@@ -38,7 +38,7 @@ PROJECT_NAME = "OPAL (Object Oriented Parallel Accelerator Library)"
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = "2022.2-dev"
PROJECT_NUMBER = "2024.2"
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
......
......@@ -33,8 +33,6 @@ Build:
#include <iostream>
#include <set>
using namespace std;
// dimension of our positions
const unsigned Dim = 3;
......@@ -289,7 +287,7 @@ public:
k2 -= nr_m[2];
kk=(int)nint(sqrt(ii*ii+jj*jj+k2*k2));
kk = min(kmax_m, (int)kk);
kk = std::min(kmax_m, (int)kk);
spectra1D_m[kk] += real(rho_m.localElement(loop));
Nk_m[kk]++;
}
......
......@@ -50,7 +50,7 @@ struct _stat_sum {
double step = boost::get<double>(args[2]);
std::string name = boost::get<std::string>(args[3]);
boost::scoped_ptr<SDDSReader> sim_stats(new SDDSReader(stat_filename_));
const std::unique_ptr<SDDSReader> sim_stats(new SDDSReader(stat_filename_));
try {
sim_stats->parseFile();
} catch (OptPilotException &ex) {
......
......@@ -60,8 +60,8 @@ struct MaxNormRadialPeak {
bool is_valid = true;
boost::scoped_ptr<PeakReader> meas_peaks(new PeakReader(meas_filename_));
boost::scoped_ptr<PeakReader> sim_peaks(new PeakReader(sim_filename_));
const std::unique_ptr<PeakReader> meas_peaks(new PeakReader(meas_filename_));
const std::unique_ptr<PeakReader> sim_peaks(new PeakReader(sim_filename_));
try {
sim_peaks->parseFile();
meas_peaks->parseFile();
......
......@@ -52,7 +52,7 @@ struct NumberOfPeaks {
bool is_valid = true;
boost::scoped_ptr<PeakReader> sim_peaks(new PeakReader(sim_filename_));
const std::unique_ptr<PeakReader> sim_peaks(new PeakReader(sim_filename_));
std::size_t nPeaks = 0;
try {
......
......@@ -100,13 +100,13 @@ namespace client { namespace ast
operand first;
std::list<operation> rest;
};
#if 0
// print functions for debugging
inline std::ostream& operator<<(std::ostream& out, nil)
{
out << "nil"; return out;
}
#endif
inline std::ostream& operator<<(std::ostream& out, identifier const& id)
{
out << id.name; return out;
......
......@@ -11,7 +11,6 @@
#include "error_handler.hpp"
#include <set>
#include <boost/function.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/phoenix/core.hpp>
#include <boost/phoenix/function.hpp>
#include <boost/phoenix/operator.hpp>
......
......@@ -47,7 +47,7 @@ struct ProbeVariable {
bool is_valid = true;
boost::scoped_ptr<ProbeReader> sim_probe(new ProbeReader(probe_filename_));
const std::unique_ptr<ProbeReader> sim_probe(new ProbeReader(probe_filename_));
try {
sim_probe->parseFile();
......
......@@ -6,7 +6,6 @@
#include "boost/type_traits/remove_cv.hpp"
#include "boost/variant/get.hpp"
#include "boost/variant/variant.hpp"
#include "boost/smart_ptr.hpp"
#include "Util/Types.h"
#include "Util/PeakReader.h"
......@@ -31,7 +30,7 @@ struct RadialPeak {
bool is_valid = true;
boost::scoped_ptr<PeakReader> sim_peaks(new PeakReader(peak_filename_));
const std::unique_ptr<PeakReader> sim_peaks(new PeakReader(peak_filename_));
try {
sim_peaks->parseFile();
} catch (OptPilotException &ex) {
......
......@@ -31,7 +31,6 @@
#include "boost/variant/get.hpp"
#include "boost/variant/variant.hpp"
#include "boost/smart_ptr.hpp"
#include "Util/Types.h"
#include "Util/SDDSReader.h"
......@@ -68,7 +67,7 @@ struct SDDSVariable {
bool is_valid = true;
boost::scoped_ptr<SDDSReader> sim_stats(new SDDSReader(stat_filename_));
const std::unique_ptr<SDDSReader> sim_stats(new SDDSReader(stat_filename_));
try {
sim_stats->parseFile();
} catch (SDDSParserException &ex) {
......
......@@ -51,10 +51,10 @@ struct SeptumExpr {
double result = 0.0;
try {
boost::scoped_ptr<PeakReader> sim_peaks(new PeakReader(probe + std::string(".peaks")));
const std::unique_ptr<PeakReader> sim_peaks(new PeakReader(probe + std::string(".peaks")));
sim_peaks->parseFile();
boost::scoped_ptr<ProbeHistReader> sim_hist(new ProbeHistReader(probe + std::string(".hist")));
const std::unique_ptr<ProbeHistReader> sim_hist(new ProbeHistReader(probe + std::string(".hist")));
sim_hist->parseFile();
double upperBound = 0.0;
......
......@@ -69,7 +69,7 @@ struct SumErrSq {
parseMeasurements(measurement_filename);
bool is_valid = true;
boost::scoped_ptr<SDDSReader> sim_stats(new SDDSReader(stat_filename_));
const std::unique_ptr<SDDSReader> sim_stats(new SDDSReader(stat_filename_));
try {
sim_stats->parseFile();
} catch (OptPilotException &ex) {
......
......@@ -35,7 +35,6 @@
#include "boost/type_traits/remove_cv.hpp"
#include "boost/variant/get.hpp"
#include "boost/variant/variant.hpp"
#include "boost/smart_ptr.hpp"
#include "Util/Types.h"
#include "Util/PeakReader.h"
......@@ -58,8 +57,8 @@ struct SumErrSqRadialPeak {
bool is_valid = true;
boost::scoped_ptr<PeakReader> meas_peaks(new PeakReader(meas_filename_));
boost::scoped_ptr<PeakReader> sim_peaks(new PeakReader(sim_filename_));
const std::unique_ptr<PeakReader> meas_peaks(new PeakReader(meas_filename_));
const std::unique_ptr<PeakReader> sim_peaks(new PeakReader(sim_filename_));
try {
sim_peaks->parseFile();
meas_peaks->parseFile();
......
......@@ -26,14 +26,13 @@
// You should have received a copy of the GNU General Public License
// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
//
#include "boost/smart_ptr.hpp"
#include "Util/CmdArguments.h"
#include <cmath>
template <class T> struct BlendCrossover
{
void crossover(boost::shared_ptr<T> ind1, boost::shared_ptr<T> ind2,
void crossover(std::shared_ptr<T> ind1, std::shared_ptr<T> ind2,
CmdArguments_t /*args*/) {
// BLX-0.5 performs better than BLX operators with any other \alpha
......
......@@ -55,8 +55,6 @@
#include "Optimizer/EA/Population.h"
#include "Optimizer/EA/Variator.h"
#include <boost/smart_ptr.hpp>
#include <boost/chrono.hpp>
#include <boost/property_tree/ptree.hpp>
#include "Util/Trace/Trace.h"
......@@ -103,7 +101,7 @@ public:
Variator_t;
typedef Population< Individual_t > Population_t;
/// alias for usage in template
using individual = boost::shared_ptr<typename FixedPisaNsga2::Individual_t>;
using individual = std::shared_ptr<typename FixedPisaNsga2::Individual_t>;
protected:
......@@ -155,9 +153,9 @@ private:
PisaState_t curState_m;
/// collect some statistics of rejected and accepted individuals
boost::scoped_ptr<Statistics<size_t> > statistics_;
const std::unique_ptr<Statistics<size_t> > statistics_;
boost::scoped_ptr<Variator_t> variator_m;
std::unique_ptr<Variator_t> variator_m;
std::vector<unsigned int> pp_all; ///< IDs of population
std::vector<unsigned int> parent_queue_; ///< IDs that will make new offspring
......@@ -180,7 +178,7 @@ private:
std::map<size_t, individual > jobmapping_m;
/// population of pareto-front (for final output)
boost::shared_ptr<Population_t> paretoFront_m;
std::shared_ptr<Population_t> paretoFront_m;
/// indicating if initial population has been created
bool initialized_m;
......@@ -243,12 +241,12 @@ private:
/// file header for result files contains this parameter description
std::string file_param_descr_;
boost::chrono::system_clock::time_point run_clock_start_;
boost::chrono::system_clock::time_point last_clock_;
std::chrono::system_clock::time_point run_clock_start_;
std::chrono::system_clock::time_point last_clock_;
// DEBUG output helpers
boost::scoped_ptr<Trace> job_trace_;
boost::scoped_ptr<Trace> progress_;
std::unique_ptr<Trace> job_trace_;
std::unique_ptr<Trace> progress_;
// entry point for starting the selector side of the PISA state machine
......@@ -279,9 +277,9 @@ private:
bool checkParetoFront(unsigned int id);
/// Dumps index, objective values and bit string of all individuals in
/// global_population.
void dumpPopulation(boost::shared_ptr<Population_t>);
void dumpPopulationToFile(boost::shared_ptr<Population_t>, std::ostringstream& filename, bool dump_offspring);
void dumpPopulationToJSON(boost::shared_ptr<Population_t>, std::ostringstream& filename, bool dump_offspring);
void dumpPopulation(std::shared_ptr<Population_t>);
void dumpPopulationToFile(std::shared_ptr<Population_t>, std::ostringstream& filename, bool dump_offspring);
void dumpPopulationToJSON(std::shared_ptr<Population_t>, std::ostringstream& filename, bool dump_offspring);
void dumpIndividualToFile(int id,
individual& ind,
std::ofstream& file,
......
......@@ -149,16 +149,16 @@ FixedPisaNsga2<CO, MO>::FixedPisaNsga2(
trace_filename << "opt.trace." << comms_.island_id;
job_trace_.reset(new Trace("Optimizer Job Trace"));
job_trace_->registerComponent( "sink",
boost::shared_ptr<TraceComponent>(
std::shared_ptr<TraceComponent>(
new FileSink(trace_filename.str())));
std::ostringstream prog_filename;
prog_filename << "opt.progress." << comms_.island_id;
progress_.reset(new Trace("Optimizer Progress"));
progress_->registerComponent( "timestamp",
boost::shared_ptr<TraceComponent>(new Timestamp()));
std::shared_ptr<TraceComponent>(new Timestamp()));
progress_->registerComponent( "sink",
boost::shared_ptr<TraceComponent>(
std::shared_ptr<TraceComponent>(
new FileSink(prog_filename.str())));
statistics_->registerStatistic("accepted", 0);
......@@ -182,8 +182,8 @@ void FixedPisaNsga2<CO, MO>::initialize() {
initialized_m = false;
// start poll loop
run_clock_start_ = boost::chrono::system_clock::now();
last_clock_ = boost::chrono::system_clock::now();
run_clock_start_ = std::chrono::system_clock::now();
last_clock_ = std::chrono::system_clock::now();
run();
// run has ended
......@@ -192,8 +192,8 @@ void FixedPisaNsga2<CO, MO>::initialize() {
current_hvol_ =
variator_m->population()->computeHypervolume(comms_.island_id, hvol_ref_m);
boost::chrono::duration<double> total =
boost::chrono::system_clock::now() - run_clock_start_;
std::chrono::duration<double> total =
std::chrono::system_clock::now() - run_clock_start_;
std::ostringstream stats;
stats << "__________________________________________" << std::endl;
stats << "GENERATION " << act_gen << std::endl;
......@@ -363,11 +363,11 @@ void FixedPisaNsga2<CO, MO>::postPoll() {
current_hvol_ = hvol;
}
boost::chrono::duration<double> total =
boost::chrono::system_clock::now() - run_clock_start_;
boost::chrono::duration<double> dt =
boost::chrono::system_clock::now() - last_clock_;
last_clock_ = boost::chrono::system_clock::now();
std::chrono::duration<double> total =
std::chrono::system_clock::now() - run_clock_start_;
std::chrono::duration<double> dt =
std::chrono::system_clock::now() - last_clock_;
last_clock_ = std::chrono::system_clock::now();
std::ostringstream stats;
stats << "__________________________________________" << std::endl;
stats << "Arriving at generation " << act_gen + 1 << std::endl;
......@@ -698,7 +698,7 @@ void FixedPisaNsga2<CO, MO>::runStateMachine() {
}
template< template <class> class CO, template <class> class MO >
void FixedPisaNsga2<CO, MO>::dumpPopulation(boost::shared_ptr<Population_t> population) {
void FixedPisaNsga2<CO, MO>::dumpPopulation(std::shared_ptr<Population_t> population) {
std::ostringstream filename;
int fileNumber = act_gen;
if (dump_offspring_m == false) fileNumber--; // parents are from generation earlier (keeping filenumbers the same)
......@@ -713,7 +713,7 @@ void FixedPisaNsga2<CO, MO>::dumpPopulation(boost::shared_ptr<Population_t> popu
}
template< template <class> class CO, template <class> class MO >
void FixedPisaNsga2<CO, MO>::dumpPopulationToFile(boost::shared_ptr<Population_t> population,
void FixedPisaNsga2<CO, MO>::dumpPopulationToFile(std::shared_ptr<Population_t> population,
std::ostringstream& filename,
bool dump_offspring) {
......@@ -783,7 +783,7 @@ void FixedPisaNsga2<CO, MO>::dumpIndividualToFile(int idx,
}
template< template <class> class CO, template <class> class MO >
void FixedPisaNsga2<CO, MO>::dumpPopulationToJSON(boost::shared_ptr<Population_t> population,
void FixedPisaNsga2<CO, MO>::dumpPopulationToJSON(std::shared_ptr<Population_t> population,
std::ostringstream& filename,
bool dump_offspring) {
......
......@@ -19,12 +19,11 @@
// You should have received a copy of the GNU General Public License
// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
//
#include "boost/smart_ptr.hpp"
#include "Util/CmdArguments.h"
template <class T> struct IndependentBitMutation
{
void mutate(boost::shared_ptr<T> ind, CmdArguments_t args) {
void mutate(std::shared_ptr<T> ind, CmdArguments_t args) {
const double probability =
args->getArg<double>("gene-mutation-probability", 0.5);
......
......@@ -33,8 +33,6 @@
#include "Expression/Expression.h"
#include "boost/smart_ptr.hpp"
class Individual {
public:
......@@ -83,7 +81,7 @@ public:
}
/// copy another individual
Individual(boost::shared_ptr<Individual> individual) {
Individual(std::shared_ptr<Individual> individual) {
genes_m = genes_t(individual->genes_m);
objectives_m = objectives_t(individual->objectives_m);
bounds_m = bounds_t(individual->bounds_m);
......
......@@ -18,12 +18,11 @@
// You should have received a copy of the GNU General Public License
// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
//
#include "boost/smart_ptr.hpp"
#include "Util/CmdArguments.h"
template <class T> struct NaiveOnePointCrossover
{
void crossover(boost::shared_ptr<T> ind1, boost::shared_ptr<T> ind2,
void crossover(std::shared_ptr<T> ind1, std::shared_ptr<T> ind2,
CmdArguments_t /*args*/) {
typedef typename T::genes_t genes_t;
......