fix bugs reported by @jibril-b-coulibaly

This commit is contained in:
Axel Kohlmeyer
2022-04-28 14:47:53 -04:00
parent 33a63e5cd3
commit f09556018b
2 changed files with 3 additions and 3 deletions

View File

@ -201,9 +201,9 @@ int DeviceT::init_device(MPI_Comm world, MPI_Comm replica, const int ngpu,
unsigned best_cus = gpu->cus(0); unsigned best_cus = gpu->cus(0);
bool type_match = (gpu->device_type(0) == type); bool type_match = (gpu->device_type(0) == type);
for (int i = 1; i < gpu->num_devices(); i++) { for (int i = 1; i < gpu->num_devices(); i++) {
if (type_match && gpu->device_type(i)!=type) if (type_match && (gpu->device_type(i) != type))
continue; continue;
if (type_match && gpu->device_type(i) == type) { if (!type_match && (gpu->device_type(i) == type)) {
type_match = true; type_match = true;
best_cus = gpu->cus(i); best_cus = gpu->cus(i);
best_device = i; best_device = i;

View File

@ -188,7 +188,7 @@ void PairGranular::compute(int eflag, int vflag)
double *history,*allhistory,**firsthistory; double *history,*allhistory,**firsthistory;
bool touchflag = false; bool touchflag = false;
const bool historyupdate = update->setupflag != 0; const bool historyupdate = update->setupflag == 0;
ev_init(eflag,vflag); ev_init(eflag,vflag);