Beispiel #1
0
int main()
{
	int             k;
	char            input[8];
	double          atof();
	void			mva();

	while (1) {                
		printf("\n(Hit RETURN to exit)\n\n");
		printf("Enter no. of centers (K): ");
		gets(input);
		if (input[0] == '\0')
			break;
		else
			K = atoi(input);
		for (k = 1; k <= K; k++) {
			printf("Enter demand at center %d (D[%d]): ", k, k);
			gets(input);
			D[k] = atof(input);
		}
		printf("Enter think time (Z):");
		gets(input);
		Z = atof(input);

		while (1) {
			printf("\n(Hit RETURN to stop)\n");
			printf("Enter no. of terminals (N): ");
			gets(input);
			if (input[0] == '\0')
				break;
			else {
				N = atoi(input);
				mva();
			}
		}

	}

   return(0);
}  
Beispiel #2
0
int main( int argc, char *argv[])
{
	MPI_Init (&argc, &argv);
	bc_init (BC_ERR|BC_PLIST_XALL);
	if (argc != 2) {
		fprintf (stderr,
				 "USAGE: mva <data file>\n\n"
				 "Data file format:\n\n"
				 "<num classes> <num queues> <error tolerance>\n"
				 "<queue type vector> (1 means QUEUE, 0 means DELAY)\n"
				 "<Load intensity vector>\n"
				 "<Visitation vector>\n"
				 "<service demand array>\n\nSee example file.\n");
		exit(0);
	}
	init(argv[1]);
 	mva(0);
 	print_results();
	cleanup(0);
 	bc_final();
	MPI_Finalize();
	return 0;
}