Question about the args for bond coefficiences when modifying the code

Dear All,

I have a question about the args for bond coefficiences when modifying the code. I want to modify the code of “bond_harmonic” a little bit, where I need increase the args from 3 to 6. The code can be compiled and run in a series way. But when I tried to run parallel, I will encounter the error of Incorrect args for bond coefficients. The location of this error is at the “allocate function” in the bond potential code.

I do not know why the code can be run in series way but not in parallel. Does anybody can help about this? Maybe I miss some part in the code.

thanks

Best

Teng

I don't understand your Q. If all you want to is
modify a bond coefficient that is an input arg, just
set it in your input script. If you've modified the code
and it doesn't work, then you need to debug.

Steve

Thanks a lot.

I also modified the code a little bit. My question is I can use it with just one single cpu, when I tried to run with multiple cpus, I will get error on the “allocate function” in the script. I will further debug it.

Best

2012/10/10 Steve Plimpton <[email protected]>

I have another question:

I check the code of “input.cpp” and create a "printf " command. When I use single cpu to run the code, I can see the printed value. When I change into multiple cpus, I did not see that. I am wondering there is difference in reading the scripts command for single and multiple cpus, which may help me understand why the modified code I did does not work for multiple cpus.

Can you help me to understand this, since I am not very familiar with the parallel computation.

Best

Thanks a lot

2012/10/10 腾张 <zhangteng2008@…24…>

I have another question:

I check the code of "input.cpp" and create a "printf " command. When I use
single cpu to run the code, I can see the printed value. When I change into
multiple cpus, I did not see that. I am wondering there is difference in
reading the scripts command for single and multiple cpus, which may help me

no. each line of an input script is read by MPI rank 0 and concatenated
in case there are any '&' continuation markers. this concatenated line is
then broadcast to all(!) MPI ranks and processed by all of them in parallel.

most likely your output is buffered by the MPI library.
try using fprintf(stderr, ...) instead of printf .

understand why the modified code I did does not work for multiple cpus.

no. you are on the wrong path here.

Can you help me to understand this, since I am not very familiar with the
parallel computation.

then i would strongly recommend to *first* spend some time working with
several of the *many* MPI parallel programming tutorials until you are more
familiar and comfortable and perhaps write some small parallel toy programs
(most tutorials have suggestions for that, some even "fill in here" examples).

trying to modify a large package code *and* learning proper parallel
programming at the same time is a recipe for disaster. you may
think that you will be saving time, but in my experience, these kind
of shortcuts always *cost* time since you often don't know whether
a problem is genuine or simply due to your limited experience in
parallel programming.

axel.

Thanks a lot. I will try some simple code first.

Best

2012/10/13 Axel Kohlmeyer <[email protected]>