Compare commits

..

4 Commits

Author SHA1 Message Date
Dennis Klein
868fe02ee9 CI: Submit results to CDash for each build step 2021-04-08 16:22:47 +02:00
Dennis Klein
a2016a9361 CI: Add alice-centos-7 environment 2021-04-08 16:22:47 +02:00
Dennis Klein
ea9aede652 Fallback to <boost/filesystem> on GCC 7 2021-04-08 16:22:47 +02:00
Alexey Rybalchenko
77bf12c8e8 docs patch 2021-04-08 12:38:18 +02:00
6 changed files with 43 additions and 16 deletions

View File

@@ -51,8 +51,12 @@ endif()
list(JOIN options ";" optionsstr) list(JOIN options ";" optionsstr)
ctest_configure(OPTIONS "${optionsstr}") ctest_configure(OPTIONS "${optionsstr}")
ctest_submit()
ctest_build(FLAGS "-j${NCPUS}") ctest_build(FLAGS "-j${NCPUS}")
ctest_submit()
ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}" ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}"
PARALLEL_LEVEL 1 PARALLEL_LEVEL 1
SCHEDULE_RANDOM ON SCHEDULE_RANDOM ON

9
Jenkinsfile vendored
View File

@@ -29,7 +29,11 @@ def jobMatrix(String type, List specs) {
sh "cat ${jobscript}" sh "cat ${jobscript}"
sh "bash ${jobscript}" sh "bash ${jobscript}"
} else { } else {
def containercmd = "singularity exec -B/shared ${env.SINGULARITY_CONTAINER_ROOT}/fairmq/${os}.${ver}.sif bash -l -c \\\"${ctestcmd} -DRUN_STATIC_ANALYSIS=ON\\\"" def static_analysis = "OFF"
if (selector =~ /^fedora/) {
static_analysis = "ON"
}
def containercmd = "singularity exec -B/shared ${env.SINGULARITY_CONTAINER_ROOT}/fairmq/${os}.${ver}.sif bash -l -c \\\"${ctestcmd} -DRUN_STATIC_ANALYSIS=${static_analysis}\\\""
sh """\ sh """\
echo \"echo \\\"*** Job started at .......: \\\$(date -R)\\\"\" >> ${jobscript} echo \"echo \\\"*** Job started at .......: \\\$(date -R)\\\"\" >> ${jobscript}
echo \"echo \\\"*** Job ID ...............: \\\${SLURM_JOB_ID}\\\"\" >> ${jobscript} echo \"echo \\\"*** Job ID ...............: \\\${SLURM_JOB_ID}\\\"\" >> ${jobscript}
@@ -42,12 +46,14 @@ def jobMatrix(String type, List specs) {
sh "test/ci/slurm-submit.sh \"FairMQ \${JOB_BASE_NAME} ${label}\" ${jobscript}" sh "test/ci/slurm-submit.sh \"FairMQ \${JOB_BASE_NAME} ${label}\" ${jobscript}"
withChecks('Static Analysis') { withChecks('Static Analysis') {
if (static_analysis == "ON") {
recordIssues(enabledForFailure: true, recordIssues(enabledForFailure: true,
tools: [gcc(pattern: 'build/Testing/Temporary/*.log')], tools: [gcc(pattern: 'build/Testing/Temporary/*.log')],
filters: [excludeFile('extern/*'), excludeFile('usr/*')], filters: [excludeFile('extern/*'), excludeFile('usr/*')],
skipBlames: true) skipBlames: true)
} }
} }
}
deleteDir() deleteDir()
githubNotify(context: "${label}", description: 'Success', status: 'SUCCESS') githubNotify(context: "${label}", description: 'Success', status: 'SUCCESS')
@@ -73,6 +79,7 @@ pipeline{
steps{ steps{
script { script {
def builds = jobMatrix('build', [ def builds = jobMatrix('build', [
[os: 'alice-centos', ver: '7', arch: 'x86_64', compiler: 'gcc-7'],
[os: 'fedora', ver: '32', arch: 'x86_64', compiler: 'gcc-10'], [os: 'fedora', ver: '32', arch: 'x86_64', compiler: 'gcc-10'],
[os: 'macos', ver: '11', arch: 'x86_64', compiler: 'apple-clang-12'], [os: 'macos', ver: '11', arch: 'x86_64', compiler: 'apple-clang-12'],
]) ])

View File

@@ -203,6 +203,13 @@ macro(set_fairmq_defaults)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${CCACHE}) set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${CCACHE})
endif() endif()
endif() endif()
if( CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8)
set(FAIRMQ_HAS_STD_FILESYSTEM 0)
else()
set(FAIRMQ_HAS_STD_FILESYSTEM 1)
endif()
endmacro() endmacro()
function(join VALUES GLUE OUTPUT) function(join VALUES GLUE OUTPUT)

View File

@@ -283,6 +283,7 @@ if(BUILD_FAIRMQ)
if(BUILD_OFI_TRANSPORT) if(BUILD_OFI_TRANSPORT)
target_compile_definitions(${_target} PRIVATE BUILD_OFI_TRANSPORT) target_compile_definitions(${_target} PRIVATE BUILD_OFI_TRANSPORT)
endif() endif()
target_compile_definitions(${_target} PUBLIC FAIRMQ_HAS_STD_FILESYSTEM=${FAIRMQ_HAS_STD_FILESYSTEM})
####################### #######################
@@ -384,6 +385,7 @@ if(BUILD_FAIRMQ)
$<$<PLATFORM_ID:Linux>:rt> $<$<PLATFORM_ID:Linux>:rt>
Boost::boost Boost::boost
Boost::date_time Boost::date_time
$<$<NOT:${FAIRMQ_HAS_STD_FILESYSTEM}>:Boost::filesystem>
Boost::program_options Boost::program_options
FairLogger::FairLogger FairLogger::FairLogger
PicoSHA2 PicoSHA2
@@ -391,6 +393,7 @@ if(BUILD_FAIRMQ)
target_include_directories(fairmq-shmmonitor PUBLIC target_include_directories(fairmq-shmmonitor PUBLIC
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}> $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>
) )
target_compile_definitions(fairmq-shmmonitor PUBLIC FAIRMQ_HAS_STD_FILESYSTEM=${FAIRMQ_HAS_STD_FILESYSTEM})
add_executable(fairmq-uuid-gen tools/runUuidGenerator.cxx) add_executable(fairmq-uuid-gen tools/runUuidGenerator.cxx)
target_link_libraries(fairmq-uuid-gen PUBLIC target_link_libraries(fairmq-uuid-gen PUBLIC

View File

@@ -20,7 +20,6 @@
#include <boost/date_time/posix_time/posix_time.hpp> #include <boost/date_time/posix_time/posix_time.hpp>
#include <csignal> #include <csignal>
#include <filesystem>
#include <iostream> #include <iostream>
#include <iomanip> #include <iomanip>
#include <chrono> #include <chrono>
@@ -32,6 +31,14 @@
#include <termios.h> #include <termios.h>
#include <poll.h> #include <poll.h>
#if FAIRMQ_HAS_STD_FILESYSTEM
#include <filesystem>
namespace fs = std::filesystem;
#else
#include <boost/filesystem.hpp>
namespace fs = ::boost::filesystem;
#endif
using namespace std; using namespace std;
using bie = ::boost::interprocess::interprocess_exception; using bie = ::boost::interprocess::interprocess_exception;
namespace bipc = ::boost::interprocess; namespace bipc = ::boost::interprocess;
@@ -275,12 +282,12 @@ bool Monitor::PrintShm(const ShmId& shmId)
void Monitor::ListAll(const std::string& path) void Monitor::ListAll(const std::string& path)
{ {
try { try {
if (std::filesystem::is_empty(path)) { if (fs::is_empty(path)) {
LOG(info) << "directory " << filesystem::path(path) << " is empty."; LOG(info) << "directory " << fs::path(path) << " is empty.";
return; return;
} }
for (const auto& entry : filesystem::directory_iterator(path)) { for (const auto& entry : fs::directory_iterator(path)) {
string filename = entry.path().filename().string(); string filename = entry.path().filename().string();
// LOG(info) << filename << ", size: " << entry.file_size() << " bytes"; // LOG(info) << filename << ", size: " << entry.file_size() << " bytes";
if (tools::StrStartsWith(filename, "fmq_") || tools::StrStartsWith(filename, "sem.fmq_")) { if (tools::StrStartsWith(filename, "fmq_") || tools::StrStartsWith(filename, "sem.fmq_")) {
@@ -296,7 +303,7 @@ void Monitor::ListAll(const std::string& path)
LOG(info) << "The file '" << filename << "' does not belong to FairMQ, skipping..."; LOG(info) << "The file '" << filename << "' does not belong to FairMQ, skipping...";
} }
} }
} catch (filesystem::filesystem_error& fse) { } catch (fs::filesystem_error& fse) {
LOG(error) << "error: " << fse.what(); LOG(error) << "error: " << fse.what();
} }
} }

View File

@@ -15,7 +15,7 @@ FairMQ Shared Memory currently uses the following names to register shared memor
| `fmq_<shmId>_m_<segmentId>` | managed segment(s) (user data) | one of the devices | devices | | `fmq_<shmId>_m_<segmentId>` | managed segment(s) (user data) | one of the devices | devices |
| `fmq_<shmId>_mng` | management segment (management data) | one of the devices | devices | | `fmq_<shmId>_mng` | management segment (management data) | one of the devices | devices |
| `fmq_<shmId>_mtx` | mutex | one of the devices | devices | | `fmq_<shmId>_mtx` | mutex | one of the devices | devices |
| `fmq_<shmId>_cv` | condition variable | one of the devices | devices with unmanaged regions | | `fmq_<shmId>_cv` | condition variable | one of the devices | devices |
| `fmq_<shmId>_rg_<index>` | unmanaged region(s) | one of the devices | devices with unmanaged regions | | `fmq_<shmId>_rg_<index>` | unmanaged region(s) | one of the devices | devices with unmanaged regions |
| `fmq_<shmId>_rgq_<index>` | unmanaged region queue(s) | one of the devices | devices with unmanaged regions | | `fmq_<shmId>_rgq_<index>` | unmanaged region queue(s) | one of the devices | devices with unmanaged regions |
| `fmq_<shmId>_ms` | shmmonitor status | shmmonitor | devices, shmmonitor | | `fmq_<shmId>_ms` | shmmonitor status | shmmonitor | devices, shmmonitor |
@@ -35,7 +35,7 @@ The monitor runs in one of the following modes:
| --------------------------- | ---------------------------------------------- | | --------------------------- | ---------------------------------------------- |
| no args | Print segment info of the specified session/shm ID and exit. | | no args | Print segment info of the specified session/shm ID and exit. |
| `--view`,`-v` | Print segment info of the specified session/shm ID and exit. | | `--view`,`-v` | Print segment info of the specified session/shm ID and exit. |
| `--interactive`,`-i` | Print segment info of the specified session/shm ID and exit at a given interval (`--interval`), with some keyboard controls. Can be combined with `--view` for read-only access (and avoid receiving heartbeats). | | `--interactive`,`-i` | Print segment info of the specified session/shm ID at a given interval (`--interval`), with some keyboard controls. Can be combined with `--view` for read-only access (and avoid receiving heartbeats). |
| `--monitor`,`-m` | Monitor the session shm usage by receiving heartbeats from shmem users, cleaning it up if no heartbeats arrived within configured timeout (`--timeout`/`-t`). Only one heartbeat receiver per session is currently possible. If `--self-destruct`/`-x` is added, monitor will exit either when (a) no shm has been observed for interval * 2, (b) a cleanup due to reached timeout has been performed, or (c) shm has been observed, but is now cleaned up. | | `--monitor`,`-m` | Monitor the session shm usage by receiving heartbeats from shmem users, cleaning it up if no heartbeats arrived within configured timeout (`--timeout`/`-t`). Only one heartbeat receiver per session is currently possible. If `--self-destruct`/`-x` is added, monitor will exit either when (a) no shm has been observed for interval * 2, (b) a cleanup due to reached timeout has been performed, or (c) shm has been observed, but is now cleaned up. |
| `--cleanup`,`-c` | Cleanup the shm for the specified session and exit. | | `--cleanup`,`-c` | Cleanup the shm for the specified session and exit. |
| `--debug`,`-b` | Print the list of messages in the current session and exit. Only availabe when FairMQ is compiled with `FAIRMQ_DEBUG_MODE=ON` (high performance impact). | | `--debug`,`-b` | Print the list of messages in the current session and exit. Only availabe when FairMQ is compiled with `FAIRMQ_DEBUG_MODE=ON` (high performance impact). |
@@ -50,7 +50,6 @@ Additional cmd options:
| `--daemonize`,`-d` | Can be combined with the monitoring mode to detach the process from the parent. | | `--daemonize`,`-d` | Can be combined with the monitoring mode to detach the process from the parent. |
| `--verbose`,`-d` | When running as a daemon, store monitor output in `fairmq-shmmonitor_<timestamp>.log` | | `--verbose`,`-d` | When running as a daemon, store monitor output in `fairmq-shmmonitor_<timestamp>.log` |
For full option details, run with `-h`.
Possible further implementation would be to run the monitor with `--self-destruct` with each topology.
The Monitor class can also be used independently from the supplied executable, allowing integration on any level. The Monitor class can also be used independently from the supplied executable, allowing integration on any level.