Main Page   Class Hierarchy   Data Structures   File List   Data Fields   Globals  

specific_function.C

Go to the documentation of this file.
00001 #include "sigma.h"
00002 
00003 #ifndef TOOLBOX
00004 
00005 #ifdef USE_specific_function
00006 #ifdef USE_MPI
00007 void print_scatter_specific_information(sdyn *b,
00008                                         sigma_input input, 
00009                                         scatter_exp experiment) {
00010 
00011   char *prefered_string = "(p1,p2,(t1,t2))";
00012   //  if(experiment.get_scatter_discriptor()==single_ionization ||
00013   //     experiment.get_scatter_discriptor()==exchange_ionization) {
00014   if(!strcmp(experiment.get_final_form(), "((p1,t1),p2,t2)") ||
00015      !strcmp(experiment.get_final_form(), "(p1,(p2,t1),t2)") ||
00016      !strcmp(experiment.get_final_form(), "(p1,p2,(t1,t2))")) {
00017     //  if (true) {
00018     int myid = MPI::COMM_WORLD.Get_rank();
00019     MPI::Status status;  
00020     int request_for_data = myid;
00021     int request_granted = 1;
00022     int master = 0;
00023     int length = 1;
00024     //    cerr << "process " << myid << " requests for output"<<endl;
00025     MPI::COMM_WORLD.Send(&request_for_data, length, MPI::INT, master, 
00026                          WRITE_REQUEST_TAG);
00027     MPI::COMM_WORLD.Recv(&request_granted, length, MPI::INT, master, 
00028                          WRITE_REQUEST_TAG, status); 
00029 
00030     //    cerr << "slave " << myid << " is allowed to write" << endl;
00031 
00032     cerr << "Found prefered final state: "
00033          << experiment.get_final_form() << endl;
00034     ppn(b, cerr);
00035     vector center = b->get_pos();
00036     print_structure_recursive(b, 0., center, true, true, 4);
00037 
00038     MPI::COMM_WORLD.Send(&request_for_data, length, MPI::INT,
00039                          master, WRITE_READY_TAG);
00040     //    cerr << "process " << myid << " finished output"<<endl;
00041 
00042   }
00043 
00044 }
00045 
00046 #else // No MPI
00047 void print_scatter_specific_information(sdyn *b,
00048                                         sigma_input input, 
00049                                         scatter_exp experiment) {
00050 
00051   char *prefered_string = "(p1,p2,(t1,t2))";
00052   //  if(experiment.get_scatter_discriptor()==single_ionization ||
00053   //     experiment.get_scatter_discriptor()==exchange_ionization) {
00054   if(!strcmp(experiment.get_final_form(), "((p1,t1),p2,t2)") ||
00055      !strcmp(experiment.get_final_form(), "(p1,(p2,t1),t2)") ||
00056      !strcmp(experiment.get_final_form(), "(p1,p2,(t1,t2))")) {
00057 
00058     cerr << "Found prefered final state: "
00059          << experiment.get_final_form() << endl;
00060     ppn(b, cerr);
00061     vector center = b->get_pos();
00062     print_structure_recursive(b, 0., center, true, true, 4);
00063 
00064   }
00065 }
00066 #endif
00067 
00068 #else
00069 void print_scatter_specific_information(sdyn *b,
00070                                         sigma_input input, 
00071                                         scatter_exp experiment) {
00072 // do nothing
00073 }
00074 #endif
00075 #endif

Generated at Sun Feb 24 09:57:17 2002 for STARLAB by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001