Code Monkey home page Code Monkey logo

proio's People

Contributors

chekanov avatar chuwyjr avatar decibelcooper avatar sbinet avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

proio's Issues

missing variable in mc.proto

Hi, David

Now I've noticed that we are missing one variable in mc.proto

optional uint32 id = 12; // original position in the MC generator

It is important to have it. After slimming event records, I need to know the original position of particles in the generator. So far I was using "barcode" for this, but "barcode" is reserved for something else (it is used by pileup mixing tool. It keeps event numbers from which the particle originates.

Can you please add it? After this change, mc.proto record should be 100% compatible with any generator or tool I know.

best, Sergei

cpp-proio: Cache descriptors within event

In the Go implementation, entry Types are cached:

proio/go-proio/event.go

Lines 277 to 289 in ed4bc26

func (evt *Event) getPrototype(id uint64) protobuf.Message {
entryType, ok := evt.entryTypeCache[id]
if !ok {
ptrType := protobuf.MessageType(evt.proto.Types[id])
if ptrType == nil {
return nil
}
entryType = ptrType.Elem()
evt.entryTypeCache[id] = entryType
}
return reflect.New(entryType).Interface().(protobuf.Message)
}

The C++ implementation should do the same with Descriptors so that a string-based lookup is not done for every entry.

Thanks to Alexander Kiselev for pointing this out.

go-proio: Event corruption with large LZ4 buckets

Identified by protobuf errors (wrong wiretype and field id). Saw this when simulating and digitizing high-energy events and keeping all calorimeter eic::SimHits. Events were on O(10 MB) each, uncompressed. It seems to be an issue with the github.com/pierrec/lz4 reader when decompressing these large frames, but I can't be sure yet.

Suggestions for including proto files in installation

We need to include "model" mc.proto and other template files inside created PROIO files.
Therefore, I would suggested to copy the directory "model" to the installation location. Then one can link such files using the path $PROIO/model/mc.proto (as an example) during file creation of files.

There should be also a mechanism to store such files (and log files) inside PROIO

best, Sergei

support for URL

We need a support for URL for proio/java-proio/src/main/java/proio/Reader.java
(I've implemented it in my version of this class). It should look as this:

import java.net.*;

.....



 public Reader(String filename) throws IOException {


     // first URL
     if (filename.startsWith("http") || filename.startsWith("ftp")) {
                                URL url = null;
                                try {
                                        url = new URL(filename);
                                } catch (MalformedURLException e) {
                                        System.out.println("Error in accessing the URL="
                                                        + url.toString());
                                }
                               try {
                                        // System.out.println("Reading from URL: " + file);
                                        URLConnection urlConn = url.openConnection();
                                        urlConn.setDoInput(true);
                                        urlConn.setUseCaches(false);
                                        InputStream inStream = urlConn.getInputStream();
                                        stream = CodedInputStream.newInstance(inStream);
                                } catch (MalformedURLException e) {
                                        System.out.println(e.toString());
                                } catch (IOException e) {
                                        System.out.println(e.toString());
                                }

    } else {

    // normal file
    fileStream = new FileInputStream(filename);
    stream = CodedInputStream.newInstance(fileStream);

    }

  }


Remove generated java and python code from repo

Ideally these will be generated by the respective builds on the user's machine to match the user's protobuf library. The go generated code is a special case, and will stay for the foreseeable future.

Integrate with go-hep/fwk

It might be nice to implement either a fwk Input/OutputStreamer or a standalone Component in the go-proio source code itself. @sbinet, any thoughts?

Create global entry stores to alleviate cost of allocation

This comes about from discussion with Alexander Kiselev. The idea is to alleviate the entry object allocation overhead (that is significant in some scenarios) by Clearing previously allocated entries of the desired type.

Entries with IDs are owned by the Event at all times, and are accessible and mutable in memory up until the point that the Event is either Pushed or destroyed. Currently, Events at this point destroy allocated entries. Instead, it would be advantageous to Clear the entries and return them to a global store to be used again.

Failed to compile using singularity

Hi, David

I've typed "make", and after 5 min of dong something with the singularity container, it failed to compile

Importing: /tmp/singularity-cache/docker/sha256:1024a55a68004f50fe1cfdb2c6353faeadc033c343d632c8e198091901bcfc45.tar.gz
/bin/tar: opt/Go/.wh..wh..opq: implausibly old time stamp 1969-12-31 18:00:00
Importing: /tmp/singularity-cache/metadata/sha256:90a76215fbf315cbb77cb867de4eaf6e7bc8b44ea70ddf6bab70378ab8ea112f.tar.gz
Done. Container is at: proio-gen.img
singularity exec -C -H /proio proio-gen.img protoc --gofast_out=go-proio/model proio.proto
ERROR  : Base home directory does not exist within the container: /users
ABORT  : Retval = 255
make: *** [go-proio/model/proio.pb.go] Error 255

Is it possible to have an option for cpp version using make, assumed gcc is installed?

Reader cannot use streams for the seek method

Hi, David

It looks like the class proio/Reader.java cannot use the method seekToStart for streams (it works only for local files).
This creates a problem for random access of events using URL (the method skip() is not sufficient for this). Can you add a support for streams in the seekToStart() method?

best, Sergei

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.