Rohan, Removing linking with libdmtcp solved the problem.
BTW, I am using the function dmtcp_set_ckpt_file() in my application. Since this function is not in the dmtcp.h file, I had to add a declaration in my code. I had to add "__attribute__ ((weak))" to this declaration so that my application would link without libdmtcp. Thanks so much for the help, -Stu ----- Original Message ----- From: "Rohan Garg" <rohg...@ccs.neu.edu> To: "Stu Whitman" <swhit...@groupw.com> Sent: Monday, February 29, 2016 1:44:21 PM Subject: Re: [Dmtcp-forum] Running application without dmtcp_launch Ah! I know the problem: you are linking with libdmtcp. This is not required and not expected. More explanation follows: a) dmtcp_launch, before it execs the user program, sets up certain environment variables which it computes based on the current environment. b) libdmtcp’s constructor expects these env. variables to be present after it’s loaded by the Linux linker/loader. c) When you link a program against libdmtcp and run it without dmtcp_launch, the library gets loaded after exec-ing the program, and the library's constructor asserts out when it’s unable to get the env. variables. The correct way to compile and run a program that uses the DMTCP API is as follows: $ gcc -fPIC -o ./a.out -I/path/to/dmtcp.h /path/to/application.c $ dmtcp_launch ./a.out # Checkpoint will be invoked when requested $ ./a.out # Checkpoint will not be invoked, DMTCP_NOT_PRESENT is returned instead As you can see the only things that are required to compile your application are: the include path to the DMTCP header file, and the -fPIC flag. There should be no difference in the output of the application with our without DMTCP. > On Feb 29, 2016, at 1:24 PM, Stu Whitman <swhit...@groupw.com> wrote: > > No problem. Attached is the applic.c file that is located in the folder: > ./dmtcp-2.3.1/test/plugin/applic-initiated-ckpt/ > > I compiled it like this: > gcc -fPIC -o applic.exe -I ../include -L ../lib/dmtcp -ldmtcp -ldl applic.c > > and run it like this: > LD_LIBRARY_PATH=../lib/dmtcp ./applic.exe > > and I get the error: > dmtcpplugin.cpp:467 DMTCP Internal Error: Env var DMTCP_DLSYM_OFFSET not set. > Aborting. > > Please let me know if you need anything else. > > -Stu > > ----- Original Message ----- > From: "Rohan Garg" <rohg...@ccs.neu.edu> > To: "Stu Whitman" <swhit...@groupw.com> > Cc: "dmtcp-forum" <dmtcp-forum@lists.sourceforge.net> > Sent: Monday, February 29, 2016 12:57:11 PM > Subject: Re: [Dmtcp-forum] Running application without dmtcp_launch > > The ability to run without dmtcp_launch is supported, unless we had a > regression. > > The only difference when running without dmtcp_launch is that it’ll not > invoke a > checkpoint and the DMTCP API functions will return DMTCP_NOT_PRESENT. > > Could you please share an example program that demonstrates the bug? > >> On Feb 29, 2016, at 12:50 PM, Stu Whitman <swhit...@groupw.com> wrote: >> >> Rohan, >> >> Thanks for the response. I have successfully followed the >> applic-initiated-ckpt example with my application. This worked for me even >> without compiling with the -fPIC option. >> >> I am now trying to follow section 4 in the plugin-tutorial.pdf document >> located in the doc folder. This is a short section, so I will paste it here: >> --------------------------------------------------------- >> 4 Application-Initiated Checkpoints >> Application-initiated checkpoints are even simpler than full-featured >> plugins. In the simplest form, the >> following code can be executed both **with dmtcp launch and without**.: >> #include <stdio.h> >> #include "dmtcp.h" >> int main() { >> if (dmtcpCheckpoint() == DMTCP_NOT_PRESENT) { >> printf("dmtcpcheckpoint: DMTCP not present. No checkpoint is >> taken.\n"); >> } >> return 0; >> } >> >> For this program to be aware of DMTCP, it must be compiled with -fPIC and >> -ldl : >> gcc -fPIC -IDMTCP ROOT/dmtcp/include -o myapp myapp.c -ldl >> >> The most useful functions are: >> int dmtcpIsEnabled() — returns 1 when running with DMTCP; 0 otherwise. >> int dmtcpCheckpoint() — returns DMTCP AFTER CHECKPOINT, DMTCP AFTER RESTART, >> or >> DMTCP NOT PRESENT. >> int dmtcpDelayCheckpointsLock() — DMTCP will block any checkpoint requests. >> int dmtcpDelayCheckpointsUnlock() — DMTCP will execute any blocked >> checkpoint requests, and will >> permit new checkpoint requests. >> >> The last two functions follow the common pattern of returning 0 on success >> and DMTCP NOT PRESENT >> if DMTCP is not present. See the subdirectories DMTCP >> ROOT/test/plugin/applic-initiated-ckpt and >> DMTCP >> --------------------------------------------------------- >> >> I am now compiling the application with -fPIC and -ldl as instructed, but >> get the error message I reported when running the application without >> dmtcp_launch. The application runs fine with dmtcp_launch. I realize that >> this must be quite an old document since the function names are incorrect. >> >> Can I assume by your response that the ability to run with and without >> dmtcp_launch is no longer supported? >> >> Thanks again, >> Stu >> >> >> ----- Original Message ----- >> From: "Rohan Garg" <rohg...@ccs.neu.edu> >> To: "Stu Whitman" <swhit...@groupw.com> >> Cc: "dmtcp-forum" <dmtcp-forum@lists.sourceforge.net> >> Sent: Monday, February 29, 2016 11:38:28 AM >> Subject: Re: [Dmtcp-forum] Running application without dmtcp_launch >> >> Hi Stu, >> >> For application-initiated checkpointing you need to do two things: >> >> a) compile your application with -fPIC; and >> b) run your application under dmtcp_launch. >> >> Please refer to the example in test/plugin/applic-intiated-ckpt/. Run a >> `make check` to execute the example. The example code is in: applic.c >> in the same directory. >> >> Hope this helps, >> Rohan >> >>> On Feb 29, 2016, at 11:13 AM, Stu Whitman <swhit...@groupw.com> wrote: >>> >>> Hello, >>> >>> I am trying to run my application without dmtcp_launch and use the function >>> dmtcp_is_enabled() to test if checkpointing is available. The information >>> on the website led me to believe I needed to compile the application with >>> the -fPIC option, which I have done. I am using version 2.3.1. When I run >>> my application I get the following message: >>> >>> dmtcpplugin.cpp:467 DMTCP Internal Error: Env var DMTCP_DLSYM_OFFSET not >>> set. >>> Aborting. >>> >>> Is this still a supported feature, or is there something that I am not >>> understanding? >>> >>> Thanks, >>> -Stu >>> ------------------------------------------------------------------------------ >>> Site24x7 APM Insight: Get Deep Visibility into Application Performance >>> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month >>> Monitor end-to-end web transactions and take corrective actions now >>> Troubleshoot faster and improve end-user experience. Signup Now! >>> http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________ >>> Dmtcp-forum mailing list >>> Dmtcp-forum@lists.sourceforge.net >>> https://lists.sourceforge.net/lists/listinfo/dmtcp-forum > <applic.c> ------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 _______________________________________________ Dmtcp-forum mailing list Dmtcp-forum@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dmtcp-forum