Skip to content

Commit

Permalink
Add some debug output, to be removed
Browse files Browse the repository at this point in the history
Signed-off-by: Joseph Schuchart <schuchart@icl.utk.edu>
  • Loading branch information
devreal committed Sep 23, 2022
1 parent 33af1d5 commit 1b856ca
Showing 1 changed file with 22 additions and 15 deletions.
37 changes: 22 additions & 15 deletions parsec/remote_dep_mpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ int parsec_comm_gets = 0;
int parsec_comm_puts_max = DEP_NB_CONCURENT * MAX_PARAM_COUNT;
int parsec_comm_puts = 0;

static int parsec_remote_dep_use_get = 1;
static int parsec_remote_dep_use_get = 0;

/**
* Number of data movements to be extracted at each step. Bigger the number
Expand Down Expand Up @@ -1478,6 +1478,7 @@ static int remote_dep_mpi_pack_dep(int peer,
cb_data->deps = deps;
cb_data->k = k;
cb_data->memory_handle = source_memory_handle;
printf("GET cb_data %p, k %d, memory handle %p\n", cb_data, k, source_memory_handle);
memcpy(packed_buffer+saved_position, &cb_data, sizeof(uintptr_t));
saved_position += sizeof(uintptr_t);
dsize += sizeof(uintptr_t);
Expand Down Expand Up @@ -1888,14 +1889,19 @@ remote_dep_mpi_remote_get_end_cb(parsec_comm_engine_t *ce,
void *data)
{
/* Retreive deps from callback_data */
remote_dep_cb_data_t *cb_data = (remote_dep_cb_data_t *)data;
remote_dep_cb_data_t *cb_data = (remote_dep_cb_data_t *)msg;
parsec_remote_deps_t* deps = cb_data->deps;
parsec_execution_stream_t* es = &parsec_comm_es;

PARSEC_DEBUG_VERBOSE(6, parsec_debug_output, "MPI:\tTO\tna\Get END \tunknown \tk=%d\twith deps %p\tparams bla\t(tag=bla) data ptr bla",
((remote_dep_cb_data_t *)cb_data)->k, deps);

int rank;
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
printf("[%d] get from %d: msg %p, deps %p\n", rank, src, (void*)msg, deps);

TAKE_TIME(MPIsnd_prof, MPI_Data_plds_ek, ((remote_dep_cb_data_t *)cb_data)->k);

TAKE_TIME(es->es_profile, MPI_Data_plds_ek, ((remote_dep_cb_data_t *)cb_data)->k);

remote_dep_complete_and_cleanup(&deps, 1);

Expand Down Expand Up @@ -2177,7 +2183,7 @@ static void remote_dep_mpi_get_start(parsec_execution_stream_t* es,
(parsec_remote_dep_cb_data_mempool->thread_mempools);
callback_data->deps = deps;
callback_data->k = k;
printf("get: remote memory handle %p\n", deps->memhandles);
printf("[%d] get from %d: remote_cb_data %p, remote memory handle %p\n", es->virtual_process->parsec_context->my_rank, from, (void*)deps->remote_cb_data, deps->memhandles);
parsec_ce.get(&parsec_ce, receiver_memory_handle, 0,
deps->memhandles, 0, 0, from,
&remote_dep_mpi_local_get_end_cb, callback_data,
Expand Down Expand Up @@ -2221,15 +2227,6 @@ static void remote_dep_mpi_get_start(parsec_execution_stream_t* es,
nbdtt = deps->output[k].data.remote.dst_count;


# if defined(PARSEC_DEBUG_NOISIER)
MPI_Type_get_name(dtt, type_name, &len);
int _size;
MPI_Type_size(dtt, &_size);
PARSEC_DEBUG_VERBOSE(10, parsec_debug_output, "MPI:\tTO\t%d\tGet START\t% -8s\tk=%d\twith datakey %lx at %p type %s count %d displ %ld \t(k=%d, dst_mem_handle=%p)",
from, tmp, k, task->deps, PARSEC_DATA_COPY_GET_PTR(deps->output[k].data.data), type_name, nbdtt,
deps->output[k].data.remote.dst_displ, k, receiver_memory_handle);
# endif

/* We have the remote mem_handle.
* Let's allocate our mem_reg_handle
* and let the source know.
Expand All @@ -2252,6 +2249,16 @@ static void remote_dep_mpi_get_start(parsec_execution_stream_t* es,
&receiver_memory_handle, &receiver_memory_handle_size);

}
# if defined(PARSEC_DEBUG_NOISIER)
MPI_Type_get_name(dtt, type_name, &len);
int _size;
MPI_Type_size(dtt, &_size);
PARSEC_DEBUG_VERBOSE(10, parsec_debug_output, "MPI:\tTO\t%d\tGet START\t% -8s\tk=%d\twith datakey %lx at %p type %s count %d displ %ld \t(k=%d, dst_mem_handle=%p)",
from, tmp, k, task->deps, PARSEC_DATA_COPY_GET_PTR(deps->output[k].data.data), type_name, nbdtt,
deps->output[k].data.remote.dst_displ, k, receiver_memory_handle);
# endif


callback_data->memory_handle = receiver_memory_handle;
/* We need multiple information to be passed to the callback_fn we have assigned above.
* We pack the pointer to this callback_data and pass to the other side so we can complete
Expand All @@ -2275,7 +2282,7 @@ static void remote_dep_mpi_get_start(parsec_execution_stream_t* es,
// from, es->virtual_process->parsec_context->my_rank, (*task));
/* Send AM */
parsec_ce.send_am(&parsec_ce, REMOTE_DEP_GET_DATA_TAG, from, buf, buf_size);
TAKE_TIME(MPIctl_prof, MPI_Data_ctl_ek, event_id);
TAKE_TIME(es->es_profile, MPI_Data_ctl_ek, event_id);
// TODO: fix the profiling!
//TAKE_TIME_WITH_INFO(MPIrcv_prof, MPI_Data_pldr_sk, k, from,
// es->virtual_process->parsec_context->my_rank, deps->msg);
Expand Down Expand Up @@ -2364,7 +2371,7 @@ remote_dep_mpi_local_get_end_cb(parsec_comm_engine_t *ce,

printf("GET END\n");

TAKE_TIME(MPIrcv_prof, MPI_Data_pldr_ek, callback_data->k);
TAKE_TIME(es->es_profile, MPI_Data_pldr_ek, callback_data->k);
remote_dep_mpi_get_end(es, callback_data->k, deps);

ce->mem_unregister(&lreg);
Expand Down

0 comments on commit 1b856ca

Please sign in to comment.