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

Comparing trunk/OOPSE/libmdtools/DumpReader.cpp (file contents):
Revision 1119 by tim, Mon Apr 19 17:44:48 2004 UTC vs.
Revision 1203 by gezelter, Thu May 27 18:59:17 2004 UTC

# Line 273 | Line 273 | void DumpReader :: readSet( int whichFrame ){
273    int *MolToProcMap = mpiSim->getMolToProcMap();
274    int localIndex;
275    int nCurObj;
276 +  int nitems;
277  
278 +  nTotObjs = simnfo->getTotIntegrableObjects();
279    haveError = 0;
280    if (worldRank == 0) {
281       fsetpos(inFile,  framePos[whichFrame]);
# Line 286 | Line 288 | void DumpReader :: readSet( int whichFrame ){
288        simError();
289      }
290  
291 <    nTotObjs = atoi( read_buffer );
291 >    nitems = atoi( read_buffer );
292  
293      // Check to see that the number of integrable objects  in the intial configuration file is the
294      // same as declared in simBass.
295  
296 <    if( nTotObjs != simnfo->getTotIntegrableObjects()){
296 >    if( nTotObjs != nitems){
297        sprintf( painCave.errMsg,
298                 "DumpReadererror. %s n_atoms, %d, "
299                 "does not match the BASS file's n_atoms, %d.\n",
# Line 325 | Line 327 | void DumpReader :: readSet( int whichFrame ){
327        simError();
328      }
329  
330 <    for (i=0 ; i < mpiSim->getTotNmol(); i++) {
330 >    for (i=0 ; i < mpiSim->getNMolGlobal(); i++) {
331        which_node = MolToProcMap[i];
332        if(which_node == 0){
333         //molecules belong to master node
# Line 354 | Line 356 | void DumpReader :: readSet( int whichFrame ){
356            
357            if(haveError) nodeZeroError();
358  
359 <          parseDumpLine(read_buffer, integrableObjects[i]);
359 >          parseDumpLine(read_buffer, integrableObjects[j]);
360            
361         }
362  
# Line 363 | Line 365 | void DumpReader :: readSet( int whichFrame ){
365        else{
366        //molecule belongs to slave nodes
367  
368 <        MPI_Recv(&nCurObj, 1, MPI_INT, 0,
368 >        MPI_Recv(&nCurObj, 1, MPI_INT, which_node,
369                 TAKE_THIS_TAG_INT, MPI_COMM_WORLD, &istatus);
370        
371 <       for(j=0; j < integrableObjects.size(); j++){
371 >       for(j=0; j < nCurObj; j++){
372          
373            eof_test = fgets(read_buffer, sizeof(read_buffer), inFile);
374            if(eof_test == NULL){
# Line 393 | Line 395 | void DumpReader :: readSet( int whichFrame ){
395    }
396    else{
397    //actions taken at slave nodes
398 <    for (i=0 ; i < mpiSim->getTotNmol(); i++) {
398 >    MPI_Bcast(read_buffer, BUFFERSIZE, MPI_CHAR, 0, MPI_COMM_WORLD);
399 >
400 >    parseErr = parseCommentLine( read_buffer, simnfo);
401 >
402 >    if( parseErr != NULL ){
403 >      strcpy( painCave.errMsg, parseErr );
404 >      haveError = 1;
405 >      simError();
406 >    }
407 >  
408 >    for (i=0 ; i < mpiSim->getNMolGlobal(); i++) {
409        which_node = MolToProcMap[i];
410        
411        if(which_node == worldRank){
# Line 411 | Line 423 | void DumpReader :: readSet( int whichFrame ){
423  
424          nCurObj = integrableObjects.size();
425          
426 <        MPI_Recv(&nCurObj, 1, MPI_INT, 0,
427 <                        TAKE_THIS_TAG_INT, MPI_COMM_WORLD, &istatus);
426 >        MPI_Send(&nCurObj, 1, MPI_INT, 0,
427 >                        TAKE_THIS_TAG_INT, MPI_COMM_WORLD);
428  
429          for(j = 0; j < integrableObjects.size(); j++){
430  
# Line 732 | Line 744 | void DumpReader::nodeZeroError( void ){
744    int j, myStatus;
745  
746    myStatus = 0;
747 <  for (j = 0; j < mpiSim->getNumberProcessors(); j++) {
747 >  for (j = 0; j < mpiSim->getNProcessors(); j++) {
748      MPI_Send( &myStatus, 1, MPI_INT, j,
749                TAKE_THIS_TAG_INT, MPI_COMM_WORLD);
750    }
# Line 748 | Line 760 | void DumpReader::anonymousNodeDie( void ){
760    MPI_Finalize();
761    exit (0);
762   }
763 < #endif
763 > #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines