예제 #1
0
void comm_cp_parse_info(CP_PARSE *cp_parse, MPI_Comm world)

/*=======================================================================*/
/*             Begin routine                                              */
{/*begin routine */
/*=======================================================================*/
/*             Local variable declarations                                */

  
#include "../typ_defs/typ_mask.h"

  int ncp_parse_int    = 6;
  int ncp_parse_double = 11;
  MPI_Datatype cp_parse_info_comm_int;
  MPI_Datatype cp_parse_info_comm_double;
  MPI_Datatype types_int[1];
  MPI_Datatype types_double[1];
  MPI_Aint displs_int[1];
  MPI_Aint displs_double[1];
  int blockcounts_int[1];
  int blockcounts_double[1];

  Address(&(cp_parse->istart_cp),&displs_int[0]);
  Address(&(cp_parse->cp_mass_tau_def),&displs_double[0]);
  types_int[0] = MPI_INT;
  types_double[0] = MPI_DOUBLE;
  blockcounts_int[0] = ncp_parse_int;
  blockcounts_double[0] = ncp_parse_double;
  Barrier(world);
  Type_struct(1,blockcounts_int,displs_int,types_int,
                &cp_parse_info_comm_int);
  Barrier(world);
  Type_struct(1,blockcounts_double,displs_double,types_double,
                &cp_parse_info_comm_double);
  Barrier(world);
  Type_commit(&cp_parse_info_comm_int);
  Barrier(world);
  Type_commit(&cp_parse_info_comm_double);
  Barrier(world);
  Bcast(MPI_BOTTOM,1,cp_parse_info_comm_int,0,world);
  Barrier(world);
  Bcast(MPI_BOTTOM,1,cp_parse_info_comm_double,0,world);
  Barrier(world);
  Type_free(&cp_parse_info_comm_int);
  Barrier(world);
  Type_free(&cp_parse_info_comm_double);
  Barrier(world);


/*------------------------------------------------------------------------*/
} /*end routine*/ 
예제 #2
0
void comm_cpcoeffs_info(CPCOEFFS_INFO *cpcoeffs_info,MPI_Comm world)

/*=======================================================================*/
/*             Begin routine                                              */
{/*begin routine */
/*=======================================================================*/
/*             Local variable declarations                                */

#include "../typ_defs/typ_mask.h"

  int ninfo = 17;
  MPI_Datatype cpcoeffs_info_comm;
  MPI_Datatype types[1];
  MPI_Aint displs[1];
  int blockcounts[1];

  Address(&(cpcoeffs_info->pi_beads),&displs[0]);
  types[0] = MPI_INT;
  blockcounts[0] = ninfo;
  Barrier(world);
  Type_struct(1,blockcounts,displs,types,&cpcoeffs_info_comm);
  Barrier(world);
  Type_commit(&cpcoeffs_info_comm);
  Barrier(world);
  Bcast(MPI_BOTTOM,1,cpcoeffs_info_comm,0,world);
  Barrier(world);
  Type_free(&cpcoeffs_info_comm);
  Barrier(world);
  Bcast(&(cpcoeffs_info->ecut),1,MPI_DOUBLE,0,world);
  Bcast(&(cpcoeffs_info->cp_hess_cut),1,MPI_DOUBLE,0,world);

/*------------------------------------------------------------------------*/
   }/*end routine*/ 
예제 #3
0
void comm_cp_wannier(CP_WANNIER *cp_wannier,MPI_Comm world)

/*=======================================================================*/
/*             Begin routine                                              */
{/*begin routine */
/*=======================================================================*/
/*             Local variable declarations                                */

#include "../typ_defs/typ_mask.h"

  int ninfo = 4;
  MPI_Datatype cp_wannier_comm;
  MPI_Datatype types[1];
  MPI_Aint displs[1];
  int blockcounts[1];

  Address(&(cp_wannier->cp_wan_calc_frq),&displs[0]);
  types[0] = MPI_INT;
  blockcounts[0] = ninfo;
  Barrier(world);
  Type_struct(1,blockcounts,displs,types,&cp_wannier_comm);
  Barrier(world);
  Type_commit(&cp_wannier_comm);
  Barrier(world);
  Bcast(MPI_BOTTOM,1,cp_wannier_comm,0,world);
  Barrier(world);
  Type_free(&cp_wannier_comm);
  Barrier(world);
  Bcast(&(cp_wannier->rcut_wan_orb),1,MPI_DOUBLE,0,world);
  Bcast(&(cp_wannier->rcut_wan_nl),1,MPI_DOUBLE,0,world);

/*------------------------------------------------------------------------*/
   }/*end routine*/
예제 #4
0
void comm_cptherm_info(CPTHERM_INFO *cptherm_info,MPI_Comm world)

/*=======================================================================*/
/*             Begin routine                                              */
{/*begin routine */
/*=======================================================================*/
/*             Local variable declarations                                */

  
#include "../typ_defs/typ_mask.h"

  int ninfo = 5;
  MPI_Datatype cptherm_info_comm;
  MPI_Datatype types[1];
  MPI_Aint displs[1];
  int blockcounts[1];

  Address(&(cptherm_info->len_c_nhc),&displs[0]);
  types[0]       = MPI_INT;
  blockcounts[0] = ninfo;
  Barrier(world);
  Type_struct(1,blockcounts,displs,types,&cptherm_info_comm);
  Barrier(world);
  Type_commit(&cptherm_info_comm);
  Barrier(world);
  Bcast(MPI_BOTTOM,1,cptherm_info_comm,0,world);
  Barrier(world);
  Type_free(&cptherm_info_comm);
  Barrier(world);

  Bcast(&(cptherm_info->cp_therm_heat_fact),1,MPI_DOUBLE,0,world);
  Barrier(world);

/*------------------------------------------------------------------------*/
} /*end routine*/ 
예제 #5
0
void comm_simopts(SIMOPTS *simopts,MPI_Comm world)

/*=======================================================================*/
/*             Begin routine                                              */
{/*begin routine */
/*=======================================================================*/
/*             Local variable declarations                                */
#include "../typ_defs/typ_mask.h"

  MPI_Datatype simopts_comm;
  MPI_Datatype types[1];
  MPI_Aint displs[1];
  int blockcounts[1];

  Address(&(simopts->md),&displs[0]);
  types[0] = MPI_INT;
  blockcounts[0] = 18;
  
  Barrier(world);
  Type_struct(1,blockcounts,displs,types,&simopts_comm);
  Barrier(world);
  Type_commit(&simopts_comm);
  Barrier(world);
  Bcast(MPI_BOTTOM,1,simopts_comm,0,world);
  Barrier(world);
  Type_free(&simopts_comm);
  Barrier(world);
  Bcast(&(simopts->ann_rate),1,MPI_DOUBLE,0,world);
  Bcast(&(simopts->ann_start_temp),1,MPI_DOUBLE,0,world);
  Bcast(&(simopts->ann_target_temp),1,MPI_DOUBLE,0,world);



/*------------------------------------------------------------------------*/
} /*end routine*/ 
예제 #6
0
void comm_filenames(FILENAMES *filenames,MPI_Comm world)

/*=======================================================================*/
/*             Begin routine                                              */
{/*begin routine */
/*=======================================================================*/
/*             Local variable declarations                                */

#include "../typ_defs/typ_mask.h"
  int filenames_num = 14;
  MPI_Datatype filenames_comm;
  MPI_Datatype types[1];
  MPI_Aint displs[1];
  int blockcounts[1];

  Address(&(filenames->iwrite_screen),&displs[0]);
  types[0] = MPI_INT;
  blockcounts[0] = filenames_num;
  
  Barrier(world);
  Type_struct(1,blockcounts,displs,types,&filenames_comm);
  Barrier(world);
  Type_commit(&filenames_comm);
  Barrier(world);
  Bcast(MPI_BOTTOM,1,filenames_comm,0,world);
  Barrier(world);
  Type_free(&filenames_comm);

/*------------------------------------------------------------------------*/
} /*end routine*/ 
예제 #7
0
void comm_cpopts(CPOPTS *cpopts,MPI_Comm world)

/*=======================================================================*/
/*             Begin routine                                              */
{/*begin routine */
/*=======================================================================*/
/*             Local variable declarations                                */

#include "../typ_defs/typ_mask.h"
  int cpopts_num = 39;
  MPI_Datatype cpopts_comm;
  MPI_Datatype types[1];
  MPI_Aint displs[1];
  int blockcounts[1];

  Address(&(cpopts->cp_lda),&displs[0]);
  types[0] = MPI_INT;
  blockcounts[0] = cpopts_num;
  
  Barrier(world);
  Type_struct(1,blockcounts,displs,types,&cpopts_comm);
  Barrier(world);
  Type_commit(&cpopts_comm);
  Barrier(world);
  Bcast(MPI_BOTTOM,1,cpopts_comm,0,world);
  Barrier(world);
  Type_free(&cpopts_comm);

/*------------------------------------------------------------------------*/
} /*end routine*/ 
예제 #8
0
void comm_ensopts(ENSOPTS *ensopts,MPI_Comm world)

/*=======================================================================*/
/*             Begin routine                                              */
{/*begin routine */
/*=======================================================================*/
/*             Local variable declarations                                */

#include "../typ_defs/typ_mask.h"
  int nensopts = 5;
  MPI_Datatype ensopts_comm;
  MPI_Datatype types[1];
  MPI_Aint displs[1];
  int blockcounts[1];

  Address(&(ensopts->nve),&displs[0]);
  types[0] = MPI_INT;
  blockcounts[0] = nensopts;
  
  Barrier(world);
  Type_struct(1,blockcounts,displs,types,&ensopts_comm);
  Barrier(world);
  Type_commit(&ensopts_comm);
  Barrier(world);
  Bcast(MPI_BOTTOM,1,ensopts_comm,0,world);
  Barrier(world);
  Type_free(&ensopts_comm);



/*------------------------------------------------------------------------*/
} /*end routine*/ 
예제 #9
0
void comm_cpconstrnt(CPCONSTRNT *cpconstrnt,MPI_Comm world)

/*=======================================================================*/
/*             Begin routine                                              */
{/*begin routine */
/*=======================================================================*/
/*             Local variable declarations                                */

#include "../typ_defs/typ_mask.h"

  int nscal_cpconstrnt = 3;
  MPI_Datatype cpconstrnt_comm;
  MPI_Datatype types[1];
  MPI_Aint displs[1];
  int blockcounts[1];

  Address(&(cpconstrnt->c_tolshake),&displs[0]);
  types[0] = MPI_DOUBLE;
  blockcounts[0] = nscal_cpconstrnt;
  
  Barrier(world);
  Type_struct(1,blockcounts,displs,types,&cpconstrnt_comm);
  Barrier(world);
  Type_commit(&cpconstrnt_comm);
  Barrier(world);
  Bcast(MPI_BOTTOM,1,cpconstrnt_comm,0,world);
  Barrier(world);
  Type_free(&cpconstrnt_comm);

/*------------------------------------------------------------------------*/
} /*end routine*/ 
예제 #10
0
파일: type.c 프로젝트: mfvalin/serial-mpi
/* Public function, wrapper for Type_struct that translates handle to
 * pointer (see NOTES at top of file)
 */
int MPI_Type_struct(int count, int * blocklens, MPI_Aint * displacements, 
                    MPI_Datatype *oldtypes,     MPI_Datatype *newtype)
{
  int i;
  Datatype oldtypes_ptr[count];
  Datatype * newtype_ptr;

  for (i = 0; i < count; i++)
  {
    oldtypes_ptr[i] = *(Datatype*) mpi_handle_to_datatype(oldtypes[i]);
  }

  mpi_alloc_handle(newtype, (void**) &newtype_ptr);

  return Type_struct(count, blocklens, displacements,
                          oldtypes_ptr, newtype_ptr); 
}
예제 #11
0
void comm_vel_samp_cp(VEL_SAMP_CP *vel_samp_cp,MPI_Comm world,int myid)

/*=======================================================================*/
/*             Begin routine                                             */
{           /* begin routine */
/*=======================================================================*/
/*             Local variable declarations                               */

#include "../typ_defs/typ_mask.h"

  int i,itemp;
  double temp,qseed;
  int nint = 8;
  MPI_Datatype vel_samp_comm;
  MPI_Datatype types[1];
  MPI_Aint displs[1];
  int blockcounts[1];

  Address(&(vel_samp_cp->ivelc_smpl_on),&displs[0]);
  types[0] = MPI_INT;
  blockcounts[0] = nint;
  Barrier(world);
  Type_struct(1,blockcounts,displs,types,&vel_samp_comm);
  Barrier(world);
  Type_commit(&vel_samp_comm);
  Barrier(world);
  Bcast(MPI_BOTTOM,1,vel_samp_comm,0,world);
  Barrier(world);
  Type_free(&vel_samp_comm);
  Barrier(world);
  Bcast(&(vel_samp_cp->qseed),1,MPI_DOUBLE,0,world);
  Bcast(&(vel_samp_cp->vc_scal_tol),1,MPI_DOUBLE,0,world);

/*Randomize random seed */
  qseed = vel_samp_cp->qseed;
  for(i=1;i<=myid;i++){
    temp=10000.0*ran_essl(&qseed);
    itemp = temp;
  }/*endfor*/
  if(myid>0){vel_samp_cp->qseed = (double)itemp;}

/*------------------------------------------------------------------------*/
} /*end routine*/ 
예제 #12
0
void comm_minopts(MINOPTS *minopts,MPI_Comm world)

/*=======================================================================*/
/*             Begin routine                                              */
{/*begin routine */
/*=======================================================================*/
/*             Local variable declarations                                */
#include "../typ_defs/typ_mask.h"

  int nmin_int    = 10;
  MPI_Datatype minopts_comm;
  MPI_Datatype types[1];
  MPI_Aint displs[1];
  int blockcounts[1];

  Address(&(minopts->min_std),&displs[0]);
  types[0] = MPI_INT;
  blockcounts[0] = nmin_int;
  
  Barrier(world);
  Type_struct(1,blockcounts,displs,types,&minopts_comm);
  Barrier(world);
  Type_commit(&minopts_comm);
  Barrier(world);
  Bcast(MPI_BOTTOM,1,minopts_comm,0,world);
  Barrier(world);
  Type_free(&minopts_comm);
  Barrier(world);
  Bcast(&(minopts->tol_coef),1,MPI_DOUBLE,0,world);
  Barrier(world);
  Bcast(&(minopts->tol_atom),1,MPI_DOUBLE,0,world);



/*------------------------------------------------------------------------*/
} /*end routine*/