int standard_membership_test ( void ) { int fail,n,dim,deg,nv; char ans; printf("\nReading a witness set ...\n"); fail = read_witness_set(&n,&dim,°); nv = n - dim; if(verbose>0) /* only in verbose mode */ { printf("\nThe ambient dimension : %d.\n",n); printf("The dimension of the solution set : %d.\n",dim); printf("The degree of the solution set : %d.\n",deg); printf("\nDo you want to see the embedded system ? (y/n) "); scanf("%c",&ans); if(ans == 'y') { printf("\nThe system read :\n"); fail = syscon_write_standard_system(); } scanf("%c",&ans); /* skip end of line character */ printf("\nDo you want to see the solutions ? (y/n) "); scanf("%c",&ans); if(ans == 'y') { printf("\nThe solutions read :\n"); fail = solcon_write_standard_solutions(); } scanf("%c",&ans); /* skip end of line character */ } { int fail,onsys,onset; double tpt[2*nv]; const double restol = 1.0e-6; const double homtol = 1.0e-10; printf("\nReading the coordinates of the test point x ...\n"); standard_read_point(nv,tpt); fail = standard_homotopy_membership_test (1,nv,dim,restol,homtol,tpt,&onsys,&onset); } return 0; }
int standard_test ( void ) { int fail,n,dim,deg,nbloops,kind; char ans; printf("\nReading a witness set ...\n"); fail = read_witness_set(&n,&dim,°); printf("\nMENU for the kind of output :\n"); printf(" 0. remain silent with no intermediate output;\n"); printf(" 1. all intermediate output goes to screen;\n"); printf(" 2. give a file name for all intermediate output.\n"); printf("Type 0, 1, or 2 to make a choice : "); scanf("%d",&kind); scanf("%c",&ans); /* skip end of line character */ if(kind == 0) fail = set_state_to_silent(); if(kind == 2) fail = define_output_file(); if(verbose>0) /* only in verbose mode */ { printf("\nThe ambient dimension : %d.\n",n); printf("The dimension of the solution set : %d.\n",dim); printf("The degree of the solution set : %d.\n",deg); printf("\nDo you wish to see the embedded system ? (y/n) "); scanf("%c",&ans); if(ans == 'y') { printf("\nThe system read :\n"); fail = print_system(); } } fail = assign_labels(n,deg,0); printf("\nGive the number of loops : "); scanf("%d",&nbloops); fail = standard_monodromy_breakup(nbloops,n,dim,deg); if(kind == 2) printf("See the output file for results.\n"); return 0; }
int main ( int argc, char *argv[] ) { int myid,numprocs,n,dim,deg,nbloops,fail; double startwtime,trackwtime,wtime,*mytime; MPI_Status status; adainit(); MPI_Init(&argc,&argv); MPI_Comm_size(MPI_COMM_WORLD,&numprocs); MPI_Comm_rank(MPI_COMM_WORLD,&myid); srand(time(NULL)); /* for different random gamma constant */ if(myid == 0) { mytime = (double*) calloc(numprocs, sizeof(double)); startwtime = MPI_Wtime(); fail = read_witness_set(&n,&dim,°); fail = define_output_file(); printf("Give the number of loops : "); scanf("%d",&nbloops); } else trackwtime = MPI_Wtime(); MPI_Barrier(MPI_COMM_WORLD); /* wait for node 0 */ dimension_broadcast(myid,&n); MPI_Bcast(&nbloops,1,MPI_INT,0,MPI_COMM_WORLD); fail = monodromy_breakup(myid,n,dim,deg,nbloops,numprocs,&trackwtime); MPI_Barrier(MPI_COMM_WORLD); if(myid == 0) wtime = MPI_Wtime() - startwtime; else wtime = trackwtime; MPI_Gather(&wtime,1,MPI_DOUBLE,mytime,1,MPI_DOUBLE,0,MPI_COMM_WORLD); if(myid == 0) print_time(mytime,numprocs); MPI_Finalize(); adafinal(); return 0; }