Esempio n. 1
0
int dobldobl_test ( void )
{
   int fail,n,dim,deg,nbloops,kind;
   char ans;

   printf("\nReading a witness set ...\n");
   fail = read_dobldobl_witness_set(&n,&dim,&deg);
   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 = syscon_write_dobldobl_system();
      }
   }

   fail = dobldobl_assign_labels(n,deg);

   printf("\nGive the number of loops : ");
   scanf("%d",&nbloops);

   fail = dobldobl_monodromy_breakup(nbloops,n,dim,deg);

   if(kind == 2) printf("See the output file for results.\n");

   return 0;
}
Esempio n. 2
0
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);   
}
Esempio n. 3
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,&deg);
      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;
}
Esempio n. 4
0
void read_cells_and_solve_start_system ( void )
{
   int fail,dim,r,len,prcs;

   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);
   printf("dimension of the lifted points : %d\n",dim);
   fail = show_mixture(dim,&r);
   fail = celcon_number_of_cells(&len);
   printf("number of cells in the configuration : %d\n",len);

   prcs = prompt_for_precision();
   if(prcs == 0)
      solve_standard_start_system(len);
   else if(prcs == 1)
      solve_dobldobl_start_system(len);
   else if(prcs == 2)
      solve_quaddobl_start_system(len);
   else
      printf("invalid precision level\n");
}