jack2 codebase
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

673 lines
20KB

  1. /*
  2. Copyright (C) 2004-2006 Grame
  3. This program is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation; either version 2 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, write to the Free Software
  13. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  14. */
  15. #include <iostream>
  16. #include <fstream>
  17. #include <assert.h>
  18. #include "JackEngine.h"
  19. #include "JackExternalClient.h"
  20. #include "JackEngineControl.h"
  21. #include "JackClientControl.h"
  22. #include "JackEngineTiming.h"
  23. #include "JackGlobals.h"
  24. #include "JackChannel.h"
  25. #include "JackSyncInterface.h"
  26. namespace Jack
  27. {
  28. JackEngine::JackEngine(JackGraphManager* manager,
  29. JackSynchro** table,
  30. JackEngineControl* control)
  31. {
  32. fGraphManager = manager;
  33. fSynchroTable = table;
  34. fEngineControl = control;
  35. fChannel = JackGlobals::MakeServerNotifyChannel();
  36. fSignal = JackGlobals::MakeInterProcessSync();
  37. fEngineTiming = new JackEngineTiming(fClientTable, fGraphManager, fEngineControl);
  38. for (int i = 0; i < CLIENT_NUM; i++)
  39. fClientTable[i] = NULL;
  40. fEngineTiming->ClearTimeMeasures();
  41. fEngineTiming->ResetRollingUsecs();
  42. }
  43. JackEngine::~JackEngine()
  44. {
  45. delete fChannel;
  46. delete fEngineTiming;
  47. delete fSignal;
  48. }
  49. //-------------------
  50. // Client management
  51. //-------------------
  52. int JackEngine::Open()
  53. {
  54. JackLog("JackEngine::Open\n");
  55. // Open audio thread => request thread communication channel
  56. if (fChannel->Open() < 0) {
  57. jack_error("Cannot connect to server");
  58. return -1;
  59. } else {
  60. return 0;
  61. }
  62. }
  63. int JackEngine::Close()
  64. {
  65. JackLog("JackEngine::Close\n");
  66. fChannel->Close();
  67. // Close (possibly) remaining clients (RT is stopped)
  68. for (int i = 0; i < CLIENT_NUM; i++) {
  69. JackClientInterface* client = fClientTable[i];
  70. if (client) {
  71. JackLog("JackEngine::Close remaining client %ld\n", i);
  72. ClientCloseAux(i, client, false);
  73. client->Close();
  74. delete client;
  75. }
  76. }
  77. fSignal->Destroy();
  78. return 0;
  79. }
  80. int JackEngine::Allocate()
  81. {
  82. for (int i = 0; i < CLIENT_NUM; i++) {
  83. if (!fClientTable[i]) {
  84. JackLog("JackEngine::AllocateRefNum ref = %ld\n", i);
  85. return i;
  86. }
  87. }
  88. return -1;
  89. }
  90. //------------------
  91. // Graph management
  92. //------------------
  93. void JackEngine::ProcessNext(jack_time_t callback_usecs)
  94. {
  95. fLastSwitchUsecs = callback_usecs;
  96. if (fGraphManager->RunNextGraph()) // True if the graph actually switched to a new state
  97. fChannel->ClientNotify(ALL_CLIENTS, kGraphOrderCallback, 0);
  98. fSignal->SignalAll(); // Signal for threads waiting for next cycle
  99. }
  100. void JackEngine::ProcessCurrent(jack_time_t callback_usecs)
  101. {
  102. if (callback_usecs < fLastSwitchUsecs + 2 * fEngineControl->fPeriodUsecs) // Signal XRun only for the first failling cycle
  103. CheckXRun(callback_usecs);
  104. fGraphManager->RunCurrentGraph();
  105. }
  106. bool JackEngine::Process(jack_time_t callback_usecs)
  107. {
  108. bool res = true;
  109. // Transport begin
  110. fEngineControl->CycleBegin(callback_usecs);
  111. // Timing
  112. fEngineControl->IncFrameTime(callback_usecs);
  113. fEngineTiming->UpdateTiming(callback_usecs);
  114. // Graph
  115. if (fGraphManager->IsFinishedGraph()) {
  116. ProcessNext(callback_usecs);
  117. res = true;
  118. } else {
  119. JackLog("Process: graph not finished!\n");
  120. if (callback_usecs > fLastSwitchUsecs + fEngineControl->fTimeOutUsecs) {
  121. JackLog("Process: switch to next state delta = %ld\n", long(callback_usecs - fLastSwitchUsecs));
  122. //RemoveZombifiedClients(callback_usecs); TODO
  123. ProcessNext(callback_usecs);
  124. res = true;
  125. } else {
  126. JackLog("Process: waiting to switch delta = %ld\n", long(callback_usecs - fLastSwitchUsecs));
  127. ProcessCurrent(callback_usecs);
  128. res = false;
  129. }
  130. }
  131. // Transport end
  132. fEngineControl->CycleEnd(fClientTable);
  133. return res;
  134. }
  135. /*
  136. Client that finish *after* the callback date are considered late even if their output buffers may have been
  137. correctly mixed in the time window: callbackUsecs <==> Read <==> Write.
  138. */
  139. void JackEngine::CheckXRun(jack_time_t callback_usecs) // REVOIR les conditions de fin
  140. {
  141. for (int i = REAL_REFNUM; i < CLIENT_NUM; i++) {
  142. JackClientInterface* client = fClientTable[i];
  143. if (client && client->GetClientControl()->fActive) {
  144. JackClientTiming* timing = fGraphManager->GetClientTiming(i);
  145. jack_client_state_t status = timing->fStatus;
  146. jack_time_t finished_date = timing->fFinishedAt;
  147. if (status != NotTriggered && status != Finished) {
  148. jack_error("JackEngine::XRun: client = %s was not run: state = %ld", client->GetClientControl()->fName, status);
  149. //fChannel->ClientNotify(i, kXRunCallback, 0); // Notify the failing client
  150. fChannel->ClientNotify(ALL_CLIENTS, kXRunCallback, 0); // Notify all clients
  151. }
  152. if (status == Finished && (long)(finished_date - callback_usecs) > 0) {
  153. jack_error("JackEngine::XRun: client %s finished after current callback", client->GetClientControl()->fName);
  154. //fChannel->ClientNotify(i, kXRunCallback, 0); // Notify the failing client
  155. fChannel->ClientNotify(ALL_CLIENTS, kXRunCallback, 0); // Notify all clients
  156. }
  157. }
  158. }
  159. }
  160. //---------------
  161. // Zombification
  162. //---------------
  163. bool JackEngine::IsZombie(JackClientInterface* client, jack_time_t current_time)
  164. {
  165. return ((current_time - fGraphManager->GetClientTiming(client->GetClientControl()->fRefNum)->fFinishedAt) > 2 * fEngineControl->fTimeOutUsecs); // A VERIFIER
  166. }
  167. // TODO : check what happens with looped sub-graph....
  168. void JackEngine::GetZombifiedClients(bool zombi_clients[CLIENT_NUM], jack_time_t current_time)
  169. {
  170. for (int i = REAL_REFNUM; i < CLIENT_NUM; i++) {
  171. JackClientInterface* client1 = fClientTable[i];
  172. if (client1 && IsZombie(client1, current_time)) {
  173. JackLog("JackEngine::GetZombifiedClients: %s\n", client1->GetClientControl()->fName);
  174. zombi_clients[i] = true; // Assume client is dead
  175. // If another dead client is connected to the scanned one, then the scanned one is not the first of the dead subgraph
  176. for (int j = REAL_REFNUM; j < CLIENT_NUM; j++) {
  177. JackClientInterface* client2 = fClientTable[j];
  178. if (client2 && IsZombie(client2, current_time) && fGraphManager->IsDirectConnection(j, i)) {
  179. zombi_clients[i] = false;
  180. break;
  181. }
  182. }
  183. } else {
  184. zombi_clients[i] = false;
  185. }
  186. }
  187. }
  188. void JackEngine::RemoveZombifiedClients(jack_time_t current_time)
  189. {
  190. bool zombi_clients[CLIENT_NUM];
  191. GetZombifiedClients(zombi_clients, current_time);
  192. for (int i = REAL_REFNUM; i < CLIENT_NUM; i++) {
  193. if (zombi_clients[i] && !fClientTable[i]->GetClientControl()->fZombie) {
  194. fClientTable[i]->GetClientControl()->fZombie = true;
  195. JackLog("RemoveZombifiedCients: name = %s\n", fClientTable[i]->GetClientControl()->fName);
  196. fGraphManager->DirectDisconnect(FREEWHEEL_DRIVER_REFNUM, i);
  197. fGraphManager->DirectDisconnect(i, FREEWHEEL_DRIVER_REFNUM);
  198. fGraphManager->DisconnectAllPorts(i);
  199. fChannel->ClientNotify(i, kZombifyClient, 0); // Signal engine
  200. }
  201. }
  202. }
  203. void JackEngine::ZombifyClient(int refnum)
  204. {
  205. NotifyClient(refnum, kZombifyClient, false, 0);
  206. }
  207. //---------------
  208. // Notifications
  209. //---------------
  210. void JackEngine::NotifyClient(int refnum, int event, int sync, int value)
  211. {
  212. JackClientInterface* client = fClientTable[refnum];
  213. // The client may be notified by the RT thread while closing
  214. if (client && client->GetClientControl()->fCallback[event]) {
  215. if (client->ClientNotify(refnum, client->GetClientControl()->fName, event, sync, value) < 0)
  216. jack_error("NotifyClient fails name = %s event = %ld = val = %ld", client->GetClientControl()->fName, event, value);
  217. } else {
  218. JackLog("JackEngine::NotifyClient: client not available anymore\n");
  219. }
  220. }
  221. void JackEngine::NotifyClients(int event, int sync, int value)
  222. {
  223. for (int i = 0; i < CLIENT_NUM; i++) {
  224. JackClientInterface* client = fClientTable[i];
  225. if (client && client->GetClientControl()->fCallback[event]) {
  226. if (client->ClientNotify(i, client->GetClientControl()->fName, event, sync, value) < 0)
  227. jack_error("NotifyClient fails name = %s event = %ld = val = %ld", client->GetClientControl()->fName, event, value);
  228. }
  229. }
  230. }
  231. int JackEngine::NotifyAddClient(JackClientInterface* new_client, const char* name, int refnum)
  232. {
  233. // Notify existing clients of the new client and new client of existing clients.
  234. for (int i = 0; i < CLIENT_NUM; i++) {
  235. JackClientInterface* old_client = fClientTable[i];
  236. if (old_client) {
  237. if (old_client->ClientNotify(refnum, name, kAddClient, true, 0) < 0) {
  238. jack_error("NotifyAddClient old_client fails name = %s", old_client->GetClientControl()->fName);
  239. return -1;
  240. }
  241. if (new_client->ClientNotify(i, old_client->GetClientControl()->fName, kAddClient, true, 0) < 0) {
  242. jack_error("NotifyAddClient new_client fails name = %s", name);
  243. return -1;
  244. }
  245. }
  246. }
  247. return 0;
  248. }
  249. void JackEngine::NotifyRemoveClient(const char* name, int refnum)
  250. {
  251. // Notify existing clients (including the one beeing suppressed) of the removed client
  252. for (int i = 0; i < CLIENT_NUM; i++) {
  253. JackClientInterface* client = fClientTable[i];
  254. if (client) {
  255. client->ClientNotify(refnum, name, kRemoveClient, true, 0);
  256. }
  257. }
  258. }
  259. // Coming from the driver
  260. void JackEngine::NotifyXRun(jack_time_t callback_usecs)
  261. {
  262. // Use the audio thread => request thread communication channel
  263. fEngineControl->ResetFrameTime(callback_usecs);
  264. fChannel->ClientNotify(ALL_CLIENTS, kXRunCallback, 0);
  265. }
  266. void JackEngine::NotifyXRun(int refnum)
  267. {
  268. if (refnum == ALL_CLIENTS) {
  269. NotifyClients(kXRunCallback, false, 0);
  270. } else {
  271. NotifyClient(refnum, kXRunCallback, false, 0);
  272. }
  273. }
  274. void JackEngine::NotifyGraphReorder()
  275. {
  276. NotifyClients(kGraphOrderCallback, false, 0);
  277. }
  278. void JackEngine::NotifyBufferSize(jack_nframes_t nframes)
  279. {
  280. NotifyClients(kBufferSizeCallback, true, nframes);
  281. }
  282. void JackEngine::NotifyFreewheel(bool onoff)
  283. {
  284. fEngineControl->fRealTime = !onoff;
  285. NotifyClients((onoff ? kStartFreewheelCallback : kStopFreewheelCallback), true, 0);
  286. }
  287. void JackEngine::NotifyPortRegistation(jack_port_id_t port_index, bool onoff)
  288. {
  289. NotifyClients((onoff ? kPortRegistrationOnCallback : kPortRegistrationOffCallback), false, port_index);
  290. }
  291. void JackEngine::NotifyActivate(int refnum)
  292. {
  293. NotifyClient(refnum, kActivateClient, true, 0);
  294. }
  295. //-------------------
  296. // Client management
  297. //-------------------
  298. bool JackEngine::ClientCheckName(const char* name)
  299. {
  300. for (int i = 0; i < CLIENT_NUM; i++) {
  301. JackClientInterface* client = fClientTable[i];
  302. if (client && (strcmp(client->GetClientControl()->fName, name) == 0))
  303. return true;
  304. }
  305. return false;
  306. }
  307. // Used for external clients
  308. int JackEngine::ClientExternalOpen(const char* name, int* ref, int* shared_engine, int* shared_client, int* shared_graph_manager)
  309. {
  310. JackLog("JackEngine::ClientOpen: name = %s \n", name);
  311. if (ClientCheckName(name)) {
  312. jack_error("client %s already registered", name);
  313. return -1;
  314. }
  315. int refnum = Allocate();
  316. if (refnum < 0) {
  317. jack_error("No more refnum available");
  318. return -1;
  319. }
  320. JackExternalClient* client = new JackExternalClient();
  321. if (!fSynchroTable[refnum]->Allocate(name, 0)) {
  322. jack_error("Cannot allocate synchro");
  323. goto error;
  324. }
  325. if (client->Open(name, refnum, shared_client) < 0) {
  326. jack_error("Cannot open client");
  327. goto error;
  328. }
  329. if (!fSignal->TimedWait(5 * 1000000)) {
  330. // Failure if RT thread is not running (problem with the driver...)
  331. jack_error("Driver is not running");
  332. goto error;
  333. }
  334. if (NotifyAddClient(client, name, refnum) < 0) {
  335. jack_error("Cannot notify add client");
  336. goto error;
  337. }
  338. fClientTable[refnum] = client;
  339. fGraphManager->InitRefNum(refnum);
  340. fEngineTiming->ResetRollingUsecs();
  341. *shared_engine = fEngineControl->GetShmIndex();
  342. *shared_graph_manager = fGraphManager->GetShmIndex();
  343. *ref = refnum;
  344. return 0;
  345. error:
  346. ClientCloseAux(refnum, client, false);
  347. client->Close();
  348. delete client;
  349. return -1;
  350. }
  351. // Used for server driver clients
  352. int JackEngine::ClientInternalOpen(const char* name, int* ref, JackEngineControl** shared_engine, JackGraphManager** shared_manager, JackClientInterface* client)
  353. {
  354. JackLog("JackEngine::ClientInternalNew: name = %s\n", name);
  355. if (ClientCheckName(name)) {
  356. jack_error("client %s already registered", name);
  357. return -1;
  358. }
  359. int refnum = Allocate();
  360. if (refnum < 0) {
  361. jack_error("No more refnum available");
  362. return -1;
  363. }
  364. if (!fSynchroTable[refnum]->Allocate(name, 0)) {
  365. jack_error("Cannot allocate synchro");
  366. return -1;
  367. }
  368. if (NotifyAddClient(client, name, refnum) < 0) {
  369. jack_error("Cannot notify add client");
  370. return -1;
  371. }
  372. fClientTable[refnum] = client;
  373. fGraphManager->InitRefNum(refnum);
  374. fEngineTiming->ResetRollingUsecs();
  375. *shared_engine = fEngineControl;
  376. *shared_manager = fGraphManager;
  377. *ref = refnum;
  378. return 0;
  379. }
  380. // Used for externall clients
  381. int JackEngine::ClientExternalClose(int refnum)
  382. {
  383. JackClientInterface* client = fClientTable[refnum];
  384. if (client) {
  385. fEngineControl->fTransport.ResetTimebase(refnum);
  386. int res = ClientCloseAux(refnum, client, true);
  387. client->Close();
  388. delete client;
  389. return res;
  390. } else {
  391. return -1;
  392. }
  393. }
  394. // Used for server internal clients
  395. int JackEngine::ClientInternalClose(int refnum)
  396. {
  397. JackClientInterface* client = fClientTable[refnum];
  398. return (client) ? ClientCloseAux(refnum, client, true) : -1;
  399. }
  400. // Used for drivers that close when the RT thread is stopped
  401. int JackEngine::ClientInternalCloseIm(int refnum)
  402. {
  403. JackClientInterface* client = fClientTable[refnum];
  404. return (client) ? ClientCloseAux(refnum, client, false) : -1;
  405. }
  406. int JackEngine::ClientCloseAux(int refnum, JackClientInterface* client, bool wait)
  407. {
  408. JackLog("JackEngine::ClientCloseAux ref = %ld name = %s\n", refnum, client->GetClientControl()->fName);
  409. // Remove the client from the table
  410. fClientTable[refnum] = NULL;
  411. // Remove ports
  412. fGraphManager->RemoveAllPorts(refnum);
  413. // Wait until next cycle to be sure client is not used anymore
  414. if (wait) {
  415. if (!fSignal->TimedWait(fEngineControl->fTimeOutUsecs * 2)) { // Must wait at least until a switch occurs in Process, even in case of graph end failure
  416. jack_error("JackEngine::ClientCloseAux wait error ref = %ld", refnum);
  417. }
  418. }
  419. // Notify running clients
  420. NotifyRemoveClient(client->GetClientControl()->fName, client->GetClientControl()->fRefNum);
  421. // Cleanup...
  422. fSynchroTable[refnum]->Destroy();
  423. fEngineTiming->ResetRollingUsecs();
  424. return 0;
  425. }
  426. int JackEngine::ClientActivate(int refnum)
  427. {
  428. JackClientInterface* client = fClientTable[refnum];
  429. assert(fClientTable[refnum]);
  430. JackLog("JackEngine::ClientActivate ref = %ld name = %s\n", refnum, client->GetClientControl()->fName);
  431. fGraphManager->Activate(refnum);
  432. // Wait for graph state change to be effective
  433. if (!fSignal->TimedWait(fEngineControl->fTimeOutUsecs * 10)) {
  434. jack_error("JackEngine::ClientActivate wait error ref = %ld name = %s", refnum, client->GetClientControl()->fName);
  435. return -1;
  436. } else {
  437. NotifyActivate(refnum);
  438. return 0;
  439. }
  440. }
  441. // May be called without client
  442. int JackEngine::ClientDeactivate(int refnum)
  443. {
  444. JackClientInterface* client = fClientTable[refnum];
  445. if (client == NULL)
  446. return -1;
  447. JackLog("JackEngine::ClientDeactivate ref = %ld name = %s\n", refnum, client->GetClientControl()->fName);
  448. fGraphManager->Deactivate(refnum);
  449. fLastSwitchUsecs = 0; // Force switch to occur next cycle, even when called with "dead" clients
  450. // Wait for graph state change to be effective
  451. if (!fSignal->TimedWait(fEngineControl->fTimeOutUsecs * 10)) {
  452. jack_error("JackEngine::ClientDeactivate wait error ref = %ld name = %s", refnum, client->GetClientControl()->fName);
  453. return -1;
  454. } else {
  455. return 0;
  456. }
  457. }
  458. //-----------------
  459. // Port management
  460. //-----------------
  461. int JackEngine::PortRegister(int refnum, const char* name, unsigned int flags, unsigned int buffer_size, jack_port_id_t* port_index)
  462. {
  463. JackLog("JackEngine::PortRegister ref = %ld name = %s flags = %d buffer_size = %d\n", refnum, name, flags, buffer_size);
  464. assert(fClientTable[refnum]);
  465. *port_index = fGraphManager->AllocatePort(refnum, name, (JackPortFlags)flags);
  466. if (*port_index != NO_PORT) {
  467. NotifyPortRegistation(*port_index, true);
  468. return 0;
  469. } else {
  470. return -1;
  471. }
  472. }
  473. int JackEngine::PortUnRegister(int refnum, jack_port_id_t port_index)
  474. {
  475. JackLog("JackEngine::PortUnRegister ref = %ld port_index = %ld\n", refnum, port_index);
  476. assert(fClientTable[refnum]);
  477. if (fGraphManager->ReleasePort(refnum, port_index) == 0) {
  478. NotifyPortRegistation(port_index, false);
  479. return 0;
  480. } else {
  481. return -1;
  482. }
  483. }
  484. int JackEngine::PortConnect(int refnum, const char* src, const char* dst)
  485. {
  486. JackLog("JackEngine::PortConnect src = %s dst = %s\n", src, dst);
  487. jack_port_id_t port_src, port_dst;
  488. return (fGraphManager->CheckPorts(src, dst, &port_src, &port_dst) < 0)
  489. ? -1
  490. : PortConnect(refnum, port_src, port_dst);
  491. }
  492. int JackEngine::PortDisconnect(int refnum, const char* src, const char* dst)
  493. {
  494. JackLog("JackEngine::PortDisconnect src = %s dst = %s\n", src, dst);
  495. jack_port_id_t port_src, port_dst;
  496. return (fGraphManager->CheckPorts(src, dst, &port_src, &port_dst) < 0)
  497. ? -1
  498. : fGraphManager->Disconnect(port_src, port_dst);
  499. }
  500. int JackEngine::PortConnect(int refnum, jack_port_id_t src, jack_port_id_t dst)
  501. {
  502. JackLog("JackEngine::PortConnect src = %d dst = %d\n", src, dst);
  503. JackClientInterface* client;
  504. int ref;
  505. if (fGraphManager->CheckPorts(src, dst) < 0)
  506. return -1;
  507. ref = fGraphManager->GetOutputRefNum(src);
  508. assert(ref >= 0);
  509. client = fClientTable[ref];
  510. assert(client);
  511. if (!client->GetClientControl()->fActive) {
  512. jack_error("Cannot connect ports owned by inactive clients:"
  513. " \"%s\" is not active", client->GetClientControl()->fName);
  514. return -1;
  515. }
  516. ref = fGraphManager->GetInputRefNum(dst);
  517. assert(ref >= 0);
  518. client = fClientTable[ref];
  519. assert(client);
  520. if (!client->GetClientControl()->fActive) {
  521. jack_error("Cannot connect ports owned by inactive clients:"
  522. " \"%s\" is not active", client->GetClientControl()->fName);
  523. return -1;
  524. }
  525. return fGraphManager->Connect(src, dst);
  526. }
  527. int JackEngine::PortDisconnect(int refnum, jack_port_id_t src, jack_port_id_t dst)
  528. {
  529. JackLog("JackEngine::PortDisconnect src = %d dst = %d\n", src, dst);
  530. if (dst == ALL_PORTS) {
  531. return (fGraphManager->CheckPort(src) < 0)
  532. ? -1
  533. : fGraphManager->DisconnectAll(src);
  534. } else {
  535. return (fGraphManager->CheckPorts(src, dst) < 0)
  536. ? -1
  537. : fGraphManager->Disconnect(src, dst);
  538. }
  539. }
  540. //----------------------
  541. // Transport management
  542. //----------------------
  543. int JackEngine::ReleaseTimebase(int refnum)
  544. {
  545. return fEngineControl->fTransport.ResetTimebase(refnum);
  546. }
  547. int JackEngine::SetTimebaseCallback(int refnum, int conditional)
  548. {
  549. return fEngineControl->fTransport.SetTimebase(refnum, conditional);
  550. }
  551. //-----------
  552. // Debugging
  553. //-----------
  554. void JackEngine::PrintState()
  555. {
  556. std::cout << "Engine State" << std::endl;
  557. for (int i = 0; i < CLIENT_NUM; i++) {
  558. JackClientInterface* client = fClientTable[i];
  559. if (client)
  560. std::cout << "Client : " << client->GetClientControl()->fName << " : " << i << std::endl;
  561. }
  562. //fGraphManager->PrintState();
  563. fEngineTiming->PrintState();
  564. }
  565. } // end of namespace