@@ -558,4 +558,235 @@ private native long rGet(
558558 int targetRank , int targetDisp , int targetCount , long targetType ,
559559 int baseType ) throws MPIException ;
560560
561+ /**
562+ * Java binding of {@code MPI_RACCUMULATE}.
563+ * @param origin origin buffer
564+ * @param orgCount number of entries in origin buffer
565+ * @param orgType datatype of each entry in origin buffer
566+ * @param targetRank rank of target
567+ * @param targetDisp displacement from start of window to target buffer
568+ * @param targetCount number of entries in target buffer
569+ * @param targetType datatype of each entry in target buffer
570+ * @param op reduce operation
571+ * @return RMA request
572+ * @throws MPIException
573+ */
574+ public Request rAccumulate (Buffer origin , int orgCount , Datatype orgType ,
575+ int targetRank , int targetDisp , int targetCount ,
576+ Datatype targetType , Op op )
577+ throws MPIException
578+ {
579+ MPI .check ();
580+
581+ if (!origin .isDirect ())
582+ throw new IllegalArgumentException ("The origin must be direct buffer." );
583+
584+ return new Request (rAccumulate (handle , origin , orgCount , orgType .handle ,
585+ targetRank , targetDisp , targetCount , targetType .handle ,
586+ op , op .handle , getBaseType (orgType , targetType )));
587+ }
588+
589+ private native long rAccumulate (
590+ long win , Buffer origin , int orgCount , long orgType ,
591+ int targetRank , int targetDisp , int targetCount , long targetType ,
592+ Op jOp , long hOp , int baseType ) throws MPIException ;
593+
594+ /**
595+ * Java binding of {@code MPI_GET_ACCUMULATE}.
596+ * @param origin origin buffer
597+ * @param orgCount number of entries in origin buffer
598+ * @param orgType datatype of each entry in origin buffer
599+ * @param resultAddr result buffer
600+ * @param resultCount number of entries in result buffer
601+ * @param resultType datatype of each entry in result buffer
602+ * @param targetRank rank of target
603+ * @param targetDisp displacement from start of window to target buffer
604+ * @param targetCount number of entries in target buffer
605+ * @param targetType datatype of each entry in target buffer
606+ * @param op reduce operation
607+ * @throws MPIException
608+ */
609+
610+ public void getAccumulate (Buffer origin , int orgCount , Datatype orgType ,
611+ Buffer resultAddr , int resultCount , Datatype resultType ,
612+ int targetRank , int targetDisp , int targetCount ,
613+ Datatype targetType , Op op )
614+ throws MPIException
615+ {
616+ MPI .check ();
617+
618+ if (!origin .isDirect ())
619+ throw new IllegalArgumentException ("The origin must be direct buffer." );
620+
621+ getAccumulate (handle , origin , orgCount , orgType .handle ,
622+ resultAddr , resultCount , resultType .handle ,
623+ targetRank , targetDisp , targetCount , targetType .handle ,
624+ op , op .handle , getBaseType (orgType , targetType ));
625+ }
626+
627+ private native void getAccumulate (
628+ long win , Buffer origin , int orgCount , long orgType ,
629+ Buffer resultAddr , int resultCount , long resultType ,
630+ int targetRank , int targetDisp , int targetCount , long targetType ,
631+ Op jOp , long hOp , int baseType ) throws MPIException ;
632+
633+ /**
634+ * Java binding of {@code MPI_RGET_ACCUMULATE}.
635+ * @param origin origin buffer
636+ * @param orgCount number of entries in origin buffer
637+ * @param orgType datatype of each entry in origin buffer
638+ * @param resultAddr result buffer
639+ * @param resultCount number of entries in result buffer
640+ * @param resultType datatype of each entry in result buffer
641+ * @param targetRank rank of target
642+ * @param targetDisp displacement from start of window to target buffer
643+ * @param targetCount number of entries in target buffer
644+ * @param targetType datatype of each entry in target buffer
645+ * @param op reduce operation
646+ * @return RMA request
647+ * @throws MPIException
648+ */
649+
650+ public Request rGetAccumulate (Buffer origin , int orgCount , Datatype orgType ,
651+ Buffer resultAddr , int resultCount , Datatype resultType ,
652+ int targetRank , int targetDisp , int targetCount ,
653+ Datatype targetType , Op op )
654+ throws MPIException
655+ {
656+ MPI .check ();
657+
658+ if (!origin .isDirect ())
659+ throw new IllegalArgumentException ("The origin must be direct buffer." );
660+
661+ return new Request (rGetAccumulate (handle , origin , orgCount , orgType .handle ,
662+ resultAddr , resultCount , resultType .handle ,
663+ targetRank , targetDisp , targetCount , targetType .handle ,
664+ op , op .handle , getBaseType (orgType , targetType )));
665+ }
666+
667+ private native long rGetAccumulate (
668+ long win , Buffer origin , int orgCount , long orgType ,
669+ Buffer resultAddr , int resultCount , long resultType ,
670+ int targetRank , int targetDisp , int targetCount , long targetType ,
671+ Op jOp , long hOp , int baseType ) throws MPIException ;
672+
673+ /**
674+ * Java binding of the MPI operation {@code MPI_WIN_LOCK_ALL}.
675+ * @param assertion program assertion
676+ * @throws MPIException
677+ */
678+ public void lockAll (int assertion ) throws MPIException
679+ {
680+ MPI .check ();
681+ lockAll (handle , assertion );
682+ }
683+
684+ private native void lockAll (long win , int assertion )
685+ throws MPIException ;
686+
687+ /**
688+ * Java binding of the MPI operation {@code MPI_WIN_UNLOCK_ALL}.
689+ * @throws MPIException
690+ */
691+ public void unlockAll () throws MPIException
692+ {
693+ MPI .check ();
694+ unlockAll (handle );
695+ }
696+
697+ private native void unlockAll (long win ) throws MPIException ;
698+
699+ /**
700+ * Java binding of the MPI operation {@code MPI_WIN_SYNC}.
701+ * @throws MPIException
702+ */
703+ public void sync () throws MPIException
704+ {
705+ MPI .check ();
706+ sync (handle );
707+ }
708+
709+ private native void sync (long win ) throws MPIException ;
710+
711+ /**
712+ * Java binding of the MPI operation {@code MPI_WIN_FLUSH}.
713+ * @param targetRank rank of target window
714+ * @throws MPIException
715+ */
716+ public void flush (int targetRank ) throws MPIException
717+ {
718+ MPI .check ();
719+ flush (handle , targetRank );
720+ }
721+
722+ private native void flush (long win , int targetRank ) throws MPIException ;
723+
724+ /**
725+ * Java binding of the MPI operation {@code MPI_WIN_FLUSH_ALL}.
726+ * @throws MPIException
727+ */
728+ public void flushAll () throws MPIException
729+ {
730+ MPI .check ();
731+ flushAll (handle );
732+ }
733+
734+ private native void flushAll (long win ) throws MPIException ;
735+
736+ /**
737+ * Java binding of {@code MPI_COMPARE_AND_SWAP}.
738+ * @param origin origin buffer
739+ * @param compareAddr compare buffer
740+ * @param resultAddr result buffer
741+ * @param targetType datatype of each entry in target buffer
742+ * @param targetRank rank of target
743+ * @param targetDisp displacement from start of window to target buffer
744+ * @throws MPIException
745+ */
746+
747+ public void compareAndSwap (Buffer origin , Buffer compareAddr , Buffer resultAddr ,
748+ Datatype targetType , int targetRank , int targetDisp )
749+ throws MPIException
750+ {
751+ MPI .check ();
752+
753+ if (!origin .isDirect ())
754+ throw new IllegalArgumentException ("The origin must be direct buffer." );
755+
756+ compareAndSwap (handle , origin , compareAddr , resultAddr ,
757+ targetType .handle , targetRank , targetDisp );
758+ }
759+
760+ private native void compareAndSwap (
761+ long win , Buffer origin , Buffer compareAddr , Buffer resultAddr ,
762+ long targetType , int targetRank , int targetDisp ) throws MPIException ;
763+
764+ /**
765+ * Java binding of {@code MPI_FETCH_AND_OP}.
766+ * @param origin origin buffer
767+ * @param resultAddr result buffer
768+ * @param dataType datatype of entry in origin, result, and target buffers
769+ * @param targetRank rank of target
770+ * @param targetDisp displacement from start of window to target buffer
771+ * @param op reduce operation
772+ * @throws MPIException
773+ */
774+
775+ public void fetchAndOp (Buffer origin , Buffer resultAddr , Datatype dataType ,
776+ int targetRank , int targetDisp , Op op )
777+ throws MPIException
778+ {
779+ MPI .check ();
780+
781+ if (!origin .isDirect ())
782+ throw new IllegalArgumentException ("The origin must be direct buffer." );
783+
784+ fetchAndOp (handle , origin , resultAddr , dataType .handle , targetRank ,
785+ targetDisp , op , op .handle , getBaseType (dataType , dataType )); //neccessary?
786+ }
787+
788+ private native void fetchAndOp (
789+ long win , Buffer origin , Buffer resultAddr , long targetType , int targetRank ,
790+ int targetDisp , Op jOp , long hOp , int baseType ) throws MPIException ;
791+
561792} // Win
0 commit comments