simgrid.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2012-2015 Université de Bordeaux
  4. *
  5. * StarPU is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU Lesser General Public License as published by
  7. * the Free Software Foundation; either version 2.1 of the License, or (at
  8. * your option) any later version.
  9. *
  10. * StarPU is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. *
  14. * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  15. */
  16. #ifndef __SIMGRID_H__
  17. #define __SIMGRID_H__
  18. #ifdef STARPU_SIMGRID
  19. #ifdef STARPU_HAVE_SIMGRID_MSG_H
  20. #include <simgrid/msg.h>
  21. #else
  22. #include <msg/msg.h>
  23. #endif
  24. #include <datawizard/data_request.h>
  25. struct _starpu_pthread_args
  26. {
  27. void *(*f)(void*);
  28. void *arg;
  29. };
  30. #define MAX_TSD 16
  31. #define STARPU_MPI_AS_PREFIX "StarPU-MPI"
  32. #define _starpu_simgrid_running_smpi() (getenv("SMPI_GLOBAL_SIZE") != NULL)
  33. void _starpu_simgrid_init(void);
  34. void _starpu_simgrid_wait_tasks(int workerid);
  35. void _starpu_simgrid_submit_job(int workerid, struct _starpu_job *job, struct starpu_perfmodel_arch* perf_arch, double length, unsigned *finished, starpu_pthread_mutex_t *mutex, starpu_pthread_cond_t *cond);
  36. int _starpu_simgrid_transfer(size_t size, unsigned src_node, unsigned dst_node, struct _starpu_data_request *req);
  37. /* Return the number of hosts prefixed by PREFIX */
  38. int _starpu_simgrid_get_nbhosts(const char *prefix);
  39. unsigned long long _starpu_simgrid_get_memsize(const char *prefix, unsigned devid);
  40. msg_host_t _starpu_simgrid_get_host_by_name(const char *name);
  41. struct _starpu_worker;
  42. msg_host_t _starpu_simgrid_get_host_by_worker(struct _starpu_worker *worker);
  43. void _starpu_simgrid_get_platform_path(char *path, size_t maxlen);
  44. msg_as_t _starpu_simgrid_get_as_by_name(const char *name);
  45. #pragma weak starpu_mpi_world_rank
  46. extern int starpu_mpi_world_rank(void);
  47. #pragma weak _starpu_mpi_simgrid_init
  48. int _starpu_mpi_simgrid_init(int argc, char *argv[]);
  49. starpu_pthread_queue_t _starpu_simgrid_transfer_queue[STARPU_MAXNODES];
  50. starpu_pthread_queue_t _starpu_simgrid_task_queue[STARPU_NMAXWORKERS];
  51. #define _starpu_simgrid_cuda_malloc_cost() starpu_get_env_number_default("STARPU_SIMGRID_CUDA_MALLOC_COST", 1)
  52. #define _starpu_simgrid_queue_malloc_cost() starpu_get_env_number_default("STARPU_SIMGRID_QUEUE_MALLOC_COST", 1)
  53. #endif
  54. #endif // __SIMGRID_H__