diff --git a/examples/mdi/sequence_driver.py b/examples/mdi/sequence_driver.py index 66b9bc9aff..b04a1c23f2 100644 --- a/examples/mdi/sequence_driver.py +++ b/examples/mdi/sequence_driver.py @@ -137,9 +137,13 @@ def perform_tasks(world,mdicomm,dummy): if mode == "eval": pass elif mode == "run": + print("SENDING INIT_MD") mdi.MDI_Send_command("@INIT_MD",mdicomm) + print("SENDING NITERATE") mdi.MDI_Send_command(">NITERATE",mdicomm) + print("SENDING NITERATE data nsteps") mdi.MDI_Send(nsteps,1,mdi.MDI_INT,mdicomm) + print("SENDING DEFAULT") mdi.MDI_Send_command("@DEFAULT",mdicomm) elif mode == "min": mdi.MDI_Send_command("@INIT_OPTG",mdicomm) diff --git a/src/MDI/library_mdi.cpp b/src/MDI/library_mdi.cpp index 4048f805a5..112ce18d2d 100644 --- a/src/MDI/library_mdi.cpp +++ b/src/MDI/library_mdi.cpp @@ -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) { + printf("LIB wrapper command %s\n",command); MDIEngine *mdi_engine = (MDIEngine *) class_obj; return mdi_engine->execute_command(command,comm); } diff --git a/src/MDI/mdi_engine.cpp b/src/MDI/mdi_engine.cpp index 1244e72dc0..e9c5e4f8ec 100644 --- a/src/MDI/mdi_engine.cpp +++ b/src/MDI/mdi_engine.cpp @@ -186,12 +186,16 @@ void MDIEngine::mdi_engine(int narg, char **arg) // top-level mdi engine only recognizes three nodes // DEFAULT, INIT_MD, INIT_OPTG + printf("MAIN LOOP pre engine_node DEF\n"); engine_node("@DEFAULT"); + printf("MAIN LOOP post engine_node DEF\n"); // MDI commands for dynamics or minimization if (strcmp(mdicmd,"@INIT_MD") == 0) { + printf("MAIN LOOP pre mdi_md\n"); mdi_md(); + printf("MAIN LOOP post mdi_md\n"); if (exit_command) break; } 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 // 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); 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); + printf("POST MDI RECV_command: node eng/drv: %s/%s\n",mdicmd); + // execute the command 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 // --------------------------------------- + printf("ABOUT to process command %s\n",command); + if (strcmp(command,">CELL") == 0) { receive_cell(); @@ -607,7 +617,9 @@ void MDIEngine::mdi_md() niterate = -1; + printf("PRE @INIT_MD\n"); engine_node("@INIT_MD"); + printf("POST @INIT_MD %s\n",mdicmd); if (strcmp(mdicmd,"EXIT") == 0) return; // add an instance of fix MDI/ENGINE diff --git a/src/library.cpp b/src/library.cpp index a983b24b7f..ace9905451 100644 --- a/src/library.cpp +++ b/src/library.cpp @@ -172,9 +172,6 @@ void *lammps_open(int argc, char **argv, MPI_Comm comm, void **ptr) lammps_mpi_init(); 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 try { @@ -186,9 +183,7 @@ void *lammps_open(int argc, char **argv, MPI_Comm comm, void **ptr) if (ptr) *ptr = nullptr; } #else - printf("PRE-INSTANTIATE\n"); lmp = new LAMMPS(argc, argv, comm); - printf("POST-INSTANTIATE %p\n",lmp); if (ptr) *ptr = (void *) lmp; #endif return (void *) lmp;