Skip to content

Commit ba5bbad

Browse files
eisenhauervicentebolea
authored andcommitted
Add CTest for XRootd Remote support
1 parent ab1518d commit ba5bbad

File tree

9 files changed

+60
-27
lines changed

9 files changed

+60
-27
lines changed

cmake/DetectOptions.cmake

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,16 @@ elseif(ADIOS2_USE_XRootD)
583583
endif()
584584
if(XRootD_FOUND)
585585
set(ADIOS2_HAVE_XRootD TRUE)
586+
FIND_PROGRAM( XROOTD_SERVER_BINARY xrootd
587+
HINTS
588+
${XROOTD_DIR}
589+
$ENV{XROOTD_DIR}
590+
/usr
591+
/opt/xrootd
592+
PATH_SUFFIXES bin
593+
)
594+
message (STATUS "xrootd server binary is ${XROOTD_SERVER_BINARY}")
595+
586596
endif()
587597

588598
# Campaign Management

source/adios2/toolkit/remote/XrootdRemote.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,8 @@ void myRequest::Alert(XrdSsiRespInfoMsg &aMsg)
134134

135135
// Print what we received
136136
//
137-
// fprintf(XrdSsiCl::outFile, "%s@%s: Rcvd %d bytes alert: '%s'\n", rName,
138-
// GetEndPoint().c_str(),
139-
// theMsz, theMsg);
137+
fprintf(XrdSsiCl::outFile, "%s@%s: Rcvd %d bytes alert: '%s'\n", rName, GetEndPoint().c_str(),
138+
theMsz, theMsg);
140139

141140
// Recycle the message
142141
//

source/utils/xrootd-plugin/AdiosFilePool.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ AnonADIOSFile *ADIOSFilePool::GetFree(std::string Filename, bool RowMajorArrays)
1010
auto res = map.find(index);
1111

1212
SubPool *subpool;
13-
AnonADIOSFile *ret;
1413
if (res != map.end())
1514
{
1615
subpool = res->second.get();

source/utils/xrootd-plugin/XrdSsiSvService.cpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,6 @@ using namespace std;
6464

6565
namespace
6666
{
67-
void *SvWecho(void *svP)
68-
{
69-
XrdSsiSvService *sessP = (XrdSsiSvService *)svP;
70-
sessP->doWecho();
71-
return 0;
72-
}
73-
7467
void *SvAdiosGet(void *svP)
7568
{
7669
XrdSsiSvService *sessP = (XrdSsiSvService *)svP;
@@ -501,7 +494,6 @@ void XrdSsiSvService::ProcessRequest4Me(XrdSsiRequest *rqstP)
501494
pthread_t tid;
502495
auto engine = poolEntry->m_engine;
503496
auto io = poolEntry->m_io;
504-
auto var = io.InquireVariable(VarName);
505497
adios2::Box<adios2::Dims> varSel(Start, Count);
506498
adios2::DataType TypeOfVar = io.InquireVariableType(VarName);
507499
try
@@ -569,11 +561,9 @@ int XrdSsiSvService::Copy2Buff(char *dest, int dsz, const char *src, int ssz)
569561

570562
void XrdSsiSvService::Respond(const char *rData, const char *mData)
571563
{
572-
XrdSsiResponder::Status rc;
573-
int rLen;
574-
575564
throw std::logic_error("Respond shouldn't be called");
576565
}
566+
577567
void XrdSsiSvService::AdiosRespond(const char *rData, const char *mData)
578568
{
579569
XrdSsiResponder::Status rc;

source/utils/xrootd-plugin/XrdSsiSvService.hh

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,11 @@
4444
class XrdSsiSvService : public XrdSsiService, public XrdSsiResponder
4545
{
4646
public:
47-
//-----------------------------------------------------------------------------
48-
//! Attach to a previously detached server-side request.
49-
//-----------------------------------------------------------------------------
50-
51-
virtual void Attach(XrdSsiRequest &reqRef, std::string handle) {}
52-
5347
//-----------------------------------------------------------------------------
5448
//! Do delayed echo (internal)
5549
//-----------------------------------------------------------------------------
5650

57-
void doWecho()
58-
{
59-
Respond(m_responseBuffer, m_respMeta);
60-
}
51+
void doWecho() { Respond(m_responseBuffer, m_respMeta); }
6152

6253
void doAdiosGet() { AdiosRespond(m_responseBuffer, m_respMeta); }
6354

@@ -103,7 +94,7 @@ protected:
10394
//! Destructor is protected. You cannot use delete on a service, use the
10495
//! Stop() method to effectively delete the service object.
10596
//-----------------------------------------------------------------------------
106-
~XrdSsiSvService();
97+
~XrdSsiSvService();
10798

10899
private:
109100
int Copy2Buff(char *dest, int dsz, const char *src, int ssz);
@@ -118,7 +109,7 @@ private:
118109
static int alertNum;
119110
char *sName;
120111
char *m_responseBuffer = NULL;
121-
int m_responseBufferSize = 0;
112+
size_t m_responseBufferSize = 0;
122113
char m_respMeta[512];
123114
char m_respData[1024];
124115
int streamRdSz;

testing/adios2/engine/bp/CMakeLists.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,26 @@ if ((NOT WIN32) AND ADIOS2_HAVE_SST)
134134
add_file_remote_tests_helper(WriteMemorySelectionRead)
135135
endif()
136136

137+
if (ADIOS2_HAVE_XRootD)
138+
macro(add_get_xrremote_tests_helper testname)
139+
add_test(NAME "Remote.BP${testname}.GetXRRemote" COMMAND Test.Engine.BP.${testname}.Serial bp5)
140+
set_tests_properties(Remote.BP${testname}.GetXRRemote PROPERTIES FIXTURES_REQUIRED XRServer ENVIRONMENT "DoXRootD=1")
141+
endmacro()
142+
143+
add_test(NAME generateXRootDConfig COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/generateXRootDConfig.sh $<TARGET_FILE:adios2_xrootd> )
144+
add_test(NAME remoteXRServerSetup COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/start_xrootd.sh ${XROOTD_SERVER_BINARY} ${CMAKE_CURRENT_BINARY_DIR})
145+
146+
set_tests_properties(remoteXRServerSetup PROPERTIES FIXTURES_SETUP XRServer)
147+
set_tests_properties(remoteXRServerSetup PROPERTIES DEPENDS "generateXRootDConfig")
148+
149+
add_test(NAME remoteXRServerCleanup COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/kill_xrootd.sh )
150+
set_tests_properties(remoteXRServerCleanup PROPERTIES FIXTURES_CLEANUP XRServer)
151+
152+
##### add remote tests below this line
153+
add_get_xrremote_tests_helper(WriteReadADIOS2stdio)
154+
add_get_xrremote_tests_helper(WriteMemorySelectionRead)
155+
endif()
156+
137157
if(ADIOS2_HAVE_MPI)
138158
list(APPEND BP5LargeMeta "Engine.BP.BPLargeMetadata.BPWrite1D_LargeMetadata.BP5.MPI" "Engine.BP.BPLargeMetadata.ManyLongStrings.BP5.MPI")
139159
endif()
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/sh
2+
echo "First arg is $1"
3+
mkdir -p xroot/var/spool
4+
mkdir -p xroot/run/xrootd
5+
mkdir -p xroot/etc/xrootd
6+
{
7+
echo "xrootd.fslib libXrdSsi.so";
8+
echo ""
9+
echo "all.export /home/eisen/xroot/data nolock r/w";
10+
echo ""
11+
echo "oss.statlib -2 libXrdSsi.so";
12+
echo ""
13+
echo "ssi.svclib $1";
14+
echo ""
15+
} > xroot/etc/xrootd/xrootd-ssi.cfg
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
kill -2 "$(cat /tmp/xrootd.pid)"
3+
#rm /tmp/xrootd.pid
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
if [ "$(id -u)" -eq 0 ]; then
3+
# we run as root in CI in docker images, this is OK, but we have to tell XRootD that it's OK.
4+
ROOT_ARGS="-R sshd"
5+
fi
6+
"$1" -b -l /tmp/xroot.log "$ROOT_ARGS" -w "$2" -c "$2"/xroot/etc/xrootd/xrootd-ssi.cfg

0 commit comments

Comments
 (0)