main.cpp 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*
  2. = StarPU-Top for StarPU =
  3. Copyright (C) 2011
  4. William Braik
  5. Yann Courtois
  6. Jean-Marie Couteyen
  7. Anthony Roy
  8. This library is free software; you can redistribute it and/or
  9. modify it under the terms of the GNU Lesser General Public
  10. License as published by the Free Software Foundation; either
  11. version 2.1 of the License, or (at your option) any later version.
  12. This library is distributed in the hope that it will be useful,
  13. but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. Lesser General Public License for more details.
  16. You should have received a copy of the GNU Lesser General Public
  17. License along with this library; if not, write to the Free Software
  18. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  19. */
  20. #include <QtGui/QApplication>
  21. #include "mainwindow.h"
  22. #include <string.h>
  23. #include <config.h>
  24. #define PROGNAME "starpu_top"
  25. static void parse_args(int argc, char **argv)
  26. {
  27. if (argc == 1)
  28. return;
  29. if (argc > 2 || /* Argc should be either 1 or 2 */
  30. strncmp(argv[1], "--help", 6) == 0 ||
  31. strncmp(argv[1], "-h", 2) == 0)
  32. {
  33. (void) fprintf(stderr, "\
  34. starpu-top is an interface which remotely displays the \n\
  35. on-line state of a StarPU application and permits the user \n\
  36. to change parameters on the fly. \n\
  37. \n\
  38. Usage: %s [OPTION] \n\
  39. \n\
  40. Options: \n\
  41. -h, --help display this help and exit \n\
  42. -v, --version output version information and exit \n\
  43. \n\
  44. Report bugs to <" PACKAGE_BUGREPORT ">.",
  45. PROGNAME);
  46. }
  47. else if (strncmp(argv[1], "--version", 9) == 0 ||
  48. strncmp(argv[1], "-v", 2) == 0)
  49. {
  50. (void) fprintf(stderr, "%s %d.%d\n",
  51. PROGNAME, STARPU_MAJOR_VERSION, STARPU_MINOR_VERSION);
  52. }
  53. else
  54. {
  55. fprintf(stderr, "Unknown arg %s\n", argv[1]);
  56. }
  57. exit(EXIT_FAILURE);
  58. }
  59. int main(int argc, char *argv[])
  60. {
  61. parse_args(argc, argv);
  62. QApplication a(argc, argv);
  63. // Application description
  64. QCoreApplication::setOrganizationName("INRIA Bordeaux Sud-Ouest");
  65. QCoreApplication::setOrganizationDomain("runtime.bordeaux.inria.fr");
  66. QCoreApplication::setApplicationName("StarPU-Top");
  67. QCoreApplication::setApplicationVersion("0.1");
  68. MainWindow w;
  69. w.show();
  70. return a.exec();
  71. }