[Darshan-users] This darshan log has no file records. No summary was produced.
Snyder, Shane
ssnyder at mcs.anl.gov
Tue Oct 30 11:28:00 CDT 2018
Hi Jeremy,
Thanks for pointing out this problem to us!
Everything looks fine with your install/setup/usage of Darshan at first glance, and it turns out we can easily reproduce this same error using your code snippet.
The problem is that the ofstream implementation is confusing Darshan's internal instrumentation methods. Basically, the ofstream code is calling libc fopen() under the covers when you open the file (or construct the ofstream type in your case), but it is issuing underlying write operations to that file using libc write() call. fopen() returns a FILE*, but write() takes a file descriptor, so internally ofstream is converting the FILE* to a descriptor using the fileno() call, but Darshan is not explicitly accounting for that in its tracking of file pointers/descriptors. We need to add functionality to additionally wrap fileno() so that Darshan can easily map between FILE* and descriptors mapping to the same file.
We recently created a ticket to add fileno instrumentation into Darshan, so I added more notes about this particular failure mode there: https://xgitlab.cels.anl.gov/darshan/darshan/issues/248
We will take a look at getting that fixed and can let you know when we have committed a fix for it soon.
--Shane
On 10/29/2018 10:11 AM, Jérémy Fouriaux wrote:
Hello everyone,
I enjoyed a lot working with installed darshan on HPC systems and I tried to install it on my Linux Ubuntu machine to profile posix related IOs.
Installation went fine using darshan 3.1.6
```
./configure CC=mpicc --prefix /home/jeremy/Devel/Darshan_try/ --with-mem-align=8 --with-log-path-by-env=DARSHAN_LOG_DIR --with-jobid-env=NONE
make && make install
```
Then I have intended to use darshan dynamic load mode with a sample program that write a file with 4k bytes:
```
include <fstream>
#include <cstdlib>
#include <mpi.h>
int main (int argc, char** argv) {
MPI_Init (0, nullptr);
std::ofstream output (argv[1], std::ofstream::binary);
size_t size = atoi(argv[2]);
char* buffer = new char[size];
output.write (buffer, size);
output.close();
delete [] buffer;
MPI_Finalize();
return 0;
}
```
compiled with mpic++, backend compiler g++, mpi library: openmpi
```
mpic++ --std=c++14 my_program.cpp -o my_program
```
launched in a test.sh file:
```
#!/usr/bin/env sh
current_path=`pwd`
#export DARSHAN_LOGFILE=${current_path}/logs/darshan.log
export PATH=${PATH}:/home/jeremy/Devel/Darshan_try/bin
export DARSHAN_LOG_DIR=${current_path}/logs
rm -rf ${current_path}/logs
mkdir ${current_path}/logs
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/jeremy/Devel/Performances/Darshan/example/
export LD_PRELOAD=/home/jeremy/Devel/Darshan_try/lib/libdarshan.so
# writing 4k bytes in a file
mpirun -n 1 ./mpi_write_file test.txt 4000
darshan-job-summary.pl ${current_path}/logs/*
```
the output of darshan-job-summary is the following:
```
This darshan log has no file records. No summary was produced.
jobid: 3881
uid: 1000
starttime: Mo Okt 29 16:07:41 2018 ( 1540825661 )
runtime: 1 (seconds)
nprocs: 1
version: 3.10
```
I don't really understand why there is no records for my file write of 4000 bytes, is there something I have done incorrectly ?
I have attached the darshan output file.
Best regards,
Jeremy.
_______________________________________________
Darshan-users mailing list
Darshan-users at lists.mcs.anl.gov<mailto:Darshan-users at lists.mcs.anl.gov>
https://lists.mcs.anl.gov/mailman/listinfo/darshan-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/darshan-users/attachments/20181030/1bdd1446/attachment.html>
More information about the Darshan-users
mailing list