void supports_broadcast ( int myid, int nspt, int dim ) { int mix[nspt]; int fail,i,j; double point[dim]; if(myid == 0) { fail = celcon_type_of_mixture(&nspt,mix); if(v>0) printf("The number of occurrences of supports is: "); if(v>0) Print_Integer_Array(nspt,mix); } MPI_Bcast(mix,nspt,MPI_INT,0,MPI_COMM_WORLD); if(myid != 0) fail = celcon_set_type_of_mixture(nspt,mix); if(myid == 0) { fail = celcon_length_of_supports(&nspt,mix); /* get #different supports and #points of each support. */ if(v>0) printf("The number of points in root supports is: "); if(v>0) Print_Integer_Array(nspt,mix); } MPI_Bcast(mix,nspt,MPI_INT,0,MPI_COMM_WORLD); for(i=0;i<nspt;i++) for(j=0;j<mix[i];j++) { if(myid==0) fail = celcon_get_lifted_point(dim,i+1,j+1,point); MPI_Bcast(point,dim,MPI_DOUBLE,0,MPI_COMM_WORLD); if(myid!=0) fail = celcon_append_lifted_point(dim,i+1,point); } }
int show_mixture ( int dim, int *r ) { int fail,*mix,i; double *c; mix = (int*)calloc(dim,sizeof(int)); fail = celcon_type_of_mixture(r,mix); if(fail == 1) printf("An error occurred, type of mixture not available.\n"); else { printf("number of different supports : %d\n",*r); printf("type of mixture :"); for(i=0; i<*r; i++) printf(" %d", mix[i]); printf("\n"); } return fail; }
void retrieve_dimensions ( int myid, int *nspt, int *dim ) { int fail, *mix; if(myid == 0) { fail = celcon_read_mixed_cell_configuration(); printf("\nReading a system to initialize the symbol table..."); fail = read_standard_target_system(); fail = define_output_file(); fail = celcon_dimension_of_points(dim); mix = (int*)calloc((*dim-1), sizeof(int)); fail = celcon_type_of_mixture(nspt,mix); if(v>0) printf("\nThe number of different support is %d\n",*nspt); if(v>0) printf("The dimension of lifted points is %d\n",*dim); } MPI_Bcast(nspt,1,MPI_INT,0,MPI_COMM_WORLD); MPI_Bcast(dim,1,MPI_INT,0,MPI_COMM_WORLD); }