source: trunk/src/testing/app/mframes/machinefile_code/machinefile_gen.cpp @ 4

Revision 4, 2.7 KB checked in by ajaworski, 13 years ago (diff)

Added modified SAGE sources

Line 
1/******************************************************************************
2 * SAGE - Scalable Adaptive Graphics Environment
3 *
4 * Copyright (C) 2004 Electronic Visualization Laboratory,
5 * University of Illinois at Chicago
6 *
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions are met:
11 *
12 *  * Redistributions of source code must retain the above copyright
13 *    notice, this list of conditions and the following disclaimer.
14 *  * Redistributions in binary form must reproduce the above
15 *    copyright notice, this list of conditions and the following disclaimer
16 *    in the documentation and/or other materials provided with the distribution.
17 *  * Neither the name of the University of Illinois at Chicago nor
18 *    the names of its contributors may be used to endorse or promote
19 *    products derived from this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
25 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
26 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
27 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
28 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 *
33 * Direct questions, comments etc about SAGE to http://www.evl.uic.edu/cavern/forum/
34 *
35 *****************************************************************************/
36
37#include <stdlib.h>
38#include <stdio.h>
39#include "tile_config.h"
40#include "file_parsers.h"
41
42PhysicalDisplay* pd;
43DisplayCluster* dc;
44VirtualDesktop* vd;
45
46int main(int argc, char** argv)
47{
48
49        if( argc < 3 )
50        {
51                printf("Usage: machinefile_gen <tile config file> <machine file>\n");
52                printf("input - tile config file\noutput - machine file\n");
53                return 0;
54        }
55
56        pd = new PhysicalDisplay();
57        dc = new DisplayCluster();
58        vd = new VirtualDesktop();
59
60        int retcode;
61        retcode = stdInputFileParser( argv[1], pd, dc, vd );
62        if( retcode < 0 )
63        {
64                delete pd;
65                delete dc;
66        //      delete vd;
67                return 1;
68        }
69
70        FILE* fptr = fopen(argv[2],"w");
71        Display_Node* dn = dc->getFirstNode();
72        while( dn )
73        {
74                fprintf( fptr, "%s\n", dn->IP() );
75                dn = dn->Next();
76        }
77
78        fclose(fptr);
79
80        delete pd;
81        delete dc;
82//      delete vd;
83
84        return 0;
85}
86
Note: See TracBrowser for help on using the repository browser.