more debugging on plugin mode
This commit is contained in:
@ -137,9 +137,13 @@ def perform_tasks(world,mdicomm,dummy):
|
|||||||
if mode == "eval":
|
if mode == "eval":
|
||||||
pass
|
pass
|
||||||
elif mode == "run":
|
elif mode == "run":
|
||||||
|
print("SENDING INIT_MD")
|
||||||
mdi.MDI_Send_command("@INIT_MD",mdicomm)
|
mdi.MDI_Send_command("@INIT_MD",mdicomm)
|
||||||
|
print("SENDING NITERATE")
|
||||||
mdi.MDI_Send_command(">NITERATE",mdicomm)
|
mdi.MDI_Send_command(">NITERATE",mdicomm)
|
||||||
|
print("SENDING NITERATE data nsteps")
|
||||||
mdi.MDI_Send(nsteps,1,mdi.MDI_INT,mdicomm)
|
mdi.MDI_Send(nsteps,1,mdi.MDI_INT,mdicomm)
|
||||||
|
print("SENDING DEFAULT")
|
||||||
mdi.MDI_Send_command("@DEFAULT",mdicomm)
|
mdi.MDI_Send_command("@DEFAULT",mdicomm)
|
||||||
elif mode == "min":
|
elif mode == "min":
|
||||||
mdi.MDI_Send_command("@INIT_OPTG",mdicomm)
|
mdi.MDI_Send_command("@INIT_OPTG",mdicomm)
|
||||||
|
|||||||
@ -131,6 +131,7 @@ The function executes a single command from an external MDI driver.
|
|||||||
|
|
||||||
int lammps_execute_mdi_command(const char *command, MDI_Comm comm, void *class_obj)
|
int lammps_execute_mdi_command(const char *command, MDI_Comm comm, void *class_obj)
|
||||||
{
|
{
|
||||||
|
printf("LIB wrapper command %s\n",command);
|
||||||
MDIEngine *mdi_engine = (MDIEngine *) class_obj;
|
MDIEngine *mdi_engine = (MDIEngine *) class_obj;
|
||||||
return mdi_engine->execute_command(command,comm);
|
return mdi_engine->execute_command(command,comm);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -186,12 +186,16 @@ void MDIEngine::mdi_engine(int narg, char **arg)
|
|||||||
// top-level mdi engine only recognizes three nodes
|
// top-level mdi engine only recognizes three nodes
|
||||||
// DEFAULT, INIT_MD, INIT_OPTG
|
// DEFAULT, INIT_MD, INIT_OPTG
|
||||||
|
|
||||||
|
printf("MAIN LOOP pre engine_node DEF\n");
|
||||||
engine_node("@DEFAULT");
|
engine_node("@DEFAULT");
|
||||||
|
printf("MAIN LOOP post engine_node DEF\n");
|
||||||
|
|
||||||
// MDI commands for dynamics or minimization
|
// MDI commands for dynamics or minimization
|
||||||
|
|
||||||
if (strcmp(mdicmd,"@INIT_MD") == 0) {
|
if (strcmp(mdicmd,"@INIT_MD") == 0) {
|
||||||
|
printf("MAIN LOOP pre mdi_md\n");
|
||||||
mdi_md();
|
mdi_md();
|
||||||
|
printf("MAIN LOOP post mdi_md\n");
|
||||||
if (exit_command) break;
|
if (exit_command) break;
|
||||||
|
|
||||||
} else if (strcmp(mdicmd,"@INIT_OPTG") == 0) {
|
} else if (strcmp(mdicmd,"@INIT_OPTG") == 0) {
|
||||||
@ -251,6 +255,8 @@ void MDIEngine::engine_node(const char *node)
|
|||||||
// read the next command from the driver
|
// read the next command from the driver
|
||||||
// all procs call this, but only proc 0 receives the command
|
// all procs call this, but only proc 0 receives the command
|
||||||
|
|
||||||
|
printf("PRE MDI RECV_command: node eng/drv: %s/%s\n",node_engine,node_driver);
|
||||||
|
|
||||||
ierr = MDI_Recv_command(mdicmd,mdicomm);
|
ierr = MDI_Recv_command(mdicmd,mdicomm);
|
||||||
if (ierr) error->all(FLERR,"MDI: Unable to receive command from driver");
|
if (ierr) error->all(FLERR,"MDI: Unable to receive command from driver");
|
||||||
|
|
||||||
@ -258,6 +264,8 @@ void MDIEngine::engine_node(const char *node)
|
|||||||
|
|
||||||
MPI_Bcast(mdicmd,MDI_COMMAND_LENGTH,MPI_CHAR,0,world);
|
MPI_Bcast(mdicmd,MDI_COMMAND_LENGTH,MPI_CHAR,0,world);
|
||||||
|
|
||||||
|
printf("POST MDI RECV_command: node eng/drv: %s/%s\n",mdicmd);
|
||||||
|
|
||||||
// execute the command
|
// execute the command
|
||||||
|
|
||||||
execute_command(mdicmd,mdicomm);
|
execute_command(mdicmd,mdicomm);
|
||||||
@ -306,6 +314,8 @@ int MDIEngine::execute_command(const char *command, MDI_Comm mdicomm)
|
|||||||
// receives first, sends second, node commands third
|
// receives first, sends second, node commands third
|
||||||
// ---------------------------------------
|
// ---------------------------------------
|
||||||
|
|
||||||
|
printf("ABOUT to process command %s\n",command);
|
||||||
|
|
||||||
if (strcmp(command,">CELL") == 0) {
|
if (strcmp(command,">CELL") == 0) {
|
||||||
receive_cell();
|
receive_cell();
|
||||||
|
|
||||||
@ -607,7 +617,9 @@ void MDIEngine::mdi_md()
|
|||||||
|
|
||||||
niterate = -1;
|
niterate = -1;
|
||||||
|
|
||||||
|
printf("PRE @INIT_MD\n");
|
||||||
engine_node("@INIT_MD");
|
engine_node("@INIT_MD");
|
||||||
|
printf("POST @INIT_MD %s\n",mdicmd);
|
||||||
if (strcmp(mdicmd,"EXIT") == 0) return;
|
if (strcmp(mdicmd,"EXIT") == 0) return;
|
||||||
|
|
||||||
// add an instance of fix MDI/ENGINE
|
// add an instance of fix MDI/ENGINE
|
||||||
|
|||||||
@ -172,9 +172,6 @@ void *lammps_open(int argc, char **argv, MPI_Comm comm, void **ptr)
|
|||||||
lammps_mpi_init();
|
lammps_mpi_init();
|
||||||
if (ptr) ptr_argument_warning();
|
if (ptr) ptr_argument_warning();
|
||||||
|
|
||||||
printf("LAMMPS instantiate argc %d argv[1] %s argv[2] %s\n",
|
|
||||||
argc,argv[1],argv[2]);
|
|
||||||
|
|
||||||
#ifdef LAMMPS_EXCEPTIONS
|
#ifdef LAMMPS_EXCEPTIONS
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -186,9 +183,7 @@ void *lammps_open(int argc, char **argv, MPI_Comm comm, void **ptr)
|
|||||||
if (ptr) *ptr = nullptr;
|
if (ptr) *ptr = nullptr;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
printf("PRE-INSTANTIATE\n");
|
|
||||||
lmp = new LAMMPS(argc, argv, comm);
|
lmp = new LAMMPS(argc, argv, comm);
|
||||||
printf("POST-INSTANTIATE %p\n",lmp);
|
|
||||||
if (ptr) *ptr = (void *) lmp;
|
if (ptr) *ptr = (void *) lmp;
|
||||||
#endif
|
#endif
|
||||||
return (void *) lmp;
|
return (void *) lmp;
|
||||||
|
|||||||
Reference in New Issue
Block a user