ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/InitializeFromFile.cpp
(Generate patch)

Comparing trunk/OOPSE/libmdtools/InitializeFromFile.cpp (file contents):
Revision 1130 by tim, Thu Apr 22 14:55:17 2004 UTC vs.
Revision 1268 by tim, Fri Jun 11 17:16:21 2004 UTC

# Line 220 | Line 220 | void InitializeFromFile :: readInit( SimInfo* the_simn
220  
221      MPI_Bcast(read_buffer, BUFFERSIZE, MPI_CHAR, 0, MPI_COMM_WORLD);
222  
223    cerr << "node " << worldRank << " finished  MPI_Bcast" << endl;
223  
224      parseErr = parseCommentLine( read_buffer, simnfo);
225  
# Line 230 | Line 229 | void InitializeFromFile :: readInit( SimInfo* the_simn
229        simError();
230      }
231  
232 <    for (i=0 ; i < mpiSim->getTotNmol(); i++) {
232 >    for (i=0 ; i < mpiSim->getNMolGlobal(); i++) {
233        which_node = MolToProcMap[i];
234        if(which_node == 0){
235         //molecules belong to master node
# Line 270 | Line 269 | void InitializeFromFile :: readInit( SimInfo* the_simn
269  
270          MPI_Recv(&nCurObj, 1, MPI_INT, which_node,
271                 TAKE_THIS_TAG_INT, MPI_COMM_WORLD, &istatus);
272 <         cerr << "node " << worldRank << " finished  MPI_Send" << endl;  
272 >
273         for(j=0; j < nCurObj; j++){
274          
275            eof_test = fgets(read_buffer, sizeof(read_buffer), c_in_file);
# Line 288 | Line 287 | void InitializeFromFile :: readInit( SimInfo* the_simn
287  
288              MPI_Send(read_buffer, BUFFERSIZE, MPI_CHAR, which_node,
289                        TAKE_THIS_TAG_CHAR, MPI_COMM_WORLD);
290 <           cerr << "node " << worldRank << " finished  MPI_Send" << endl;
290 >
291         }
292  
293        }
# Line 301 | Line 300 | void InitializeFromFile :: readInit( SimInfo* the_simn
300  
301      MPI_Bcast(read_buffer, BUFFERSIZE, MPI_CHAR, 0, MPI_COMM_WORLD);
302  
304    cerr << "node " << worldRank << " finished  MPI_Bcast" << endl;
303      parseErr = parseCommentLine( read_buffer, simnfo);
304  
305      if( parseErr != NULL ){
# Line 310 | Line 308 | void InitializeFromFile :: readInit( SimInfo* the_simn
308        simError();
309      }
310    
311 <    for (i=0 ; i < mpiSim->getTotNmol(); i++) {
311 >    for (i=0 ; i < mpiSim->getNMolGlobal(); i++) {
312        which_node = MolToProcMap[i];
313        
314        if(which_node == worldRank){
# Line 331 | Line 329 | void InitializeFromFile :: readInit( SimInfo* the_simn
329          MPI_Send(&nCurObj, 1, MPI_INT, 0,
330                          TAKE_THIS_TAG_INT, MPI_COMM_WORLD);
331  
334        cerr << "node " << worldRank << " finished  MPI_Send" << endl;
332          for(j = 0; j < integrableObjects.size(); j++){
333  
334            MPI_Recv(read_buffer, BUFFERSIZE, MPI_CHAR, 0,
335                                TAKE_THIS_TAG_CHAR, MPI_COMM_WORLD, &istatus);
336  
340        cerr << "node " << worldRank << " finished  MPI_Recv" << endl;
337            parseErr = parseDumpLine(read_buffer, integrableObjects[j]);
338  
339            if( parseErr != NULL ){
# Line 522 | Line 518 | char* InitializeFromFile::parseDumpLine(char* readLine
518  
519      qSqr = (q[0] * q[0]) + (q[1] * q[1]) + (q[2] * q[2]) + (q[3] * q[3]);
520  
521 +    if (fabs(qSqr) < 1e-6) {
522 +      sprintf(painCave.errMsg,
523 +          "initial quaternion error (q0^2 + q1^2 + q2^2 + q3^2 ~ 0).\n");
524 +       return strdup(painCave.errMsg);
525 +    }
526 +    
527      qLength = sqrt( qSqr );
528      q[0] = q[0] / qLength;
529      q[1] = q[1] / qLength;
# Line 653 | Line 655 | void initFile::nodeZeroError( void ){
655    int j, myStatus;
656  
657    myStatus = 0;
658 <  for (j = 0; j < mpiSim->getNumberProcessors(); j++) {
658 >  for (j = 0; j < mpiSim->getNProcessors(); j++) {
659      MPI_Send( &myStatus, 1, MPI_INT, j,
660                TAKE_THIS_TAG_INT, MPI_COMM_WORLD);
661    }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines