Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 723095fb authored by THIBAULT Samuel's avatar THIBAULT Samuel
Browse files

Push flushed data to main memory when we have time to

parent a5f37713
No related branches found
No related tags found
No related merge requests found
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* of Tennessee Research Foundation. * of Tennessee Research Foundation.
* All rights reserved. * All rights reserved.
* @copyright (c) 2012-2014 Inria. All rights reserved. * @copyright (c) 2012-2014 Inria. All rights reserved.
* @copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved. * @copyright (c) 2012-2015 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
* *
**/ **/
...@@ -26,6 +26,19 @@ ...@@ -26,6 +26,19 @@
**/ **/
#include "runtime/starpu/include/morse_starpu.h" #include "runtime/starpu/include/morse_starpu.h"
#ifdef CHAMELEON_USE_STARPU_IDLE_PREFETCH
static void data_flush(void *handle)
{
starpu_data_idle_prefetch_on_node(handle, STARPU_MAIN_RAM, 1);
starpu_data_release_on_node(handle, -1);
}
#else
static void data_release(void *handle)
{
starpu_data_release(handle);
}
#endif
void MORSE_TASK_dataflush(MORSE_option_t *options, void MORSE_TASK_dataflush(MORSE_option_t *options,
MORSE_desc_t *A, int Am, int An) MORSE_desc_t *A, int Am, int An)
{ {
...@@ -36,15 +49,24 @@ void MORSE_TASK_dataflush(MORSE_option_t *options, ...@@ -36,15 +49,24 @@ void MORSE_TASK_dataflush(MORSE_option_t *options,
* compute the handle address in starpu. We have to be careful with this if * compute the handle address in starpu. We have to be careful with this if
* something similar happen in Quark. * something similar happen in Quark.
*/ */
#if defined(CHAMELEON_USE_MPI)
{ {
starpu_data_handle_t *ptrtile = (starpu_data_handle_t*)(A->schedopt); starpu_data_handle_t *ptrtile = (starpu_data_handle_t*)(A->schedopt);
ptrtile += ((int64_t)(A->lmt) * (int64_t)An + (int64_t)Am); ptrtile += ((int64_t)(A->lmt) * (int64_t)An + (int64_t)Am);
if (*ptrtile != NULL) if (*ptrtile != NULL)
{
#if defined(CHAMELEON_USE_MPI)
starpu_mpi_cache_flush(MPI_COMM_WORLD, *ptrtile); starpu_mpi_cache_flush(MPI_COMM_WORLD, *ptrtile);
}
#endif #endif
/* Push data to main memory when we have time to */
#ifdef CHAMELEON_USE_STARPU_IDLE_PREFETCH
starpu_data_acquire_on_node_cb(*ptrtile, -1, STARPU_R, data_flush, *ptrtile);
#else
starpu_data_acquire_cb(*ptrtile, STARPU_R, data_release, *ptrtile);
#endif
}
}
} }
void MORSE_TASK_dataflush_all() void MORSE_TASK_dataflush_all()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment