! ! License-Identifier: GPL ! ! Copyright (C) 2017 The Yambo Team ! ! Authors (see AUTHORS file for details): AM ! ! headers ! #include<dev_defs.h> #include<y_memory.h> ! subroutine X_ALLOC_parallel(X_par,NG,NW,mode) ! use pars, ONLY:cZERO use parallel_m, ONLY:COMM_copy,PAR_COM_RL_INDEX,PAR_COM_RL_A2A use matrix, ONLY:MATRIX_reset,PAR_matrix use X_m, ONLY:X_rows,X_cols use parallel_int, ONLY:PARALLEL_live_message use y_memory_alloc ! implicit none ! type(PAR_matrix) :: X_par integer :: NG,NW character(*) :: mode ! ! Work Space ! logical :: l_PAR,l_INI_ONLY ! ! Type of allocation.... ! l_PAR = index(mode,"X")>0 l_INI_ONLY = index(mode,"INIT_ONLY")>0 ! ! Initialization ! if (l_PAR) then call MATRIX_init( "X", X_par, NG, NW ) endif ! X_rows = X_par%rows !DEV_ACC update device(X_rows) X_cols = X_par%cols !DEV_ACC update device(X_cols) ! if (l_INI_ONLY) return ! YAMBO_ALLOC(X_par%blc,(X_par%rows(1):X_par%rows(2),X_par%cols(1):X_par%cols(2),NW)) X_par%blc=cZERO ! ! The device copy of X_par%blc is allocated (and freed) inside X_irredux ! call PARALLEL_live_message("RL vectors(X)",LOADED=X_par%ncols*X_par%nrows,TOTAL=NG**2,NCPU=X_par%INTER_comm%n_CPU) ! end subroutine