Skip to content

Commit

Permalink
update mpi float check
Browse files Browse the repository at this point in the history
  • Loading branch information
aroadant committed Apr 19, 2024
1 parent 3f84f7d commit 18e82fa
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
20 changes: 10 additions & 10 deletions qlat/qlat/include/qlat/vector_utils/utils_COPY_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -232,16 +232,16 @@ void cpy_data_threadT(T0* Pres, const T1* Psrc, const TInt Nvol, int GPU, QBOOL
#ifdef QLAT_USE_ACC
if(sizeof(T0) == sizeof(T1) and qlat::qnorm(ADD) < QLAT_COPY_LIMIT)
{
//if(stream == NULL){
// if(GPU == 0){gpuErrchk(qacc_MemcpyAsync((void*) Pres, (void*) Psrc , Nvol*sizeof(T0), qacc_MemcpyHostToHost));}
// if(GPU == 1){gpuErrchk(qacc_MemcpyAsync((void*) Pres, (void*) Psrc , Nvol*sizeof(T0), qacc_MemcpyDeviceToDevice));}
//}
//else{
// qacc_Stream_t* pstream = (qacc_Stream_t*) stream;
// if(GPU == 0){gpuErrchk(qacc_MemcpyAsync((void*) Pres, (void*) Psrc , Nvol*sizeof(T0), qacc_MemcpyHostToHost, *pstream));}
// if(GPU == 1){gpuErrchk(qacc_MemcpyAsync((void*) Pres, (void*) Psrc , Nvol*sizeof(T0), qacc_MemcpyDeviceToDevice, *pstream));}
//}
qGPU_forNB(isp, Nvol, GPU, {Pres[isp] = Psrc[isp];})
if(stream == NULL){
if(GPU == 0){gpuErrchk(qacc_MemcpyAsync((void*) Pres, (void*) Psrc , Nvol*sizeof(T0), qacc_MemcpyHostToHost));}
if(GPU == 1){gpuErrchk(qacc_MemcpyAsync((void*) Pres, (void*) Psrc , Nvol*sizeof(T0), qacc_MemcpyDeviceToDevice));}
}
else{
qacc_Stream_t* pstream = (qacc_Stream_t*) stream;
if(GPU == 0){gpuErrchk(qacc_MemcpyAsync((void*) Pres, (void*) Psrc , Nvol*sizeof(T0), qacc_MemcpyHostToHost, *pstream));}
if(GPU == 1){gpuErrchk(qacc_MemcpyAsync((void*) Pres, (void*) Psrc , Nvol*sizeof(T0), qacc_MemcpyDeviceToDevice, *pstream));}
}
//qGPU_forNB(isp, Nvol, GPU, {Pres[isp] = Psrc[isp];})
if(dummy==QTRUE){qacc_barrier(dummy);}
return ;
}
Expand Down
6 changes: 3 additions & 3 deletions qlat/qlat/include/qlat/vector_utils/utils_mpi.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ inline int set_mpi_type<RealD>(MPI_Datatype& mpi_type)
template <>
inline int set_mpi_type<RealF>(MPI_Datatype& mpi_type)
{
mpi_type = MPI_DOUBLE;
mpi_type = MPI_FLOAT ;
return 1;
}

Expand Down Expand Up @@ -170,8 +170,8 @@ unsigned int get_mpi_type(MPI_Datatype& curr)
const int Nsize = set_mpi_type<D>(curr);
Qassert(sizeof(D) % Nsize == 0);
const int size = sizeof(D) / Nsize;
if(size == 0)if(get_id_node()== 0){printf("Type not found !!!! \n");}
qassert(size != 0);
//if(size == 0)if(get_id_node()== 0){printf("Type not found !!!! \n");}
//qassert(size != 0);
return size;
}

Expand Down

0 comments on commit 18e82fa

Please sign in to comment.