[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ESPResSo-users] Implementation of S2 code
From: |
Axel Arnold |
Subject: |
Re: [ESPResSo-users] Implementation of S2 code |
Date: |
Mon, 3 Oct 2011 20:25:53 +0200 |
User-agent: |
KMail/1.13.6 (Linux/2.6.38-11-generic; KDE/4.6.2; x86_64; ; ) |
Dear Muhammad,
the interface code is good, so chances are fairly good that the mistake is
somewhere in your code. Best thing is, if you run Espresso in the debugger,
gdb, and check where actually the segfault occurs. For debugging, you best
recompile Espresso with CFLAGS="-g -O0" so that no variables are optimized
out. Then you can use e.g. gdb as usual. If you haven't used a debugger so
far, you will probably need to get someone local to help; there is nothing
special about debugging Espresso, so anybody familiar with C will be ok.
Many regards,
Axel
On Saturday 01 October 2011, Muhammad Anwar wrote:
> Hello,
> Dear Users and developers,
> I am trying to implement orientational order parameter algorithm in
> ESPResSo, i compiled it successfully, the problem i am finding is ,
> when i try to calculate the parameter, it give result for one step then
> give message of "segmentation fault". I am following
> "lipid_orient_order" code to learn how to implement in espresso because
> it is very close to my work. The code is like this
>
> int orient_order_S2(double* result)
> {
> *result = 0.0;
>
>
> //my code
>
> *result = -2*z2;
> return TCL_OK;
> }
>
> *and parse function is
> *
> static int tclcommand_analyze_parse_orient_order_S2(Tcl_Interp *interp,
> int argc, char **argv)
> {
> double result;
> char buffer[TCL_DOUBLE_SPACE];
> int i , j ;
> result = 0;
>
> if (n_total_particles <= 1) {
> Tcl_AppendResult(interp, "(not enough particles)",
> (char *)NULL);
> return (TCL_OK);
> }
>
> /* Do the calculation */
> if ( orient_order_S2(&result) != TCL_OK ) {
> Tcl_AppendResult(interp, "Error calculating orientational order ",
> (char *)NULL);
> return TCL_ERROR;
> }
>
> Tcl_PrintDouble(interp, result, buffer);
> Tcl_AppendResult(interp, buffer, (char *)NULL);
> return TCL_OK;
> Tcl_AppendResult(interp, "Error calculating orientational order ",
> (char *)NULL);
> return TCL_ERROR;
> }
>
> I will really appreciate if any body can help about this problem.
> Thanks and have a nice day.
>
> Best Regards,
> Muhammad Anwar
--
JP Dr. Axel Arnold Tel: +49 711 685 67609
ICP, Universität Stuttgart Email: address@hidden
Pfaffenwaldring 27
70569 Stuttgart, Germany