release notes | Book: 1.9.5, 1.9.12 (opt, FHS), 2.11 (FHS), 2.12 (FHS), 2.13 (FHS), 2.14 (FHS), | Wiki | Q&A black_bg
Web: Multi-page, Single page | PDF: A4-size, Letter-size | eBook: epub black_bg

Quick tests

The subsequent paragraphs describe a quick guide on how to test xrootd using the xrdcp and ROOT clients.

[return to top]

Copying files with xrdcp

A simple way to get files in and out of dCache via xrootd is the command xrdcp. It is included in every xrootd and ROOT distribution.

To transfer a single file in and out of dCache, just issue

[user] $ xrdcp /bin/sh root://<door_hostname>//pnfs/<site.de>/data/xrd_test
      [user] $ xrdcp root://<door_hostname>//pnfs/<site.de>/data/xrd_test /dev/null

[return to top]

Accessing files from within ROOT

This simple ROOT example shows how to write a randomly filled histogram to a file in dCache:

root [0] TH1F h("testhisto", "test", 100, -4, 4);
root [1] h->FillRandom("gaus", 10000);
root [2] TFile *f = new TXNetFile("root://<door_hostname>//pnfs/<site.de>/data/test.root","new");
061024 12:03:52 001 Xrd: Create: (C) 2004 SLAC INFN XrdClient 0.3
root [3] h->Write();
root [4] f->Write();
root [5] f->Close();
root [6] 061101 15:57:42 14991 Xrd: XrdClientSock::RecvRaw: Error reading from socket: Success
061101 15:57:42 14991 Xrd: XrdClientMessage::ReadRaw: Error reading header (8 bytes)

Closing remote xrootd files that live in dCache produces this warning, but has absolutely no effect on subsequent ROOT commands. It happens because dCache closes all TCP connections after finishing a file transfer, while xrootd expects to keep them open for later resue.

To read it back into ROOT from dCache:

root [7] TFile *reopen = TXNetFile ("root://<door_hostname>//pnfs/<site.de>/data/test.root","read");
root [8] reopen->ls();
TXNetFile**             //pnfs/<site.de>/data/test.root
 TXNetFile*             //pnfs/<site.de>/data/test.root
  KEY: TH1F     testhisto;1     test