3
0
mirror of https://github.com/triqs/dft_tools synced 2024-11-01 03:33:50 +01:00
Commit Graph

31 Commits

Author SHA1 Message Date
Olivier Parcollet
9002c1e456 implement array_const_view 2013-10-21 15:12:53 +02:00
Olivier Parcollet
1517cdaaeb clean the TRIQS_COMPILER macros
- from now on, C++11 compilers only.
- no ressources to maintain old stuff.
2013-10-21 15:12:08 +02:00
Olivier Parcollet
39edb2f846 [API change] gf : factories -> constructors
- Make more general constructors for the gf.
  gf( mesh, target_shape_t)
- remove the old make_gf for the basic gf.
- 2 var non generic gf removed.
- clean evaluator
- add tensor_valued
- add a simple vertex test.
- clean specialisation
- Fix bug introduced in 1906dc3
- forgot to resize the gf in new version of operator =
- Fix make_singularity in gf.hpp

- clean resize in operator =

- update h5 read/write for block gf
  - changed a bit the general trait to save *all* the gf.
  - allows a more general specialization, then a correct for blocks

- NOT FINISHED : need to save the block indice for python.
  How to reread ?
  Currently it read the blocks names and reconstitute the mesh from it.
  Is it sufficient ?

- clean block constructors

 - block constructors simplest possible : an int for the number of blocks
 - rest in free factories.
 - fixed the generic constructor from GfType for the regular type :
   only enable iif GfType is ImmutableGreenFunction

- multivar. fix linear index in C, and h5 format

  - linear index now correctly flatten in C mode
    (was in fortran mode), using a simple reverse of the tuple in the folding.
  - fix the h5 read write of the multivar fonctions
   in order to write an array on dimension # variables + dim_target
   i.e. without flattening the indices of the meshes.
   Easier for later data analysis, e.g. in Python.

- merge matrix/tensor_valued. improve factories

  - matrix_valued now = tensor_valued<2>
    (simplifies generic code for h5).
  - factories_one_var -> factories : this is the generic case ...
    only a few specialization, code is simpler.

- clef expression call with rvalue for *this
- generalize matrix_proxy to tensor and clean

 - clean exception catch in tests

  - exception catching catch in need in test
    because the silly OS X does not print anything, just "exception occurred".
    Very convenient for the developer...
  - BUT, one MUST add return 1, or the make test will *pass* !!
  - --> systematically replace the catch by a macro TRIQS_CATCH_AND_ABORT
    which return a non zero error code.
   - exception : curry_and_fourier which does not work at this stage
   (mesh incompatible).

- gf: clean draft of gf 2 times
  - comment the python interface for the moment.
  - rm useless tests
2013-10-21 15:11:44 +02:00
Olivier Parcollet
a4305f8f2a utility : correct a compile macro
- _j notation was not compiled...
2013-10-21 15:11:42 +02:00
Olivier Parcollet
800aea4c5e remove workaround for icc 13.0
- deprecated....
- remove the TRIQS_WORKAROUND_INTEL_COMPILER_BUGS macro
2013-10-17 00:32:09 +02:00
Michel Ferrero
3de5c682f6 Add TRIQS_CATCH_AND_ABORT macro
modified:   triqs/utility/macros.hpp
2013-10-17 00:32:08 +02:00
Olivier Parcollet
6f7deca96a tuple tools : add reverse for a tuple...
- add in std:: the reverse to be able to apply the algorithms on a
  reversed tuple
- overloaded std::get, std::tuple_size for this
- added tests.
2013-09-28 22:54:21 +02:00
Olivier Parcollet
1906dc30a5 Fix expression template for gf & std::vector
- add move semantics in expression template.

for gfs :
- rm descriptor
- Remove data from expr, rewrote assignment
  which now iterates on the mesh, simply.
  RHS models now FunctionOnMesh
- This fix the multiplication bug of gf
- Remove assign_no_resize/assign_with_resize from proxy
2013-09-22 18:17:40 +02:00
Olivier Parcollet
2cca9584b9 mpi: first draft for #12
- a thin layer, using a bit boost::mpi (for the communicator mostly ...)
  along the lines discussed in #12.
- implemented reduce, allreduce, bcast for arrays, simple scalars,
and any custom type that support boost serialization.
- Custom types :  the operations are done recursively on members.
  No change is needed in the class to use this mpi routine, as long as
  serialize function is defined.
- For arrays of basic types (int, double...), a direct call to MPI C API, which works also for views
  (as long as they are contiguous).
- For arrays of more complex types, we revert to boost::mpi.
- Added a simple test.
- Work still in progress :
   - missing a simple scatter/gather for the arrays
   - need more tests & API thinking.
   - dispatch array code to array lib
   - reduce is "sum" only, but do we need more.
2013-09-13 09:20:21 +02:00
Olivier Parcollet
0586c77307 add c14 details in std::c14
- to use already a few c14 convenience details :

-> polymorphic std::plus, e.g.
   boost::mpi::reduce (world, A,C, std::c14::plus<>(),0);
this plus determine the type by itself ...
  -> errors on the type can be very cryptic on the gf.

-> add std::c14::make_unique
(equivalent of make_shared for unique_ptr).
2013-09-11 20:22:38 +02:00
Olivier Parcollet
c06e183ae5 arrays : revised version of map & fold
- also cleaned a bit reinterpretview example
2013-09-11 18:39:25 +02:00
Olivier Parcollet
4bbcbe35ef gcc 4.6: correction
- removing some test & tuple_tool which fail on old 4.6
For Ubuntu 12.04 compat.
2013-09-08 15:17:18 +02:00
Olivier Parcollet
2c542647fd clef : new version using lvalues and moving rvalues
- change : all objects are by default
  stored now by reference, not by copy any more.
  Unless the trait force_copy_in_expr is true.
- rvalue refs are moved into the tree
- simplifies a lot the writing of lazy method, objects.
- added a macro for methods
- tests ok. Further check needed to control absence of copies...
- improved documentation
2013-09-08 15:04:12 +02:00
Olivier Parcollet
1313566669 utility: simplify a bit tuple::apply 2013-09-06 21:23:55 +02:00
Olivier Parcollet
9790fe8bd0 Work on gf
- clean curry.
- start testing.
2013-09-06 16:00:51 +02:00
Olivier Parcollet
f78e6baf9e code cleaning
- TRIQS_MODEL_CONCEPT renamed : clearer for doc
- index_value_type : remove, useless...
2013-08-27 13:43:58 +02:00
Olivier Parcollet
17a741ad9e arrays: rm has_view_type_tag & add_views
- has_view_type_tag mechanism was replaced by a decltype long ago.
Cleaning since it seems to work on all supported compiler now.

- removed add_views : not used any more.
2013-08-27 13:43:57 +02:00
Olivier Parcollet
41bc8d0338 changing non_view_type to regular_type
- cosmetic : for clarity of the code.
2013-08-27 13:43:57 +02:00
Olivier Parcollet
938f3dc425 arrays: workaround a bug in clang 3.3 release ?
- Apparently there is a bug in release 3.3 of clang
(? on kondo cluster ?) that crash the compiler in compiling
a test. Pb not present in clang from svn.
Changed a little bit the libs as a workaround.
2013-08-27 11:37:21 +02:00
Olivier Parcollet
e707cd8754 correction tuple_tools for gcc 4.6 2013-07-30 22:37:41 +02:00
Olivier Parcollet
0172c61892 tuple_tools : add push_back/front, call_on_zip
- changed apply_on_zip3 -> apply_on_zip ...
2013-07-30 09:08:57 +02:00
Olivier Parcollet
0cdfc4f2d3 tuple_tools : add apply_construct
- given a class F and a tuple t,
it returns F(t[0], t[1], ...)
2013-07-30 09:08:57 +02:00
Olivier Parcollet
c16dc354a9 tuple tools : generalize apply_on_zip to accept && 2013-07-30 09:08:57 +02:00
Olivier Parcollet
9290e640fd icc : workaround macro was not set in the config.h
- forgot to declare one cmake var.
- test can now be not compiled (Build_Triqs_General_Tools_Test had no
  effect)
2013-07-25 23:08:44 +02:00
Olivier Parcollet
7367e4d50a utility : add printing of a tuple
- << tuple now works, with a default version.
Useful for debugging
2013-07-25 15:19:54 +02:00
Olivier Parcollet
b196561a9a utility : add tuple_serialize code 2013-07-25 15:19:54 +02:00
Olivier Parcollet
2c77efe619 uility : add foreach_enumerate
- to be tested
2013-07-25 15:19:54 +02:00
Olivier Parcollet
552c440238 arrays : add ConstView to fix const correctness
- A()(0) = 1
will not work any more if A is const, as it should be.

- Introduced the notion of const_view, simply done by a flag
(flag 0, for easy debug)
- changed the slice of ISP to use it (only on C++11 compliant compiler)
- Move BoundCheck Flags to 5.
2013-07-23 08:13:52 +02:00
Olivier Parcollet
fc2a620eae arrays: new ref counting and weak views
- improve the mem_block and shared_block.
- the reference counting is now done in the mem_block and shared_block, removing the need of shared_ptr.

- speed tests shows that shared_ptr is very slow (due to thread safety?)
the new version is much better, though not perfect.

- Hence introducing weak views.

- also :
-- clean the guard mechanism for python (to allow returning from python without any python ref left).
-- clean code, add documentation for mem_block
-- remove nan init, which was not working, and corresponding test
-- serialisation of view still unchanged (need to forbid serialization of view ??).

- tests ok, incl. valgrind tests.
2013-07-23 08:13:44 +02:00
Olivier Parcollet
aa2c52cb01 utility : tuple, complex_ops
- add _j notation on C++11 compliant compilers
- correct tuple fold (was working in reverse)
- add construction of mini_vector from tuple
2013-07-19 13:27:03 +02:00
Olivier Parcollet
f2c7d449cc First commit : triqs libs version 1.0 alpha1
for earlier commits, see TRIQS0.x repository.
2013-07-17 19:24:07 +02:00