[Simgrid-user] SURF: Using GTNetS and network action delays

Kurt Vanmechelen kurt.vanmechelen at ua.ac.be
Wed Jul 16 19:38:49 CEST 2008


> Yeah, gtnets needs informations about routers. Give a try to the
> platform files in /examples/msg/gtnets.
OK thanks, dogbone-p.xml works! The bigger platform with the r-n200-f50-s4-2-p.xml file returns :
Invalid XML (XML input line 608, state 16): Starting tag <router> is not allowed here.
** SimGrid: UNCAUGHT EXCEPTION received on (0): category: unknown_err; value: 0
** Parse error in /home/kvanmech/workspace/simgrid/examples/msg/gtnets/r-n200-f50-s4-2-p.xml
** Thrown by () in this process
[0.000000] xbt/ex.c:113: [xbt_ex/CRITICAL] Parse error in /home/kvanmech/workspace/simgrid/examples/msg/gtnets/r-n200-f50-s4-2-p.xml

**   In xbt_backtrace_current() at /home/kvanmech/workspace/simgrid/src/xbt/backtrace_linux.c:19
**   In parse_platform_file() at /home/kvanmech/workspace/simgrid/src/surf/surfxml_parse.c:617
Aborted
I guess all the router tags need to be moved to the top of the file...(?).

Now, I have a question regarding the reported finishing times of actions with GTNetS. If I run the test program below, I notice that the reported finished times of the actions
do not coincide with the internal clock of the simulator at each surf_solve() call, i.e. after the first call to surf_solve :
Action : C1toS1
Action state : 3
Action Remains :0
Action Finished :0.330214
Action : C2toS2
Action state : 1
Action Remains :0
Action Finished :-1
Current Time : 0.165107

So action C1toS1 reportedly finished at 0.330214 but the current time of the simulator is 0.165107. At the end of the simulation the current 
SURF clock is 0.324606. Is this logical? My guess is that the real ending times of the actions would be 0.165107 and 0.324606. Could you confirm this?


For reference here is the full output:
GES_Surf test program!
First argument (platform file) : /home/kvanmech/workspace/simgrid/examples/msg/gtnets/dogbone-p.xml
Calling surf_solve for the 1th time
TCP 0x60d430 NewRx, seq 0 nrxs 0 size 200
Case 1, advanced nrxs to 200
TCP 0x60d430 sending ack (nrxs), 200 latx 0.0406212 nextTxSeq 0
TCP 0x60bd20 got ack 200 highestRxAck 0 ntxs 200 time 0.165107
TCP 0x60bd20 clearing dupack count, acknum 200 hrxa 0 ntxs 200
TCP 0x60d430 NewRx, seq 0 nrxs 0 size 200
Case 1, advanced nrxs to 200
TCP 0x60d430 sending ack (nrxs), 200 latx 0.0406212 nextTxSeq 0
TCP 0x60bd20 got ack 200 highestRxAck 0 ntxs 200 time 0.165107
TCP 0x60bd20 clearing dupack count, acknum 200 hrxa 0 ntxs 200
All action info
Action : C1toS1
Action state : 3
Action Remains :0
Action Finished :0.330214
Action : C2toS2
Action state : 1
Action Remains :0
Action Finished :-1
Current Time : 0.165107
DONE ACTIONS
Action : C1toS1
Actions running
Action : C2toS2
Calling surf_solve for the 2th time
TCP 0x619d40 NewRx, seq 0 nrxs 0 size 150
Case 1, advanced nrxs to 150
TCP 0x619d40 sending ack (nrxs), 150 latx 0.0806212 nextTxSeq 0
TCP 0x609f50 got ack 150 highestRxAck 0 ntxs 150 time 0.324606
TCP 0x609f50 clearing dupack count, acknum 150 hrxa 0 ntxs 150
TCP 0x619d40 NewRx, seq 0 nrxs 0 size 150
Case 1, advanced nrxs to 150
TCP 0x619d40 sending ack (nrxs), 150 latx 0.0806212 nextTxSeq 0
TCP 0x609f50 got ack 150 highestRxAck 0 ntxs 150 time 0.324606
TCP 0x609f50 clearing dupack count, acknum 150 hrxa 0 ntxs 150
All action info
Action : C1toS1
Action state : 3
Action Remains :0
Action Finished :0.330214
Action : C2toS2
Action state : 3
Action Remains :0
Action Finished :0.484106
Current Time : 0.324606
DONE ACTIONS
Action : C1toS1
Action : C2toS2
Actions running
Calling surf_solve for the 3th time
All action info
Action : C1toS1
Action state : 3
Action Remains :0
Action Finished :0.330214
Action : C2toS2
Action state : 3
Action Remains :0
Action Finished :0.484106
Current Time : 0.324606
DONE ACTIONS
Action : C1toS1
Action : C2toS2
Actions running
Simulation ended

... and here is the test driver :

#include <iostream>
#include "surf/surf.h"
#include "surf/workstation_private.h"
#include "surf/network_private.h"
#include "xbt/swag.h"
#include "surf/gtnets/gtnets_interface.h"
#include <sstream>
#include <string>
using std::cout;
using std::endl;
using std::cerr;
using std::string;

surf_action_t action1;
surf_action_t action2;

void printActionInfo(surf_action_t act) {
	e_surf_action_state_t state = surf_workstation_model->common_public->action_get_state(act);
	cout << "Action : " << ((char*)act->data) << endl;
	cout << "Action state : " << state << endl;
	cout << "Action Remains :" << act->remains << endl;
	cout << "Action Finished :" << act->finish << endl;
}


void printDoneActions() {
	void* act = NULL;
	cout << "DONE ACTIONS " << endl;
	xbt_swag_t done_actions = surf_network_model->common_public->states.done_action_set;
	xbt_swag_foreach(act, done_actions) {
		cout << "Action : " << (char*) ((surf_action_t) act)->data << endl;
	}
	cout.flush();
}

void printRunningActions() {
	void* act = NULL;
	xbt_swag_t running_actions = surf_network_model->common_public->states.running_action_set;
	cout << "Actions running" << endl;
	xbt_swag_foreach(act, running_actions) {
		cout << "Action : " << (char*) ((surf_action_t) act)->data << endl;
	}
	cout.flush();
}

void logData() {
	cout << "All action info " << endl;
	printActionInfo(action1);
	printActionInfo(action2);

	cout << "Current Time : " << surf_get_clock() << endl;
	//cout << "Next action end : " << getNextActionTime() << endl;
	//cout << "End next GTNetS flow : " << gtnets_get_time_to_next_flow_completion() + surf_get_clock() << endl;

	printDoneActions();
	printRunningActions();
}

int main(int args, char *argv[]) {
	cout << "GES_Surf test program!" << endl;
	cout << "First argument (platform file) : " << argv[1] << endl;

	surf_init(&args, argv);
	surf_timer_model_init(argv[1]);
	surf_cpu_model_init_Cas01(argv[1]);
	surf_network_model_init_GTNETS(argv[1]);
	surf_workstation_model_init_compound(argv[1]);

	parse_platform_file(argv[1]);

	int workstation_id = find_model_description(surf_workstation_model_description,"compound");
	if (surf_workstation_model_description[workstation_id].create_ws != NULL)
		surf_workstation_model_description[workstation_id].create_ws();

	void* consumer1 = xbt_dict_get(workstation_set, "C1");
	void* consumer2 = xbt_dict_get(workstation_set, "C2");
	void* server1 = xbt_dict_get(workstation_set, "S1");
	void* server2 = xbt_dict_get(workstation_set, "S2");

	action1 = surf_workstation_model->extension_public->communicate(consumer1,server1, 200, 1.0E50);
	action2 = surf_workstation_model->extension_public->communicate(consumer2,server2, 150, 1.0E50);

	action1->data = (void*)"C1toS1";
	action2->data = (void*)"C2toS2";

	surf_presolve();

	int index = 1;
	int result = 0;
	while(result != -1) {
		cout << "Calling surf_solve for the " << index << "th time" << endl;
		index++;
		result = surf_solve();
		logData();
	}

	cout << "Simulation ended " << endl;
}

Cheers,

Kurt

On Wednesday 16 July 2008 17:03:47 Arnaud Legrand wrote:
> Hi,
>
> Kurt Vanmechelen a écrit :
> > I recently tried to fire up SURF on GTNetS with a small test program but
> > have run into the following error:
> > I am testing this with the small_platform.xml from the repository, but
> > the msg_platform.xml gave a similar error.
> > Note that I can switch around network implementations such as Reno and
> > Vegas just fine, only with GTNetS does the test program fail.
>
> Yeah, gtnets needs informations about routers. Give a try to the
> platform files in /examples/msg/gtnets.
>
> Cheers,
>
>      Arnaud


-- 
================================================
Kurt Vanmechelen
Phd Student
Dept. of Mathematics and Computer Sciences
Group CoMP (Computational Modelling and Programming)
University of Antwerp
Middelheimlaan 1
2020 Antwerpen, Belgium
G2.14

Phone : 03/265 3477
Mail  : kurt.vanmechelen at ua.ac.be
================================================




More information about the Simgrid-user mailing list