Changes between Version 22 and Version 23 of Piernik
- Timestamp:
- 03/11/13 00:25:57 (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Piernik
v22 v23 206 206 In the original code, before every MC step the rho_gas and m_gas multidimensional arrays were recomputed, in the MUSCLE variant we replace the code with MUSCLE_Receive calls 207 207 {{{ 208 call MUSCLE_Receive("rho_gas", rho_gas, %REF(size(rho_gas)), MUSCLE_DOUBLE) !here we assume that real is always real*8209 call MUSCLE_Receive("m_gas", m_gas, %REF(size(m_gas)), MUSCLE_DOUBLE) !here we assume that real is always real*8208 call MUSCLE_Receive("rho_gas", rho_gas, size(rho_gas), MUSCLE_DOUBLE) !here we assume that real is always real*8 209 call MUSCLE_Receive("m_gas", m_gas, size(m_gas), MUSCLE_DOUBLE) !here we assume that real is always real*8 210 210 }}} 211 211 As mentioned before the arrays are multidimensional (4 and 3 dimensional saying more precisely) but taking into consideration fact that both kernels are FORTRAN codes and that FORTRAN multidimensional arrays have continues memory layout we can safely cast it to single dimension. … … 213 213 Now we need to add corresponding `MUSCLE_Send` calls to the MHD kernel after the gas density and momentum values are recomputed: 214 214 {{{ 215 call MUSCLE_Send("rho_gas", rho_gas, %REF(size(rho_gas)), MUSCLE_DOUBLE) !here we assume that real is always real*8216 call MUSCLE_Send("m_gas", m_gas, %REF(size(m_gas)), MUSCLE_DOUBLE) !here we assume that real is always real*8215 call MUSCLE_Send("rho_gas", rho_gas, size(rho_gas), MUSCLE_DOUBLE) !here we assume that real is always real*8 216 call MUSCLE_Send("m_gas", m_gas, size(m_gas), MUSCLE_DOUBLE) !here we assume that real is always real*8 217 217 }}} 218 218 … … 230 230 } 231 231 }}} 232 And the corresponding code: 233 {{{ 234 #ifdef MHD_KERNEL 235 call time_step(dt) 236 call MUSCLE_Send("dt_final", dt, dt_len, MUSCLE_DOUBLE) 237 #else /*MC_KERNEL*/ 238 dt = timestep_mc() 239 call MUSCLE_Send("dt_mc", dt, dt_len, MUSCLE_DOUBLE) 240 call MUSCLE_Receive("dt_final", dt, dt_len, MUSCLE_DOUBLE) 241 #endif 242 }}} 232 243 == MPI enabling == 233 244