5 #include "Poco/Util/Application.h"
6 #include "Poco/Util/ServerApplication.h"
7 #include "Poco/String.h"
8 #include "Poco/Environment.h"
9 #include "Poco/Format.h"
11 #include "../Qxtrm_driver/Qxtrm_driver.h"
12 #include "../newicp/icptimer.h"
16 virtual int main(
const std::vector<std::string>& args);
21 if (config().getBool(
"application.runAsService",
false))
25 std::cerr <<
"press a key";
29 std::string app_dir = config().getString(
"application.dir");
30 std::string config_file = app_dir +
"..\\..\\..\\qxtrm_config.xml";
31 if ( access(config_file.c_str(), 04) == -1 )
33 config_file = app_dir +
"qxtrm_config.xml";
35 std::cerr <<
"Using config file " << config_file << std::endl;
36 std::cerr <<
"Initialising Qxtrm connection ... ";
37 int nwords = 25*1024*1024;
41 Qxtrm_driver qx_driver(config_file,
"host_loopback",
"process1");
42 std::cerr <<
"Creating channel eth1_RDMA1_loop ... ";
43 Poco::SharedPtr<Qxtrm_channel> rdma_mem_loop = qx_driver.
createChannel(
"eth1_RDMA1_loop");
44 std::cerr <<
"Creating channel eth1_RDMA2_loop ... ";
45 Poco::SharedPtr<Qxtrm_channel> rdma_reg_loop = qx_driver.
createChannel(
"eth1_RDMA2_loop");
46 uint32_t* local_mem =
new uint32_t[nwords];
47 uint32_t* local_reg =
new uint32_t[nwords];
48 rdma_mem_loop->RDMARegisterMemory(local_mem, nwords * 4, 0x0);
49 rdma_reg_loop->RDMARegisterMemory(local_reg, nwords * 4, 0x0);
51 std::cerr <<
"DONE" << std::endl;
52 std::cerr <<
"Creating channel eth1_RDMA1 ... ";
53 Poco::SharedPtr<Qxtrm_channel> rdma_mem = qx_driver.
createChannel(
"eth1_RDMA1");
54 std::cerr <<
"DONE" << std::endl;
55 std::cerr <<
"Creating channel eth1_RDMA2 ... ";
56 Poco::SharedPtr<Qxtrm_channel> rdma_reg = qx_driver.
createChannel(
"eth1_RDMA2");
57 std::cerr <<
"DONE" << std::endl;
67 rdma_reg->RDMAWrite(53, 0x00000230);
69 char* mem_buffer =
new char[nwords * 4];
74 rdma_mem->RDMAWrite(mem_buffer, nwords * 4, 0x0);
75 tim.
info(
"100Mb", std::cerr);
81 catch(
const std::exception& ex)
83 std::cerr << ex.what() << std::endl;
91 return app.run(argc, argv);
Poco::SharedPtr< Qxtrm_channel > createChannel(const std::string &chan_name)
std::ostream & channelTransferStats(std::ostream &os) const
std::ostream & channelStatus(std::ostream &os) const
virtual int main(const std::vector< std::string > &args)
double info(const char *title, std::ostream &os, bool add_nl=true)
int _tmain(int argc, _TCHAR *argv[])