LIBBATCH_FIND_ALL_LOCAL_COMMANDS()
ENDIF()
+INCLUDE(CheckCXXCompilerFlag)
+
+SET(LIBBATCH_NO_CXX11_SUPPORT FALSE CACHE BOOL "Switch OFF C++-11 standard")
+IF(NOT LIBBATCH_NO_CXX11_SUPPORT)
+ # C++11 support
+ CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
+ IF(COMPILER_SUPPORTS_CXX11)
+ MESSAGE(STATUS "Enable C++11 support")
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+ ELSE()
+ CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
+ IF(COMPILER_SUPPORTS_CXX0X)
+ MESSAGE(STATUS "Enable C++0x support")
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
+ ELSE()
+ MESSAGE(WARNING "Compiler ${CMAKE_CXX_COMPILER} has no C++11 support.")
+ ENDIF()
+ ENDIF()
+ENDIF()
+
+IF(NOT (WIN32 OR APPLE))
+ SET(LIBBATCH_DEBUG_WARNINGS FALSE CACHE BOOL "Print more compiler warnings")
+ SET(LIBBATCH_TREAT_WARNINGS_AS_ERRORS FALSE CACHE BOOL "Treat compiler warnings as errors")
+ IF(LIBBATCH_DEBUG_WARNINGS)
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wpedantic")
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic")
+ ENDIF()
+ IF(LIBBATCH_TREAT_WARNINGS_AS_ERRORS)
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
+ ENDIF()
+ENDIF()
+
+# Compiler flag to disable treating alternative C++ tokens (compatibility with MSVS)
+CHECK_CXX_COMPILER_FLAG("-fno-operator-names" COMPILER_SUPPORTS_NO_OPERATOR_NAMES)
+IF(COMPILER_SUPPORTS_NO_OPERATOR_NAMES)
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-operator-names")
+ENDIF()
+
# Prerequisites detection:
# ========================
FIND_PACKAGE(LibbatchPThread REQUIRED)
// Methode pour le controle des jobs : teste si un job est present en machine
- bool BatchManager_CCC::isRunning(const JobId & jobid)
+ bool BatchManager_CCC::isRunning(const JobId & /*jobid*/)
{
throw NotYetImplementedException("BatchManager_CCC::isRunning");
}
}
// Methode pour le controle des jobs : retire un job du gestionnaire
- void BatchManager::deleteJob(const JobId & jobid)
+ void BatchManager::deleteJob(const JobId & /*jobid*/)
{
throw NotYetImplementedException("Method deleteJob not implemented by Batch Manager \"" + _type + "\"");
}
// Methode pour le controle des jobs : suspend un job en file d'attente
- void BatchManager::holdJob(const JobId & jobid)
+ void BatchManager::holdJob(const JobId & /*jobid*/)
{
throw NotYetImplementedException("Method holdJob not implemented by Batch Manager \"" + _type + "\"");
}
// Methode pour le controle des jobs : relache un job suspendu
- void BatchManager::releaseJob(const JobId & jobid)
+ void BatchManager::releaseJob(const JobId & /*jobid*/)
{
throw NotYetImplementedException("Method releaseJob not implemented by Batch Manager \"" + _type + "\"");
}
// Methode pour le controle des jobs : modifie un job en file d'attente
- void BatchManager::alterJob(const JobId & jobid, const Parametre & param, const Environnement & env)
+ void BatchManager::alterJob(const JobId & /*jobid*/, const Parametre & /*param*/, const Environnement & /*env*/)
{
throw NotYetImplementedException("Method alterJob not implemented by Batch Manager \"" + _type + "\"");
}
// Methode pour le controle des jobs : modifie un job en file d'attente
- void BatchManager::alterJob(const JobId & jobid, const Parametre & param)
+ void BatchManager::alterJob(const JobId & /*jobid*/, const Parametre & /*param*/)
{
throw NotYetImplementedException("Method alterJob not implemented by Batch Manager \"" + _type + "\"");
}
// Methode pour le controle des jobs : modifie un job en file d'attente
- void BatchManager::alterJob(const JobId & jobid, const Environnement & env)
+ void BatchManager::alterJob(const JobId & /*jobid*/, const Environnement & /*env*/)
{
throw NotYetImplementedException("Method alterJob not implemented by Batch Manager \"" + _type + "\"");
}
// Methode pour le controle des jobs : renvoie l'etat du job
- JobInfo BatchManager::queryJob(const JobId & jobid)
+ JobInfo BatchManager::queryJob(const JobId & /*jobid*/)
{
throw NotYetImplementedException("Method queryJob not implemented by Batch Manager \"" + _type + "\"");
}
- const JobId BatchManager::addJob(const Job & job, const string & reference)
+ const JobId BatchManager::addJob(const Job & /*job*/, const string & reference)
{
return JobId(this, reference);
}
}
}
- const Batch::JobId BatchManager::runJob(const Batch::Job & job)
+ const Batch::JobId BatchManager::runJob(const Batch::Job & /*job*/)
{
throw NotYetImplementedException("Method runJob not implemented by Batch Manager \"" + _type + "\"");
}
private:
// Forbid the use of copy constructor and assignment operator
- BatchManagerCatalog(const BatchManagerCatalog & orig) {}
- void operator=(const BatchManagerCatalog & orig) {}
+ BatchManagerCatalog(const BatchManagerCatalog &) {}
+ void operator=(const BatchManagerCatalog &) {}
};
}
vector<string> CommunicationProtocolSH::getExecCommandArgs(const string & subCommand,
- const string & host,
- const string & user) const
+ const string & /*host*/,
+ const string & /*user*/) const
{
vector<string> cmd;
}
vector<string> CommunicationProtocolSH::getCopyCommandArgs(const string & sourcePath,
- const string & sourceHost,
- const string & sourceUser,
+ const string & /*sourceHost*/,
+ const string & /*sourceUser*/,
const string & destinationPath,
- const string & destinationHost,
- const string & destinationUser) const
+ const string & /*destinationHost*/,
+ const string & /*destinationUser*/) const
{
vector<string> cmd;
cmd.push_back(CP_COMMAND);
static Log & getInstance();
// Forbid the use of copy constructor and assignment operator
- Log(const Log & orig) {}
- void operator=(const Log & orig) {}
+ Log(const Log &) {}
+ void operator=(const Log &) {}
std::ofstream _stream;
return "${LAMRANK}";
}
-string MpiImpl_LAM::boot(const string machinefile, const unsigned int nbnodes)
+string MpiImpl_LAM::boot(const string machinefile, const unsigned int /*nbnodes*/)
{
ostringstream oss;
oss << "lamboot " << machinefile << endl;
return oss.str();
}
-string MpiImpl_LAM::run(const string machinefile, const unsigned int nbproc, const string fileNameToExecute)
+string MpiImpl_LAM::run(const string /*machinefile*/, const unsigned int nbproc, const string fileNameToExecute)
{
ostringstream oss;
oss << "mpirun -np " << nbproc << " " << fileNameToExecute << endl;
return "${MPIRUN_RANK}";
}
-string MpiImpl_MPICH1::boot(const string machinefile, const unsigned int nbnodes)
+string MpiImpl_MPICH1::boot(const string /*machinefile*/, const unsigned int /*nbnodes*/)
{
return "";
}
return oss.str();
}
-string MpiImpl_MPICH2::run(const string machinefile, const unsigned int nbproc, const string fileNameToExecute)
+string MpiImpl_MPICH2::run(const string /*machinefile*/, const unsigned int nbproc, const string fileNameToExecute)
{
ostringstream oss;
oss << "mpirun -np " << nbproc << " " << fileNameToExecute << endl;
return "${OMPI_MCA_ns_nds_vpid}";
}
-string MpiImpl_OPENMPI::boot(const string machinefile, const unsigned int nbnodes)
+string MpiImpl_OPENMPI::boot(const string /*machinefile*/, const unsigned int /*nbnodes*/)
{
return "";
}
return "${OMPI_MCA_ns_nds_vpid}";
}
-string MpiImpl_OMPI::boot(const string machinefile, const unsigned int nbnodes)
+string MpiImpl_OMPI::boot(const string /*machinefile*/, const unsigned int /*nbnodes*/)
{
return "";
}
return "${SLURM_PROCID}";
}
-string MpiImpl_SLURM::boot(const string machinefile, const unsigned int nbnodes)
+string MpiImpl_SLURM::boot(const string /*machinefile*/, const unsigned int /*nbnodes*/)
{
return "";
}
-string MpiImpl_SLURM::run(const string machinefile, const unsigned int nbproc, const string fileNameToExecute)
+string MpiImpl_SLURM::run(const string /*machinefile*/, const unsigned int /*nbproc*/, const string fileNameToExecute)
{
ostringstream oss;
oss << "srun " << fileNameToExecute << endl;
return "${RMS_RANK}";
}
-string MpiImpl_PRUN::boot(const string machinefile, const unsigned int nbnodes)
+string MpiImpl_PRUN::boot(const string /*machinefile*/, const unsigned int /*nbnodes*/)
{
return "";
}
-string MpiImpl_PRUN::run(const string machinefile, const unsigned int nbproc, const string fileNameToExecute)
+string MpiImpl_PRUN::run(const string /*machinefile*/, const unsigned int nbproc, const string fileNameToExecute)
{
ostringstream oss;
oss << "prun -n " << nbproc << " " << "-p mpi " << fileNameToExecute << endl;
private:
// Forbid the use of copy constructor and assignment operator
- ParameterTypeMap(const ParameterTypeMap & orig) {}
- void operator=(const ParameterTypeMap & orig) {}
+ ParameterTypeMap(const ParameterTypeMap &) {}
+ void operator=(const ParameterTypeMap &) {}
};
}
Versatile::Versatile(const Versatile & V)
- : _discriminator(V._discriminator),
- _maxsize(V._maxsize),
- _name(V._name)
+ : list(),
+ _discriminator(V._discriminator),
+ _maxsize(V._maxsize),
+ _name(V._name)
{
Versatile::const_iterator it;
for(it=V.begin(); it!=V.end(); it++)
private:
- // Forbid the use of affectation operator
- void operator= (const Versatile & V) {}
+ // Forbid the use of assignment operator
+ void operator= (const Versatile &) {}
};
// Methode pour le controle des jobs : teste si un job est present en machine
- bool BatchManager_LSF::isRunning(const JobId & jobid)
+ bool BatchManager_LSF::isRunning(const JobId & /*jobid*/)
{
throw NotYetImplementedException("BatchManager_LSF::isRunning");
}
// On force donc l'état du job à erreur - pour cela on ne donne pas d'Id
// au JobId
const Batch::JobId
- BatchManager_Local::addJob(const Batch::Job & job, const std::string & reference)
+ BatchManager_Local::addJob(const Batch::Job & /*job*/, const std::string & /*reference*/)
{
return JobId(this, "undefined");
}
}
// Methode pour le controle des jobs : teste si un job est present en machine
- bool BatchManager_PBS::isRunning(const JobId & jobid)
+ bool BatchManager_PBS::isRunning(const JobId & /*jobid*/)
{
throw NotYetImplementedException("BatchManager_PBS::isRunning");
}
}
// Methode pour le controle des jobs : teste si un job est present en machine
- bool BatchManager_SGE::isRunning(const JobId & jobid)
+ bool BatchManager_SGE::isRunning(const JobId & /*jobid*/)
{
throw NotYetImplementedException("BatchManager_SGE::isRunning");
}
BatchManager_Vishnu::BatchManager_Vishnu(const FactBatchManager * parent,
const char * host,
const char * username,
- CommunicationProtocolType protocolType,
+ CommunicationProtocolType /*protocolType*/,
const char * mpiImpl)
: // Force SH protocol for Vishnu
BatchManager(parent, host, username, SH, mpiImpl)