Skip to content

Commit

Permalink
Merge branch 'master' into 10903_ida_abs_corr_tab
Browse files Browse the repository at this point in the history
Refs #10903
  • Loading branch information
DanNixon committed Mar 26, 2015
2 parents 5d0f40e + db48022 commit 15e442d
Show file tree
Hide file tree
Showing 467 changed files with 4,729 additions and 1,048 deletions.
2 changes: 1 addition & 1 deletion Code/Mantid/Build/CMake/DarwinSetup.cmake
Expand Up @@ -80,7 +80,7 @@ endif ()
# Force 64-bit compiler as that's all we support
###########################################################################

set ( CLANG_WARNINGS "-Wall -Wextra -Winit-self -Wpointer-arith -Wcast-qual -fno-common -Wno-deprecated-register")
set ( CLANG_WARNINGS "-Wall -Wextra -pedantic -Winit-self -Wpointer-arith -Wcast-qual -fno-common -Wno-deprecated-register")

set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64 ${CLANG_WARNINGS}" )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64 -std=c++0x" )
Expand Down
5 changes: 0 additions & 5 deletions Code/Mantid/Build/CMake/FindJsonCPP.cmake
Expand Up @@ -9,11 +9,6 @@
# JSONCPP_LIBRARY_DEBUG - library files for linking (debug version)
# JSONCPP_LIBRARIES - All required libraries, including the configuration type

# Using unset here is a temporary hack to force FindJson to find the correct
# path in an incremental build. It should be removed a day or two after the
# branch introducing this is merged.
unset ( JSONCPP_INCLUDE_DIR CACHE )

# Headers
find_path ( JSONCPP_INCLUDE_DIR json/reader.h
PATH_SUFFIXES jsoncpp )
Expand Down
5 changes: 3 additions & 2 deletions Code/Mantid/Build/CMake/GNUSetup.cmake
Expand Up @@ -24,9 +24,10 @@ set( GNUFLAGS "-Wall -Wextra -Wconversion -Winit-self -Wpointer-arith -Wcast-qua
set( GNUFLAGS "${GNUFLAGS} -Wno-deprecated -Wno-write-strings")

# Check if we have a new enough version for this flag
# some -pedantic warnings remain with gcc 4.4.7
if ( CMAKE_COMPILER_IS_GNUCXX )
if (GCC_COMPILER_VERSION VERSION_GREATER "4.3")
set(GNUFLAGS "${GNUFLAGS} -Wno-unused-result")
if (NOT (GCC_COMPILER_VERSION VERSION_LESS "4.5"))
set(GNUFLAGS "${GNUFLAGS} -Wno-unused-result -pedantic")
endif ()
elseif ( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" )
set(GNUFLAGS "${GNUFLAGS} -Wno-sign-conversion")
Expand Down
1 change: 1 addition & 0 deletions Code/Mantid/Framework/API/CMakeLists.txt
Expand Up @@ -221,6 +221,7 @@ set ( INC_FILES
inc/MantidAPI/IPeakFunction.h
inc/MantidAPI/IPeaksWorkspace.h
inc/MantidAPI/IPowderDiffPeakFunction.h
inc/MantidAPI/IRemoteJobManager.h
inc/MantidAPI/ISpectrum.h
inc/MantidAPI/ISplittersWorkspace.h
inc/MantidAPI/ITableWorkspace.h
Expand Down
Expand Up @@ -59,7 +59,7 @@ class MANTID_API_DLL DomainCreatorFactoryImpl
/// Private Constructor for singleton class
DomainCreatorFactoryImpl();
/// No copying
DISABLE_COPY_AND_ASSIGN(DomainCreatorFactoryImpl);
DISABLE_COPY_AND_ASSIGN(DomainCreatorFactoryImpl)
/// Private Destructor for singleton
virtual ~DomainCreatorFactoryImpl();

Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/Framework/API/inc/MantidAPI/FileFinder.h
Expand Up @@ -50,7 +50,7 @@ Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
class MANTID_API_DLL FileFinderImpl {
public:
std::string getFullPath(const std::string &filename) const;
std::string getFullPath(const std::string &filename, const bool ignoreDirs = false) const;
std::string getPath(const std::vector<IArchiveSearch_sptr> &archs,
const std::set<std::string> &filename,
const std::vector<std::string> &extensions) const;
Expand Down
Expand Up @@ -50,6 +50,11 @@ class MANTID_API_DLL FunctionParameterDecorator : virtual public IFunction {

IFunction_sptr clone() const;

virtual void setWorkspace(boost::shared_ptr<const Workspace> ws);
virtual void
setMatrixWorkspace(boost::shared_ptr<const MatrixWorkspace> workspace,
size_t wi, double startX, double endX);

/// Set i-th parameter of decorated function.
virtual void setParameter(size_t i, const double &value,
bool explicitlySet = true);
Expand Down
280 changes: 280 additions & 0 deletions Code/Mantid/Framework/API/inc/MantidAPI/IRemoteJobManager.h
@@ -0,0 +1,280 @@
#ifndef MANTID_KERNEL_IREMOTEJOBMANAGER_H
#define MANTID_KERNEL_IREMOTEJOBMANAGER_H

#include "MantidAPI/DllConfig.h"
#include "MantidKernel/DateAndTime.h"

namespace Mantid {
namespace API {
/**
Common interface to different remote job managers (job schedulers, web
services, etc. such as MOAB, Platform LSF, or SLURM).
IremoteJobManager objects are (in principle) created via the
RemoteJobManagerFactory. There are several "remote algorithms" in
Mantid: Authenticate, SubmitRemoteJob, QueryRemoteJobStatus,
etc. These algorithms are meant to use this interface to the different
specific implementations. Or, from the opposite angle, the methods of
this interface provide the functionality required by the remote
algorithms in a generic way (with respect to different job schedulers
or underlying mechanisms to handle remote jobs). So-called remote job
manager classes can implement this interface to provide
specialisations for Platform LSF, SLURM, MOAB, the Mantid web service
API, etc.
A typical sequence of calls when you use this interface would be:
1) Authenticate/log-in (authenticate())
2) Do transactions
Where the sequence of calls within a transaction is:
2.1) Start transaction (startRemoteTransaction())
2.2) Do actions
2.3) Stop transaction (stopRemoteTransaction())
In 2.2, several types of actions are possible:
- Submit a job to run on the (remote) compute resource (submitRemoteJob()).
- Get status info for one or all jobs (queryRemoteJob() and
queryAllRemoteJobs()).
- Cancel a job (abortRemoteJob()).
- Get list of available files for a transaction on the compute resource
(queryRemoteFile())
- Upload / download files ( uploadRemoteFile() and downloadRemoteFile()).
Copyright &copy; 2015 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge
National Laboratory & European Spallation Source
This file is part of Mantid.
Mantid is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
Mantid is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
File change history is stored at: <https://github.com/mantidproject/mantid>.
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
class MANTID_API_DLL IRemoteJobManager {
public:
virtual ~IRemoteJobManager(){};

/**
* Status and general information about jobs running on (remote)
* compute resources.
*/
struct RemoteJobInfo {
/// Job ID, usually assigned by a job scheduler as an integer
/// number or similar.
std::string id;
/// name of the job, whether given by the user or automatically
/// assigned by the job scheduler
std::string name;
/// Name of the script or executable. Depending on the specific
/// implementation, job scheduler, etc. this can be an
/// 'application' name, a script name or different ways of
/// specifying what is run
std::string runnableName;
/// Last status retrieved (typically: Pending, Running, Exited,
/// etc.). The values are implementation/job scheduler dependent.
std::string status;
/// ID of the transaction where this job is included
std::string transactionID;
/// Date-time of submission. No particular format can be assumed
/// from the specific remote job managers, and some of them may
/// not provide this info
Mantid::Kernel::DateAndTime submitDate;
/// Date-time the job actually started running. No particular
/// format can be assumed
Mantid::Kernel::DateAndTime startDate;
/// Date-time the job finished. No particular format can be
/// assumed
Mantid::Kernel::DateAndTime completionTime;
};

/**
* Authenticate or log-in, previous to submitting jobs, up/downloading, etc.
*
* @param username User name or credentials
*
* @param password Password (or other type of authentication token)
* string.
*
* @throws std::invalid_argument If any of the inputs is not set
* properly.
* @throws std::runtime_error If authentication fails
*/
virtual void authenticate(const std::string &username,
const std::string &password) = 0;

/**
* Submit a job (and implicitly request to start it) within a
* transaction.
*
* @param transactionID ID obtained from a startRemoteTransaction()
*
* @param runnable Name of the script or executable for the
* job. This can be a name or path to a file (implementation
* dependent).
*
* @param param Parameters for the job. This is implementation
* dependent and may be a list of command line options, the name of
* a script or configuration file, the contents of a script to run
* or configuration template, etc. For example, for the Mantid web
* service API, this is the content of a python script.
*
* @param taskName (optional) human readable name for this job.
*
* @param numNodes number of nodes to use (optional and dependent on
* implementation and compute resource)
*
* @parm coresPerNode number of cores to use in each node (optional
* and dependent on implemenation and compute resource)
*
* @return jobID string for the job started (if successful).
*
* @throws std::invalid_argument If any of the inputs is not set
* properly.
* @throws std::runtime_error if job submission fails.
*/
virtual std::string
submitRemoteJob(const std::string &transactionID, const std::string &runnable,
const std::string &param, const std::string &taskName = "",
const int numNodes = 1, const int coresPerNode = 1) = 0;

/**
* Get/download a file from the (remote) compute resource.
*
* @param transactionID ID obtained from a startRemoteTransaction()
*
* @param remoteFileName Name of file on the (remote) compute
* resource. This can be a full or relative path or a simple file
* name, depending on implementation.
*
* @param localFileName Where to place the downloaded file on the
* local machine.
*
* @throws std::invalid_argument If any of the inputs is not set
* properly.
* @throws std::runtime_error If the download operation fails
*/
virtual void downloadRemoteFile(const std::string &transactionID,
const std::string &remoteFileName,
const std::string &localFileName) = 0;

/**
* Get information (status etc.) for all running jobs on the remote
* compute resource
*
* @return Status and general info for all the jobs found on the
* (remote) compute resource. Each of them should come identified by
* its ID.
*
* @throws std::runtime_error If the query fails
*/
virtual std::vector<RemoteJobInfo> queryAllRemoteJobs() const = 0;

/**
* Get the list of files available for a transaction at the (remote)
* compute resource.
*
* @param transactionID ID obtained from startRemoteTransaction()
*
* @return The names of all the available files
*
* @throws std::invalid_argument If there's an issue with the
* transaction ID
*
* @throws std::runtime_error If the query fails
*/
virtual std::vector<std::string>
queryRemoteFile(const std::string &transactionID) const = 0;

/**
* Get information (status etc.) for an (in principle) running job
*
* @param jobID ID of a job as obtained from submitRemoteJob()
*
* @return Status and general info for the job requested
*
* @throws std::invalid_argument If there's an issue with the
* job ID
*
* @throws std::runtime_error If the query fails
*/
virtual RemoteJobInfo queryRemoteJob(const std::string &jobID) const = 0;

/**
* Start a transaction before up/downloading files and submitting
* jobs
*
* @return ID of the transaction as produced by the job scheduler
* and/or remote job manager.
*
* @throws std::runtime_error If the transaction creation fails
*/
virtual std::string startRemoteTransaction() = 0;

/**
* Finish a transaction. This implicitly can cancel all the
* operations (jobs) associated with this transaction.
*
* @param transactionID An Id of a transaction, as returned by
* startRemoteTransaction()
*
* @throws std::invalid_argument If there's an issue with the
* transaction ID
*
* @throws std::runtime_error If the stop operation fails
*/
virtual void stopRemoteTransaction(const std::string &transactionID) = 0;

/**
* Cancel a job (expected to be currently running on the remote resource)
*
* @param jobID ID for a job in a transaction, as returned by
* submitRemoteJob()
*
* @throws std::invalid_argument If there's an issue with the
* job ID
* @throws std::runtime_error If the abort/cancel operation fails
*/
virtual void abortRemoteJob(const std::string &jobID) = 0;

/**
* Upload file for a transaction on the rmeote compute resource
*
* @param transactionID ID, as you get them from
* startRemoteTransaction()
*
* @param remoteFileName Name of file on the (remote) compute
* resource. This can be a full or relative path or a simple file
* name, depending on implementation.
*
* @param localFileName Path to the file to upload
*
* @throws std::invalid_argument If there's an issue with the
* arguments passed
* @throws std::runtime_error If the upload fails
*/
virtual void uploadRemoteFile(const std::string &transactionID,
const std::string &remoteFileName,
const std::string &localFileName) = 0;
};

// shared pointer type for the IRemoteJobManager
typedef boost::shared_ptr<IRemoteJobManager> IRemoteJobManager_sptr;

} // namespace API
} // namespace Mantid

#endif // MANTID_API_IREMOTEJOBMANAGER_H
2 changes: 1 addition & 1 deletion Code/Mantid/Framework/API/inc/MantidAPI/ScopedWorkspace.h
Expand Up @@ -74,7 +74,7 @@ class DLLExport ScopedWorkspace {
void set(Workspace_sptr newWS);

private:
DISABLE_COPY_AND_ASSIGN(ScopedWorkspace);
DISABLE_COPY_AND_ASSIGN(ScopedWorkspace)

/// ADS name of the workspace
const std::string m_name;
Expand Down
6 changes: 3 additions & 3 deletions Code/Mantid/Framework/API/inc/MantidAPI/ScriptRepository.h
Expand Up @@ -48,7 +48,7 @@ enum SCRIPTSTATUS {
LOCAL_ONLY = (1u << 1),
REMOTE_CHANGED = (1u << 2),
LOCAL_CHANGED = (1u << 3),
BOTH_CHANGED = (REMOTE_CHANGED | LOCAL_CHANGED),
BOTH_CHANGED = (REMOTE_CHANGED | LOCAL_CHANGED)
};

/**
Expand Down Expand Up @@ -610,7 +610,7 @@ class MANTID_API_DLL ScriptRepository {

/// shared pointer to the function base class
typedef boost::shared_ptr<ScriptRepository> ScriptRepository_sptr;
};
};
}
}

#endif // MANTID_API_SCRIPTREPOSITORY_H_

0 comments on commit 15e442d

Please sign in to comment.