--- trunk/OOPSE/libmdtools/InitializeFromFile.cpp 2003/10/29 00:19:10 837 +++ trunk/OOPSE/libmdtools/InitializeFromFile.cpp 2004/01/08 18:13:30 911 @@ -45,7 +45,11 @@ InitializeFromFile::InitializeFromFile( char *in_name strcpy( c_in_name, in_name); #ifdef IS_MPI } - strcpy( checkPointMsg, "Infile opened for reading successfully." ); + else{ + sprintf( c_in_name, "mpiNodeParser_%d", worldRank ); + } + + strcpy( checkPointMsg, "Infile opened for reading successfully." ); MPIcheckPoint(); #endif return; @@ -261,7 +265,7 @@ void InitializeFromFile :: readInit( SimInfo* the_simn } } myStatus = -1; - for (j = 0; j < mpiSim->getNumberProcessors(); j++) { + for (j = 1; j < mpiSim->getNumberProcessors(); j++) { MPI_Send( &myStatus, 1, MPI_INT, j, TAKE_THIS_TAG_INT, MPI_COMM_WORLD); } @@ -583,54 +587,63 @@ char* InitializeFromFile::parseCommentLine(char* readL entry_plug->setBoxM( theBoxMat3 ); //get chi and integralOfChidt, they should appear by pair - foo = strtok(NULL, " ,;\t\n"); - if(foo != NULL){ - chi = atof(foo); - + + if( entry_plug->useInitXSstate ){ foo = strtok(NULL, " ,;\t\n"); - if(foo == NULL){ - sprintf( painCave.errMsg, - "chi and integralOfChidt should appear by pair in %s\n", c_in_name ); - return strdup( painCave.errMsg ); + if(foo != NULL){ + chi = atof(foo); + + foo = strtok(NULL, " ,;\t\n"); + if(foo == NULL){ + sprintf( painCave.errMsg, + "chi and integralOfChidt should appear by pair in %s\n", c_in_name ); + return strdup( painCave.errMsg ); + } + integralOfChidt = atof( foo ); + + //push chi and integralOfChidt into SimInfo::properties which can be + //retrieved by integrator later + DoubleData* chiValue = new DoubleData(); + chiValue->setID(CHIVALUE_ID); + chiValue->setData(chi); + entry_plug->addProperty(chiValue); + + DoubleData* integralOfChidtValue = new DoubleData(); + integralOfChidtValue->setID(INTEGRALOFCHIDT_ID); + integralOfChidtValue->setData(integralOfChidt); + entry_plug->addProperty(integralOfChidtValue); + } - integralOfChidt = atof( foo ); - - //push chi and integralOfChidt into SimInfo::properties which can be + else + return NULL; + + //get eta + foo = strtok(NULL, " ,;\t\n"); + if(foo != NULL ){ + + for(int i = 0 ; i < 9; i++){ + + if(foo == NULL){ + sprintf( painCave.errMsg, + "error in reading eta[%d] from %s\n", i, c_in_name ); + return strdup( painCave.errMsg ); + } + eta[i] = atof( foo ); + foo = strtok(NULL, " ,;\t\n"); + } + } + else + return NULL; + + //push eta into SimInfo::properties which can be //retrieved by integrator later - DoubleData* chiValue = new DoubleData(); - chiValue->setID(CHIVALUE_ID); - chiValue->setData(chi); - entry_plug->addProperty(chiValue); - - DoubleData* integralOfChidtValue = new DoubleData(); - integralOfChidtValue->setID(INTEGRALOFCHIDT_ID); - integralOfChidtValue->setData(integralOfChidt); - entry_plug->addProperty(integralOfChidtValue); - + //entry_plug->setBoxM( theBoxMat3 ); + DoubleArrayData* etaValue = new DoubleArrayData(); + etaValue->setID(ETAVALUE_ID); + etaValue->setData(eta, 9); + entry_plug->addProperty(etaValue); } - else - return NULL; - //get eta - for(int i = 0 ; i < 9; i++){ - foo = strtok(NULL, " ,;\t"); - if(foo == NULL){ - sprintf( painCave.errMsg, - "error in reading eta[%d] from %s\n", i, c_in_name ); - return strdup( painCave.errMsg ); - } - eta[i] = atof( foo ); - } - - //push eta into SimInfo::properties which can be - //retrieved by integrator later - //entry_plug->setBoxM( theBoxMat3 ); - DoubleArrayData* etaValue = new DoubleArrayData(); - etaValue->setID(ETAVALUE_ID); - etaValue->setData(eta, 9); - entry_plug->addProperty(etaValue); - - return NULL; }