mpi_cholesky_params.c 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2009, 2010 Université de Bordeaux 1
  4. * Copyright (C) 2010, 2011, 2012, 2013 Centre National de la Recherche Scientifique
  5. *
  6. * StarPU is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU Lesser General Public License as published by
  8. * the Free Software Foundation; either version 2.1 of the License, or (at
  9. * your option) any later version.
  10. *
  11. * StarPU is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  14. *
  15. * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  16. */
  17. #include <string.h>
  18. #include <stdlib.h>
  19. #include <stdio.h>
  20. unsigned size = 4*1024;
  21. unsigned nblocks = 16;
  22. unsigned nbigblocks = 2;
  23. unsigned noprio = 0;
  24. unsigned display = 0;
  25. unsigned dblockx = -1;
  26. unsigned dblocky = -1;
  27. void parse_args(int argc, char **argv)
  28. {
  29. int i;
  30. for (i = 1; i < argc; i++)
  31. {
  32. if (strcmp(argv[i], "-size") == 0)
  33. {
  34. char *argptr;
  35. size = strtol(argv[++i], &argptr, 10);
  36. }
  37. if (strcmp(argv[i], "-dblockx") == 0)
  38. {
  39. char *argptr;
  40. dblockx = strtol(argv[++i], &argptr, 10);
  41. }
  42. if (strcmp(argv[i], "-dblocky") == 0)
  43. {
  44. char *argptr;
  45. dblocky = strtol(argv[++i], &argptr, 10);
  46. }
  47. if (strcmp(argv[i], "-nblocks") == 0)
  48. {
  49. char *argptr;
  50. nblocks = strtol(argv[++i], &argptr, 10);
  51. }
  52. if (strcmp(argv[i], "-nbigblocks") == 0)
  53. {
  54. char *argptr;
  55. nbigblocks = strtol(argv[++i], &argptr, 10);
  56. }
  57. if (strcmp(argv[i], "-no-prio") == 0)
  58. {
  59. noprio = 1;
  60. }
  61. if (strcmp(argv[i], "-display") == 0)
  62. {
  63. display = 1;
  64. }
  65. if (strcmp(argv[i], "-h") == 0)
  66. {
  67. printf("usage : %s [-display] [-size size] [-nblocks nblocks]\n", argv[0]);
  68. }
  69. }
  70. if (nblocks > size) nblocks = size;
  71. }