Warning, /include/Geant4/tools/wroot/mpi_send_basket is written in an unsupported language. File is not indexed.
0001 // Copyright (C) 2010, Guy Barrand. All rights reserved.
0002 // See the file tools.license for terms.
0003
0004 #ifndef tools_wroot_mpi_send_basket
0005 #define tools_wroot_mpi_send_basket
0006
0007 #include "mpi_protocol"
0008 #include "../impi"
0009 #include "basket"
0010
0011 namespace tools {
0012 namespace wroot {
0013
0014 inline bool mpi_pack_basket(impi& a_mpi,uint32 a_icol,const basket& a_basket) {
0015 if(!a_mpi.pack(a_icol)) return false;
0016
0017 if(!a_mpi.spack(a_basket.object_name())) return false;
0018 if(!a_mpi.spack(a_basket.object_title())) return false;
0019
0020 if(!a_mpi.pack(a_basket.last())) return false;
0021 if(!a_mpi.pack(a_basket.nev_buf_size())) return false;
0022 if(!a_mpi.pack(a_basket.nev())) return false;
0023
0024 if(a_basket.entry_offset()) {
0025 if(!a_mpi.bpack(true)) return false;
0026 if(!a_mpi.pack(a_basket.nev_buf_size(),a_basket.entry_offset())) return false;
0027 } else {
0028 if(!a_mpi.bpack(false)) return false;
0029 }
0030
0031 if(a_basket.displacement()) {
0032 if(!a_mpi.bpack(true)) return false;
0033 if(!a_mpi.pack(a_basket.nev_buf_size(),a_basket.displacement())) return false;
0034 } else {
0035 if(!a_mpi.bpack(false)) return false;
0036 }
0037
0038 if(!a_mpi.pack(a_basket.datbuf().length(),a_basket.datbuf().buf())) return false;
0039 return true;
0040 }
0041
0042 inline bool mpi_send_basket(impi& a_mpi,int a_dest,int a_tag,uint32 a_id,uint32 a_icol,const basket& a_basket) {
0043 a_mpi.pack_reset();
0044 if(!a_mpi.pack(mpi_protocol_basket())) return false;
0045 if(!a_mpi.pack(a_id)) return false;
0046 if(!mpi_pack_basket(a_mpi,a_icol,a_basket)) return false;
0047 return a_mpi.send_buffer(a_dest,a_tag);
0048 }
0049
0050 }}
0051
0052 #endif